AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GUI- how do I discover these coordinates?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
fade2gray



Joined: 21 Oct 2006
Posts: 12

PostPosted: Thu Nov 08, 2007 5:03 pm    Post subject: GUI- how do I discover these coordinates? Reply with quote

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
View user's profile Send private message
BoBoĻ
Guest





PostPosted: Fri Nov 09, 2007 9:02 am    Post subject: Reply with quote

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





PostPosted: Fri Nov 09, 2007 9:04 am    Post subject: Reply with quote

ControlGetPos !
Back to top
fade2gray



Joined: 21 Oct 2006
Posts: 12

PostPosted: Fri Nov 09, 2007 6:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group