abberration Posted November 6, 2012 Share Posted November 6, 2012 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 Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 6, 2012 Moderators Share Posted November 6, 2012 (edited) 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. M23Edit: 13k! Unlucky for some perhaps. ;D Edited November 6, 2012 by Melba23 abberration 1 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
abberration Posted November 6, 2012 Author Share Posted November 6, 2012 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. M23Edit: 13k! Unlucky for some perhaps. ;DWhat 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. Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 6, 2012 Moderators Share Posted November 6, 2012 abberation, No need to reinvent the wheel - take a look here. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
abberration Posted November 6, 2012 Author Share Posted November 6, 2012 abberation, No need to reinvent the wheel - take a look here. M23 Ah, that is very cool. I had written a StringSplit statement and pieced it back together and it was not working. However, your BitShift version works perfectly. Thanks again, M23! Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 6, 2012 Moderators Share Posted November 6, 2012 abberration, My pleasure. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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