home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 February / PCWorld_2006-02_cd.bin / software / vyzkuste / triky / triky.exe / autoit-v3-setup.exe / Examples / treeview.au3 < prev    next >
Text File  |  2005-01-19  |  3KB  |  85 lines

  1. #include <GUIConstants.au3>
  2.  
  3. GUICreate("GUI with more treeviews",340,200,-1,-1,BitOr($WS_MINIMIZEBOX,$WS_MAXIMIZEBOX,$WS_GROUP,$WS_CAPTION,$WS_POPUP,$WS_SYSMENU))
  4.  
  5. $maintree = GUICtrlCreateTreeView (10,10,120,150)
  6. $aboutitem = GUICtrlCreateTreeViewItem ("About",$maintree)
  7. $generalitem = GUICtrlCreateTreeViewItem ("General",$maintree)
  8. $toolsitem = GUICtrlCreateTreeViewItem ("Tools",$maintree)
  9. $effectitem = GUICtrlCreateTreeViewItem ("Effects",$generalitem)
  10. $styleitem = GUICtrlCreateTreeViewItem ("Styles",$generalitem)
  11. $cmditem = GUICtrlCreateTreeViewItem ("Commandline",$toolsitem)
  12. $miscitem = GUICtrlCreateTreeViewItem ("Misc",$toolsitem)
  13.  
  14. $descgroup = GUICtrlCreateGroup ("Description",140,105,180,55)
  15. GUICtrlSetState (-1,$GUI_HIDE)
  16.  
  17. $effectsgroup = GUICtrlCreateGroup ("Effects",140,5,180,95)
  18. GUICtrlSetState (-1,$GUI_HIDE)
  19. $effectstree = GUICtrlCreateTreeView (150,20,160,70,BitOr($TVS_CHECKBOXES,$TVS_DISABLEDRAGDROP),$WS_EX_CLIENTEDGE)
  20. GUICtrlSetState (-1,$GUI_HIDE)
  21. $effect1 = GUICtrlCreateTreeViewItem ("Effect 1",$effectstree)
  22. $effect2 = GUICtrlCreateTreeViewItem ("Effect 2",$effectstree)
  23. $effect3 = GUICtrlCreateTreeViewItem ("Effect 3",$effectstree)
  24. $effect4 = GUICtrlCreateTreeViewItem ("Effect 4",$effectstree)
  25. $effect5 = GUICtrlCreateTreeViewItem ("Effect 5",$effectstree)
  26.  
  27. $stylesgroup = GUICtrlCreateGroup ("Styles",140,5,180,95)
  28. GUICtrlSetState (-1,$GUI_HIDE)
  29. $stylestree = GUICtrlCreateTreeView (150,20,160,70,BitOr($TVS_CHECKBOXES,$TVS_DISABLEDRAGDROP),$WS_EX_CLIENTEDGE)
  30. GUICtrlSetState (-1,$GUI_HIDE)
  31. $style1 = GUICtrlCreateTreeViewItem ("Style 1",$stylestree)
  32. $style2 = GUICtrlCreateTreeViewItem ("Style 2",$stylestree)
  33. $style3 = GUICtrlCreateTreeViewItem ("Style 3",$stylestree)
  34. $style4 = GUICtrlCreateTreeViewItem ("Style 4",$stylestree)
  35. $style5 = GUICtrlCreateTreeViewItem ("Style 5",$stylestree)
  36.  
  37. $aboutlabel = GUICtrlCreateLabel ("This is only a treeview demo.",160,80,160,20)
  38.  
  39. $cancelbutton = GUICtrlCreateButton ("Cancel",130,170,70,20)
  40. GUISetState()
  41.  
  42. GUIctrlSetState ($effect1,$GUI_CHECKED)
  43. GUIctrlSetState ($effect3,$GUI_CHECKED)
  44. GUIctrlSetState ($style4,$GUI_CHECKED)
  45. GUIctrlSetState ($style5,$GUI_CHECKED)
  46.  
  47. While 1
  48.     $msg = GUIGetMsg()
  49.     Select
  50.         Case $msg = -3 Or $msg = -1 Or $msg = $cancelbutton
  51.             ExitLoop
  52.         Case $msg = $aboutitem
  53.             GUIctrlSetState ($descgroup,$GUI_HIDE)
  54.             GUIctrlSetState ($effectstree,$GUI_HIDE)
  55.             GUIctrlSetState ($effectsgroup,$GUI_HIDE)
  56.             GUIctrlSetState ($stylestree,$GUI_HIDE)
  57.             GUIctrlSetState ($stylesgroup,$GUI_HIDE)
  58.             GUIctrlSetState ($aboutlabel,$GUI_SHOW)
  59.         
  60.         Case $msg = $effectitem
  61.             GUIctrlSetState ($stylestree,$GUI_HIDE)
  62.             GUIctrlSetState ($stylesgroup,$GUI_HIDE)
  63.             GUIctrlSetState ($aboutlabel,$GUI_HIDE)
  64.             GUIctrlSetState ($effectsgroup,$GUI_SHOW)
  65.             GUIctrlSetState ($descgroup,$GUI_SHOW)
  66.             GUICtrlSetState($effectstree,$GUI_SHOW)
  67.             GUICtrlSetBkColor ($effectstree,0xD0F0F0)
  68.             ;GUIctrlSetState...($effectstree,$GUI_SHOW)
  69.                     
  70.         Case $msg = $styleitem
  71.             GUIctrlSetState ($effectstree,$GUI_HIDE)
  72.             GUIctrlSetState ($effectsgroup,$GUI_HIDE)
  73.             GUIctrlSetState ($aboutlabel,$GUI_HIDE)
  74.             GUIctrlSetState ($stylesgroup,$GUI_SHOW)
  75.             GUIctrlSetState ($descgroup,$GUI_SHOW)
  76.             ;GUIctrlSetState.($stylestree,$GUI_SHOW)
  77.             GUICtrlSetState ($stylestree,$GUI_SHOW)
  78.             GUICtrlSetColor ($stylestree,0xD00000)
  79.             GUICtrlSetBkColor ($stylestree,0xD0FFD0)
  80.             
  81.     EndSelect
  82. WEnd
  83.  
  84. GUIDelete()
  85. Exit