Thornhunt Posted December 24, 2009 Posted December 24, 2009 ok im playing around a little in Autoit and i thought i would try and make a simple gui that will hold numerous links to variouse files ect the idea is that uppon hitting + button at the top it opens another gui (inanother func) for you to sort out the links ect ect, all is going well until i choose to close the second gui. if i hit close or the X at top right it closes the gui but doesnt exit the func(i think) making it unable to use the + button on the origional gui again. i dont know maybe someone can help me. expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> $DesctopWidth = @DesktopWidth $LeftPlace = $DesctopWidth - 150 #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 150, 300, $LeftPlace,0) $Add = GUICtrlCreateButton("+", 0, 0, 19, 17, $WS_GROUP) $Minus = GUICtrlCreateButton("-", 19, 0, 19, 17, $WS_GROUP) $BTMenuClose = GUICtrlCreateButton("X", 130, 0, 19, 17, $WS_GROUP) $BTMenuAbout = GUICtrlCreateButton("?", 110, 0, 19, 17, $WS_GROUP) $Button3 = GUICtrlCreateButton("%", 38, 0, 19, 17, $WS_GROUP) $Graphic1 = GUICtrlCreateGraphic(0, 18, 151, 2) GUICtrlSetColor(-1, 0x000000) GUICtrlCreateGraphic(10, 40, 130, 2) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateGraphic(10, 62, 130, 2) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateGraphic(10, 84, 130, 2) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateGraphic(10, 106, 130, 2) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateGraphic(10, 128, 130, 2) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateGraphic(10, 150, 130, 2) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateGraphic(10, 172, 130, 2) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateGraphic(10, 194, 130, 2) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateGraphic(10, 216, 130, 2) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateGraphic(10, 238, 130, 2) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateGraphic(10, 260, 130, 2) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateGraphic(10, 282, 130, 2) GUICtrlSetColor(-1, 0x0000FF) $LinksBT1 = GUICtrlCreateLabel("", 8, 22,-1,18) $LinksBT2 = GUICtrlCreateLabel("", 8, 44,-1,18) $LinksBT3 = GUICtrlCreateLabel("", 8, 66,-1,18) $LinksBT4 = GUICtrlCreateLabel("", 8, 88,-1,18) $LinksBT5 = GUICtrlCreateLabel("", 8, 110,-1,18) $LinksBT6 = GUICtrlCreateLabel("", 8, 132,-1,18) $LinksBT7 = GUICtrlCreateLabel("", 8, 154,-1,18) $LinksBT8 = GUICtrlCreateLabel("", 8, 176,-1,18) $LinksBT9 = GUICtrlCreateLabel("", 8, 198,-1,18) $LinksBT10 = GUICtrlCreateLabel("", 8, 220,-1,18) $LinksBT11 = GUICtrlCreateLabel("", 8, 242,-1,18) $LinksBT12 = GUICtrlCreateLabel("", 8, 264,-1,18) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $BTMenuClose Exit Case $BTMenuAbout MsgBox(0,"ABout","About section") Case $Add Add() EndSwitch WEnd Func Add() #Region ### START Koda GUI section ### Form= $AddGUI = GUICreate("Form1", 262, 124, 379, 151) $LableA1 = GUICtrlCreateLabel("Add A link to your Dock", 8, 8, 116, 17) $GRAB = GUICtrlCreateButton("Get File", 168, 32, 75, 25, $WS_GROUP) $Linkpath = GUICtrlCreateInput("File Location", 8, 34, 153, 21) $Linkname = GUICtrlCreateInput("Link Name, 30Chars Max", 32, 64, 129, 21) $ADD = GUICtrlCreateButton("ADD", 64, 88, 75, 25, $WS_GROUP) $CLOSE = GUICtrlCreateButton("CLOSE", 144, 88, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $ADDMsg = GUIGetMsg() Switch $ADDMsg Case $GUI_EVENT_CLOSE GUIDelete($AddGUI) ExitLoop Case $CLOSE GUIDelete($AddGUI) ExitLoop Case $ADD ;DO SOME STUFF Case $GRAB $Name = FileOpenDialog("File Link",@DesktopDir, "all (*.*)") GUICtrlSetData($Linkpath, $Name) EndSwitch WEnd EndFunc Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D
Moderators Melba23 Posted December 24, 2009 Moderators Posted December 24, 2009 Thornhunt, If I told you that AutoIt capitialises all variables when it runs, would these lines give you a clue? ; From $Form1 $Add = GUICtrlCreateButton("+", 0, 0, 19, 17, $WS_GROUP) ; From $AddGUI $ADD = GUICtrlCreateButton("ADD", 64, 88, 75, 25, $WS_GROUP) M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Thornhunt Posted December 25, 2009 Author Posted December 25, 2009 Thornhunt, If I told you that AutoIt capitialises all variables when it runs, would these lines give you a clue? ; From $Form1 $Add = GUICtrlCreateButton("+", 0, 0, 19, 17, $WS_GROUP) ; From $AddGUI $ADD = GUICtrlCreateButton("ADD", 64, 88, 75, 25, $WS_GROUP) M23 well thats news to me, thankyou . and merry xmas Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D
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