Sunaj Posted September 10, 2006 Share Posted September 10, 2006 (edited) Well, as stated in the Topic what I would really appreciate help on is the following: 2 list are placed side by side, when one list has a selected item the other should deselect all items automatically?! I searched the web, the forum and the help file hi and lo and came out empty handed. Here is the part of my prg code I need help with: expandcollapse popup#include <GUIConstants.au3> #include <Array.au3> #include <string.au3> #Include <GuiList.au3> Opt("GUIOnEventMode", 1); change to onevent mode Opt("TrayIconHide", 1); hide icon from icontray GUICreate("Someapp Preferences", 500, 431); open main gui form GUISetOnEvent($GUI_EVENT_CLOSE, "closeclicked"); allow for standard exit with onevent stuff GUICtrlCreateTab(0, 0, 500, 431); creates main gui of tabs, values are: left, top, width, height GUICtrlCreateTabItem("Someapp Search Plugins"); creates tab for data $label_list_available = GUICtrlCreateLabel("Available Plugins", 20, 35, 200, 20,"",""); centered label for left plugin list GUICtrlSetStyle ($label_list_available, $SS_CENTER); center text GUICtrlSetBkColor ($label_list_available, $GUI_BKCOLOR_TRANSPARENT); make form invisible $label_list_enabled = GUICtrlCreateLabel("Enabled Plugins", 279, 35, 200, 20,"",""); centered label for right plugin list GUICtrlSetStyle ($label_list_enabled, $SS_CENTER); center text GUICtrlSetBkColor ($label_list_enabled, $GUI_BKCOLOR_TRANSPARENT); make form invisible $plugin_list_available = GUICtrlCreateList("", 20, 52, 200, 340, $LBS_DISABLENOSCROLL + $LBS_NOINTEGRALHEIGHT + $WS_VSCROLL); left available plugin list update_plugin_list_available(); read *.src files from available plugin directory GUICtrlSetOnEvent ($plugin_list_available, "plugin_list_available") $plugin_list_enabled = GUICtrlCreateList("", 279, 52, 200, 340, $LBS_DISABLENOSCROLL + $LBS_NOINTEGRALHEIGHT + $WS_VSCROLL); right enabled plugin list update_plugin_list_enabled(); read *.src files from enabled plugin directory GUICtrlSetOnEvent ($plugin_list_enabled, "plugin_list_enabled") $move2right_plugin_button = GUICtrlCreateButton ("--->", 225, 190, 50); move2right_plugin_button GUICtrlSetState ($move2right_plugin_button, $GUI_DISABLE) GUICtrlSetOnEvent($move2right_plugin_button, "move2right_plugin_button"); remember = GUICtrlSetOnEvent $move2left_plugin_button = GUICtrlCreateButton ("<---", 225, 230, 50); move2left_plugin_button GUICtrlSetState ($move2left_plugin_button, $GUI_DISABLE) GUICtrlSetOnEvent($move2left_plugin_button, "move2left_plugin_button"); remember = GUICtrlSetOnEvent $close_plugin_button = GUICtrlCreateButton ("Close", 215, 400, 70); close button GUICtrlSetOnEvent($close_plugin_button, "close_plugin_button"); remember = GUICtrlSetOnEvent GUISetState(@SW_SHOW) While 1 Sleep(10); Idle around WEnd Func plugin_list_available() $checkifselected_plugin_list_available = GUICtrlRead($plugin_list_available) If ($checkifselected_plugin_list_available <> "") Then; if left, available list, is selected then do.. GUICtrlSetState ($move2right_plugin_button, $GUI_ENABLE) GUICtrlSetState ($move2left_plugin_button, $GUI_DISABLE) EndIf GUISetState(@SW_SHOW) ;MsgBox(64, "Information", GUICtrlRead($plugin_list_available)) EndFunc Func plugin_list_enabled() $checkifselected_plugin_list_enabled = GUICtrlRead($plugin_list_enabled) If ($checkifselected_plugin_list_enabled <> "") Then; if right, available list, is selected then do.. GUICtrlSetState ($move2right_plugin_button, $GUI_DISABLE) GUICtrlSetState ($move2left_plugin_button, $GUI_ENABLE) EndIf GUISetState(@SW_SHOW) ;MsgBox(64, "Information", GUICtrlRead($plugin_list_available)) EndFunc Func move2right_plugin_button() MsgBox(64, "Information", GUICtrlRead($plugin_list_available)) EndFunc Func move2left_plugin_button() MsgBox(64, "Information", GUICtrlRead($plugin_list_enabled)) EndFunc Func close_plugin_button() Exit EndFunc Func closeclicked() Exit EndFunc Func update_plugin_list_available() For $i = 1 to 3 - 1 GUICtrlSetData($plugin_list_available,"lalaleft"); put all array data into actual display file Next EndFunc Func update_plugin_list_enabled() For $i = 1 to 3 - 1 GUICtrlSetData($plugin_list_enabled,"lalaright"); put all array data into actual display file Next EndFunc Edited September 10, 2006 by Sunaj [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list] Link to comment Share on other sites More sharing options...
GaryFrost Posted September 10, 2006 Share Posted September 10, 2006 Func plugin_list_available() $checkifselected_plugin_list_available = _GUICtrlListGetText($plugin_list_available,_GUICtrlListSelectedIndex($plugin_list_available)) If ($checkifselected_plugin_list_available <> "") Then; if left, available list, is selected then do.. GUICtrlSetState($move2right_plugin_button, $GUI_ENABLE) GUICtrlSetState($move2left_plugin_button, $GUI_DISABLE) EndIf EndFunc ;==>plugin_list_available Func plugin_list_enabled() $checkifselected_plugin_list_enabled = _GUICtrlListGetText($plugin_list_enabled,_GUICtrlListSelectedIndex($plugin_list_enabled)) If ($checkifselected_plugin_list_enabled <> "") Then; if right, available list, is selected then do.. GUICtrlSetState($move2right_plugin_button, $GUI_DISABLE) GUICtrlSetState($move2left_plugin_button, $GUI_ENABLE) EndIf EndFunc ;==>plugin_list_enabled SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Sunaj Posted September 10, 2006 Author Share Posted September 10, 2006 Hi gafrost, thnx f quick reply , unfortunately I'm not seing any change from using ur code example? I'm using AutoIt v3.2.0.1. With the code below both lists still have focus (on one from each of them) at once - if it is possible what I really want to achieve is to only have focus on in one list at any given time! Func plugin_list_available() $checkifselected_plugin_list_available = _GUICtrlListGetText($plugin_list_available,_GUICtrlListSelectedIndex($plugin_list_available)) If ($checkifselected_plugin_list_available <> "") Then; if left, available list, is selected then do.. GUICtrlSetState($move2right_plugin_button, $GUI_ENABLE) GUICtrlSetState($move2left_plugin_button, $GUI_DISABLE) EndIf EndFunc ;==>plugin_list_available Func plugin_list_enabled() $checkifselected_plugin_list_enabled = _GUICtrlListGetText($plugin_list_enabled,_GUICtrlListSelectedIndex($plugin_list_enabled)) If ($checkifselected_plugin_list_enabled <> "") Then; if right, available list, is selected then do.. GUICtrlSetState($move2right_plugin_button, $GUI_DISABLE) GUICtrlSetState($move2left_plugin_button, $GUI_ENABLE) EndIf EndFunc ;==>plugin_list_enabled [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list] Link to comment Share on other sites More sharing options...
GaryFrost Posted September 10, 2006 Share Posted September 10, 2006 _GUICtrlListSetSel SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Sunaj Posted September 10, 2006 Author Share Posted September 10, 2006 _GUICtrlListSetSel_GUICtrlListSetSel is a good candidate and I tried it - unfortunately it works does "not work with single-selection list boxes" and if one enables $LBS_MULTIPLESEL it still displays random behavior with multiple items on one of the lists (i.e. it can not reliably deselect all items on a list)! [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list] Link to comment Share on other sites More sharing options...
GaryFrost Posted September 10, 2006 Share Posted September 10, 2006 expandcollapse popup#include <GUIConstants.au3> #include <Array.au3> #include <string.au3> #Include <GuiList.au3> Opt("GUIOnEventMode", 1); change to onevent mode Opt("TrayIconHide", 1); hide icon from icontray GUICreate("Someapp Preferences", 500, 431); open main gui form GUISetOnEvent($GUI_EVENT_CLOSE, "closeclicked"); allow for standard exit with onevent stuff GUICtrlCreateTab(0, 0, 500, 431); creates main gui of tabs, values are: left, top, width, height GUICtrlCreateTabItem("Someapp Search Plugins"); creates tab for data $label_list_available = GUICtrlCreateLabel("Available Plugins", 20, 35, 200, 20, "", ""); centered label for left plugin list GUICtrlSetStyle($label_list_available, $SS_CENTER); center text GUICtrlSetBkColor($label_list_available, $GUI_BKCOLOR_TRANSPARENT); make form invisible $label_list_enabled = GUICtrlCreateLabel("Enabled Plugins", 279, 35, 200, 20, "", ""); centered label for right plugin list GUICtrlSetStyle($label_list_enabled, $SS_CENTER); center text GUICtrlSetBkColor($label_list_enabled, $GUI_BKCOLOR_TRANSPARENT); make form invisible $plugin_list_available = GUICtrlCreateList("", 20, 52, 200, 340, BitOR($LBS_DISABLENOSCROLL, $LBS_NOINTEGRALHEIGHT, $WS_VSCROLL)); left available plugin list update_plugin_list_available(); read *.src files from available plugin directory GUICtrlSetOnEvent($plugin_list_available, "plugin_list_available") $plugin_list_enabled = GUICtrlCreateList("", 279, 52, 200, 340, BitOR($LBS_DISABLENOSCROLL, $LBS_NOINTEGRALHEIGHT, $WS_VSCROLL)); right enabled plugin list update_plugin_list_enabled(); read *.src files from enabled plugin directory GUICtrlSetOnEvent($plugin_list_enabled, "plugin_list_enabled") $move2right_plugin_button = GUICtrlCreateButton("--->", 225, 190, 50); move2right_plugin_button GUICtrlSetState($move2right_plugin_button, $GUI_DISABLE) GUICtrlSetOnEvent($move2right_plugin_button, "move2right_plugin_button"); remember = GUICtrlSetOnEvent $move2left_plugin_button = GUICtrlCreateButton("<---", 225, 230, 50); move2left_plugin_button GUICtrlSetState($move2left_plugin_button, $GUI_DISABLE) GUICtrlSetOnEvent($move2left_plugin_button, "move2left_plugin_button"); remember = GUICtrlSetOnEvent $close_plugin_button = GUICtrlCreateButton("Close", 215, 400, 70); close button GUICtrlSetOnEvent($close_plugin_button, "close_plugin_button"); remember = GUICtrlSetOnEvent GUISetState(@SW_SHOW) While 1 Sleep(10); Idle around WEnd Func plugin_list_available() $checkifselected_plugin_list_available = _GUICtrlListGetText($plugin_list_available, _GUICtrlListSelectedIndex($plugin_list_available)) If ($checkifselected_plugin_list_available <> "") Then; if left, available list, is selected then do.. GUICtrlSetState($move2right_plugin_button, $GUI_ENABLE) GUICtrlSetState($move2left_plugin_button, $GUI_DISABLE) EndIf EndFunc ;==>plugin_list_available Func plugin_list_enabled() $checkifselected_plugin_list_enabled = _GUICtrlListGetText($plugin_list_enabled, _GUICtrlListSelectedIndex($plugin_list_enabled)) If ($checkifselected_plugin_list_enabled <> "") Then; if right, available list, is selected then do.. GUICtrlSetState($move2right_plugin_button, $GUI_DISABLE) GUICtrlSetState($move2left_plugin_button, $GUI_ENABLE) EndIf EndFunc ;==>plugin_list_enabled Func move2right_plugin_button() MsgBox(64, "Information", _GUICtrlListGetText($plugin_list_available, _GUICtrlListSelectedIndex($plugin_list_available))) _GUICtrlListSelectIndex($plugin_list_available, -1) EndFunc ;==>move2right_plugin_button Func move2left_plugin_button() MsgBox(64, "Information", _GUICtrlListGetText($plugin_list_enabled, _GUICtrlListSelectedIndex($plugin_list_enabled))) _GUICtrlListSelectIndex($plugin_list_enabled, -1) EndFunc ;==>move2left_plugin_button Func close_plugin_button() Exit EndFunc ;==>close_plugin_button Func closeclicked() Exit EndFunc ;==>closeclicked Func update_plugin_list_available() For $i = 1 To 3 - 1 GUICtrlSetData($plugin_list_available, "lalaleft" & $i); put all array data into actual display file Next EndFunc ;==>update_plugin_list_available Func update_plugin_list_enabled() For $i = 1 To 3 - 1 GUICtrlSetData($plugin_list_enabled, "lalaright"); put all array data into actual display file Next EndFunc ;==>update_plugin_list_enabled you should be able to figure out the rest. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Sunaj Posted September 10, 2006 Author Share Posted September 10, 2006 From the looks of it I guess that will definately be the case, will report back tomorrow after some codefree sleeping. Cheersyou should be able to figure out the rest. [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list] Link to comment Share on other sites More sharing options...
Sunaj Posted September 11, 2006 Author Share Posted September 11, 2006 From the looks of it I guess that will definately be the case, will report back tomorrow after some codefree sleeping. CheersAnd so it does, brilliant help here! Thanks again. [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list] 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