Bug 222010 - [DateTime] Unable to change background and foreground colors
Summary: [DateTime] Unable to change background and foreground colors
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-10 04:33 EDT by Michael Seele CLA
Modified: 2021-11-26 10:57 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Seele CLA 2008-03-10 04:33:09 EDT
The setBackground method is not being overridden and thus the widget background is not being changed. Having the ability to set the background would be particularly useful.
Comment 1 Grant Gayed CLA 2008-03-26 15:56:56 EDT
foreground colour too
Comment 2 Elias Volanakis CLA 2009-04-07 00:45:35 EDT
+1 

Would consume this as well.

Comment 3 Elias Volanakis CLA 2010-07-09 18:20:41 EDT
Would be great for 3.7
Comment 4 Juerg Hirt CLA 2012-03-29 01:58:57 EDT
Would appreciate this too. The widget looks strange between other widgets with coloured background. What's the reason.
Comment 5 Carolyn MacLeod CLA 2012-03-29 07:37:41 EDT
Which one are you using - the textual "DATE" (and "TIME") control, or the "CALENDAR" control?
Comment 6 Juerg Hirt CLA 2012-03-29 07:49:58 EDT
With Eclipse Indigo Relase  (Build id: 20110615-0604) building RCP-Applications.
Textual Date
DateTime datePicker = new DateTime(area, SWT.BORDER | SWT.DATE | SWT.DROP_DOWN);
Comment 7 Carolyn MacLeod CLA 2012-03-29 10:26:49 EDT
Interesting - you have the drop-down calendar. Would you expect the drop-down calendar to have a changed background also? I am asking because, if I recall correctly, the Windows calendar control has a bunch of different ways to change the color, and we looked at them and couldn't decide which way to go.
Ah, yes - here's the link to the doc for DATETIMEPICK DTM_SETMCCOLOR http://msdn.microsoft.com/en-us/library/bb761773(VS.85).aspx (same info as for MONTHCAL MCM_SETCOLOR http://msdn.microsoft.com/en-us/library/bb760997(VS.85).aspx). Notice that there are 3 different background colors and 3 different foreground colors. We tried various combinations for the calendar, and thought they all looked "funny".

I can look into why DATETIMEPICK color setting isn't working correctly.
My guess is that I just need to override setForegroundPixel and setBackgroundPixel in a similar manner to Combo and invalidate the hwndText, which can be retrieved using DTM_GETDATETIMEPICKERINFO http://msdn.microsoft.com/en-us/library/bb761755(VS.85).aspx .

I don't have time to do this for the rest of this week, but I will have a look at it on Tuesday.
Comment 8 Lars Vogel CLA 2019-11-14 03:31:52 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.
Comment 9 Michael Seele CLA 2019-11-14 03:36:31 EST
It's still relevant
Comment 10 Kai-Uwe Duske CLA 2021-10-28 11:28:11 EDT
+1
I miss this feature too.
Comment 11 Randall Becker CLA 2021-11-26 10:57:08 EST
This is important when you are doing date validation, as in turn red if you go beyond some critical date.