home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / shareware / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlStatusBarResize.au3 < prev    next >
Encoding:
Text File  |  2006-08-01  |  1.7 KB  |  70 lines

  1. Opt("MustDeclareVars", 1)
  2.  
  3. #include <GUIConstants.au3>
  4. #Include <GuiStatusBar.au3>
  5.  
  6. Global $StatusBar2
  7.  
  8. _Example_1()
  9. _Example_2()
  10.  
  11. Func _Example_1()
  12.     
  13.     Local $gui, $StatusBar1, $msg
  14.     Local $a_PartsRightEdge[3] = [100, 350, -1]
  15.     Local $a_PartsText[3] = ["New Text", "More Text", "Even More Text"]
  16.     
  17.     $gui = GUICreate("Status Bar Resize", 500, -1, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SYSMENU, $WS_SIZEBOX, $WS_MAXIMIZEBOX))
  18.     
  19.     
  20.     $StatusBar1 = _GUICtrlStatusBarCreate($gui, $a_PartsRightEdge, $a_PartsText)
  21.     
  22.     GUISetState(@SW_SHOW)
  23.     
  24.     While 1
  25.         $msg = GUIGetMsg()
  26.         Select
  27.             Case $msg = $GUI_EVENT_RESIZED Or $msg = $GUI_EVENT_MINIMIZE Or $msg = $GUI_EVENT_MAXIMIZE Or $msg = $GUI_EVENT_RESTORE
  28.                 _GUICtrlStatusBarResize($StatusBar1)
  29.             Case $msg = $GUI_EVENT_CLOSE
  30.                 ExitLoop
  31.             Case Else
  32.                 ;;;;;
  33.         EndSelect
  34.         
  35.     WEnd
  36.     GUIDelete()
  37. EndFunc   ;==>_Example_1
  38.  
  39. Func _Example_2()
  40.     Local $gui, $msg
  41.     Local $a_PartsRightEdge[3] = [100, 350, -1]
  42.     Local $a_PartsText[3] = ["New Text", "More Text", "Even More Text"]
  43.     
  44.     $gui = GUICreate("Status Bar Resize", 500, -1, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SYSMENU, $WS_SIZEBOX, $WS_MAXIMIZEBOX))
  45.     
  46.     $StatusBar2 = _GUICtrlStatusBarCreate($gui, $a_PartsRightEdge, $a_PartsText)
  47.     
  48.     ;$WM_SIZE/$WM_SIZING are defined in GuiStatusBar.au3
  49.     GUIRegisterMsg($WM_SIZING, "WM_SIZING"); handle resize
  50.     GUIRegisterMsg($WM_SIZE, "WM_SIZING"); button maximize
  51.     
  52.     GUISetState(@SW_SHOW)
  53.     
  54.     While 1
  55.         $msg = GUIGetMsg()
  56.         Select
  57.             Case $msg = $GUI_EVENT_CLOSE
  58.                 ExitLoop
  59.             Case Else
  60.                 ;;;;;
  61.         EndSelect
  62.         
  63.     WEnd
  64.     GUIDelete()
  65. EndFunc   ;==>_Example_2
  66.  
  67. Func WM_SIZING()
  68.     Return _GUICtrlStatusBarResize($StatusBar2)
  69. EndFunc   ;==>WM_SIZING
  70.