Sign in to follow this  
Followers 0
cdm_Death

HElp on a GUI issue please :)

5 posts in this topic




#2 ·  Posted (edited)

hi, u mean something like this?

#include <GuiConstants.au3>
GuiCreate("MyGUI", 392, 323,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$Input_1 = GuiCtrlCreateInput("Input1", 50, 60, 180, 60)
$Button_2 = GuiCtrlCreateButton("Button2", 90, 160, 120, 30)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_2
        $test = GUICtrlRead($Input_1)
        MsgBox(0, "", $test)
        FileWrite("c:\test.txt", $test & @CRLF)
    EndSelect
WEnd
Exit
Edited by iceberg

mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites

hi, u mean something like this?

#include <GuiConstants.au3>
GuiCreate("MyGUI", 392, 323,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$Input_1 = GuiCtrlCreateInput("Input1", 50, 60, 180, 60)
$Button_2 = GuiCtrlCreateButton("Button2", 90, 160, 120, 30)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_2
        $test = GUICtrlRead($Input_1)
        MsgBox(0, "", $test)
        FileWrite("c:\test.txt", $test & @CRLF)
    EndSelect
WEnd
Exit

maybe you could help me understand why mine is not working?

I have an idea... I think maybe... MAYBE its reading the variables before I type them in... so if there blank to sart and it never re-reads them, then input_# is always blank?

thoughts?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I'm a n00b to auto it and your got a clue as much as me about how to use autoit ..lol

but this is a small example of writing the values that are in your input boxes into a .txt file when you hit save button.

#include <GuiConstants.au3>

Opt("GUIOnEventMode", 1)

Global $file = @ScriptDir & "\DeathsAutoMove.txt"

GuiCreate("Death's AutoMove", 371, 194,(@DesktopWidth-371)/2, (@DesktopHeight-194)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$Input_1 = GuiCtrlCreateInput("", 220, 40, 55, 20)
$Input_2 = GuiCtrlCreateInput("", 150, 40, 55, 20)
$Input_3 = GuiCtrlCreateInput("", 220, 90, 55, 20)
$Input_4 = GuiCtrlCreateInput("", 150, 90, 55, 20)
$save = GuiCtrlCreateButton("Save", 50, 150, 120, 30)
GUICtrlSetOnEvent($save, "save")
$cancel = GuiCtrlCreateButton("Cancel", 190, 150, 130, 30)
GUICtrlSetOnEvent($cancel, "cancel")
$Icon_5 = GuiCtrlCreateIcon("Icon5", 0, 10, 10, 110, 110)
$Label_6 = GuiCtrlCreateLabel("Item 1:", 130, 10, 210, 20)
$Label_7 = GuiCtrlCreateLabel("Item 2:", 130, 70, 210, 20)

GUISetState (@SW_SHOW)

While 1
  Sleep(10)   
WEnd

Func save()
    $in1 = GUICtrlRead ($Input_1)
    $in2 = GUICtrlRead ($Input_2)
    $in3 = GUICtrlRead ($Input_3)
    $in4 = GUICtrlRead ($Input_4)
    FileWriteLine ($file,  $in1)
    FileWriteLine ($file,  $in2)
    FileWriteLine ($file,  $in3)
    FileWriteLine ($file,  $in4)
    FileClose ($file)
    MSgBox(1, "Death's AutoMove", "Thank You for your use and support of Death's d2 Products.")
EndFunc
    
Func cancel()
    GUIDelete ()
    MSgBox(1, "Death's AutoMove", "Thank You for your use and support of Death's d2 Products.")
    Exit
EndFunc

cheers

Edit: Doh , I was to slow...lol

Edited by smashly

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I'm a n00b to auto it and your got a clue as much as me about how to use autoit ..lol

but this is a small example of writing the values that are in your input boxes into a .txt file when you hit save button.

#include <GuiConstants.au3>

Opt("GUIOnEventMode", 1)

Global $file = @ScriptDir & "\DeathsAutoMove.txt"

GuiCreate("Death's AutoMove", 371, 194,(@DesktopWidth-371)/2, (@DesktopHeight-194)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$Input_1 = GuiCtrlCreateInput("", 220, 40, 55, 20)
$Input_2 = GuiCtrlCreateInput("", 150, 40, 55, 20)
$Input_3 = GuiCtrlCreateInput("", 220, 90, 55, 20)
$Input_4 = GuiCtrlCreateInput("", 150, 90, 55, 20)
$save = GuiCtrlCreateButton("Save", 50, 150, 120, 30)
GUICtrlSetOnEvent($save, "save")
$cancel = GuiCtrlCreateButton("Cancel", 190, 150, 130, 30)
GUICtrlSetOnEvent($cancel, "cancel")
$Icon_5 = GuiCtrlCreateIcon("Icon5", 0, 10, 10, 110, 110)
$Label_6 = GuiCtrlCreateLabel("Item 1:", 130, 10, 210, 20)
$Label_7 = GuiCtrlCreateLabel("Item 2:", 130, 70, 210, 20)

GUISetState (@SW_SHOW)

While 1
  Sleep(10)   
WEnd

Func save()
    $in1 = GUICtrlRead ($Input_1)
    $in2 = GUICtrlRead ($Input_2)
    $in3 = GUICtrlRead ($Input_3)
    $in4 = GUICtrlRead ($Input_4)
    FileWriteLine ($file,  $in1)
    FileWriteLine ($file,  $in2)
    FileWriteLine ($file,  $in3)
    FileWriteLine ($file,  $in4)
    FileClose ($file)
    MSgBox(1, "Death's AutoMove", "Thank You for your use and support of Death's d2 Products.")
EndFunc
    
Func cancel()
    GUIDelete ()
    MSgBox(1, "Death's AutoMove", "Thank You for your use and support of Death's d2 Products.")
    Exit
EndFunc

cheers

Edit: Doh , I was to slow...lol

only diffrence im seeing is placment of functions... anyone see something I missed?

btw thanks

I SEE IT!

GUICtrlRead

THAK YOU!

Edited by cdm_Death

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0