Jump to content

Recommended Posts

Posted

Greetings, I was hoping if someone can help me design a template that I can modify. It's hard for me to describe so i have a picture to help me explain.

I'm looking to basically create a GUI that will have multiple tabs with many list of items, once I check the selection I like it'll save the choice to a text file name of choice. I've read and saw some gui examples but just not able to tie in the buttons and make it all work. If not the checkbox, even a drop down menu would be best. Here's a GUI that i took off the net and edited in paint:

https://i.imgur.com/4WNveje.png

Thanks for reading, and looking forward to a response :)

  • Developers
Posted (edited)
20 minutes ago, User751139 said:

I was hoping if someone can help me design a template

So what do you have since you want help with your design?

EDIT: mmm ... merged your other post you crippled and guess you first just tried to put in your order?
Just rewording like you did here is like you question our intelligence or am I seeing this all wrong?

Jos 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted
1 hour ago, User751139 said:

wasn't aware it can't be posted here.

Of course you are allowed to ask questions, but not in a way like Janis Joplin asks the Lord to prove His love for her by buying her a Mercedes-Benz automobile, a color TV, and a "night on the town." :lol:

You might want to take a look at the GUI-Designer-Koda . The software is older and the author is no longer active, but some people still seem to use it with success. I never worked with it, though.

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted

This is the closest that I can find in terms of saving the files from input:

but i'm looking to make predefined items 

 

Quote

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <file.au3>

local $msg

GUICreate("Macros", 320, 185)
GUISetState(@SW_SHOW)

GUICtrlCreateLabel("F3", 5, 35) ;f3, f4, f5, f6 text labels
GUICtrlCreateLabel("F4", 5, 65)
GUICtrlCreateLabel("F5", 5, 95)
GUICtrlCreateLabel("F6", 5, 125)

$button = GUICtrlCreateButton("Exit without saving", 110, 150) ; to use this button, you must assign a variable

$f3edit = GUICtrlCreateEdit("", 25, 30, 300, 20) ;control edits that takes input from user
$f4edit = GUICtrlCreateEdit("", 25, 60, 300, 20)
$f5edit = GUICtrlCreateEdit("", 25, 90, 300, 20)
$f6edit = GUICtrlCreateEdit("", 25, 120, 300, 20)


While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then
_FileCreate("test.txt")
_FileWriteToLine("test.txt", 1, GUICtrlRead($f3edit), 1)
_FileWriteToLine("test.txt", 2, GUICtrlRead($f4edit), 1)
_FileWriteToLine("test.txt", 3, GUICtrlRead($f5edit), 1)
_FileWriteToLine("test.txt", 4, GUICtrlRead($f6edit), 1)
ExitLoop
Endif

If $msg = $button Then ; If button is pushed, exit without saving to text file
    ExitLoop
EndIf

WEnd
GUIDelete()

 

Posted (edited)
Posted (edited)
1 hour ago, User751139 said:

This is the closest that I can find in terms of saving the files from input:

but i'm looking to make predefined items 

 

 

 

Look at GUICtrlSetData()

as about radiobuttons/checkboxes also look at this

https://www.autoitscript.com/wiki/FAQ#How_can_I_test_if_checkbox_.2F_radiobutton_is_checked.3F

Edited by Zedna
Posted (edited)

Thanks for the help, looks like this is what I'm looking for: but when i choose an item from the drop down, it's not saving that option but saving all 3:

 

 
 
 
 
Quote
#include <GUIConstantsEx.au3>
#Include <GuiComboBox.au3>
#Include <File.au3>

$hGUI = GUICreate("Test 1", 500, 500)

$hCombo = GUICtrlCreateCombo("", 10, 10, 200, 30)
GUICtrlSetData(-1, "callThis()|callThat()|callUs()")

$hButton = GUICtrlCreateButton("Save", 10, 100, 80, 30)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton
            $aList1 = _GUICtrlComboBox_GetListArray($hCombo)
            _FileWriteFromArray(@ScriptDir & "\Test.txt", $aList1, 1)
            ExitLoop
    EndSwitch

WEnd

 

 

Edited by User751139
Posted (edited)
#include <GUIConstantsEx.au3>
#include <Misc.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>

; Set ENTER to run the _Action function when pressed
HotKeySet("{ENTER}", "_Action")

;-----------HOTKEYS-------------
Global $g_bPaused = False
; +!d = Shift + ALT + D
HotKeySet("+!F", "_OptionalMenu1")
HotKeySet("+!P", "_OptionalMenu2")
HotKeySet("+!R", "_OptionalMenu3")
HotKeySet("+!T", "_OptionalMenu4") ; Shift-Alt-d
HotKeySet("+!S", "_OptionalMenu5") ; CTRL + S
HotKeySet("+!W", "_OptionalMenu6") ; Shift-Alt-d
HotKeySet("+!D", "_OptionalMenu7") ; CTRL + S

Example()


