Jump to content

Must be blind - cant find a prob


ddarek
 Share

Recommended Posts

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $Fast = True
Global $Bless = True

#Region ### START Koda GUI section ### Form=
$Form = GUICreate("Dragon", 210, 297, 478, 163)
$button_1 = GUICtrlCreateButton("Start", 20, 20, 165, 60)
$button_2 = GUICtrlCreateButton("Adjust window", 56, 230, 100, 28)
$group_1 = GUICtrlCreateGroup("Owned by", 20, 92, 165, 60)
$radio_1 = GUICtrlCreateRadio("Reds", 30, 112, 70, 20)
$radio_2 = GUICtrlCreateRadio("Blues", 100, 112, 70, 20)
$group_2 = GUICtrlCreateGroup("WayOut", 20, 160, 165, 60)
$radio_3 = GUICtrlCreateRadio("Fast", 30, 180, 60, 20)
$radio_4 = GUICtrlCreateRadio("Standard", 100, 180, 60, 20)

$Label_1 = GUICtrlCreateLabel("PGDN - Shows/Hide    ESC - Exit", 24, 272, 162, 17)
#EndRegion ### END Koda GUI section ###

GUICtrlSetState($radio_1, $GUI_UNCHECKED)
GUICtrlSetState($radio_3, $GUI_UNCHECKED)
GUICtrlSetState($button_1, $GUI_FOCUS + $GUI_DEFBUTTON)

GUISetState()

While 1
        $Msg = GUIGetMsg()
        Switch $Msg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Msg = $button_1
                        start()
                Case $Msg = $radio_4
                        $Fast = False
                Case $Msg = $radio_2
                        $Bless = False
                Case $Msg = $button_2
                        ControlMove($client, "", "", 0, 0, 800, 600)
        EndSwitch
WEnd

So GUI starts and without asking 'bout permision (START button I suppose) calls start() and goes on

Any idea why ?

Link to comment
Share on other sites

Ewww Koda. Try taking out the line:

GUICtrlSetState($button_1, $GUI_FOCUS + $GUI_DEFBUTTON)

Not sure that's it but it's worth a shot.

EDIT: Fixed. You said to do a switch, but set it up like a select. Take out the "$Msg = " in lines 34, 36, and 38.

Edited by Minikori

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Link to comment
Share on other sites

Just a syntax error on the Switch statement. The expression after the Switch keyword declares what to evaluate. By putting $msg = [xxx] in each case, you are assigning $msg to [xxx] and causing a true condition. regardless of which condition was first (after the close) it would be evaluated as true. remove the $Msg = as below.

Switch $Msg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $button_1
                        start()
                Case $radio_4
                        $Fast = False
                Case $radio_2
                        $Bless = False
                Case $button_2
                        ControlMove($client, "", "", 0, 0, 800, 600)
        EndSwitch
Link to comment
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
 Share

  • Recently Browsing   0 members

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