:: SmartGUI Creator for SciTE4AutoHotkey :: - Create Graphical User Interfaces (GUIs)
for AutoHotkey Scripts easily
- - Rajat - |
|
Main Features:
|
Getting Started:
(For more help on GUI features, open AutoHotkey help file, select Index Tab and type 'GUI') |
Guidelines: ComboBoxes Set GUI
Count Group Move Edit Script GUI Stealer Tabs |
Basic Tutorial: Goal: Present a custom GUI to ask user his Name and Year of birth, and do basic processing. Steps: 1. Use SmartGUI to create a basic layout and save the script, something like this:
2. Add variable declarations to both edit fields (the letter 'v' followed by variable name). Like this:
3. Now assign functions to the 'Ok' and 'Cancel' buttons: Ok should do further processing. Cancel should do unquestioned exit. A button's default section name (unless assigned otherwise) is the word 'Button' followed by its label. Eg. ButtonOk ButtonCancel Now, we can assign the same function to ButtonCancel as we've done to GuiClose, ie. unquestioned exit. This is how the ButtonCancel section should look like:
4. Now we've to assign further processing function to 'Ok' button. Lets say we want to calculate the user's age from the available data. The first step to get data from a GUI is to make it submit it. The command for it is: GUI, Submit Note: 'Gui, Submit' is required only if you need to get data from edit fields, checkboxes etc. So this is how the ButtonOk function should look like:
5. So finally our complete script should look like this:
Remember that in a control's section you can include just about anything, like run a program, open/close a window or send key presses. Note: In both the sections (ButtonOk and ButtonCancel) there's no 'Return' command at the end, this is because both scripts exit at the end (ExitApp). Had this not been the case, a 'Return' would be required. More Examples: 1. This will run notepad on the press of a button:
2. This will show your windows version:
Now go ahead and explore. |
Tips &
Tricks:
|
Limitations:
|