Jump to content

Calendar title color is not correct on many colors


Recommended Posts

Hello, everyone. I have been racking my brain on this problem. I have a calendar inserted into one of my programs. I have created a color picker to change the title bar color and it works to an extent. It seems about half the colors I try do not show up as the correct color. I have created a little example below that shows a non-working example after 3 seconds and then after another 3 seconds, it shows a working example. The square on the right always produces the correct color, so I'm including it to help illustrate.

Does anyone know if this is a known bug with the _GUICtrlMonthCal_SetColor function? If you have any suggestions, they would be appreciated.

Thanks!

#include <GuiMonthCal.au3>
#include <GUIConstants.au3>

$Form = GUICreate("Form3", 347, 207, 297, 132)

$Label1 = GUICtrlCreateLabel("", 240, 32, 76, 81)
GUICtrlSetBkColor($Label1, 0x800000)
$MonthCal1 = GUICtrlCreateMonthCal("2012/11/06", 16, 8, 191, 154)
GUISetState(@SW_SHOW)
Sleep (3000)

; 3 seconds later, change calendar title to a maroon color - but it is not maroon
_GUICtrlMonthCal_SetColor ($MonthCal1, $MCSC_TITLEBK, 0x800000)

; 3 more seconds, change both to pink - this time it works
Sleep(3000)
GUICtrlSetBkColor($Label1, 0xFF00FF)
_GUICtrlMonthCal_SetColor ($MonthCal1, $MCSC_TITLEBK, 0xFF00FF)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd
Link to comment
Share on other sites

  • Moderators

abberration,

As the second colour (which works) is palindromic I would suggest that the function requires colours in BGR and not RGB format. So try with 0x000080 and see if that works. ;)

M23

Edit: 13k! Unlucky for some perhaps. ;D

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

abberration,

As the second colour (which works) is palindromic I would suggest that the function requires colours in BGR and not RGB format. So try with 0x000080 and see if that works. ;)

M23

Edit: 13k! Unlucky for some perhaps. ;D

What you said makes a lot of sense now. I just notices that the colors that are off are opposites of each other. Yellow is light blue and light blue is yellow. Red is dark blue and dark blue is red.

Thanks M23! I'm off to write a function to re-order the RGB values.

Link to comment
Share on other sites

  • Moderators

abberation,

No need to reinvent the wheel - take a look here. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

abberration,

My pleasure. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...