Zedna Posted June 20, 2005 Posted June 20, 2005 (edited) I vote for adding these new GUI events:$GUI_EVENT_SHOW in case of GUISetState(@SW_SHOW)$GUI_EVENT_HIDE in case of GUISetState(@SW_HIDE)$GUI_EVENT_OPEN opposite to $GUI_EVENT_CLOSE$GUI_EVENT_MOVE in case of changing position$GUI_EVENT_PRIMARYDOUBLE mouse primary doubleclick$GUI_EVENT_SECONDARYDOUBLE mouse secondary doubleclickI have script with tray icon/menu and one "always on top" toolbox windowwhich can be in state show/hide. I'm using:Opt("GUIOnEventMode",1) GUISetOnEvent ($GUI_EVENT_PRIMARYDOWN, "functionx" )Opt("TrayOnEventMode",1)TrayItemSetOnEvent(-1,"functiony")Main loop is:while 1 ... wend(with some more complicated timing and testing).These new GUI events in this case may help in doing more advanced finesses.Thanks Edited June 20, 2005 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
therks Posted June 21, 2005 Posted June 21, 2005 Most of these I could see, except $GUI_EVENT_OPEN. Where would you use that? You said opposite of $GUI_EVENT_CLOSE, but that's triggered by the [x] button in the corner of the GUI (or by the Esc key possibly). What would trigger $GUI_EVENT_OPEN? Could you provide some pseudo example code?And just to be a pain, I vote we also add $GUI_EVENT_FOCUS and $GUI_EVENT_UNFOCUS. This could more easily help to create local GUI hotkeys.Think of it:GuiCreate('') GuiSetState() While 1 $gm = GuiGetMsg() If $gm = $GUI_EVENT_FOCUS Then HotKeySet('^a', 'SelectAll') ElseIf $gm = $GUI_EVENT_UNFOCUS Then HotKeySet('^a') ElseIf $gm = $GUI_EVENT_CLOSE Then ExitLoop EndIf WEndI really want an easy way to create local HotKeys. I can't stand this looping to check focus workaround we're currently forced to use. It's just so clunky. My AutoIt Stuff | My Github
Zedna Posted June 22, 2005 Author Posted June 22, 2005 Most of these I could see, except $GUI_EVENT_OPEN. Where would you use that? You said opposite of $GUI_EVENT_CLOSE, but that's triggered by the [x] button in the corner of the GUI (or by the Esc key possibly). What would trigger $GUI_EVENT_OPEN? Could you provide some pseudo example code?And just to be a pain, I vote we also add $GUI_EVENT_FOCUS and $GUI_EVENT_UNFOCUS. This could more easily help to create local GUI hotkeys.Think of it:GuiCreate('') GuiSetState() While 1 $gm = GuiGetMsg() If $gm = $GUI_EVENT_FOCUS Then HotKeySet('^a', 'SelectAll') ElseIf $gm = $GUI_EVENT_UNFOCUS Then HotKeySet('^a') ElseIf $gm = $GUI_EVENT_CLOSE Then ExitLoop EndIf WEndI really want an easy way to create local HotKeys. I can't stand this looping to check focus workaround we're currently forced to use. It's just so clunky.<{POST_SNAPBACK}>$GUI_EVENT_OPEN would be something like constructor as $GUI_EVENT_CLOSE is something like destructor.But you are right, $GUI_EVENT_OPEN is not neccesary becausecode listed in this event can be written immediately after GuiCreate()with same effect.Your tip for events about getting/losing focus$GUI_EVENT_FOCUS and $GUI_EVENT_UNFOCUSI think names$GUI_EVENT_GETFOCUS and $GUI_EVENT_LOSEFOCUS or$GUI_EVENT_ACTIVATE and $GUI_EVENT_DEACTIVATEwould be better Resources UDF ResourcesEx UDF AutoIt Forum Search
PerryRaptor Posted June 23, 2005 Posted June 23, 2005 I vote for the addition of $GUI_EVENT_ACTIVATE and $GUI_EVENT_DEACTIVATE. If you don't like these names may be $GUI_EVENT_ENABLE and $GUI_EVENT_DISABLE.
Michel Claveau Posted June 23, 2005 Posted June 23, 2005 I prefer $GUI_EVENT_SETFOCUS $GUI_EVENT_REMOVEFOCUS only for to have the same word than I use in Paradox.
therks Posted June 24, 2005 Posted June 24, 2005 How about we take after HTML and use Focus and Blur? $GUI_EVENT_onfocus $GUI_EVENT_onblur In HTML, you can do something like this: Click in this input box, then click somewhere else on the page.<br> <input name="status" onfocus="this.value='onfocus Triggered'" onblur="this.value='onblur Triggered'"> Go ahead, save that as file.html and give it a try. My AutoIt Stuff | My Github
Zedna Posted June 25, 2005 Author Posted June 25, 2005 (edited) About focus events: For me sounds best$GUI_EVENT_GETFOCUS$GUI_EVENT_LOSEFOCUSIt exactly says what is going on:losing or getting focus.These names also have window events in PowerBuilderEDIT:We also should keep name convence from previous existing events:$GUI_EVENT_CLOSE $GUI_EVENT_MINIMIZE $GUI_EVENT_RESTORE $GUI_EVENT_MAXIMIZE $GUI_EVENT_PRIMARYDOWN $GUI_EVENT_PRIMARYUP $GUI_EVENT_SECONDARYDOWN$GUI_EVENT_SECONDARYUP $GUI_EVENT_MOUSEMOVE $GUI_EVENT_RESIZED See there is no $GUI_EVENT_ONCLOSEbut$GUI_EVENT_CLOSEBecause that is not perfect$GUI_EVENT_onfocus$GUI_EVENT_onblurso rather $GUI_EVENT_FOCUS$GUI_EVENT_BLUR Edited June 25, 2005 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Valik Posted June 25, 2005 Posted June 25, 2005 I think that adding a facility to subscribe to any Windows message would be a better use of time than adding support for more hard-coded events.
Zedna Posted June 25, 2005 Author Posted June 25, 2005 (edited) @Valik Yes but I think it's sure more complicated to implement such universal solution than only adding a few hardcoded events which will cover 99% of needs all users... Edited June 25, 2005 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Valik Posted June 25, 2005 Posted June 25, 2005 @ValikYes but I think it's sure more complicated to implementsuch universal solutionthan only adding a few hardcoded events which will cover99% of needs all users...<{POST_SNAPBACK}>But subscribing to events at the users discretion will cover 100%.
Zedna Posted June 25, 2005 Author Posted June 25, 2005 Yes I said Yes But if authors couldn't implement this universal (more complicated) solution soon then I vote for simple hardcoded events (maded more quickly) Resources UDF ResourcesEx UDF AutoIt Forum Search
therks Posted June 25, 2005 Posted June 25, 2005 I think that adding a facility to subscribe to any Windows message would be a better use of time than adding support for more hard-coded events.<{POST_SNAPBACK}>This intrigues me. Could you demonstrate how this might work with AutoIt code? My AutoIt Stuff | My Github
Valik Posted June 25, 2005 Posted June 25, 2005 This intrigues me. Could you demonstrate how this might work with AutoIt code?<{POST_SNAPBACK}>No, because the GUI designers are currently in a KISS mode with the GUI. This would require some additonal method for communicating parameters as part of the message. For example, subscribing to a WM_MOUSEMOVE would require some way to pass the parameters of that message (The x,y coordinates). I want to see a true callback method where the callback function for the event automagically gets passed some parameters, but I'm not sure if thats do-able at this point with AutoIt's internal workings. Also, this might be a bit more complex for new users because of the seemingly magical way things work in a callback system.
Zedna Posted June 25, 2005 Author Posted June 25, 2005 About possibility of subscribe to any Windows messageI found another topic:GUIGetMsg(1), additional parameter in advanced mode Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted August 5, 2005 Author Posted August 5, 2005 I have another topic (in Idea Lab forum) related to this one:Possibility to handle any windows message Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted November 7, 2005 Author Posted November 7, 2005 Please can be added these two GUI events?$GUI_EVENT_PRIMARYDOUBLE - mouse primary doubleclick$GUI_EVENT_SECONDARYDOUBLE - mouse secondary doubleclickIt has corresponding windows messages (WM_LBUTTONDBLCLK, WM_RBUTTONDBLCLK),so implement this can't be so hard.I found several workarounds in AutoIt forum,but there are problems in some circumstances with itand code is little dirty (less readable) with it.Thank you***I also vote for these two events:$GUI_EVENT_GETFOCUS$GUI_EVENT_LOSEFOCUS Resources UDF ResourcesEx UDF AutoIt Forum Search
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now