AutoHotkey Community

It is currently May 27th, 2012, 4:01 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: May 26th, 2011, 3:24 pm 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
I'm trying to add a pop-up button-menu type control to my gui. Basically it will be a selector that looks/acts just like a 1-menu Menu (just 1 menu item in the "menu bar"), which looks/acts just like a button. Somewhat like the Windows Start button I guess. I'm sure there's a name for this type of control.

I've tried using the following controls:
- ListBox (no auto-highlighting when hover mouse over items)
- Menu (can't position where want; only located at top/left of gui)
- DropDownList (need it to go UP not down; don't want arrow-thingy at right)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2011, 8:39 pm 
Offline

Joined: May 13th, 2010, 10:11 am
Posts: 352
Location: Houston, Tx.
*Edit: I forgot about the selector.
**Edit: After reading your question again, I can see this is not what you're looking for. I'll keep looking.
Code:
   CoordMode, Menu, Relative
   Menu, PopupMenu, Add, Notepad, MenuLabel
   Menu, PopupMenu, Add, My Documents, MenuLabel
   Menu, PopupMenu, Add, Control Panel, MenuLabel
   Menu, PopupMenu, Add
   Menu, PopupMenu, Add, Program Files, MenuLabel
   Gui, Add, Button, y120 w80 h40 gButtonMenu, My Start Menu
   Gui, Show, w200
Return

ButtonMenu:
   If (!MenuShow)
   {
      MenuShow := 1
      Menu, PopupMenu, Show , 14, 44
   }
   Else
      MenuShow := 0
Return

MenuLabel:
   MenuShow := 0
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 29th, 2011, 4:48 pm 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
I had another think and realised i could use a standard menu (not menubar), as that can be positioned (via "Menu, MenuName, Show, x, y" - which you also detailed in your code).
I just (again, as shown in your code) combined a Button with a Menu. It selects alright, and your code should too?

So it's all sorted, and since I made it into a function/include (mainly so I could post sth in "Scripts & Functions" :wink:), I posted it here ---> AddButtonMenu()

However, the fun might not be over yet - I'm thinking of using corrupt's AddGraphicButton() function. I may return here.....


Last edited by a_h_k on May 29th, 2011, 5:09 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 29th, 2011, 5:01 pm 
Offline

Joined: May 13th, 2010, 10:11 am
Posts: 352
Location: Houston, Tx.
Fantastic! I'm glad you were able to glean something from the code.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], Leef_me, rbrtryn, Yahoo [Bot] and 52 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group