houstonl3 Posted April 6, 2015 Share Posted April 6, 2015 I currently have a GUI that has to be called by a hotkeyset to open. This gui is where the user can go in and change variables for different circumstances, however, it's kind of large as there are around 20 variables. I'd like to have a gui that is always up (a smaller one in the corner) and have it contain a button that can be pressed and open the "set variables" GUI. I'm sure this has been answered at some point, but I couldn't seem to find exactly what I was looking for. I just really can't figure out how to make a child gui that reads input boxes, and can be saved, then closed, and have the main gui continue running. I want it to work where this "set Variables" gui can be opened at any time. I have tried this a couple of different ways, and just can't make it work. Thanks in advance. Link to comment Share on other sites More sharing options...
l3ill Posted April 6, 2015 Share Posted April 6, 2015 Your " Set Variables" that dont change are called Static. If I understand the question correctly you can save your other information between settings to a text or ini file. My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
houstonl3 Posted April 7, 2015 Author Share Posted April 7, 2015 These variables will change. "set Variables" is just a term I used because that's what I would name the button. I need a GUI that can be re-opened multiple times, from the "set variables" button on another GUI. Link to comment Share on other sites More sharing options...
MikahS Posted April 7, 2015 Share Posted April 7, 2015 (edited) Make the parent GUI be the GUI with the button, and have a child GUI that will always open. Have a look at this tutorial: Managing Multiple GUIs P.S. Here is an example of how you would keep one variable the same and keep the main GUI on top, and up at the same time as the child. expandcollapse popup#include <GUIConstants.au3> ; variable declarations Global $pGUI, $cGUI, $msg, $iStored = 0, $pButton, $cButton = 9999, $input ; function call MainGUI() ; main msg event loop While 1 $msg = GUIGetMsg(1) Switch $msg[1] Case $pGUI Switch $msg[0] Case $GUI_EVENT_CLOSE Exit Case $pButton ChildGUI() EndSwitch Case $cGUI Switch $msg[0] Case $GUI_EVENT_CLOSE GUIDelete($cGUI) Case $cButton $iStored += 1 GUICtrlSetData($input, $iStored) EndSwitch EndSwitch WEnd ; main gui function Func MainGUI() $pGUI = GUICreate("MAIN GUI", 100, 80, -1, -1, $WS_SIZEBOX, $WS_EX_TOPMOST) WinMove("MAIN GUI", "", 0, 0) $pButton = GUICtrlCreateButton("Click Me", 15, 15) GUISetState(@SW_SHOW) EndFunc ;==>MainGUI ; main child gui function Func ChildGUI() $cGUI = GUICreate("CHILD GUI", 150, 125, -1, -1, $WS_SIZEBOX) $cButton = GUICtrlCreateButton("Add 1", 5, 15) $input = GUICtrlCreateInput($iStored, 50, 15, 30, 15, $ES_READONLY) GUICtrlCreateLabel("if you close this, the" & @CRLF & "input will be the same.", 5, 50) GUISetState(@SW_SHOW) EndFunc Any questions? Edited April 7, 2015 by MikahS houstonl3 1 Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ 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