Bug 209022 - DateTime cannot be shown without a border
Summary: DateTime cannot be shown without a border
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows 2000
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 223426 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-07 08:51 EST by Bjoern Sundin CLA
Modified: 2021-11-12 11:30 EST (History)
5 users (show)

See Also:


Attachments
Snippet demonstrating the use of a DateTime widget as CellEditor in a Table within a TableViewer (9.83 KB, text/x-java)
2007-11-07 08:51 EST, Bjoern Sundin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bjoern Sundin CLA 2007-11-07 08:51:27 EST
Created attachment 82327 [details]
Snippet demonstrating the use of a DateTime widget as CellEditor in a Table within a TableViewer

While using the DateTime widget as CellEditor Control of a
cell in a TableViewer I have noticed the following:

1) Cannot show the DateTime without border. Other CellEditors show in a
"flat" way, the DateTime not. I haven't found any way of influencing the STW
style in order to remove the border.

2) The lower part of the DateTime text is below the cell and thus partly not
visible (this would probably be handled if the border wasn't there or if one
could set the vertical text alignment to top)

Also see attached snipped to reproduce

Version: 3.3.0
Build id: I20070621-1340
Comment 1 Grant Gayed CLA 2007-11-07 10:11:25 EST
Car to see if this is natively supported or not.
Comment 2 Carolyn MacLeod CLA 2007-11-07 13:28:37 EST
I can do this natively on WIndws by adding the following code to 
createHandle() after the handle is created:

	if ((style & SWT.BORDER) == 0) {
		int bits = OS.GetWindowLong (handle, OS.GWL_EXSTYLE);
		bits &= ~(OS.WS_EX_CLIENTEDGE | OS.WS_EX_STATICEDGE);
		OS.SetWindowLong (handle, OS.GWL_EXSTYLE, bits);
	}


I am not sure if the check should be:
	if ((style & SWT.BORDER) == 0) {
or:
	if ((style & SWT.FLAT) != 0) {

Grant, do you know which it should be?
Comment 3 Grant Gayed CLA 2007-11-07 13:46:06 EST
I think it should be "if ((style & SWT.BORDER) == 0)".  This would make it match the DateTime on gtk (no border unless style SWT.BORDER specified) and would also match Spinner on win32 (which is of a very similar nature).
Comment 4 Carolyn MacLeod CLA 2007-11-07 14:16:50 EST
Thanks, Grant - I think that's the correct way.
Also, I've just noticed that the javadoc for SWT.FLAT says it's only used for buttons and toolbars.

Fixed > 20071107.
Comment 5 Josh Knauer CLA 2008-03-07 03:48:46 EST
This still seems to be a problem on Vista with 3.4 M5.
Comment 6 Grant Gayed CLA 2008-03-26 09:51:19 EDT
*** Bug 223426 has been marked as a duplicate of this bug. ***
Comment 7 Carolyn MacLeod CLA 2008-03-26 11:31:28 EDT
Reopening so that the Vista bug does not get lost.
Comment 8 Philipe Mulet CLA 2008-05-23 04:29:27 EDT
Please adjust the target milestone, so it does not point at a closed milestone in the past.
Comment 9 Eclipse Webmaster CLA 2019-09-06 16:04:31 EDT
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.