Jump to content

guibutton


Cloudsx
 Share

Recommended Posts

oke this what i have till now

#include <GUIConstants.au3>

GUICreate("game",350,400); will create a dialog box that when displayed is centered
GUISetState (@SW_SHOW); will display an empty dialog box


Opt("GUICoordMode",4)
$gebouwen = GUICtrlCreateButton("gebouwen",290,100,60)
$militair = GUICtrlCreateButton("militair",290,125,60)
$onderzoek = GUICtrlCreateButton("onderzoek",290,150,60)
$verdediging = GUICtrlCreateButton("verdediging",290,175,61)
$overzicht =  GUICtrlCreateButton("overzicht",290,200,60) 

GUISetState ();this wil create a button



While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then Exit
if $msg = $gebouwen Then GUI2Create()
If $msg = $militair then Gui3create()
If $msg = $onderzoek then Gui4create()
If $msg = $verdediging then gui5create()
If $msg = $overzicht then Gui6create()
    
Wend

Func GUI2Create()
GUICreate("gebouwen",350,350)
GUISetState (@SW_SHOW)
EndFunc

Func Gui3create()
GUICreate("militair",350,350)
GUISetState (@SW_SHOW)
EndFunc

Func gui4create()
GUICreate("onderzoek",350,350)
GUISetState (@SW_SHOW)
EndFunc

Func gui5create()
GUICreate("verdediging",350,350)
GUISetState (@SW_SHOW)
EndFunc

Func gui6create()
GUICreate("overzicht",350,350)
GUISetState (@SW_SHOW)
EndFunc


            
        

        

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


Valuater
            
            
                Posted 
                
            
        
    
    
        


Valuater
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                MVPs
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 11.1k
                            
                                
                            
                        
                        
                            
                                
                                    
                                        
                                        7
                                
                                    
                                
                            
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                
            
        
    

    

    

    
        
        
            this is bas akwards... as i said.. i believe you should create all of the gui's... and use the buttons to show themm

this approach you are using will get more and more difficult 

#include <GUIConstants.au3>

GUICreate("game",350,400); will create a dialog box that when displayed is centered
GUISetState (@SW_SHOW); will display an empty dialog box


Opt("GUICoordMode",4)
$gebouwen = GUICtrlCreateButton("gebouwen",290,100,60)
$militair = GUICtrlCreateButton("militair",290,125,60)
$onderzoek = GUICtrlCreateButton("onderzoek",290,150,60)
$verdediging = GUICtrlCreateButton("verdediging",290,175,61)
$overzicht = GUICtrlCreateButton("overzicht",290,200,60)

GUISetState ();this wil create a button

Dim $2, $3, $4, $5, $6

While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then
    If WinActive("game") then Exit
    If WinActive("gebouwen") then GUIDelete( $2)
    If WinActive("militair") then GUIDelete( $3)
    If WinActive("onderzoek") then GUIDelete( $4)
    If WinActive("verdediging") then GUIDelete( $5)
    If WinActive("overzicht") then GUIDelete($6)
EndIf
if $msg = $gebouwen Then GUI2Create()
If $msg = $militair then Gui3create()
If $msg = $onderzoek then Gui4create()
If $msg = $verdediging then gui5create()
If $msg = $overzicht then Gui6create()

Wend

Func GUI2Create()
If WinExists("gebouwen") then Return
$2 = GUICreate("gebouwen",350,350)
GUISetState (@SW_SHOW)
EndFunc

Func Gui3create()
If WinExists("militair") then Return
$3 = GUICreate("militair",350,350)
GUISetState (@SW_SHOW)
EndFunc

Func gui4create()
If WinExists("onderzoek") then Return
$4 = GUICreate("onderzoek",350,350)
GUISetState (@SW_SHOW)
EndFunc

Func gui5create()
If WinExists("verdediging") then Return
$5 = GUICreate("verdediging",350,350)
GUISetState (@SW_SHOW)
EndFunc

Func gui6create()
If WinExists("overzicht") then Return
$6 = GUICreate("overzicht",350,350)
GUISetState (@SW_SHOW)
EndFunc

8)

NEWHeader1.png

Link to comment
Share on other sites

thanks again

i make a little game from what i and you made this far

but now my last problem(i think so and hope so)

if something in gebouwen (buildings) going to make i press on tax factory i want to make that then i want to see on the parent dialog that tax factory is under construction how can i make that

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