Jump to content

trouble with disabling a gui input


stampy
 Share

Recommended Posts

I have an older script with a gui front end that I recently needed to change. After the change I noticed the inputs would disable but not grey out. They will enable correctly. The only issue is greying out. The inputs are located on a tab inside a group. When I made the changes I did not touch any of the Gui code.

When I played around I found that the original was written with ver 3.1.1.0 and it works correctly. Ver 3.1.1.84 Beta does not grey out. And 3.2.2.1 that I'm currently on does not grey out.

If I'm missing something please someone kick me, but at this point it appears to be a bug.

I've included the sample code that resembles my code to show the problem.

Any help or idea's would be great.

CODE
#include <GUIConstants.au3>

GUICreate(" My GUI input acceptfile", 400,400)

$tab=GUICtrlCreateTab (10,10, 380,100)

$tab1=GUICtrlCreateTabitem ( "tab----1")

GUICtrlCreateGroup ("Group 1", 20, 40, 360, 60);LTWH

$input1 = GUICtrlCreateInput('',40,60,50,20)

GUICtrlSetState(-1,$GUI_DISABLE)

$btnENABLE = GUICtrlCreateButton("enable",120,60)

$btnDisable = GUICtrlCreateButton("Disable",180,60)

GUICtrlCreateGroup ("",-99,-99,1,1) ;close group

GUICtrlCreateTabitem (""); end tabitem definition

GUICtrlCreateInput ("", 10, 130, 300, 20) ; will not accept drag&drop files

GUICtrlSetState(-1,$GUI_DISABLE)

$btn = GUICtrlCreateButton ("Ok", 40, 190, 60, 20)

GUISetState ()

$msg = 0

While $msg <> $GUI_EVENT_CLOSE

$msg = GUIGetMsg()

Select

Case $msg = $btn

exitloop

Case $msg = $btnDisable

GUICtrlSetState($input1,$GUI_DISABLE)

Case $msg = $btnENABLE

GUICtrlSetState($input1,$GUI_enable)

EndSelect

Wend

Link to comment
Share on other sites

I remember someone wanted it to stay white and not grey out , turns out they made it a permanent change xD well theres always, u can change ur own grey :P

#include <GUIConstants.au3>

GUICreate(" My GUI input acceptfile", 400,400)
$tab=GUICtrlCreateTab (10,10, 380,100)
$tab1=GUICtrlCreateTabitem ( "tab----1")

GUICtrlCreateGroup ("Group 1", 20, 40, 360, 60);LTWH
$input1 = GUICtrlCreateInput('',40,60,50,20)
GUICtrlSetState(-1,$GUI_DISABLE)
$btnENABLE = GUICtrlCreateButton("enable",120,60)
$btnDisable = GUICtrlCreateButton("Disable",180,60)
GUICtrlCreateGroup ("",-99,-99,1,1) ;close group
GUICtrlCreateTabitem (""); end tabitem definition


GUICtrlCreateInput ("", 10, 130, 300, 20) ; will not accept drag&drop files
GUICtrlSetState(-1,$GUI_DISABLE)
$btn = GUICtrlCreateButton ("Ok", 40, 190, 60, 20)

GUISetState ()

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
$msg = GUIGetMsg()
Select
Case $msg = $btn
exitloop
Case $msg = $btnDisable
GUICtrlSetState($input1,$GUI_DISABLE)
GUICtrlSetBkColor($input1,0x9C9C9C)
Case $msg = $btnENABLE
GUICtrlSetState($input1,$GUI_enable)
GUICtrlSetBkColor($input1,0xFFFFFF)

EndSelect
Wend
Link to comment
Share on other sites

Doh. Thanks for the info. My only problem is I have alot of inputs to adjust now. :P( All for one simple other fix. Although I can't figure out why you would want them to not be grey? Wouldn't that be a standard for disabled features?

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