Sign in to follow this  
Followers 0
cracker

clear gui

14 posts in this topic

#1 ·  Posted (edited)

hello in my actuall program it would be nice to easylie clear the wohle gui. that means just to del all labels, input boxes etc... that would be a kind of repaint(). Or is there no other way then to destroy gui and to create an new one?

thanks for help

Edited by cracker

Share this post


Link to post
Share on other sites



GUICtrlSetState :whistle:


Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Maybe you could create it new. (EDIT: Sorry, I just saw, you wrote it) Thats how I did an identical task in my program... :whistle:

But could you describe, why you want all buttons and so on empty???

As far as I know: In the new beta should be some kind of refresh!

Edited by Earthquake

Yes, I am a noob! But at least I try to learn!Moddingtech.de - Home of the german Modding-Scene!

Share this post


Link to post
Share on other sites

@ fossil rock no this dont helps me because the input fields etc are not declared in variables.

i dont want it only empty i want that all items go away so guictrlsetsate($all,@sw_hide) is what i want. but i think i will solve this problem other because its not possible (it looks like) thx for your tries

Share this post


Link to post
Share on other sites

i want that all items go away so guictrlsetsate($all,@sw_hide) is what i want. but i think i will solve this problem other because its not possible (it looks like) thx for your tries

You could add your controls into an array, then loop through them to hide them all with GuiCtrlSetState().

To make it easy to address your controls, then consider using Enum on the variables to use for indexing the array.

Small example

#include <GUIConstants.au3>

Global $ctrl[3]
Enum $gui, $button1, $button2

$ctrl[$gui] = GUICreate('title')
$ctrl[$button1] = GUICtrlCreateButton('text 1', 0,  0)
$ctrl[$button2] = GUICtrlCreateButton('text 2', 0, 30)
GUISetState()

Sleep(3000)

For $i = 1 To UBound($ctrl)-1
    GUICtrlSetState($ctrl[$i], $GUI_HIDE)
Next

While WinActive('title')
    Sleep(1000)
WEnd

:whistle:

Share this post


Link to post
Share on other sites

Or is there no other way then to destroy gui and to create an new one?

That got me thinking... I'd never done this before but works well:
#include <guiconstants.au3>

Local $Main = _GUI_CreateMain()
GUISetState(@SW_SHOW, $Main[1])

While 1
    Switch GUIGetMsg()
        Case -3
            Exit
        Case $Main[3]
            GUIDelete($Main[1])
            $Main = _GUI_CreateMain()
            GUISetState(@SW_SHOW, $Main[1])
    EndSwitch
WEnd

Func _GUI_CreateMain()
    Local $aCtrls[4]
    $aCtrls[1] = GUICreate('Some GUI', 200, 100)
    $aCtrls[2] = GUICtrlCreateCombo('', 10, 10, 180, 100)
    $aCtrls[3] = GUICtrlCreateButton('Click Me', 75, 50, 50, 30)
    Return $aCtrls
EndFunc
The same concept of using arrays as MHz.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

thanks a lot you both! I think i will try to use Sm0ke_N ´s version it looks really nice :) :)

:"> :"> :whistle:

Edited by cracker

Share this post


Link to post
Share on other sites

yeah it works great !!! thx a lot again. but now i have an other problem. I want to make my window scrollable so i created it like this:

: AutoIt

GUICreate("Delete It",600,500,-1,-1,$WS_VSCROLL+$WS_SIZEBOX+$WS_SYSMENU)

but if i scroll now the window doesn´t goes down... iam sure i have to tell the window "how to scroll" but i didn´t found the answer in the help file how to do this can you help me again?

Share this post


Link to post
Share on other sites

does nobody understand where my problem is or should i create a new thread for a new quesion???(sorry for double post...) :P:nuke:

Share this post


Link to post
Share on other sites

does nobody understand where my problem is or should i create a new thread for a new quesion???(sorry for double post...) :P:nuke:

I really didn't know what you were saying, do you have a working example of what it is you'd like to be done and what it is you'd like to change?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

oh i will try to explain it more exactly:

i have a gui the size is for example 500 x 400 . now i add in a while loop elemts to the gui (labels, checkbox and so on). And its logical that the gui is at any time full and the next elemts would be displayed out of the gui (for example:

GUICtrlCreateLabel("test",40,500) oÝ÷ Ù»­¡÷(º»§¶Ú,yè­²u×jÇ+¢Y[j¶®¶­sduT7&VFRgV÷C·FW7BgV÷C²ÃSÃCÂÓÂÓÂb33cµu5õe45$ôÄÂ

now i see the scrollbar on the right side but if i scroll down it "dont moves down" maybe the screenshot in the attachment can help you to understand my problem. Or maybe you just have a example with a gui and $WS_VSCROLL

thanks :P

Share this post


Link to post
Share on other sites

No, what I meant was, I don't feel like making my own GUI to try and provide a "working" example for you. Since this is a request, I would suggest making a working GUI, with the example that is not working, so we can debug it for you.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

it looks like that this hasn´t helped you again... what have i done wrong? pls it is importent for me that this scroll works :P

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