;-- Initialize #SingleInstance force DetectHiddenWindows On SysGet MonitorWorkArea,MonitorWorkArea AllModeOptions= (ltrim join`s AutoDeleteChars AutoDeleteSpace AutoLower AutoSort AutoSortDesc AutoTrim AutoUpper AutoUpperT CancelButton CaseSensitive CheckAll CheckBoxes Close ConfirmClose ConfirmDelete ContextMenu Copy Delete DoubleClick EditButtons EscapeToClose Insert Menu Modify Move NoBlank NoDuplicates Paste ReturnButtonSave ReturnButtonSelect ReturnButtonOK ReturnListPos Select SelectAll SelectionRequired SelectMulti Sort TypeInteger TypeFloat TypeNumber TypeDigit TypexDigit TypeAlpha TypeUpper TypeLower TypeAlNum ) DefaultEditModeOptions= (ltrim join`s CancelButton Close ConfirmClose ContextMenu Copy Delete EscapeToClose Insert Menu Modify Move Paste ReturnButtonSave Select SelectMulti ) DefaultChecklistModeOptions= (ltrim join`s CancelButton Checkboxes Close ContextMenu Copy Delete DoubleClick EscapeToClose Insert Menu Modify Move Paste ReturnButtonSave Select SelectMulti ) DefaultSelectModeOptions= (ltrim join`s CancelButton Close Copy DoubleClick EscapeToClose ReturnButtonSelect Select SelectionRequired ) DefaultDisplayModeOptions= (ltrim join`s Close EscapeToClose ReturnButtonOK ) ;-- OK, these aren't all List options, but for this exercise... AllListOptions= (ltrim join`s w300 h200 +Grid BackgroundBlack BackgroundSilver BackgroundGray BackgroundWhite BackgroundMaroon BackgroundRed BackgroundPurple BackgroundFuchsia BackgroundGreen BackgroundLime BackgroundOlive BackgroundYellow BackgroundNavy BackgroundBlue BackgroundTeal BackgroundAqua ) DefaultListOptions:="w300 h200" ;-- OK, these aren't all the Fonts, but for this exercise... AllFont= (ltrim join| Arial Courier Courier New Lucida Console MS Sans Serif MS Serif Tahoma Times New Roman Verdana ) DefaultFont:="" ;-- OK, these aren't all the Fonts, but for this exercise... AllFontOptions= (ltrim join`s Bold Italic Strike Underline cBlack cSilver cGray cWhite cMaroon cRed cPurple cFuchsia cGreen cLime cOlive cYellow cNavy cBlue cTeal cAqua s05 s06 s07 s08 s09 s10 s11 s12 s14 s16 s18 s20 s22 s24 s26 s28 s30 ) DefaultFontOptions:="" ;-- OK, these aren't all GUI options, but for this exercise... AllGUIOptions= (ltrim join`s -Caption +Border -Border +Resize -MaximizeBox -MinimizeBox -SysMenu +ToolWindow ) DefaultGUIOptions:="" ;-- Parent GUI gui 23:Default gui -MinimizeBox ;+AlwaysOnTop gui Margin,0,0 gui Add,Button,x0 h30 w270 Left gTest1,%A_Space%01 - Edit Example 1 gui Add,Button,x0 h30 w270 Left gTest2,%A_Space%02 - Edit Example 2: +EditButtons +NoDuplicates gui Add,Button,x0 h30 w270 Left gTest3,%A_Space%03 - Checklist Example 1 gui Add,Button,x0 h30 w270 Left gTest4,%A_Space%04 - Checklist Example 2: +EditButtons +NoDuplicates gui Add,Button,x0 h30 w270 Left gTest5,%A_Space%05 - Select Example 1 gui Add,Button,x0 h30 w270 Left gTest6,%A_Space%06 - Select Example 2: +Checkboxes -Select gui Add,Button,x0 h30 w270 Left gTest7,%A_Space%07 - Display Example 1 gui Add,Button,x0 h30 w270 Left gTest8,%A_Space%07 - Display Example 2: +Copy +Select +Sort gui Add,Button,x0 h30 w270 Left gTest9,%A_Space%08 - Custom Example (with ToolTip hints) gui Add,Button,x0 h30 w270 Center,Reload script... ;-- Render, position, and show gui Show,Hide,ListManagerGUI Test ;-- Render but don't show WinGetPos,,,ParentW,ParentH,ParentGUI Random PosX,0,% MonitorWorkAreaRight-ParentW Random PosY,0,% MonitorWorkAreaBottom-ParentH ;;;;;gui Show,x%PosX% y%PosY% gui Show return 23ButtonReloadScript...: reload return Test1: List=FRIDAY|Sunday|dayMon|tuesday|Thursday|Saturday|Blueday Return:=ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,List ;-- List ,"" ;-- Default list ,"" ;-- Delimiter ,"Edit" ;-- Mode ,"" ;-- Mode options ,"Days Of The Week" ;-- List title ,"" ;-- Window title ,"w200" ;-- List options ,"" ;-- Font ,"" ;-- Font options ,"" ;-- GUI options ,"") ;-- Background color gui +OwnDialogs MsgBox End of example.`n`nErrorLevel=%ErrorLevel%`nReturn=%Return% return Test2: List=Red|Green|Blue|Wednesday|White|Yllow|Cyan|Magenta|Black Return:=ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,List ;-- List ,"" ;-- Default list ,"" ;-- Delimiter ,"Edit" ;-- Mode ,"+EditButtons -Menu +NoDuplicates" ;-- Mode options ,"Colors" ;-- List title ,"" ;-- Window title ,"w150" ;-- List options ,"" ;-- Font ,"" ;-- Font options ,"+Resize -MaximizeBox" ;-- GUI options ,"") ;-- Background color gui +OwnDialogs MsgBox End of example.`n`nErrorLevel=%ErrorLevel%`nReturn=%Return% return Test3: List= (ltrim join 1APE:0MAC:0APL:0CDA:1FLAC:1MID:1MIDI:0RMI:0KAR:0MIZ:0mod:0nst:0stm:0stz: 0s3m:0s3z:0it:0itz:0xm:0xmz:0mtm:0ult:0669:0far:0amf:0okt:0ptm:1MP3:1MP2: 1MP1:1AAC:0APL:0VLB:0M4A:0NSV:0NSA:1OGG:0aiff:0au:0avr:0caf:0htk:0iff:0paf: 0pvf:0raw:0sd2:0sds:0sf:0voc:0w64:0xi:1WMA:1M3U:0M3U8:1PLS:0B4S:0WPL ) Return:=ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,List ;-- List ,"" ;-- Default list ,":" ;-- Delimiter ,"Checklist" ;-- Mode ,"+Sort" ;-- Mode options ,"File Types" ;-- List title ,"Associated File Types" ;-- Window Title ,"w150 h300" ;-- List options ,"" ;-- Font ,"" ;-- Font options ,"+Resize -MaximizeBox -SysMenu" ;-- GUI options ,"") ;-- Background color gui +OwnDialogs MsgBox End of example.`n`nErrorLevel=%ErrorLevel%`nReturn=%Return% return Test4: List= (ltrim join| 1Milk 0Eggs 0Butter 0Yogurt 1Orange Juice 1Grape Juice 1Cheerios 1Raisin Bran 1Cookies 1Broccoli 0Spinach 0Lettuce 1Tomatoes 0Potatoes 0Onions 1Apples 1Oranges 1Bananas 1Strawberries ) Return:=ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,List ;-- List ,"" ;-- Default list ,"" ;-- Delimiter ,"Checklist", ;-- Mode (ltrim join`s ;-- Mode options " +AutoTrim +AutoUpperT +EditButtons -Menu +NoDuplicates +Sort " ) ,"Groceries" ;-- List title ,"Grocery List" ;-- Window title ,"w150 h350 +BackGroundFFFFC0" ;-- List options ,"" ;-- Font ,"s10" ;-- Font options ,"+Resize -MaximizeBox" ;-- GUI options ,"") ;-- Background color gui +OwnDialogs MsgBox End of example.`n`nErrorLevel=%ErrorLevel%`nReturn=%Return% return Test5: List=Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday Return:=ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,List ;-- List ,"" ;-- Default list ,"" ;-- Delimiter ,"Select" ;-- Mode ,"" ;-- Mode options ,"Day" ;-- List title ,"" ;-- Window title ,"w120" ;-- List options ,"" ;-- Font ,"" ;-- Font options ,"" ;-- GUI options ,"") ;-- Background color gui +OwnDialogs MsgBox End of example.`n`nErrorLevel=%ErrorLevel%`nReturn=%Return% return Test6: List=Red|Green|Blue|White|Yellow|Cyan|Magenta|Black Return:=ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,List ;-- List ,"" ;-- Default list ,"" ;-- Delimiter ,"Select" ;-- Mode ,"+Checkboxes -Select" ;-- Mode options ,"Colors" ;-- List title ,"" ;-- Window title ,"w120 h150" ;-- List options ,"" ;-- Font ,"" ;-- Font options ,"" ;-- GUI options ,"") ;-- Background color gui +OwnDialogs MsgBox End of example.`n`nErrorLevel=%ErrorLevel%`nReturn=%Return% return Test7: List=Coke|Pepsi|RC Cola|Dr Pepper|Mr. PiBB|Sprite|7-Up|Big Red|Barq's Root Beer Return:=ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,List ;-- List ,"" ;-- Default list ,"" ;-- Delimiter ,"Display" ;-- Mode ,"" ;-- Mode options ,"" ;-- List title ,"Soft Drinks" ;-- Window title ,"w150 +BackGroundC0FFFF" ;-- List options ,"" ;-- Font ,"s10" ;-- Font options ,"" ;-- GUI options ,"") ;-- Background color gui +OwnDialogs MsgBox End of example.`n`nErrorLevel=%ErrorLevel%`nReturn=%Return% return Test8: List= (ltrim join| Pineapple Apple Cherry Strawberry Orange Plum Mango Papaya Lemon Cantaloupe Lime Kiwi Pomegranate Grapefruit Tangelo Tangerine Grape Date Watermelon Gooseberry Fig Kumquat Pear Crabapple Mulberry Honeydew Banana Apricot Peach Blackberry Blueberry Raspberry Gooseberry ) Return:=ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,List ;-- List ,"" ;-- Default list ,"" ;-- Delimiter ,"Display" ;-- Mode ,"+ContextMenu +Copy +Select +SelectMulti +Sort" ;-- Mode options ,"" ;-- List title ,"Fruit" ;-- Window title ,"w150 h200 +BackGroundE0F0E0" ;-- List options ,"" ;-- Font ,"s10" ;-- Font options ,"+Resize -MaximizeBox" ;-- GUI options ,"") ;-- Background color gui +OwnDialogs MsgBox End of example.`n`nErrorLevel=%ErrorLevel%`nReturn=%Return% return Test9: List:="august|february||october|aPril|mAY|june|july|january|september|march|november|december|JULY" DefaultList:="february|september" ;[========] ;[ Mode ] ;[========] Tip= (ltrim Select a "Mode". The selected Mode will be used for the rest of this example. To select another Mode, restart the "Custom" example. Note: The "Checklist" mode is not included in this example because the input/output format is slightly different. Hint: If running this example for the first time, try the "Edit" mode. ) SetTimer ToolTip,-150 SetTimer ToolTip_Off,-30000 Mode:=ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,"Edit Select Display" ;-- List ,"Edit" ;-- Default list ,A_Space ;-- Delimiter ,"Select" ;-- Mode ,"" ;-- Mode options ,"Mode" ;-- List title ,"" ;-- Window title ,"w120 h50" ;-- List options ,"" ;-- Font ,"" ;-- Font options ,"-SysMenu" ;-- GUI options ,"") ;-- Background color Tooltip if ErrorLevel return ;-- Set defaults ModeOptions:=Default%Mode%ModeOptions ListOptions:=DefaultListOptions Font:=DefaultFont FontOptions:=DefaultFontOptions GUIOptions:=DefaultGUIOptions loop { ;[================] ;[ Mode Options ] ;[================] Tip= (ltrim Select the desired "Mode Options" by either checking or unchecking the options from the list. Note: Options that are already checked are either the defaults for the selected Mode or were selected in a previous iteration. Hint: Stay away from the TypeXXX options until you become familiar with the other options. ) SetTimer ToolTip,-150 SetTimer ToolTip_Off,-60000 ModeOptions:="" . ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,AllModeOptions . A_Space . ModeOptions ;-- List ,ModeOptions ;-- Default list ,A_Space ;-- Delimiter ,"Select", ;-- Mode (ltrim join`s ;-- Mode options " +AutoSort +CheckBoxes +ContextMenu +NoDuplicates +Insert +Modify " ) ,"Mode Options" ;-- List title ,"" ;-- Window title ,"w160 h500" ;-- List options ,"" ;-- Font ,"" ;-- Font options ,"-SysMenu +Resize" ;-- GUI options ,"") ;-- Background color Tooltip if ErrorLevel break ;[================] ;[ List Options ] ;[================] Tip= (ltrim Select the desired "List Options" by either checking or unchecking the options from the list. Options that are already checked are either the defaults or were selected in a previous iteration. Note: The items in this list are for demonstration purposes only. They do not represent all possible options for this parameter. ) SetTimer ToolTip,-150 SetTimer ToolTip_Off,-30000 ListOptions:="" . ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,AllListOptions . A_Space . ListOptions ;-- List ,ListOptions ;-- Default list ,A_Space ;-- Delimiter ,"Select", ;-- Mode (ltrim join`s ;-- Mode options " -CancelButton +CheckBoxes +ContextMenu +NoDuplicates +Insert +Modify -SelectionRequired " ) ,"List Options" ;-- List title ,"" ;-- Window title ,"w160 h400" ;-- List options ,"" ;-- Font ,"" ;-- Font options ,"-SysMenu" ;-- GUI options ,"") ;-- Background color Tooltip if ErrorLevel break ;[========] ;[ Font ] ;[========] Tip= (ltrim Select the desired Font. There is no default font. If a font is selected, it was selected in a previous iteration. Note: The items in this list are for demonstration purposes only. They do not represent all possible options for this parameter. ) SetTimer ToolTip,-150 SetTimer ToolTip_Off,-30000 Font:="" . ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,AllFont ;-- List ,Font ;-- Default list ,"|" ;-- Delimiter ,"Select" ;-- Mode ,"-CancelButton -SelectionRequired" ;-- Mode options ,"Font" ;-- List title ,"" ;-- Window title ,"w160" ;-- List options ,"" ;-- Font ,"" ;-- Font options ,"-SysMenu" ;-- GUI options ,"") ;-- Background color Tooltip if ErrorLevel break ;[================] ;[ Font Options ] ;[================] Tip= (ltrim Select the desired "Font Options" by either checking or unchecking the options from the list. There are no defaults. Options that are already checked were selected in a previous iteration. Note: The items in this list are for demonstration purposes only. They do not represent all possible options for this parameter. ) SetTimer ToolTip,-150 SetTimer ToolTip_Off,-30000 FontOptions:=ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,AllFontOptions ;-- List ,FontOptions ;-- Default list ,A_Space ;-- Delimiter ,"Select" ;-- Mode ,"-CancelButton +CheckBoxes +NoDuplicates -SelectionRequired" ;-- Mode options ,"Font Options" ;-- List title ,"" ;-- Window title ,"w160 h550" ;-- List options ,"" ;-- Font ,"" ;-- Font options ,"-SysMenu +Resize" ;-- GUI options ,"") ;-- Background color Tooltip if ErrorLevel break ;[===============] ;[ GUI Options ] ;[===============] Tip= (ltrim Select the desired "GUI Options" by either checking or unchecking the options from the list. There are no defaults. Options that are already checked were selected in a previous iteration. Note: The items in this list are for demonstration purposes only. They do not represent all possible options for this parameter. ) SetTimer ToolTip,-150 SetTimer ToolTip_Off,-30000 GUIOptions:="" . ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,AllGUIOptions ;-- List ,GUIOptions ;-- Default list ,A_Space ;-- Delimiter ,"Select", ;-- Mode (ltrim join`s ;-- Mode Options " -CancelButton +CheckBoxes +NoDuplicates -SelectionRequired +Move " ) ,"GUI Options" ;-- List title ,"" ;-- Window title ,"w160" ;-- List options ,"" ;-- Font ,"" ;-- Font options ,"-SysMenu" ;-- GUI options ,"") ;-- Background color Tooltip if ErrorLevel break ;[=======================] ;[ Put it all together ] ;[=======================] Tip= (ltrim This window is the final result! ) SetTimer ToolTip,-150 SetTimer ToolTip_Off,-12000 Return:=ListManagerGUI("" ;-- GUI ,23 ;-- ParentGUI ,List ;-- List ,DefaultList ;-- Default list ,"|" ;-- Delimiter ,Mode ;-- Mode ,"NoDefaults " . ModeOptions ;-- Mode Options ,"Month" ;-- List title ,"" ;-- Window title ,ListOptions ;-- List options ,Font ;-- Font ,FontOptions ;-- Font options ,GUIOptions ;-- GUI options ,"") ;-- Background color ToolTip gui +OwnDialogs MsgBox End of example.`n`nErrorLevel=%ErrorLevel%`nReturn=%Return% MsgBox 33,,Change options for this example and try again? %A_Space% IfMsgBox Cancel break } return ToolTip: ToolTip ,%Tip%,-200,27 return ToolTip_Off: ToolTip return 23GUIEscape: 23GUIClose: ExitApp ;------------ Include function here #include ListManagerGUI.ahk ;;;;;#Include ../DisableCloseButton.ahk ;;;;;#include ../Anchor.ahk ;;;;;#include ../PopupXY.ahk