Func Example()
    GUICreate("Test GUI", 715,410) ; will create a dialog box that when displayed is centered


    GUISetBkColor(0x00ececec)
    GUISetFont(9, 70)

    GUICtrlCreateTab(10, 10, 697, 390)

    GUICtrlCreateTabItem("Main Menu")
    GUICtrlCreateLabel("label0", 30, 80, 50, 20)
    GUICtrlCreateButton("OK0", 20, 50, 50, 20)
    GUICtrlCreateInput("default", 80, 50, 70, 20)

    GUICtrlCreateTabItem("Tab 1")
    GUICtrlSetState(-1, $GUI_SHOW) ; will be display first
    GUICtrlCreateLabel("Choice 1:", 20, 40, 150, 20)
    GUICtrlCreateCombo("", 20, 60, 150, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
    GUICtrlCreateButton("OK", 175, 59, 50, 25)
    ;-------------------------------------------------

    GUICtrlCreateLabel("Choice 2:", 20, 90, 150, 20)
    GUICtrlCreateCombo("", 20, 110, 150, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
    GUICtrlCreateButton("OK1", 175, 109, 50, 25)
    ;GUICtrlCreateLabel("- Choice of your ship", 260, 59, 170, 50)

    ;-------------------------------------------------
    GUICtrlCreateLabel("Choice 3:", 20, 140, 150, 20)
    GUICtrlCreateCombo("", 20, 160, 150, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
    GUICtrlCreateButton("OK1", 175, 159, 50, 25)
    ;GUICtrlCreateLabel("- Choice of your ship", 260, 59, 170, 50)

    ;-------------------------------------------------
    GUICtrlCreateLabel("Choice 4:", 20, 190, 150, 20) ;speedUpOptions
    GUICtrlCreateCombo("", 20, 210, 150, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
    GUICtrlCreateButton("OK1", 175, 209, 50, 25)
    ;GUICtrlCreateLabel("- Choice of your ship", 260, 59, 170, 50)

    ;-------------------------------------------------
    GUICtrlCreateLabel("Choice 5:", 20, 240, 150, 20) ;speedUpOptions
    GUICtrlCreateCombo("", 20, 260, 150, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
    GUICtrlCreateButton("OK1", 175, 259, 50, 25)
    ;GUICtrlCreateLabel("- Choice of your ship", 260, 59, 170, 50)

    GUICtrlCreateLabel("Choice 7:", 20, 290, 150, 20) ;speedUpOptions
    GUICtrlCreateCombo("", 20, 310, 150, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
    GUICtrlCreateButton("OK1", 175, 309, 50, 25)
    ;GUICtrlCreateLabel("- Choice of your ship", 260, 59, 170, 50)

    GUICtrlCreateLabel("Choice 8:", 20, 340, 150, 20) ;speedUpOptions
    GUICtrlCreateCombo("", 20, 360, 150, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
    GUICtrlCreateButton("OK1", 175, 359, 50, 25)
    ;GUICtrlCreateLabel("- Choice of your ship", 260, 59, 170, 50)


    GUICtrlCreateLabel("Choice 9:", 250, 40, 190, 20) ; 2nd Collumb 1st Row
    GUICtrlCreateCombo("", 250, 60, 150, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
    GUICtrlCreateButton("OK1", 405, 59, 50, 25)
    ;GUICtrlCreateLabel("- Choice of your ship", 260, 59, 170, 50)

    GUICtrlCreateLabel("Choice 10:", 250, 90, 190, 20) ; 2nd Collumb 2nd Row
    GUICtrlCreateCombo("", 250, 110, 150, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
    GUICtrlCreateButton("OK1", 405, 109, 50, 25)
    ;GUICtrlCreateLabel("- Choice of your ship", 260, 59, 170, 50)

    ;-------------------------------------------------

    GUICtrlCreateLabel("Choice 11:", 250, 140, 190, 20) ; 2nd Collumb 3rd Row
    GUICtrlCreateCombo("", 250, 160, 150, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
    GUICtrlCreateButton("OK1", 405, 159, 50, 25)
    ;GUICtrlCreateLabel("- Choice of your ship", 260, 59, 170, 50)

    ;-------------------------------------------------

    GUICtrlCreateLabel("Choice 12:", 250, 190, 190, 20) ; 2nd Collumb 4th Row
    GUICtrlCreateCombo("", 250, 210, 150, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
    GUICtrlCreateButton("OK1", 405, 209, 50, 25)
    ;GUICtrlCreateLabel("- Choice of your ship", 260, 59, 170, 50)

    ;-------------------------------------------------

    GUICtrlCreateLabel("Choice 13:", 250, 240, 190, 20) ; 2nd Collumb 5th Row
    GUICtrlCreateCombo("", 250, 260, 150, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
    GUICtrlCreateButton("OK1", 405, 259, 50, 25)
    ;GUICtrlCreateLabel("- Choice of your ship", 260, 59, 170, 50)

    ;-------------------------------------------------

    GUICtrlCreateLabel("Choice 14:", 250, 290, 190, 20) ; 2nd Collumb 6th Row
    GUICtrlCreateCombo("", 250, 310, 150, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") ; default Jon
    GUICtrlCreateButton("OK1", 405, 309, 50, 25)
    ;GUICtrlCreateLabel("- Choice of your ship", 260, 59, 170, 50)

;------------BOT MENU-------------

    GUICtrlCreateLabel("OPTIONAL MENU", 560, 40, 100, 50) ; 3rd Collumb 1st Row
    ; Action button
    $_OptionalMenu1 = GUICtrlCreateButton("Optional Menu 1    [ SHIFT + ALT + F ]", 490, 58, 205, 25)
    ; Mouse coord button
    $_OptionalMenu2 = GUICtrlCreateButton("Optional Menu 2    [ SHIFT + ALT + P ]", 490, 108, 205, 25)
    ; Mouse coord inputs
    $_OptionalMenu3 = GUICtrlCreateButton("Optional Menu 3 [ SHIFT + ALT + T ]", 490, 160, 205, 25)
    ; Mouse coord inputs
    $_OptionalMenu4 = GUICtrlCreateButton("Optional Menu 4     [ SHIFT + ALT + R ]", 490, 208, 205, 25)
    ; Mouse coord inputs
    $_OptionalMenu5 = GUICtrlCreateButton("Optional Menu 5   [ SHIFT + ALT + S ]", 490, 258, 205, 25)
    ; Mouse coord inputs
    $_OptionalMenu6 = GUICtrlCreateButton("Start Optional Menu 6", 490, 308, 205, 25)
    ; Mouse coord inputs

;-----------------------------------------

    GUICtrlCreateTabItem("tab2")
    GUICtrlCreateLabel("label2", 30, 80, 50, 20)
    GUICtrlCreateButton("OK2", 140, 50, 50)

    GUICtrlCreateTabItem("") ; end tabitem definition

    GUICtrlCreateLabel("My test GUI :)", 490, 358, 205, 25)

    GUISetState(@SW_SHOW)


    Local $idMsg
    ; Loop until the user exits.
    While 1
        $idMsg = GUIGetMsg()

        If $idMsg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd

EndFunc   ;==>_Action

Here's what's done so far, I need to make it so that whatever option I select from the dropdown list, it saves it as a text file with the (selected) text from the dropdown menu. 

-Some of the buttons need to add the list in order such as: (If I select 3 different names and save them 3 times)

John

Lary

Trids

Thank you

 

-Some of the Optional Menu buttons on the right need to open any of the saved text files with the set Hotkey. 

Thank you for your assistance

 

 

Edited by User751139
Posted (edited)
4 hours ago, User751139 said:

Thanks for the help, looks like this is what I'm looking for: but when i choose an item from the drop down, it's not saving that option but saving all 3:

 

 

 

#include <GUIConstantsEx.au3>
#Include <GuiComboBox.au3>
#Include <File.au3>

$hGUI = GUICreate("Test 2", 500, 500)

$hCombo = GUICtrlCreateCombo("", 10, 10, 200, 30, BitOr($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
GUICtrlSetData(-1, "callThis()|callThat()|callUs()", "callThat()")

$hButton = GUICtrlCreateButton("Save All", 10, 100, 80, 30)
$hButton2 = GUICtrlCreateButton("Save Sel", 10, 150, 80, 30)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton
            $aList1 = _GUICtrlComboBox_GetListArray($hCombo)
            _FileWriteFromArray(@ScriptDir & "\Test.txt", $aList1, 1)
            ExitLoop
        Case $hButton2
            $Sel = GUICtrlRead($hCombo)
            FileDelete(@ScriptDir & "\Test2.txt")
            FileWrite(@ScriptDir & "\Test2.txt", $Sel)
            ExitLoop
    EndSwitch

WEnd

 

Edited by Zedna
Posted (edited)
On 4/25/2020 at 9:51 AM, Zedna said:

 

#include <GUIConstantsEx.au3>
#Include <GuiComboBox.au3>
#Include <File.au3>

$hGUI = GUICreate("Test 2", 500, 500)

$hCombo = GUICtrlCreateCombo("", 10, 10, 200, 30, BitOr($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
GUICtrlSetData(-1, "callThis()|callThat()|callUs()", "callThat()")

$hButton = GUICtrlCreateButton("Save All", 10, 100, 80, 30)
$hButton2 = GUICtrlCreateButton("Save Sel", 10, 150, 80, 30)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton
            $aList1 = _GUICtrlComboBox_GetListArray($hCombo)
            _FileWriteFromArray(@ScriptDir & "\Test.txt", $aList1, 1)
            ExitLoop
        Case $hButton2
            $Sel = GUICtrlRead($hCombo)
            FileDelete(@ScriptDir & "\Test2.txt")
            FileWrite(@ScriptDir & "\Test2.txt", $Sel)
            ExitLoop
    EndSwitch

WEnd

 

Thanks, What changes can I do to write a different output to the text? Eg: If I selected "callThis" from the dropdown and saved. It would wite "This was saved" in the text file.

Much appreciate if someone can advise

 

Edited by User751139

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...