Sign in to follow this  
Followers 0
Rawox

Script with TreeView

3 posts in this topic

hi.

I have a little problem with this treeview script, I just can't get it to work :)

Hope someone can helps me here. I can't figure the WEnd and EndFund thingies out!

#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Global $msg, $quitbutton
    Local $tree, $nosub, $sub
    Local $font
    
; GUI
GuiCreate("Select Your Script - Treeview", 380, 440)
;--------------------------------------------------------------------------------------TREEVIEW
$tree = GuiCtrlCreateTreeView(5, 5, 240, 390)
$nosub = GuiCtrlCreateTreeViewItem("No Subscription", $tree)
$sub = GuiCtrlCreateTreeViewItem("Subscription", $tree)
;SUBSCRIPTION
GuiCtrlCreateTreeViewItem("Mozilla Firefox", $sub)
GuiCtrlCreateTreeViewItem("1280 X 800", -1)
GuiCtrlCreateTreeViewItem("Internet Explorer", $sub)
GuiCtrlCreateTreeViewItem("1280 X 800", -1)
GuiCtrlCreateTreeViewItem("Apple Safari", $sub)
GuiCtrlCreateTreeViewItem("1280 X 800", -1)
;NO SUBSCRIPTION
GuiCtrlCreateTreeViewItem("Mozilla Firefox", $nosub)
GuiCtrlCreateTreeViewItem("1280 X 800", -1)
GuiCtrlCreateTreeViewItem("Internet Explorer", $nosub)
GuiCtrlCreateTreeViewItem("1280 X 800", -1)
GuiCtrlCreateTreeViewItem("Apple Safari", $nosub)
GuiCtrlCreateTreeViewItem("1280 X 800", -1)

;--------------------------------------------------------------------------------------TEXT
;Title
GuiSetFont (10, 1000, 4)
GuiCtrlCreateLabel ( "Explanation", 270, 8 )
GuiSetFont (8,5, 400)
;Step 1
GuiSetFont (9, 1000)
GuiCtrlCreateLabel ( "Step 1:", 255, 30 )
GuiSetFont (8,5, 400)
GuiCtrlCreateLabel ( "Choose What Kind Of", 255, 45 )
GuiCtrlCreateLabel ( "Account you have on", 255, 59 )
GuiCtrlCreateLabel ( "DeviantArt. Subscribers", 255, 73 )
GuiCtrlCreateLabel ( "Pay for their account.", 255, 87 )
;Step 2
GuiSetFont (9, 1000)
GuiCtrlCreateLabel ( "Step 2:", 255, 105 )
GuiSetFont (8,5, 400)
GuiCtrlCreateLabel ( "Choose Which Browser", 255, 120 )
GuiCtrlCreateLabel ( "you want to use while", 255, 134 )
GuiCtrlCreateLabel ( "using this script. Be", 255, 148 )
GuiCtrlCreateLabel ( "Sure the browser is", 255, 162 )
GuiCtrlCreateLabel ( "Installed in the standard", 255, 176 )
GuiCtrlCreateLabel ( "directory!", 255, 190 )
;Step 3
GuiSetFont (9, 1000)
GuiCtrlCreateLabel ( "Step 3:", 255, 208 )
GuiSetFont (8,5, 400)
GuiCtrlCreateLabel ( "Choose the Screen", 255, 223 )
GuiCtrlCreateLabel ( "Resolution that fits", 255, 237 )
GuiCtrlCreateLabel ( "best for your Computer", 255, 251 )
GuiCtrlCreateLabel ( "Sure the browser is", 255, 265 )
GuiCtrlCreateLabel ( "Installed in the standard", 255, 279 )
GuiCtrlCreateLabel ( "directory!", 255, 293 )
;Step 4
GuiSetFont (9, 1000)
GuiCtrlCreateLabel ( "Step 4:", 255, 311)
GuiSetFont (8,5, 400)
GuiCtrlCreateLabel ( "Choose the folder you", 255, 326 )
GuiCtrlCreateLabel ( "want", 255, 340 )
GuiCtrlCreateLabel ( "best for your Computer", 255, 354 )
GuiCtrlCreateLabel ( "Sure the browser is", 255, 368 )
;--------------------------------------------------------------------------------------BUTTONS
$quitbutton = GUICtrlCreateButton("Close", 95, 60, 70)
While 1
  $msg = GUIGetMsg()
  Select
