Jump to content

@SW_DISABLE... not really


LondonNDIB
 Share

Recommended Posts

I'm building a GUI window and when a user clicks certain buttons I want the entire GUI to be disabled so they can't interact with any other controls until the process is finished.

GUISetState ( @SW_DISABLE )
WinActivate ( $GUITitle )
SplashTextOn ( "", "Working... Please wait...", 150, 18, -1, -1, 1, "Arial", 9 )

I thought it was working until I tried moving the window out of the way for some reason. All the controls become active again after you stop dragging the window, even though the process hasn't fnished and the @SW_ENABLE command hasn't been given yet.

Is this a bug? Has anyone figured it out?

LD

Link to comment
Share on other sites

I'm building a GUI window and when a user clicks certain buttons I want the entire GUI to be disabled so they can't interact with any other controls until the process is finished.

GUISetState ( @SW_DISABLE )
WinActivate ( $GUITitle )
SplashTextOn ( "", "Working... Please wait...", 150, 18, -1, -1, 1, "Arial", 9 )

I thought it was working until I tried moving the window out of the way for some reason. All the controls become active again after you stop dragging the window, even though the process hasn't fnished and the @SW_ENABLE command hasn't been given yet.

Is this a bug? Has anyone figured it out?

LD

Try placing your operation in a function and then:

$MyGui = GUICreate("My Gui", 200, 200, -1, -1)
$button1 = GUICtrlCreateButton("Click Me", 50, 50, 100, 50)
; Build your Gui

    GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $button1
            GUISetState(@SW_DISABLE, $MyGui)
            Do
                $test = FuncOne()
                SplashTextOn("", "Working please be patient....", "120", "50", "-1", "-1", 3, "", "", "")
            Until $test = 1
            SplashOff
            GUISetState(@SW_ENABLE, $MyGui)     
    EndSelect
WEnd


Func FuncOne()
    MsgBox(0, "", "Click me to end the function")
    Return 1
EndFunc  ;==>FuncOne

Try running this script...

Link to comment
Share on other sites

Interesting... that is pretty much exactly how I did it but for me the GUI's window title bar is still dragable (the rest of it is disabled).

But your code works (almost - you have to swap the position of the first two lines after your Do command for the splash to be of any particular use)

So I guess its time to scour through my code to figure what the difference is.

I don't explicitely name the gui in my GUISetState() arg... its supposed to default if there is only one. Its odd because it semi-disables it.

Oh well... thanks for proving its not the function, but the author :lmao:

LD

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...