Valuater Posted January 19, 2006 Share Posted January 19, 2006 Examples are done, unless someone has some changes, if no changes then I'll start on the templates for the help file tonight or tomorrow.GaryNice work Gary and everyone elsenoted_GuiCtrlStatusBarSetBKColor ($StatusBar1, $Yellow)doesn't work in winXP Theme8) Link to comment Share on other sites More sharing options...
GaryFrost Posted January 19, 2006 Share Posted January 19, 2006 Nice work Gary and everyone elsenoted_GuiCtrlStatusBarSetBKColor ($StatusBar1, $Yellow)doesn't work in winXP Theme8) DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
dragonrider Posted January 19, 2006 Share Posted January 19, 2006 DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)Could someone do me a favor? I'm new to this thread & would like to know where the GuiStatusBar.au3 file is located.Help much appreciated.P.S. are the changes & additions from this thread in the file you are giving me the URL for?RegardsDragonrider Link to comment Share on other sites More sharing options...
Developers Jos Posted January 19, 2006 Developers Share Posted January 19, 2006 Could someone do me a favor? I'm new to this thread & would like to know where the GuiStatusBar.au3 file is located.Help much appreciated.P.S. are the changes & additions from this thread in the file you are giving me the URL for?RegardsDragonriderThis is the version of _GUIStatusbar.au3 that will be in the next BETA installer of AutoIt3... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
rysiora Posted January 20, 2006 Author Share Posted January 20, 2006 I think that for adding this to newest Beta, a documentation is needed. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 20, 2006 Developers Share Posted January 20, 2006 I think that for adding this to newest Beta, a documentation is needed.gafrost took care of the whole lot... will be in the next BETA... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
rysiora Posted January 20, 2006 Author Share Posted January 20, 2006 (edited) I'm really glad that my idea StatusBar is UDF :"> Edited January 20, 2006 by rysiora Link to comment Share on other sites More sharing options...
eltorro Posted January 27, 2006 Share Posted January 27, 2006 I've modified the create func to use extended styles. expandcollapse popup;=============================================================================== ; ; Description: _GuiCtrlStatusBarCreate ; Parameter(s): $h_Gui - Handle to parent window ; $a_PanelWidth - width of panel or panels (for more than 1 panel pass in zero based array) ; $s_PanelText - text of panel or panels (for more than 1 panel pass in zero based array) ; $v_styles - styles to apply to the status bar (Optional) for multiple styles bitor them. ; $v_exstyles - Set the extended style(s). For multiple styles, BitOr them. ; Requirement: ; Return Value(s): Returns hWhnd if successful, or 0 with error set to 1 otherwise. ; User CallTip: _GuiCtrlStatusBarCreate($h_Gui, $a_PanelWidth, $s_PanelText[, $v_styles = "", $v_exstyles =""]) Creates Statusbar. (required: <GuiStatusBar.au3>) ; Author(s): rysiora, JdeB, tonedef, ; gafrost (Gary Frost (custompcs@charter.net)), eltorro -Steve Podhajecki <gehossafats@netmdc.com> ; Note(s): ;=============================================================================== Func _GuiCtrlStatusBarCreate($h_Gui, $a_PanelWidth, $s_PanelText, $v_styles = "",$v_exstyles = ""); Added extend style If Not IsArray($a_PanelWidth) Then Local $temp_width = $a_PanelWidth Dim $a_PanelWidth[1] = [$temp_width] EndIf If Not IsArray($s_PanelText) Then Local $temp_string = $s_PanelText Dim $s_PanelText[1] = [$temp_string] EndIf If Not IsHWnd($h_Gui) Then $h_Gui = HWnd($h_Gui) Local $hwnd_Bar1, $x,$Class = "msctls_statusbar32" Local $style = BitOR($WS_CHILD, $WS_VISIBLE) If @NumParams > 3 and $v_styles <> "" then $style = BitOR($style, $v_styles) ;$hwnd_Bar1 = DllCall("comctl32.dll", "long", "CreateStatusWindow", "long", $style, "str", "", "hwnd", $h_Gui, "int", 0) ; use extended styles. $hwnd_Bar1 = dllcall("user32.dll", "long","CreateWindowEx", "long", $v_exstyles, _ "str","msctls_statusbar32","str", "", _ "long",$style,"long",0 ,"long",0,"long",0,"long",0, _ "hwnd",$h_Gui,"long",0,"hwnd",$h_Gui,"long",0) ; end use extended styles. If Not @error Then _GuiCtrlStatusBarSetParts($hwnd_Bar1[0], UBound($a_PanelWidth), $a_PanelWidth) For $x = 0 To UBound($s_PanelText) - 1 _GuiCtrlStatusBarSetText($hwnd_Bar1[0], $s_PanelText[$x], $x) Next Return $hwnd_Bar1[0] EndIf SetError(1) Return 0 EndFunc ;==>_GuiCtrlStatusBarCreate Can we get this included in one of the next betas? I'm still puzzled why the bar doesn't attach to the parent's re-size event like it should. Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
livewire Posted January 28, 2006 Share Posted January 28, 2006 Using _GuiCtrlStatusBarSetBKColor with WinXP Theme:DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 1) <- 0 doesn't use XP ThemeDllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 1) opt("MustDeclareVars", 1) #include <GUIConstants.au3> #Include <GuiStatusBar.au3> Local $gui, $StatusBar1, $msg Local $a_PartsRightEdge[3] = [100, 350, -1] Local $a_PartsText[3] = ["New Text", "More Text", "Even More Text"] Local Const $Yellow = 0xffff00 $gui = GUICreate("Status Bar Set Back Color", 500, -1, -1, -1, $WS_SIZEBOX) $StatusBar1 = _GuiCtrlStatusBarCreate ($gui, $a_PartsRightEdge, $a_PartsText) _GuiCtrlStatusBarSetBKColor ($StatusBar1, $Yellow) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_RESIZED _GuiCtrlStatusBarResize ($StatusBar1) Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;; EndSelect WEnd Link to comment Share on other sites More sharing options...
RagnaroktA Posted October 12, 2006 Share Posted October 12, 2006 (edited) New addition, _GUICtrlStatusBarCreateProgress I pretty much took eltorros code, and turned it into a UDF... Easier to call that way. expandcollapse popup;=============================================================================== ; ; Description: _GUICtrlStatusBarCreateProgress ; Parameter(s): $h_StatusBar - Target status bar ; $i_Panel - Panel of the status bar to create the progress in ; $v_styles - Styles to apply to the progress bar (Optional) for multiple styles bitor them. ; Requirement: ; Return Value(s): Returns hWhnd if successful, or 0 with error set to 1 otherwise. ; User CallTip: _GUICtrlStatusBarCreateProgress($h_StatusBar, $i_Panel[, $i_pad = 2[, $v_styles = ""]]) Creates Statusbar. (required: <GuiStatusBar.au3>) ; Author(s): eltorro, RagnaroktA, ; gafrost (Gary Frost (custompcs at charter dot net)) ; Note(s): ;=============================================================================== Func _GUICtrlStatusBarCreateProgress($h_StatusBar, $i_Panel, $v_styles = "") Local $i_pad = 2, $a_box = _GuiCtrlStatusBarGetRect($h_StatusBar, $i_Panel) ; Shrink the rect a little to fit inside panel $a_box[0] = $a_box[0] + $i_pad; left $a_box[1] = $a_box[1] + $i_pad; top $a_box[2] = $a_box[2] - $a_box[0] - $i_pad*3; width $a_box[3] = $a_box[3] - $a_box[1] - $i_pad; height ; Create the progress bar with the proper size. $h_Progress = GUICtrlCreateProgress($a_box[0], $a_box[1], $a_box[2], $a_box[3], $v_styles) GUICtrlSetResizing($h_Progress, 802) ; Change progressbars parent to statusbar If Not IsHWnd($h_StatusBar) Then $h_StatusBar = HWnd($h_StatusBar) If Not IsHWnd($h_Progress) Then $h_Progress = GUICtrlGetHandle($h_Progress) If DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $h_Progress, "hwnd", $h_StatusBar) <> 0 Then Return Else SetError(1) Return 0 EndIf ; Move progressbar to statusbar. Local $h_control, $b_repaint = True If Not IsHWnd($h_Progress) Then $h_control = GUICtrlGetHandle($h_Progress) if IsArray($a_box) Then if DllCall("user32.dll", "long", "MoveWindow", "hwnd", $h_control, _ "int", $a_box[0], "int", $a_box[1], _ "int", $a_box[2], "int", $a_box[3], "int", $b_repaint) <> 0 Then Return Else SetError(1) Return 0 EndIf Else SetError(1) Return 0 EndIf Return $h_Progress EndFunc ;==>_GUICtrlStatusBarCreateProgress Edited October 12, 2006 by RagnaroktA Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki Link to comment Share on other sites More sharing options...
GaryFrost Posted October 13, 2006 Share Posted October 13, 2006 New addition, _GUICtrlStatusBarCreateProgress I pretty much took eltorros code, and turned it into a UDF... Easier to call that way. expandcollapse popup;=============================================================================== ; ; Description: _GUICtrlStatusBarCreateProgress ; Parameter(s): $h_StatusBar - Target status bar ; $i_Panel - Panel of the status bar to create the progress in ; $v_styles - Styles to apply to the progress bar (Optional) for multiple styles bitor them. ; Requirement: ; Return Value(s): Returns hWhnd if successful, or 0 with error set to 1 otherwise. ; User CallTip: _GUICtrlStatusBarCreateProgress($h_StatusBar, $i_Panel[, $i_pad = 2[, $v_styles = ""]]) Creates Statusbar. (required: <GuiStatusBar.au3>) ; Author(s): eltorro, RagnaroktA, ; gafrost (Gary Frost (custompcs at charter dot net)) ; Note(s): ;=============================================================================== Func _GUICtrlStatusBarCreateProgress($h_StatusBar, $i_Panel, $v_styles = "") Local $i_pad = 2, $a_box = _GuiCtrlStatusBarGetRect($h_StatusBar, $i_Panel) ; Shrink the rect a little to fit inside panel $a_box[0] = $a_box[0] + $i_pad; left $a_box[1] = $a_box[1] + $i_pad; top $a_box[2] = $a_box[2] - $a_box[0] - $i_pad*3; width $a_box[3] = $a_box[3] - $a_box[1] - $i_pad; height ; Create the progress bar with the proper size. $h_Progress = GUICtrlCreateProgress($a_box[0], $a_box[1], $a_box[2], $a_box[3], $v_styles) GUICtrlSetResizing($h_Progress, 802) ; Change progressbars parent to statusbar If Not IsHWnd($h_StatusBar) Then $h_StatusBar = HWnd($h_StatusBar) If Not IsHWnd($h_Progress) Then $h_Progress = GUICtrlGetHandle($h_Progress) If DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $h_Progress, "hwnd", $h_StatusBar) <> 0 Then Return Else SetError(1) Return 0 EndIf ; Move progressbar to statusbar. Local $h_control, $b_repaint = True If Not IsHWnd($h_Progress) Then $h_control = GUICtrlGetHandle($h_Progress) if IsArray($a_box) Then if DllCall("user32.dll", "long", "MoveWindow", "hwnd", $h_control, _ "int", $a_box[0], "int", $a_box[1], _ "int", $a_box[2], "int", $a_box[3], "int", $b_repaint) <> 0 Then Return Else SetError(1) Return 0 EndIf Else SetError(1) Return 0 EndIf Return $h_Progress EndFunc;==>_GUICtrlStatusBarCreateProgress Nice try, didn't work tho Here's a working version expandcollapse popupOpt("MustDeclareVars", 1) #include <GUIConstants.au3> #Include <GuiStatusBar.au3> Local $gui, $StatusBar1, $msg, $ProgressBar1, $iProgress = 0 Local $a_PartsRightEdge[3] = [100, 350, -1] Local $a_PartsText[3] = ["New Text", "More Text", "Even More Text"] $gui = GUICreate("Status Bar Create", 500, -1, -1, -1, $WS_SIZEBOX) $StatusBar1 = _GUICtrlStatusBarCreate($gui, $a_PartsRightEdge, $a_PartsText) $ProgressBar1 = _GUICtrlStatusBarCreateProgress($StatusBar1, 1) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_RESIZED _GUICtrlStatusBarResize($StatusBar1) Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else If $ProgressBar1 <> -1 Then If $iProgress < 100 Then $iProgress = $iProgress + 1 GUICtrlSetData($ProgressBar1, $iProgress) Else $iProgress = 0 EndIf Sleep(100) EndIf EndSelect WEnd ;=============================================================================== ; ; Description: _GUICtrlStatusBarCreateProgress ; Parameter(s): $h_StatusBar - Target status bar ; $i_Panel - Panel of the status bar to create the progress in ; $v_styles - Styles to apply to the progress bar (Optional) for multiple styles bitor them. ; Requirement: ; Return Value(s): Returns hWhnd if successful, or 0 with error set to 1 otherwise. ; User CallTip: _GUICtrlStatusBarCreateProgress($h_StatusBar, $i_Panel[, $i_pad = 2[, $v_styles = ""]]) Creates Statusbar. (required: <GuiStatusBar.au3>) ; Author(s): eltorro, RagnaroktA, ; gafrost (Gary Frost (custompcs at charter dot net)) ; Note(s): ;=============================================================================== Func _GUICtrlStatusBarCreateProgress($h_StatusBar, $i_Panel, $v_styles = "") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) Local $i_pad = 2, $a_box = _GUICtrlStatusBarGetRect($h_StatusBar, $i_Panel), $v_ret ; Shrink the rect a little to fit inside panel $a_box[0] = $a_box[0] + $i_pad; left $a_box[1] = $a_box[1] + $i_pad; top $a_box[2] = $a_box[2] - $a_box[0] - $i_pad; width $a_box[3] = $a_box[3] - $a_box[1] - $i_pad; height ; Create the progress bar with the proper size. Local $Progress1 = GUICtrlCreateProgress($a_box[0], $a_box[1], $a_box[2], $a_box[3], $v_styles) GUICtrlSetResizing($Progress1, 802) ; Change progressbars parent to statusbar If Not IsHWnd($h_StatusBar) Then $h_StatusBar = HWnd($h_StatusBar) Local $h_Progress = GUICtrlGetHandle($Progress1) $v_ret = DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $h_Progress, "hwnd", $h_StatusBar) If Not IsHWnd($v_ret[0]) Then Return SetError(-1, -1, -1) Return $Progress1 EndFunc ;==>_GUICtrlStatusBarCreateProgress SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Zedna Posted April 14, 2009 Share Posted April 14, 2009 (edited) Question:Is there way to add "new line" in _GUICtrlStatusBar_SetTipText()?I tried _GUICtrlStatusBar_SetTipText($StatusBar1, 0, 'line 1' & @CRLF & 'line 2') _GUICtrlStatusBar_SetTipText($StatusBar1, 0, 'line 1\nline 2')but no success :-(EDIT:This works fine$label1 = GUICtrlCreateLabel(...) GUICtrlSetTip($label1, 'line 1' & @CRLF & 'line 2') Edited April 14, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
rover Posted April 14, 2009 Share Posted April 14, 2009 (edited) Question: Is there way to add "new line" in _GUICtrlStatusBar_SetTipText()? I tried _GUICtrlStatusBar_SetTipText($StatusBar1, 0, 'line 1' & @CRLF & 'line 2') _GUICtrlStatusBar_SetTipText($StatusBar1, 0, 'line 1\nline 2') but no success :-( EDIT: This works fine $label1 = GUICtrlCreateLabel(...) GUICtrlSetTip($label1, 'line 1' & @CRLF & 'line 2')Zedna subclass the statusbar, get WM_NOTIFY message create NMTTDISPINFO struct get TTN_GETDISPINFO message from struct 'Code' element send _GUIToolTip_SetMaxTipWidth($hWndFrom, 100) to struct 'hWndFrom' element - tooltip handle set maxtipwidth to maximum length of tooltip and any text longer than that will wrap or use carriage return/line feed you can set a global var to the tooltip handle and change colors etc with the tooltip UDFs MSDN multiline tooltips http://msdn.microsoft.com/en-us/library/bb...ample_multiline Edit: I should add you could subclass initially until first tooltip is triggered, set maxwidth, then return to original wndproc, unless you need a subclassed statusbar for embedded buttons etc. perhaps there is a better way to get the damn statusbar tooltip handle Edit 2: example script expandcollapse popup#include <GUIConstantsEX.au3> #include <Constants.au3> #include <WindowsConstants.au3> #include <GuiStatusBar.au3> #include <GuiToolTip.au3> Global $hStatusBarTooltip, $fFlag = True Global $aParts[3] = [60, 120] $hGUI = GUICreate("StatusBar Embed Control", 200, 150, -1, -1, -1, $WS_EX_TOPMOST) $hStatus = _GUICtrlStatusBar_Create ($hGUI, -1, "", $SBARS_TOOLTIPS) _GUICtrlStatusBar_SetParts($hStatus, $aParts) _GUICtrlStatusBar_SetText($hStatus, 'line 1 line 2', 0) _GUICtrlStatusBar_SetText($hStatus, 'line 1 line 2', 1) _GUICtrlStatusBar_SetText($hStatus, 'line 1 line 2', 2) _GUICtrlStatusBar_SetTipText($hStatus, 0, 'line 1' & @CRLF & 'line 2') _GUICtrlStatusBar_SetTipText($hStatus, 1, 'line 1' & @CRLF & 'line 2') _GUICtrlStatusBar_SetTipText($hStatus, 2, 'line 1' & @CRLF & 'line 2') ; subclass StatusBar $wProcNew = DllCallbackRegister("_StatusBarWndProc", "int", "hwnd;uint;wparam;lparam") $wProcOld = _WinAPI_SetWindowLong($hStatus, $GWL_WNDPROC, DllCallbackGetPtr($wProcNew)) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func OnAutoItExit() _WinAPI_SetWindowLong($hStatus, $GWL_WNDPROC, $wProcOld) DllCallbackFree($wProcNew) GUIDelete($hGUI) EndFunc ;==>OnAutoItExit Func _StatusBarWndProc($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $wParam, $lParam Switch $Msg Case $WM_NOTIFY Local $tNMHDR, $tInfo, $hWndFrom, $iIDFrom, $iCode $tInfo = DllStructCreate($tagNMHDR, $lParam) ;$tInfo = DllStructCreate($tagNMTTDISPINFO, $lParam) ;if tooltip params not needed use tagNMHDR $iCode = DllStructGetData($tInfo, "Code") ;$iIDFrom = DllStructGetData($tInfo, "IDFrom") $hWndFrom = DllStructGetData($tInfo, "hWndFrom") Switch $iCode Case $TTN_GETDISPINFO, $TTN_GETDISPINFOW ;Sent to retrieve information needed to display a ToolTip ;one time only, get handle and set maxwiidth If $fFlag Then $fFlag = False _GUIToolTip_SetMaxTipWidth($hWndFrom, 100) $hStatusBarTooltip = $hWndFrom EndIf ;set part tooltip colours Local $aTool = _GUIToolTip_GetCurrentTool($hWndFrom) Switch $aTool[2] Case 0 _GUIToolTip_SetTipBkColor($hWndFrom, 0xffffff) Case 1 _GUIToolTip_SetTipBkColor($hWndFrom, 0x00ffff) Case 2 _GUIToolTip_SetTipBkColor($hWndFrom, 0x00ff00) EndSwitch Case $TTN_SHOW ; Notifies the owner window that a ToolTip control is about to be displayed Case $TTN_POP ; Notifies the owner window that a ToolTip is about to be hidden EndSwitch EndSwitch ; pass the unhandled messages to default WndProc Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $Msg, $wParam, $lParam) EndFunc Edited April 14, 2009 by rover I see fascists... Link to comment Share on other sites More sharing options...
Zedna Posted April 14, 2009 Share Posted April 14, 2009 Thanks for info/example rover! It's nice example but I hoped for some easier trick :-) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now