;------------ Quit Button - Finished
    Case $msg = $quitbutton
        Exit
;------------ Cross - Finished  
    Case $msg = $GUI_EVENT_CLOSE
      ExitLoop
  EndSelect
WEnd

Share this post


Link to post
Share on other sites



#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Global $msg, $quitbutton
    Local $tree, $nosub, $sub
    Local $font

    ; GUI
    GUICreate("Select Your Script - Treeview", 380, 440)
    ;--------------------------------------------------------------------------------------TREEVIEW
    $tree = GUICtrlCreateTreeView(5, 5, 240, 390)
    $nosub = GUICtrlCreateTreeViewItem("No Subscription", $tree)
    $sub = GUICtrlCreateTreeViewItem("Subscription", $tree)
    ;SUBSCRIPTION
    GUICtrlCreateTreeViewItem("Mozilla Firefox", $sub)
    GUICtrlCreateTreeViewItem("1280 X 800", -1)
    GUICtrlCreateTreeViewItem("Internet Explorer", $sub)
    GUICtrlCreateTreeViewItem("1280 X 800", -1)
    GUICtrlCreateTreeViewItem("Apple Safari", $sub)
    GUICtrlCreateTreeViewItem("1280 X 800", -1)
    ;NO SUBSCRIPTION
    GUICtrlCreateTreeViewItem("Mozilla Firefox", $nosub)
    GUICtrlCreateTreeViewItem("1280 X 800", -1)
    GUICtrlCreateTreeViewItem("Internet Explorer", $nosub)
    GUICtrlCreateTreeViewItem("1280 X 800", -1)
    GUICtrlCreateTreeViewItem("Apple Safari", $nosub)
    GUICtrlCreateTreeViewItem("1280 X 800", -1)

    ;--------------------------------------------------------------------------------------TEXT
    ;Title
    GUISetFont(10, 1000, 4)
    GUICtrlCreateLabel("Explanation", 270, 8)
    GUISetFont(8, 5, 400)
    ;Step 1
    GUISetFont(9, 1000)
    GUICtrlCreateLabel("Step 1:", 255, 30)
    GUISetFont(8, 5, 400)
    GUICtrlCreateLabel("Choose What Kind Of", 255, 45)
    GUICtrlCreateLabel("Account you have on", 255, 59)
    GUICtrlCreateLabel("DeviantArt. Subscribers", 255, 73)
    GUICtrlCreateLabel("Pay for their account.", 255, 87)
    ;Step 2
    GUISetFont(9, 1000)
    GUICtrlCreateLabel("Step 2:", 255, 105)
    GUISetFont(8, 5, 400)
    GUICtrlCreateLabel("Choose Which Browser", 255, 120)
    GUICtrlCreateLabel("you want to use while", 255, 134)
    GUICtrlCreateLabel("using this script. Be", 255, 148)
    GUICtrlCreateLabel("Sure the browser is", 255, 162)
    GUICtrlCreateLabel("Installed in the standard", 255, 176)
    GUICtrlCreateLabel("directory!", 255, 190)
    ;Step 3
    GUISetFont(9, 1000)
    GUICtrlCreateLabel("Step 3:", 255, 208)
    GUISetFont(8, 5, 400)
    GUICtrlCreateLabel("Choose the Screen", 255, 223)
    GUICtrlCreateLabel("Resolution that fits", 255, 237)
    GUICtrlCreateLabel("best for your Computer", 255, 251)
    GUICtrlCreateLabel("Sure the browser is", 255, 265)
    GUICtrlCreateLabel("Installed in the standard", 255, 279)
    GUICtrlCreateLabel("directory!", 255, 293)
    ;Step 4
    GUISetFont(9, 1000)
    GUICtrlCreateLabel("Step 4:", 255, 311)
    GUISetFont(8, 5, 400)
    GUICtrlCreateLabel("Choose the folder you", 255, 326)
    GUICtrlCreateLabel("want", 255, 340)
    GUICtrlCreateLabel("best for your Computer", 255, 354)
    GUICtrlCreateLabel("Sure the browser is", 255, 368)
    ;--------------------------------------------------------------------------------------BUTTONS
    $quitbutton = GUICtrlCreateButton("Close", 95, 60, 70)
    
    GUISetState()
    
    While 1
        $msg = GUIGetMsg()
        Select
            ;------------ Quit Button - Finished
            Case $msg = $quitbutton
                Exit
                ;------------ Cross    - Finished
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
        EndSelect
    WEnd
