bobheart Posted June 28, 2004 Share Posted June 28, 2004 With the autoit builder it has a combo box /drop down list thingy and well how do you use it ? I have this code I made and was thinking on using the drop down lisy thinng to have a code in it and then it if you click on it it would load the code in the list box .How would I go about showing it in the dropdown and print with a click to the list ?Code;Generated with AutoBuilder 0.3 Opt("GUICoordMode", 1) Opt("GUINotifyMode", 1) GuiCreate("MyGUI", 718,485,10,10,0x04CF0000) $list_1 = GUISetControl("list", "List 1", 10,10, 540,470) $combo_1 = GUISetControl("combo", "Combo 1", 580,40, 120,40) GuiShow() While 1 sleep(100) $msg = GuiMsg(0) Select Case $msg = -3 Exit Case $msg = $list_1 ;;; Case $msg = $combo_1 "if (y<room_height-120)" ;;; EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
CyberSlug Posted June 29, 2004 Share Posted June 29, 2004 (edited) * You may want to upgrade to AutoBuilder 0.4 I really need to post an update for AutoBuilder; it's now buried on the third page of the Scripts and Scraps!* If you need advance listbox stuff, take a look at GuiMsg wrappers* You might want to increase the height of your combobox. Windows XP seems to ignore the height, but it makes a big difference on Windows 98 and 2000. (height = the max height of the box that drops down from the combobox.)* Finally, here is an example that populates the listbox with different data depending on what option you choose in the combo box. If you have a lot of data, it might be better to use an array instead of the hard-coded variables in my code:Opt("GUINotifyMode", 1) GuiCreate("MyGUI", 718,485,10,10,0x04CF0000) $list_1 = GUISetControl("list", "List 1", 10,10, 540,470) $combo_1 = GUISetControl("combo", "Combo 1", 580,140, 120,40) GuiSetControlData($combo_1, "option A|option B|option C") GuiShow() While 1 sleep(100) $msg = GuiMsg(0) Select Case $msg = -3 ExitLoop Case $msg = $list_1 ;;; Case $msg = $combo_1 $selectedItem = GuiRead($combo_1) Select Case $selectedItem = "option A" GuiSetControlData($list_1, "");clear list GuiSetControlData($list_1, "apple|aardvark|airplane") Case $selectedItem = "option B" GuiSetControlData($list_1, "");clear list GuiSetControlData($list_1, "banana|bird|bus") Case $selectedItem = "option C" GuiSetControlData($list_1, "");clear list GuiSetControlData($list_1, "coconut|cat|car") EndSelect EndSelect WEnd Exit Edited June 29, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
bobheart Posted June 29, 2004 Author Share Posted June 29, 2004 thank you for the help and all grab the new one you have done right now .. Link to comment Share on other sites More sharing options...
bobheart Posted June 29, 2004 Author Share Posted June 29, 2004 Ok I wanted to be able to copy the txt in the box so changed it to a edit box and changed what I though needed to be changed but getting a error . expandcollapse popupOpt("GUINotifyMode", 1) GuiCreate("MyGUI", 718,485,10,10,0x04CF0000) $edit_1 = GUISetControl("edit", "Edit 1", 10,10, 540,470) $combo_1 = GUISetControl("combo", "Combo 1", 580,140, 120,40) GuiSetControlData($combo_1, "option A|option B|option C|Test D") GuiShow() While 1 sleep(100) $msg = GuiMsg(0) Select Case $msg = -3 ExitLoop Case $msg = $edit 1 ;;; Case $msg = $combo_1 $selectedItem = GuiRead($combo_1) Select Case $selectedItem = "option A" GuiSetControlData($edit 1, "");clear list GuiSetControlData($edit 1, "apple|aardvark|airplane") Case $selectedItem = "option B" GuiSetControlData($edit 1, "");clear list GuiSetControlData($edit 1, "banana|bird|bus") Case $selectedItem = "option C" GuiSetControlData($edit 1, "");clear list GuiSetControlData($edit 1, "coconut|cat|car") Case $selectedItem = "Test D" GuiSetControlData($edit 1, "");clear list GuiSetControlData($edit 1, "dog|duck|drak") EndSelect EndSelect WEnd Exit Error --------------------------- AutoIt Error --------------------------- Line 17Â (File "E:\Programs\AutoIt3\Examples\june28\5.au3"): Case $msg = $edit 1 Case $msg = ^ ERROR Error: Variable used without being declared.What did I do worng ? Link to comment Share on other sites More sharing options...
Valik Posted June 29, 2004 Share Posted June 29, 2004 <snip>* You might want to increase the height of your combobox. Windows XP seems to ignore the height, but it makes a big difference on Windows 98 and 2000. (height = the max height of the box that drops down from the combobox.)<snip>CBS_NOINTEGRALHEIGHTSpecifies that the size of the combo box is exactly the size specified by the application when it created the combo box. Normally, the system sizes a combo box so that it does not display partial items.Setting $CBS_NOINTEGRALHEIGHT when creating a combo-box (Or $LBS_NOINTEGRALHEIGHT for a ListBox) creates the box the size you specified instead of letting Windows do it's usual routine which is to attempt to make sure an item isn't partially shown. Link to comment Share on other sites More sharing options...
bobheart Posted June 29, 2004 Author Share Posted June 29, 2004 ***Bump*** Link to comment Share on other sites More sharing options...
CyberSlug Posted June 29, 2004 Share Posted June 29, 2004 There is an underscore missing.Case $msg = $edit_1 Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
bobheart Posted June 29, 2004 Author Share Posted June 29, 2004 Ok wow you looked and looked and didn't see that . lol But now when I try to use the drop down list and click on a name I get this. --------------------------- AutoIt Error --------------------------- Line 29 (File "E:\Programs\AutoIt3\Examples\june28\5.au3"): GuiSetControlData($edit 1, "");clear list GuiSetControlData(^ ERROR Error: Variable used without being declared. Link to comment Share on other sites More sharing options...
Josbe Posted June 29, 2004 Share Posted June 29, 2004 Setting $CBS_NOINTEGRALHEIGHT when creating a combo-box (Or $LBS_NOINTEGRALHEIGHT for a ListBox) creates the box the size you specified instead of letting Windows do it's usual routine which is to attempt to make sure an item isn't partially shown.mmm....thanks 4 the tip. • AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
bobheart Posted June 29, 2004 Author Share Posted June 29, 2004 Well i found the error . ($edit 1 needed to be ($edit_1 But now nothing shows in the big edit box ? Link to comment Share on other sites More sharing options...
jpm Posted June 29, 2004 Share Posted June 29, 2004 Well i found the error .($edit 1 needed to be ($edit_1But now nothing shows in the big edit box ?GuiSetControlData is not the right function to update a "edit" control you have to use GuiWriteThat's the doc say about itGuiSetControlDataDefine data info for Combo or List Control.Good luck Link to comment Share on other sites More sharing options...
bobheart Posted June 29, 2004 Author Share Posted June 29, 2004 Now the drop down has nothing in it ? expandcollapse popupOpt("GUINotifyMode", 1) GuiCreate("MyGUI", 718,485,10,10,0x04CF0000) $edit_1 = GUISetControl("edit", "Edit 1", 10,10, 540,470) $combo_1 = GUISetControl("combo", "Combo 1", 580,140, 120,40) GUIWrite($combo_1, "option A|option B|option C|Test D") GuiShow() While 1 sleep(100) $msg = GuiMsg(0) Select Case $msg = -3 ExitLoop Case $msg = $edit_1 ;;; Case $msg = $combo_1 $selectedItem = GuiRead($combo_1) Select Case $selectedItem = "option A" GUIWrite($edit_1, "");clear list GUIWrite($edit_1, "apple|aardvark|airplane") Case $selectedItem = "option B" GUIWrite($edit_1, "");clear list GUIWrite($edit_1, "banana|bird|bus") Case $selectedItem = "option C" GUIWrite($edit_1, "");clear list GUIWrite($edit_1, "coconut|cat|car") Case $selectedItem = "Test D" GUIWrite($edit_1, "");clear list GUIWrite($edit_1, "dog|duck|drak") EndSelect EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
jpm Posted June 29, 2004 Share Posted June 29, 2004 Now the drop down has nothing in it ? expandcollapse popupOpt("GUINotifyMode", 1) GuiCreate("MyGUI", 718,485,10,10,0x04CF0000) $edit_1 = GUISetControl("edit", "Edit 1", 10,10, 540,470) $combo_1 = GUISetControl("combo", "Combo 1", 580,140, 120,40) GUIWrite($combo_1, "option A|option B|option C|Test D") GuiShow() While 1 sleep(100) $msg = GuiMsg(0) Select Case $msg = -3 ExitLoop Case $msg = $edit_1 ;;; Case $msg = $combo_1 $selectedItem = GuiRead($combo_1) Select Case $selectedItem = "option A" GUIWrite($edit_1, "");clear list GUIWrite($edit_1, "apple|aardvark|airplane") Case $selectedItem = "option B" GUIWrite($edit_1, "");clear list GUIWrite($edit_1, "banana|bird|bus") Case $selectedItem = "option C" GUIWrite($edit_1, "");clear list GUIWrite($edit_1, "coconut|cat|car") Case $selectedItem = "Test D" GUIWrite($edit_1, "");clear list GUIWrite($edit_1, "dog|duck|drak") EndSelect EndSelect WEnd ExitTha's what is implemented too. if you want something displayed you have to defined a default value but you have to use for combo the GuiSetControlData not the GuiWrite GuiSetControlData ($combo_1, "option A|option B|option C|Test D","option A" ) Link to comment Share on other sites More sharing options...
bobheart Posted June 29, 2004 Author Share Posted June 29, 2004 I tried that And I still can't get it to work . Link to comment Share on other sites More sharing options...
bobheart Posted June 29, 2004 Author Share Posted June 29, 2004 ****BUMP*** Link to comment Share on other sites More sharing options...
CyberSlug Posted June 29, 2004 Share Posted June 29, 2004 In General:Use GuiSetControlData for "list" and "combo" controlsUse GuiWrite for "edit" and "input" controlsAlso pay careful attention to the parameters:GUIWrite ( controlref ,state ,info, ...)GUISetControlData ( controlref, data,...)expandcollapse popupOpt("GUINotifyMode", 1) GuiCreate("MyGUI", 718,485,10,10,0x04CF0000) $edit_1 = GUISetControl("edit", "Edit 1", 10,10, 540,470) $combo_1 = GUISetControl("combo", "Combo 1", 580,140, 120,40) GuiSetControlData($combo_1, "option A|option B|option C|Test D") GuiShow() While 1 sleep(100) $msg = GuiMsg(0) Select Case $msg = -3 ExitLoop Case $msg = $edit_1 ;;; Case $msg = $combo_1 $selectedItem = GuiRead($combo_1) Select Case $selectedItem = "option A" GuiWrite($edit_1, -1, "");clear edit GuiWrite($edit_1, -1, "apple|aardvark|airplane") Case $selectedItem = "option B" GuiWrite($edit_1, -1, "");clear edit GuiWrite($edit_1, -1, "banana|bird|bus") Case $selectedItem = "option C" GuiWrite($edit_1,-1, "");clear edit GuiWrite($edit_1, -1, "coconut|cat|car") Case $selectedItem = "Test D" GuiWrite($edit_1, -1, "");clear edit GuiWrite($edit_1, -1, "dog|duck|drak") EndSelect EndSelect WEnd Exit Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
bobheart Posted June 29, 2004 Author Share Posted June 29, 2004 Thank you that worked , it strings them dog|duck|drak but I can work around that .. Link to comment Share on other sites More sharing options...
bobheart Posted June 29, 2004 Author Share Posted June 29, 2004 How can I add html code in the GuiWrite($edit_1, -1, "dog|duck|drak"& @CRLF & "") . If I try to html code in it , it thinks the html is autoit code .. Link to comment Share on other sites More sharing options...
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