Is there a way I can check whether a window is in focus?
I have a window that is sometimes in the background and has a timer
running every second. Sometimes when a certain condition exists it gives focus to a single line edit. This is perfect when the window is in
focus, but annoying when you are in another window, since it robs the
cursor from the window you are working in.
Can I check whether the window has focus before I set the focus to the SLE?
Thanks for all the help I get here. VO still works very well!
James
You can use the FocusChange() and Activate() callback events of the
Window class.
The docs has an explanation and sample code for those events.
Jamal
On 8/6/2022 7:15 PM, James Martin wrote:
Is there a way I can check whether a window is in focus?
I have a window that is sometimes in the background and has a timer
running every second. Sometimes when a certain condition exists it
gives focus to a single line edit. This is perfect when the window is
in focus, but annoying when you are in another window, since it robs
the cursor from the window you are working in.
Can I check whether the window has focus before I set the focus to the
SLE?
Thanks for all the help I get here. VO still works very well!
James
Thanks. I saw them this morning but wasn't sure what they were for. Do
you know whether switching between tabs also works the same way? When
you switch between tabs you change window focus on one hand, however in another sense you are still in the same master window.
James
On 8/7/22 2:12 AM, Jamal wrote:
You can use the FocusChange() and Activate() callback events of the
Window class.
The docs has an explanation and sample code for those events.
Jamal
On 8/6/2022 7:15 PM, James Martin wrote:
Is there a way I can check whether a window is in focus?
I have a window that is sometimes in the background and has a timer
running every second. Sometimes when a certain condition exists it
gives focus to a single line edit. This is perfect when the window is
in focus, but annoying when you are in another window, since it robs
the cursor from the window you are working in.
Can I check whether the window has focus before I set the focus to
the SLE?
Thanks for all the help I get here. VO still works very well!
James
Thanks. You got me on the right track. Can tab have their colourchanged in VO?
For the tab selection changing, in the parent window (the one has the tabcontrol), look at the Properties, CommonControl Events, then select TabSelChanging.
Jamal
On 8/20/2022 1:35 PM, James Martin wrote:
Thanks. I saw them this morning but wasn't sure what they were for. Do
you know whether switching between tabs also works the same way? When
you switch between tabs you change window focus on one hand, however
in another sense you are still in the same master window.
James
On 8/7/22 2:12 AM, Jamal wrote:
You can use the FocusChange() and Activate() callback events of the
Window class.
The docs has an explanation and sample code for those events.
Jamal
On 8/6/2022 7:15 PM, James Martin wrote:
Is there a way I can check whether a window is in focus?
I have a window that is sometimes in the background and has a timer
running every second. Sometimes when a certain condition exists it
gives focus to a single line edit. This is perfect when the window
is in focus, but annoying when you are in another window, since it
robs the cursor from the window you are working in.
Can I check whether the window has focus before I set the focus to
the SLE?
Thanks for all the help I get here. VO still works very well!
James
For the tab selection changing, in the parent window (the one has the tabcontrol), look at the Properties, CommonControl Events, then select TabSelChanging.
Jamal
On 8/20/2022 1:35 PM, James Martin wrote:
Thanks. I saw them this morning but wasn't sure what they were for. Do
you know whether switching between tabs also works the same way? When
you switch between tabs you change window focus on one hand, however in another sense you are still in the same master window.
James
On 8/7/22 2:12 AM, Jamal wrote:
You can use the FocusChange() and Activate() callback events of the
Window class.
The docs has an explanation and sample code for those events.
Jamal
On 8/6/2022 7:15 PM, James Martin wrote:
Is there a way I can check whether a window is in focus?
I have a window that is sometimes in the background and has a timer
running every second. Sometimes when a certain condition exists it
gives focus to a single line edit. This is perfect when the window is >>> in focus, but annoying when you are in another window, since it robs
the cursor from the window you are working in.
Can I check whether the window has focus before I set the focus to
the SLE?
Thanks for all the help I get here. VO still works very well!
James
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 299 |
Nodes: | 16 (2 / 14) |
Uptime: | 50:30:54 |
Calls: | 6,689 |
Calls today: | 7 |
Files: | 12,225 |
Messages: | 5,344,596 |
Posted today: | 1 |