EndFunc

Added GuiSetState and EndFunc :)

Share this post


Link to post
Share on other sites

Tnx! It works :)

#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Global $msg, $quitbutton
    Local $tree, $nosub, $sub
    Local $font

    ; GUI
    GUICreate("Select Your Script - Treeview", 380, 440)
    ;--------------------------------------------------------------------------------------TREEVIEW
    $tree = GUICtrlCreateTreeView(5, 5, 240, 390)
    $nosub = GUICtrlCreateTreeViewItem("No Subscription", $tree)
    $sub = GUICtrlCreateTreeViewItem("Subscription", $tree)
    ;SUBSCRIPTION
    GUICtrlCreateTreeViewItem("Mozilla Firefox", $sub)
    GUICtrlCreateTreeViewItem("1280 X 800", -1)
    GUICtrlCreateTreeViewItem("Internet Explorer", $sub)
    GUICtrlCreateTreeViewItem("1280 X 800", -1)
    GUICtrlCreateTreeViewItem("Apple Safari", $sub)
    GUICtrlCreateTreeViewItem("1280 X 800", -1)
    ;NO SUBSCRIPTION
    GUICtrlCreateTreeViewItem("Mozilla Firefox", $nosub)
    GUICtrlCreateTreeViewItem("1280 X 800", -1)
    GUICtrlCreateTreeViewItem("Internet Explorer", $nosub)
    GUICtrlCreateTreeViewItem("1280 X 800", -1)
    GUICtrlCreateTreeViewItem("Apple Safari", $nosub)
    GUICtrlCreateTreeViewItem("1280 X 800", -1)

    ;--------------------------------------------------------------------------------------TEXT
    ;Title
    GUISetFont(10, 1000, 4)
    GUICtrlCreateLabel("Explanation", 270, 8)
    GUISetFont(8, 5, 400)
    ;Step 1
    GUISetFont(9, 1000)
    GUICtrlCreateLabel("Step 1:", 255, 30)
    GUISetFont(8, 5, 400)
    GUICtrlCreateLabel("Choose What Kind Of", 255, 45)
    GUICtrlCreateLabel("Account you have on", 255, 59)
    GUICtrlCreateLabel("DeviantArt. Subscribers", 255, 73)
    GUICtrlCreateLabel("Pay for their account.", 255, 87)
    ;Step 2
    GUISetFont(9, 1000)
    GUICtrlCreateLabel("Step 2:", 255, 105)
    GUISetFont(8, 5, 400)
    GUICtrlCreateLabel("Choose Which Browser", 255, 120)
    GUICtrlCreateLabel("you want to use while", 255, 134)
    GUICtrlCreateLabel("using this script. Be", 255, 148)
    GUICtrlCreateLabel("Sure the browser is", 255, 162)
    GUICtrlCreateLabel("Installed in the standard", 255, 176)
    GUICtrlCreateLabel("directory!", 255, 190)
    ;Step 3
    GUISetFont(9, 1000)
    GUICtrlCreateLabel("Step 3:", 255, 208)
    GUISetFont(8, 5, 400)
    GUICtrlCreateLabel("Choose the Screen", 255, 223)
    GUICtrlCreateLabel("Resolution that fits", 255, 237)
    GUICtrlCreateLabel("best for your Computer", 255, 251)
    GUICtrlCreateLabel("Sure the browser is", 255, 265)
    GUICtrlCreateLabel("Installed in the standard", 255, 279)
    GUICtrlCreateLabel("directory!", 255, 293)
    ;Step 4
    GUISetFont(9, 1000)
    GUICtrlCreateLabel("Step 4:", 255, 311)
    GUISetFont(8, 5, 400)
    GUICtrlCreateLabel("Choose the folder you", 255, 326)
    GUICtrlCreateLabel("want", 255, 340)
    GUICtrlCreateLabel("best for your Computer", 255, 354)
    GUICtrlCreateLabel("Sure the browser is", 255, 368)
    ;--------------------------------------------------------------------------------------BUTTONS
    $quitbutton = GUICtrlCreateButton("Close", 95, 60, 70)
    
    GUISetState()
    
    While 1
        $msg = GUIGetMsg()
        Select
            ;------------ Quit Button - Finished
            Case $msg = $quitbutton
                Exit
                ;------------ Cross    - Finished
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
        EndSelect
    WEnd
EndFunc

Added GuiSetState and EndFunc :o

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