Modify

Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#505 closed Bug (Works For Me)

_GUICtrlStatusBar_SetBkColor doesn't work

Reported by: gcriaco <gcriaco@…> Owned by:
Milestone: Component: AutoIt
Version: 3.2.13.7 Severity: None
Keywords: Cc:

Description

The function returns the background color, but the statusbar color doesn't change.

Example:

; Set background color
msgbox(0,"Test", _GUICtrlStatusBar_SetBkColor ($hStatus, $CLR_RED))

Attachments (1)

Example.zip (65.1 KB) - added by gcriaco <gcriaco@…> 16 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 16 years ago by TicketCleanup

  • Milestone 3.2.13.8 deleted

Automatic ticket cleanup.

comment:2 Changed 16 years ago by Gary

  • Resolution set to Works For Me
  • Status changed from new to closed

Changed 16 years ago by gcriaco <gcriaco@…>

comment:3 in reply to: ↑ description Changed 16 years ago by gcriaco <gcriaco@…>

Replying to gcriaco <gcriaco@gmail.com>:

The function returns the background color, but the statusbar color doesn't change.

Example:

; Set background color
msgbox(0,"Test", _GUICtrlStatusBar_SetBkColor ($hStatus, $CLR_RED))

Here's the complete code:
#include <GuiConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WinAPI.au3>
#include <Constants.au3>

Opt('MustDeclareVars', 1)

$Debug_SB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()

Local $hGUI, $hStatus
Local $aParts[3] = [75, 150, -1]


; Create GUI
$hGUI = GUICreate("(Example 1) StatusBar Set BkColor", 400, 300)
$hStatus = _GUICtrlStatusBar_Create ($hGUI)
GUISetState()

; Set parts
_GUICtrlStatusBar_SetParts ($hStatus, $aParts)
_GUICtrlStatusBar_SetText ($hStatus, "Part 1")
_GUICtrlStatusBar_SetText ($hStatus, "Part 2", 1)

; Set background color
msgbox(0,"Test", _GUICtrlStatusBar_SetBkColor ($hStatus, $CLR_RED))

; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()

EndFunc ;==>_Main

The same thing happens on both beta (latest) and prod autoit version.
My p.c. is a WinXP SP3 machine
the attachement shows my gui.

comment:4 Changed 16 years ago by Gary

Either turn off themes on system or in the script

for example:

#include <GuiConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WinAPI.au3>
#include <Constants.au3>

Opt('MustDeclareVars', 1)

$Debug_SB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()

    Local $hGUI, $hStatus
    Local $aParts[3] = [75, 150, -1]

	_XPThemeLevel(1)
    ; Create GUI
    $hGUI = GUICreate("(Example 1) StatusBar Set BkColor", 400, 300)
    $hStatus = _GUICtrlStatusBar_Create ($hGUI)
    GUISetState()

    ; Set parts
    _GUICtrlStatusBar_SetParts ($hStatus, $aParts)
    _GUICtrlStatusBar_SetText ($hStatus, "Part 1")
    _GUICtrlStatusBar_SetText ($hStatus, "Part 2", 1)

    ; Set background color
    msgbox(0,"Test", _GUICtrlStatusBar_SetBkColor ($hStatus, $CLR_RED))

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()

EndFunc ;==>_Main 

; Functionality :
; just info about possibility to turn off theme-using in scripts/compiled-exe with using GUI stuff
; This info was produced by Holger
Func _XPThemeLevel($nFlag = 0)
    ; $nFlag = 0  ; Visual styles are completely disabled in the running script
    ; $nFlag = 1; Nonclient areas of the GUI can use visual styles
    ; $nFlag = 2; Controls can use visual styles (like Buttons, Progressbar, Group-ctrl's, etc.)
    ; $nFlag = 4; Web content displayed ??? (info from MSDN) can use visual styles
    ;
    ; These flags can be combined with BitOr(...)

    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $nFlag)
EndFunc   ;==>_XPThemeLevel

comment:5 in reply to: ↑ description Changed 16 years ago by anonymous

Replying to gcriaco <gcriaco@gmail.com>:

The function returns the background color, but the statusbar color doesn't change.

Example:

; Set background color
msgbox(0,"Test", _GUICtrlStatusBar_SetBkColor ($hStatus, $CLR_RED))

You're right as alweays.

Many thanks
Peppe

comment:6 Changed 15 years ago by partypooper@…

Can we have a footnote in the Helpfile about turning off XP themes in order to get this to work as I was about to open another ticket until I did saw this.

BTW, what about Vista/2000/Win7 etc., - are they effected as well?

comment:7 Changed 13 years ago by anonymous

Two years later and the damn thing caught me out again, this time using Windows 7 instead of WinXP. Still believe a note in the help file would be of benefit.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.