#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
;gui/menu/launcher prototype (didn't knew how to call it)
;written by taietel
;modify to fit your needs
Global $bToggle = 0, $bEditToggle=0, $iItems=10, $iW=500, $iH=330
Global $aButtons[$iItems], $aLabels[$iItems]
$hGui = GUICreate("Form1", $iW, $iH, -1, -1, BitOR($WS_POPUP, $WS_BORDER, $WS_CLIPSIBLINGS))
GUISetBkColor(0x000000)
$hExit = GUICtrlCreateIcon("shell32.dll", -28, $iW-24, 8, 16, 16, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetTip(-1, "Close me!...")
GUICtrlSetCursor(-1,0)
GUICtrlSetDefColor(0xDEDEDE)
GUICtrlCreateEdit("", 10, 10, 185, 110, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN), 0)
GUICtrlSetData(-1, "Press Start or the butterfly"&@CRLF&"to expand/retract, or"&@CRLF&"close... It can be"&@CRLF&"used as a"&@CRLF&"launcher or"&@CRLF&"menu, or"&@CRLF&"whatever"&@CRLF&".........")
GUICtrlSetBkColor(-1,0x000000)
GUICtrlSetState(-1,$GUI_DISABLE)
$hEdit = GUICtrlCreateEdit("", 320, 10, 1, 1, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN, $ES_NOHIDESEL, $WS_BORDER), 0)
GUICtrlSetData(-1, "This is an edit box shown because you clicked on Label no.9")
GUICtrlSetBkColor(-1,0x222222)
GUICtrlSetState(-1,$GUI_DISABLE+$GUI_HIDE)
For $i=1 To $iItems-1
$aButtons[$i] = GUICtrlCreateIcon("shell32.dll", -7-$i, 8, $iH-40, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetCursor(-1,0)
GUICtrlSetState(-1,$GUI_HIDE)
$aLabels[$i]=GUICtrlCreateLabel(" Label"&$i, 48, $iH-30,100,17,$SS_CENTERIMAGE)
;GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetBkColor(-1,0x222222);
GUICtrlSetCursor(-1,0)
GUICtrlSetState(-1,$GUI_HIDE)
Next
$aButtons[0] = GUICtrlCreateIcon("shell32.dll", -131, 8, $iH-40, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetCursor(-1,0)
GUICtrlSetTip(-1, "Press me!")
$aLabels[0]=GUICtrlCreateLabel("Start", 48, $iH-30)
GUICtrlSetTip(-1, "Press me!")
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetCursor(-1,0)
GUICtrlCreatePic("", 1, 1, $iW-2, $iH-2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS), $GUI_WS_EX_PARENTDRAG)
WinSetTrans($hGui,"",220)
GUISetState(@SW_SHOW)
While 1
Sleep(10)
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $hExit
Exit
Case $aButtons[0], $aLabels[0]
Switch $bToggle
Case 0
For $i=1 To $iItems-1
ControlMove($hGui,"",$aButtons[$i], 8 + 2*$i^2, $iH-40 - $i*32)
GUICtrlSetState($aButtons[$i],$GUI_SHOW)
ControlMove($hGui,"",$aLabels[$i], 48 + 2*$i^2, $iH-30 - $i*32)
GUICtrlSetState($aLabels[$i],$GUI_SHOW)
Sleep(20)
Next
$bToggle=1
Case 1
For $i=$iItems-1 To 1 Step -1
GUICtrlSetState($aButtons[$i],$GUI_HIDE)
ControlMove($hGui,"",$aButtons[$i], 8, $iH-40)
GUICtrlSetState($aLabels[$i],$GUI_HIDE)
ControlMove($hGui,"",$aLabels[$i], 48, $iH-30)
Sleep(20)
Next
$bToggle=0
EndSwitch
Case $aButtons[9],$aLabels[9]
;example action:
Switch $bEditToggle
Case 0
GUICtrlSetState($hEdit,$GUI_SHOW)
For $i=1 To 120
ControlMove($hGui,"",$hEdit, 320, 10, $i, 1)
Next
For $i=1 To 100
ControlMove($hGui,"",$hEdit, 320, 10, 120, $i)
Next
$bEditToggle=1
Case 1
For $i=1 To 100
ControlMove($hGui,"",$hEdit, 320, 10, 120, 101-$i)
Next
For $i=1 To 120
ControlMove($hGui,"",$hEdit, 320, 10, 121-$i, 1)
Next
GUICtrlSetState($hEdit,$GUI_HIDE)
$bEditToggle=0
EndSwitch
EndSwitch
WEnd