AutoHotkey Community

It is currently May 27th, 2012, 1:01 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: December 15th, 2011, 1:01 pm 
Offline

Joined: April 23rd, 2010, 11:22 am
Posts: 64
Deo wrote:
Quote:
CloneMenuItems(pm,menu,newmenu)
{
for i, item in menu.GetItems()
newmenu.add({"name" : item.name, "bold" : item.bold, "issep" : item.issep, "icon" : item.icon , "break": item.break, "tcolor": item.tcolor, "bgcolor": item.bgcolor, "noPrefix" : item.noPrefix, "disabled" : item.disabled})
}

this is the good solution, because i have disabled possibility to add same menu as submenu to the several items since it caused some bad problems. I think i'll better make similar method to clone menus instead...


This is sufficient for my needs. I though of making it recurse through submenus - but I do not need it. I suppose it will not be too difficult to modify.

Quote:
Quote:
Thanks - but I think my message was unclear. The problem is not what action is instituted by your program - it is more the message that is sent to PUM_Out. And the default is indeed "run".

now i understand, but if i got two messages, i should transfer them all both to the event handling function without filtering, right? That depends on how you will make handling of them. For example you can call "tooltip" whenever you getting "onrun" event to remove shown tooltip (since "onselect" message received first ), or you can make tooltips showing through timers and make few checks there, for example GetRect() method will return nothing if specified item is not shown on the screen at the moment
Though i can add extra parameter to return with "onselect" message, which can tell you whether item selected with mouse or not, is it highlited, is it disabled. But as i tried it doesn't filter events when you choose item with cursor or by pressing button.


Thanks will try. The "call tooltip" will still mean that the first tooltip flashes (at the moment I call tooltip right after show() returns). A 100 ms delay will be fine (maybe even better since fast scrolling and immediate tooltips will cause a lot of "flashing")

BTW Just saw http://www.autohotkey.com/forum/viewtopic.php?t=79998 - WOW![/url]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 16th, 2011, 9:08 am 
Offline

Joined: May 16th, 2010, 2:38 pm
Posts: 185
just a small tip:
remember that you can always define your own fields for any menu/item object and use them later, for example:
Code:
pm := new PUM( { onselect : "select_handler" } )
menu := pm.CreateMenu()
loop 3
  menu.Add( { name : "some item" A_Index, SomeCustomField : "Hello?!_" A_Index } )
menu.Show( A_ScreenWidth/3, A_ScreenHeight/3 )
return

select_handler( msg, obj )
{
  tooltip % "item selected: " obj.name "`nCustomField: " obj.SomeCustomField
}

though it's not recommended to add object's references this way, if you not sure it will be released later/after item/menu destroyed

_________________
Crypt|QMsgBox|PUM|Quick Cliq|WinClipboard


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2011, 8:23 am 
Offline
User avatar

Joined: September 5th, 2009, 2:06 pm
Posts: 1718
Location: Somewhere near you
Oh it's like Quick Cliq

_________________
Image
The quick onyx goblin jumps over the lazy dwarf


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2011, 7:33 pm 
Offline

Joined: May 16th, 2010, 2:38 pm
Posts: 185
Updated
bug fixed, when calling SetParams() for item caused to lose it's attached menu

_________________
Crypt|QMsgBox|PUM|Quick Cliq|WinClipboard


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 31st, 2012, 4:12 pm 
Offline

Joined: May 16th, 2010, 2:38 pm
Posts: 185
updated
all functions moved to separate class for easier user
and other changes ( check first post )

_________________
Crypt|QMsgBox|PUM|Quick Cliq|WinClipboard


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: rrhuffy and 4 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