Can we do multi-column combo or list boxes in AutoIt GUI?
Multi-column combo
Started by
Chris_1013
, Jun 21 2004 03:49 PM
4 replies to this topic
#1
Posted 21 June 2004 - 03:49 PM
#2
Posted 21 June 2004 - 07:41 PM
Yep
LBS_MULTICOLUMN needs to be added to the documentation.
Global $LBS_MULTICOLUMN = 0x200; Global $WS_VSCROLL = 0x00200000; Global $WS_HSCROLL = 0x100000; $listbox_style = $LBS_MULTICOLUMN + $WS_HSCROLL GuiCreate("Multi-Col listbox") $list_1 = GUISetControl("list", "List 1", 60, 80, 250, 90, $listbox_style ) GUISetControlData($list_1, "one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|13|14|15|16") GuiShow() GuiWaitClose()
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
#3
Posted 22 June 2004 - 08:49 AM
Ahhh, I see what you've done there, but it wasn't exactly what I meant. was thinking where each selection in a combo or list box has two (or more) pieces of data for it.
#4
Posted 22 June 2004 - 02:56 PM
Could you use multiple listbox controls?
Or could you use data entries that have a lot of blank space padding between your "columns"?
Also--this might not help you--but it is possible to associate a number (I think the range is +/- a trillion or so) with each list box entry:
Plain Text
Global $LB_GETITEMDATA = 0x199; Global $LB_SETITEMDATA = 0x19A Opt("GUINotifyMode", 1) GuiCreate("Listbox stuff") $button_1 = GuiSetControl("button", "Selected Item Info", 0, 0, 100, 50) $list_1 = GUISetControl("list", "List 1", 60, 80, 250, 90) $data = "apple|banana|carrot|donut|egg" GUISetControlData($list_1, $data) GuiShow() WinActivate("Listbox stuff") _GuiLB_SetItemData($list_1, 0, 100) _GuiLB_SetItemData($list_1, 1, 200) _GuiLB_SetItemData($list_1, 2, 300) _GuiLB_SetItemData($list_1, 3, 404) _GuiLB_SetItemData($list_1, 4, 711) While 1 $msg = GuiMsg(0) sleep(50) If $msg = -3 Then Exit If $msg = $button_1 Then $currentSelection =GuiSendMsg($list_1, 0x188, 0, 0) $text = _GuiLB_GetItemData($list_1, $currentSelection) MsgBox(4096,"Info", $text) EndIf WEnd Exit Func _GuiLB_SetItemData($ref, $index, $data) Return GuiSendMsg($ref, $LB_SETITEMDATA, $index, $data) EndFunc Func _GuiLB_GetItemData($ref, $index) Return GuiSendMsg($ref, $LB_GETITEMDATA, $index, 0) EndFunc
Edited by CyberSlug, 22 June 2004 - 02:57 PM.
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
#5
Posted 26 June 2004 - 10:16 PM
I think I finally realized what you want:
Note: The default column width (tab) cannot be changed; so if you have really long entries, you might need to use multiple tabs between short entries.
Note: The default column width (tab) cannot be changed; so if you have really long entries, you might need to use multiple tabs between short entries.
; ListBox with tabbed-columns Global $LBS_USETABSTOPS = 0x80; GuiCreate("Multi-Col listbox") $list_1 = GUISetControl("list", "List 1", 60, 80, 250, 90, $LBS_USETABSTOPS) _GuiLB_AddString($list_1, StringReplace("Char,Decimal,Hex,Description", ",", @TAB)) _GuiLB_AddString($list_1, StringReplace("a,97,61,Lowercase A", ",", @TAB)) _GuiLB_AddString($list_1, StringReplace("b,98,62,Lowercase B", ",", @TAB)) _GuiLB_AddString($list_1, StringReplace("c,99,63,Lowercase C", ",", @TAB)) _GuiLB_AddString($list_1, StringReplace("d,100,64,Lowercase D", ",", @TAB)) _GuiLB_AddString($list_1, StringReplace("e,101,65,Lowercase E", ",", @TAB)) GuiShow() GuiWaitClose() Func _GuiLB_AddString($ref, $string) Return GuiSendMsg($ref, 0x0180, 0, $string) EndFunc
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users




