 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
fade2gray
Joined: 21 Oct 2006 Posts: 12
|
Posted: Thu Nov 08, 2007 5:03 pm Post subject: GUI- how do I discover these coordinates? |
|
|
Hi guys,
When a button or tab control is selected, it is high-lighted by a broken-line box.
Q1. Is it possible to discover the coords/dims of the broken-line box (particularly for individual tabs)?
Q2. Is it possible not to show the box at all?
Thanks for any advice. |
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Fri Nov 09, 2007 9:02 am Post subject: |
|
|
| Quote: | When a button or tab control is selected, it is high-lighted by a broken-line box.
Q1. Is it possible to discover the coords/dims of the broken-line box (particularly for individual tabs)?
Q2. Is it possible not to show the box at all? |
A1: Yes. Lets call it the button gets 'the focus'. ControlGetFocus
A2. AFAIK, no. Once a Button Control gets the focus it should be indicated that way. What if a 'Delete'-Button would have the focus, but you won't see it - and you'd push the Enter-Button by mistake? |
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Fri Nov 09, 2007 9:04 am Post subject: |
|
|
| ControlGetPos ! |
|
| Back to top |
|
 |
fade2gray
Joined: 21 Oct 2006 Posts: 12
|
Posted: Fri Nov 09, 2007 6:01 pm Post subject: |
|
|
Thanks for your reply BoBo - perhaps I should've explained myself a little clearer.
I would like to display separate tooltips for individual tabs when each tab is moused over whether or not the tab has focus, and the only method I've discovered to achieve this is shown in this example:-
| Code: |
Gui, Add, Tab, , Tab1.1|Tab1.2
Tab1_1_TT := "Tooltip for Tab1.1"
Tab1_2_TT := "Tooltip for Tab1.2"
Gui, Show
OnMessage(0x200, "WM_MOUSEMOVE")
return
GuiClose:
ExitApp
WM_MOUSEMOVE()
{
static CurrControl, PrevControl, _TT
CurrControl := A_GuiControl
MouseGetPos,PosX, PosY,, VarControl
If (VarControl="SysTabControl321") {
If (PosX>=16 && PosX<=59) && (PosY>=31 && PosY<=46)
CurrControl := "Tab1_1"
If (PosX>=62 && PosX<=105) && (PosY>=31 && PosY<=46)
CurrControl := "Tab1_2"
}
If (CurrControl <> PrevControl and not InStr(CurrControl, " ")) {
ToolTip
SetTimer, DisplayToolTip, 0
PrevControl := CurrControl
}
return
DisplayToolTip:
SetTimer, DisplayToolTip, Off
ToolTip % %CurrControl%_TT
SetTimer, RemoveToolTip, 5000
return
RemoveToolTip:
SetTimer, RemoveToolTip,0
ToolTip
return
}
|
I can't find a unique ID for each tab, only ClassNN=SysTabControl321 for the group of tabs. This means I need to manually enter the coords for each tab (PosX/PosY) which seems clumsy, apart from which if I decide to reposition the tab group or change the title text for an individual tab, I need to alter the coords to compensate.
Any further advice? |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|