awrog Posted December 9, 2004 Posted December 9, 2004 Hi,I'm using the latest 'unstable' version.In the following example the instruction Do something is being executed when I select the List$MyList = GUICtrlCreateList ("Entry", 25,140,550,265) While $msg <> $GUI_EVENT_CLOSE $msg = GuiGetMsg() Select Case $msg = $Close Exit Case $msg = $MyList Do something EndSelect WendWhen I add $LBS_USETABSTOPS to the GUICtrlCreateList the instruction Do something is not being executed!$MyList = GUICtrlCreateList ("Entry", 25,140,550,265, $LBS_USETABSTOPS ) While $msg <> $GUI_EVENT_CLOSE $msg = GuiGetMsg() Select Case $msg = $Close Exit Case $msg = $MyList Do something EndSelect WendCan somebody explain this?Kind regards.
awrog Posted December 9, 2004 Author Posted December 9, 2004 A working example of au3-code below to demonstrate that the use of LBS_USETABSTOPS is changing how this script reacts! I hope someone can help. #include <GUIConstants.au3> GUICreate("URL's", 800, 470, -1, -1) GUISetFont (10, 400, 0, "Arial") ;$MyList = GUICtrlCreateList ("", 25, 50, 750, 265) $MyList = GUICtrlCreateList ("", 25, 50, 750, 265, $LBS_USETABSTOPS ) GUICtrlSetData($MyList, "Site1" & @TAB & "http://www.hiddensoft.com" ) GUICtrlSetData($MyList, "Site2" & @TAB & "http://www.hiddensoft.com/forum" ) GUICtrlSetData($MyList, "Site3" & @TAB & "http://www.free-sheetmusic.org" ) $OpenURL = GUICtrlCreateButton ("Open", 25, 395, 100, 30, $BS_DEFPUSHBUTTON) GUICtrlSetState ($OpenURL,$GUI_DISABLE) $Close = GUICtrlCreateButton ("Close", 675,395,100,30) GuiSetState () $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GuiGetMsg() Select Case $msg = $Close Exit Case $msg = $MyList GUICtrlSetState($OpenURL,$GUI_ENABLE) GUICtrlSetFont($OpenURL, 9 ,800) Case $msg = $OpenURL IF GuiRead($MyList) <> "" Then $SelectedURL = StringMid(GuiRead($MyList), StringInStr(GuiRead($MyList), "HTTP") -1, 250 ) Run(@COMSPEC & " /c Start " & $SelectedURL, "", @SW_HIDE) ELSE msgbox(0,"No URL selected","No URL selected!") ENDIF EndSelect Wend
Developers Jos Posted December 10, 2004 Developers Posted December 10, 2004 Dont know why a select doesn't trigger a msg anymore but here's a work around that doesn't depend on that: expandcollapse popup#include <GUIConstants.au3> GUICreate("URL's", 800, 470, -1, -1) GUISetFont(10, 400, 0, "Arial") ;$MyList = GUICtrlCreateList ("", 25, 50, 750, 265) $MyList = GUICtrlCreateList("", 25, 50, 750, 265, $LBS_USETABSTOPS) GUICtrlSetData($MyList, "Site1" & @TAB & "http://www.hiddensoft.com") GUICtrlSetData($MyList, "Site2" & @TAB & "http://www.hiddensoft.com/forum") GUICtrlSetData($MyList, "Site3" & @TAB & "http://www.free-sheetmusic.org") $OpenURL = GUICtrlCreateButton("Open", 25, 395, 100, 30, $BS_DEFPUSHBUTTON) GUICtrlSetState($OpenURL, $GUI_DISABLE) $Close = GUICtrlCreateButton("Close", 675, 395, 100, 30) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() If GUICtrlGetState($OpenURL) <> $GUI_ENABLE And GUIRead($MyList) <> "" Then GUICtrlSetState($OpenURL, $GUI_ENABLE) GUICtrlSetFont($OpenURL, 9, 800) EndIf Select Case $msg = $Close Exit Case $msg = $MyList GUICtrlSetState($OpenURL, $GUI_ENABLE) GUICtrlSetFont($OpenURL, 9, 800) Case $msg = $OpenURL If GUIRead($MyList) <> "" Then $SelectedURL = StringMid(GUIRead($MyList), StringInStr(GUIRead($MyList), "HTTP") - 1, 250) Run(@ComSpec & " /c Start " & $SelectedURL, "", @SW_HIDE) Else MsgBox(0, "No URL selected", "No URL selected!") EndIf EndSelect Wend SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
CyberSlug Posted December 11, 2004 Posted December 11, 2004 You apparently need to add the LBS_NOTIFY sytle back in: #include <GuiConstants.au3> Global $LBS_NOTIFY = 0x1 $style = BitOr($LBS_USETABSTOPS, $LBS_NOTIFY) GuiCreate("Example") $MyList = GUICtrlCreateList ("Click_Me", 10,10,100,100, $style ) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $MyList MsgBox(4096,"do","something") EndSelect Wend Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
DirtyBanditos Posted December 11, 2004 Posted December 11, 2004 (edited) Dont know why a select doesn't trigger a msg anymore but here's a work around that doesn't depend on that: expandcollapse popup#include <GUIConstants.au3> GUICreate("URL's", 800, 470, -1, -1) GUISetFont(10, 400, 0, "Arial") ;$MyList = GUICtrlCreateList ("", 25, 50, 750, 265) $MyList = GUICtrlCreateList("", 25, 50, 750, 265, $LBS_USETABSTOPS) GUICtrlSetData($MyList, "Site1" & @TAB & "http://www.hiddensoft.com") GUICtrlSetData($MyList, "Site2" & @TAB & "http://www.hiddensoft.com/forum") GUICtrlSetData($MyList, "Site3" & @TAB & "http://www.free-sheetmusic.org") $OpenURL = GUICtrlCreateButton("Open", 25, 395, 100, 30, $BS_DEFPUSHBUTTON) GUICtrlSetState($OpenURL, $GUI_DISABLE) $Close = GUICtrlCreateButton("Close", 675, 395, 100, 30) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() If GUICtrlGetState($OpenURL) <> $GUI_ENABLE And GUIRead($MyList) <> "" Then GUICtrlSetState($OpenURL, $GUI_ENABLE) GUICtrlSetFont($OpenURL, 9, 800) EndIf Select Case $msg = $Close Exit Case $msg = $MyList GUICtrlSetState($OpenURL, $GUI_ENABLE) GUICtrlSetFont($OpenURL, 9, 800) Case $msg = $OpenURL If GUIRead($MyList) <> "" Then $SelectedURL = StringMid(GUIRead($MyList), StringInStr(GUIRead($MyList), "HTTP") - 1, 250) Run(@ComSpec & " /c Start " & $SelectedURL, "", @SW_HIDE) Else MsgBox(0, "No URL selected", "No URL selected!") EndIf EndSelect Wend<{POST_SNAPBACK}>Hello JdeB I have test your code but wen i start the au3 he gif me this error pick is my gui.au3 to old for using your code exampel=? look pls for my error pick !But wen i rename it to this comand than wörks but he have bug not closed for me!Wat i make wrong?i have this adde in your code an wörks but not stop the open button from the links 1-3((Thx for help me $msg = 0While $msg <> $GUI_CLOSE Edited December 11, 2004 by DirtyBanditos
MHz Posted December 11, 2004 Posted December 11, 2004 (edited) @DirtyBanditos Do you have the latest Autoit 1.0.103 beta installed? Edit: Ensure also, you have #include <GUIConstants.au3> in your script. Edited December 11, 2004 by MHz
Developers Jos Posted December 11, 2004 Developers Posted December 11, 2004 is my gui.au3 to old for using your code exampel=? <{POST_SNAPBACK}>Your GUIConstants.au3 is old... download the latest from the Unstable directory and try again. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
DirtyBanditos Posted December 11, 2004 Posted December 11, 2004 (edited) Your GUIConstants.au3 is old... download the latest from the Unstable directory and try again.<{POST_SNAPBACK}>Hello have you a link to the Unstable directory download Area sry i have search on his forum not found pls tell me the link thx you I have my gui.au3 from his site is this right=? http://www.autoitscript.com/autoit3/files/unstable/autoit/Ok thx it wörks nice thx for help me out Edited December 11, 2004 by DirtyBanditos
Developers Jos Posted December 11, 2004 Developers Posted December 11, 2004 I have my gui.au3 from his site is this right=? http://www.autoitscript.com/autoit3/files/unstable/autoit/<{POST_SNAPBACK}>The filename is GUIConstants.AU3... site is correct.This file does contain :; Events and messages Global $GUI_EVENT_CLOSE = -3 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
DirtyBanditos Posted December 11, 2004 Posted December 11, 2004 The filename is GUIConstants.AU3... site is correct.This file does contain :; Events and messages Global $GUI_EVENT_CLOSE = -3<{POST_SNAPBACK}> Thx Jdeb it wörks nice thx for fast help
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