Author Topic: why the textbox code loses focus, when the mouse is on tab button?  (Read 4591 times)

Offline cambalinho

  • Multiple posting newcomer
  • *
  • Posts: 93
i'm writing code. whe i move the mouse to any tab, i lose focus on text code. why these behavior? :(
i'm felling bored with these action :(

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: why the textbox code loses focus, when the mouse is on tab button?
« Reply #1 on: August 20, 2015, 08:16:17 pm »
A little less information:
Normallyin most cases we need at least the version of Code::Blocks you use and the operating system you run it on.

But from your question I can see you use windows.
Your problem can be "fixed" by unchecking "Settings -> Environment -> Notebooks appearance -> Scroll tabs with Mousewheel -> Enable scrolling with mousewheel".
Unfortunately stealing the focus is the only way (I know) on windows to catch the mouse-events for tab-scrolling.

Offline cambalinho

  • Multiple posting newcomer
  • *
  • Posts: 93
Re: why the textbox code loses focus, when the mouse is on tab button?
« Reply #2 on: August 20, 2015, 08:25:35 pm »
i'm using 13.12 version(i belive that it's the last version).
thanks for that. the mouse wheel continues scrolling the scrollbar(or you was talking about otherthing?).
now i can continue writing without having problems with mouse on tab's. thanks for all.

'Unfortunately stealing the focus is the only way (I know) on windows to catch the mouse-events for tab-scrolling.'
i'm learning win32(winapi), i think that isn't the only way. just a nice thot:
- get mouse coordenates from RECT scrollbars;
- the hook's functions can detect the general mouse wheel.
i hope these can make you think on something ;)
thanks for all and stay well

anotherthing:
- can i rate you?
- how mark these thread resolved?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: why the textbox code loses focus, when the mouse is on tab button?
« Reply #3 on: August 20, 2015, 11:27:20 pm »
i'm using 13.12 version(i belive that it's the last version).
thanks for that. the mouse wheel continues scrolling the scrollbar(or you was talking about otherthing?).
now i can continue writing without having problems with mouse on tab's. thanks for all.

'Unfortunately stealing the focus is the only way (I know) on windows to catch the mouse-events for tab-scrolling.'
i'm learning win32(winapi), i think that isn't the only way. just a nice thot:
- get mouse coordenates from RECT scrollbars;
- the hook's functions can detect the general mouse wheel.
i hope these can make you think on something ;)
thanks for all and stay well

anotherthing:
- can i rate you?
- how mark these thread resolved?
Just change the Subject of the first (I think) post.
We talk about different things.
The scrollbars work fine,but the stolen focus is to detect, that the mouse is above a tab and "scroll" through the tabs (switching from one tab to the next by scrolling the mousewheel) or moving the tabs to the left or right if they fit not into the editors pane (with pressed modification key).

Offline cambalinho

  • Multiple posting newcomer
  • *
  • Posts: 93
Re: why the textbox code loses focus, when the mouse is on tab button?
« Reply #4 on: August 20, 2015, 11:32:39 pm »
i'm using 13.12 version(i belive that it's the last version).
thanks for that. the mouse wheel continues scrolling the scrollbar(or you was talking about otherthing?).
now i can continue writing without having problems with mouse on tab's. thanks for all.

'Unfortunately stealing the focus is the only way (I know) on windows to catch the mouse-events for tab-scrolling.'
i'm learning win32(winapi), i think that isn't the only way. just a nice thot:
- get mouse coordenates from RECT scrollbars;
- the hook's functions can detect the general mouse wheel.
i hope these can make you think on something ;)
thanks for all and stay well

anotherthing:
- can i rate you?
- how mark these thread resolved?
Just change the Subject of the first (I think) post.
We talk about different things.
The scrollbars work fine,but the stolen focus is to detect, that the mouse is above a tab and "scroll" through the tabs (switching from one tab to the next by scrolling the mousewheel) or moving the tabs to the left or right if they fit not into the editors pane (with pressed modification key).
unless you do another variable for that focus and use a diferent key(that we don't use on Text Editor). i think it's bored lose the Text Editor when we move the mouse by mistake.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: why the textbox code loses focus, when the mouse is on tab button?
« Reply #5 on: August 20, 2015, 11:39:57 pm »
unless you do another variable for that focus and use a diferent key(that we don't use on Text Editor). i think it's bored lose the Text Editor when we move the mouse by mistake.
The problem on windows with wxWidgets is, that I do not get any mouse-events if the mouse is over the tabs and the tabs do not have the focus. On linux it works flawlessly.

Offline cambalinho

  • Multiple posting newcomer
  • *
  • Posts: 93
Re: why the textbox code loses focus, when the mouse is on tab button?
« Reply #6 on: August 20, 2015, 11:42:25 pm »
unless you do another variable for that focus and use a diferent key(that we don't use on Text Editor). i think it's bored lose the Text Editor when we move the mouse by mistake.
The problem on windows with wxWidgets is, that I do not get any mouse-events if the mouse is over the tabs and the tabs do not have the focus. On linux it works flawlessly.

i'm sorry, i just told you what i know. i never used wxWidgets  or Linux. but i hope that can make you think more about it... is only what i can wish. sorry something
« Last Edit: August 20, 2015, 11:48:23 pm by cambalinho »