Sign in to follow this  
Followers 0
trashy

GUICtrlCreateUpdown

1 post in this topic

My scrippt is 5 tabs and nearly 600 lines and growing.

I've used GUICtrlCreateUpdown with 10 digits on every tab with success.

I'm trying for something different, GUICtrlCreateUpdown with 3 Predefined values,

None, Fast and Max.

I found this

 Modified to suit my needs

#include <GuiConstants.au3>

Opt("GUIOnEventMode", 1)

Global $main, $label, $input, $updown

$main = GuiCreate("UpDown Alphabet ;-)", 250, 40)
$label = GUICtrlCreateLabel("None", 11, 11, 35, 18, $SS_CENTER + $BS_CENTER)
GUICtrlSetBkColor(-1, 0xffffff)
$input = GUICtrlCreateInput("1", 10, 10, 50, 20, $ES_READONLY + $WS_CLIPSIBLINGS)
$updown = GUICtrlCreateUpdown($input)
GUICtrlSetOnEvent($updown, "UpDown")
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate", $main)
GuiSetState(@SW_SHOW, $main)

While 1
    Sleep(50)
Wend

Func UpDown()
    Dim $aSA = StringSplit("None|Fast|Max", "|")
    If StringLeft(GUICtrlRead($input), 1) = "-" Or GUICtrlRead($input) = 0 Then
        GuiCtrlSetData($input, "3")
    ElseIf GUICtrlRead($input) > $aSA[0] Then
        GuiCtrlSetData($input, "1")
    EndIf
    GuiCtrlSetData($label, $aSA[GUICtrlRead($input)])
EndFunc

Func Terminate()
    Exit
EndFunc

Looked good untill I tried to adapt it to the rest of my script.

GUIOnEventMode is causing problems with the rest of my script.

I declared Opt("GUIOnEventMode", 1) at the beginning of my script and

Opt("GUIOnEventMode", 0) at the beginning of every other function but it didn't work.

I don't think anyone wants to check 600 lines of script for me.

Is there another way to accomplish this without using GUIOnEventMode.

Any help would be greatly appreciated

Thanks

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