Jump to content

[?] what's going on with my GUI?


star2
 Share

Recommended Posts

Posted Image

as you can see from the pic I've put any time I use the [ IF ] for enabling / disabling ctrls this flickering happens is there any way to work it out?

#include <Constants.au3>
#include <GUIConstants.au3>

GUICreate ("TEST", 300,110)

$read_one = GUICtrlCreateInput ("",10,10,270,25)
$put_1 = GUICtrlCreateInput ("",10,40,270,25)
$put_3 = GUICtrlCreateInput ("",10,75,270,25)

GUISetState ()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        If GUICtrlRead ($read_one) <> "" Then
            GUICtrlSetState ($put_1,$GUI_ENABLE)
            GUICtrlSetState ($put_3,$GUI_ENABLE)
        Else
            GUICtrlSetState ($put_1,$GUI_DISABLE)
            GUICtrlSetState ($put_3,$GUI_DISABLE)
        EndIf
WEnd

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

You need another another switch......

theres probably lots of ways of doing it, but heres one....

#include <Constants.au3>

#include <GUIConstants.au3>

GUICreate ("TEST", 300,110)

$read_one = GUICtrlCreateInput ("",10,10,270,25)

$put_1 = GUICtrlCreateInput ("",10,40,270,25)

$put_3 = GUICtrlCreateInput ("",10,75,270,25)

GUISetState ()

$IsnotEmpty=0

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Select

Case $IsnotEmpty=1 AND GUICtrlRead ($read_one) <> ""

GUICtrlSetState ($put_1,$GUI_ENABLE)

GUICtrlSetState ($put_3,$GUI_ENABLE)

$IsnotEmpty=0

Case $IsnotEmpty=0 AND GUICtrlRead ($read_one) = ""

GUICtrlSetState ($put_1,$GUI_DISABLE)

GUICtrlSetState ($put_3,$GUI_DISABLE)

$IsnotEmpty=1

EndSelect

Wend

Edited by Rick

Who needs puzzles when we have AutoIt!!

Link to comment
Share on other sites

You need another another switch......

theres probably lots of ways of doing it, but heres one....

thank you so much

still didn't know what the problem with the old way !!

but your way is very good thanks

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

can anyone tell me what's wrong here?

#include <GUIConstants.au3>
GUICreate ("test",350,160)
GUISetFont (10)
GUICtrlCreateLabel ("test-1 ",10,70)
GUICtrlSetFont (-1,12,600)
GUICtrlCreateLabel ("test-2 ",220,70)
GUICtrlSetFont (-1,12,600)
$check_1 = GUICtrlCreateCheckbox ("testing 2",10,40)
$put_1 = GUICtrlCreateInput ("",10,100,200,25,$WS_DISABLED)
$put_2 = GUICtrlCreateInput ("",220,100,70,25,$WS_DISABLED)
$do = GUICtrlCreateButton ("Do",300,100,40,25)
GUICtrlSetFont (-1,12,600)
GUISetState ()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        Select
        Case    GUICtrlRead($check_1) = 1
                GUICtrlSetState($put_1, $GUI_ENABLE)
                GUICtrlSetState($put_2, $GUI_ENABLE)
        Case    GUICtrlRead($check_1)=0
                GUICtrlSetState($put_1, $WS_DISABLED)
                GUICtrlSetState($put_2, $WS_DISABLED)
    EndSelect
        If  $msg = $do Then
            If BitAND(GUICtrlRead($check_1),$GUI_CHECKED) = 1 Then
                MsgBox (-1,"info","checked")
            Else
                MsgBox (-1,"info","un-checked")
            EndIf
        EndIf
WEnd

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

  • Developers

#include <GUIConstants.au3>
GUICreate("test", 350, 160)
GUISetFont(10)
GUICtrlCreateLabel("test-1 ", 10, 70)
GUICtrlSetFont(-1, 12, 600)
GUICtrlCreateLabel("test-2 ", 220, 70)
GUICtrlSetFont(-1, 12, 600)
$check_1 = GUICtrlCreateCheckbox("testing 2", 10, 40)
$put_1 = GUICtrlCreateInput("", 10, 100, 200, 25, $GUI_DISABLE)
$put_2 = GUICtrlCreateInput("", 220, 100, 70, 25, $GUI_DISABLE)
$do = GUICtrlCreateButton("Do", 300, 100, 40, 25)
GUICtrlSetFont(-1, 12, 600)
GUISetState()
While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    Select
        Case GUICtrlRead($check_1) = 1
            GUICtrlSetState($put_1, $GUI_ENABLE)
            GUICtrlSetState($put_2, $GUI_ENABLE)
        Case GUICtrlRead($check_1) = 4
            GUICtrlSetState($put_1, $GUI_DISABLE)
            GUICtrlSetState($put_2, $GUI_DISABLE)
    EndSelect
    If $msg = $do Then
        If BitAND(GUICtrlRead($check_1), $GUI_CHECKED) = 1 Then
            MsgBox(-1, "info", "checked")
        Else
            MsgBox(-1, "info", "un-checked")
        EndIf
    EndIf
WEnd

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

thanks but what about the flickering?

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

  • Developers

thanks but what about the flickering?

Test if the control needs to be Enabled/Disabled and only change it when needed, not always like now ....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Test if the control needs to be Enabled/Disabled and only change it when needed, not always like now ....

but the condition should always be needed otherwise the control state will not mach the condition?

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

  • Developers

but the condition should always be needed otherwise the control state will not mach the condition?

update your script with this and check to see if that what you want :

Case GUICtrlRead($check_1) = 1
            If Not BitAND(GUICtrlGetState($put_1), $GUI_ENABLE) then GUICtrlSetState($put_1, $GUI_ENABLE)
            If Not BitAND(GUICtrlGetState($put_2), $GUI_ENABLE) then GUICtrlSetState($put_2, $GUI_ENABLE)
        Case GUICtrlRead($check_1) = 4
            If Not BitAND(GUICtrlGetState($put_1), $GUI_DISABLE) then GUICtrlSetState($put_1, $GUI_DISABLE)
            If Not BitAND(GUICtrlGetState($put_2), $GUI_DISABLE) then GUICtrlSetState($put_2, $GUI_DISABLE)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

update your script with this and check to see if that what you want :

Case GUICtrlRead($check_1) = 1
            If Not BitAND(GUICtrlGetState($put_1), $GUI_ENABLE) then GUICtrlSetState($put_1, $GUI_ENABLE)
            If Not BitAND(GUICtrlGetState($put_2), $GUI_ENABLE) then GUICtrlSetState($put_2, $GUI_ENABLE)
        Case GUICtrlRead($check_1) = 4
            If Not BitAND(GUICtrlGetState($put_1), $GUI_DISABLE) then GUICtrlSetState($put_1, $GUI_DISABLE)
            If Not BitAND(GUICtrlGetState($put_2), $GUI_DISABLE) then GUICtrlSetState($put_2, $GUI_DISABLE)
................. Beautiful .............. !!!!!!!!!!!!!!

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

The problem is that when you are changing the state of the control, it wants to redraw itself to reflect changes.

this is not good we have to figure a way arround that?

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

  • Developers

this is not good we have to figure a way arround that?

mmm.. the solution I gave does that very thing ....right ? Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

mmm.. the solution I gave does that very thing ....right ?

Absolutely right

I've tried to add another condition to it

but I found out that I'm a big loser

anyway I'm still in the beginings

and still trying to learn

but what I really know that AI is great

cause I hated programing before I found out about how simple AI is

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

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