Sign in to follow this  
Followers 0
Rex

Next > Next > next aso.

7 posts in this topic

Hi i'm trying to create a gui with one main gui and some childs, with a back and a next button.

My problem is i can't finde out how to get the script to keep switch to the next child when a user cliks next :P

#include <GuiConstants.au3>

$Main = GuiCreate("MyGUI", 516, 323,(@DesktopWidth-516)/2, (@DesktopHeight-323)/2)

$Button_1 = GuiCtrlCreateButton("&Next >", 330, 290, 80, 25)
$Button_2 = GuiCtrlCreateButton("< &Back", 250, 290, 80, 25)
$Button_3 = GuiCtrlCreateButton("&Exit", 420, 290, 80, 25)
$Button_6 = GuiCtrlCreateButton("", 10, 270, 490, 3,-1, $WS_EX_STATICEDGE)

GuiSetState()

$Child_1 = GuiCreate("", 506, 238,0, 0, BitOr($WS_CHILD,$WS_TABSTOP)+$WS_DLGFRAME ,-1, $main)

$Label_1 = GuiCtrlCreateLabel("Child 1", 20, 20, 230, 30)

GuiSetState()

$Child_2 = GuiCreate("", 506, 238,0, 0, BitOr($WS_CHILD,$WS_TABSTOP)+$WS_DLGFRAME ,-1, $main)

$Label_1 = GuiCtrlCreateLabel("Child 2.", 30, 40, 290, 30)

GuiSetState(@SW_HIDE)

$Child_3 = GuiCreate("", 506, 238,0, 0, BitOr($WS_CHILD,$WS_TABSTOP)+$WS_DLGFRAME ,-1, $main)

$Label_1 = GuiCtrlCreateLabel("Child 3.", 30, 40, 290, 30)

GuiSetState(@SW_HIDE)

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_1
        GUISetState(@SW_HIDE, $child_1)
        GUISetState(@SW_SHOW, $child_2)
    ;;;
    EndSelect
WEnd

Please can some one help me with this little problem ;)

Share this post


Link to post
Share on other sites



wenever i make more than 1 gui i always put em in seperate functions so i dont have to deal with all that child crap and different messages


[right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right]

Share this post


Link to post
Share on other sites

wenever i make more than 1 gui i always put em in seperate functions so i dont have to deal with all that child crap and different messages

But then you don't get the same cool function as you can with childs ;)

Share this post


Link to post
Share on other sites

here ya go

#include <GuiConstants.au3>

Dim $show = 0

$Main = GuiCreate("MyGUI", 516, 323,(@DesktopWidth-516)/2, (@DesktopHeight-323)/2)

$Button_1 = GuiCtrlCreateButton("&Next >", 330, 290, 80, 25)
$Button_2 = GuiCtrlCreateButton("< &Back", 250, 290, 80, 25)
$Button_3 = GuiCtrlCreateButton("&Exit", 420, 290, 80, 25)
$Button_6 = GuiCtrlCreateButton("", 10, 270, 490, 3,-1, $WS_EX_STATICEDGE)

GuiSetState()

$Child_1 = GuiCreate("", 506, 238,0, 0, BitOr($WS_CHILD,$WS_TABSTOP)+$WS_DLGFRAME ,-1, $main)

$Label_1 = GuiCtrlCreateLabel("Child 1", 20, 20, 230, 30)

GuiSetState()

$Child_2 = GuiCreate("", 506, 238,0, 0, BitOr($WS_CHILD,$WS_TABSTOP)+$WS_DLGFRAME ,-1, $main)

$Label_1 = GuiCtrlCreateLabel("Child 2.", 30, 40, 290, 30)

GuiSetState(@SW_HIDE)

$Child_3 = GuiCreate("", 506, 238,0, 0, BitOr($WS_CHILD,$WS_TABSTOP)+$WS_DLGFRAME ,-1, $main)

$Label_1 = GuiCtrlCreateLabel("Child 3.", 30, 40, 290, 30)

GuiSetState(@SW_HIDE)

While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_1
    Set_Show()
;;;
EndSelect
WEnd


;--------- Functions -------------------

Func Set_Show()
    
    If $Show = 0 Then
        GUISetState(@SW_HIDE, $child_1)
        GUISetState(@SW_SHOW, $child_2)
        $Show = 1
        Return
    EndIf
    
    If $Show = 1 Then
        GUISetState(@SW_SHOW, $child_1)
        GUISetState(@SW_HIDE, $child_2)
        $Show = 0
        Return
    EndIf
    
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

But then you don't get the same cool function as you can with childs ;)

there are no cool functions just abunch of confusion

[right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right]

Share this post


Link to post
Share on other sites

here ya go

Case $msg = $Button_1
    Set_Show()
;;;
EndSelect
WEnd
;--------- Functions -------------------

Func Set_Show()
    
    If $Show = 0 Then
        GUISetState(@SW_HIDE, $child_1)
        GUISetState(@SW_SHOW, $child_2)
        $Show = 1
        Return
    EndIf
    
    If $Show = 1 Then
        GUISetState(@SW_SHOW, $child_1)
        GUISetState(@SW_HIDE, $child_2)
        $Show = 0
        Return
    EndIf
    
EndFunc

8)

thx

why oh why did't i think of that ;) It so simpel

I was begining to mess around with add one, or array'er som thing like that :P

Share this post


Link to post
Share on other sites

Actually i am looking at a similar situation...

use child windows or place each gui in a function or #include each gui or use tabs or ???

but after looking at your idea.. i completed the task with 10 child windows including the "Next" and "Back" buttons... you can see it here

http://www.autoitscript.com/forum/index.php?showtopic=16769#

8)


NEWHeader1.png

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