Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362815

Summary: DateTime should support a style without spinner buttons
Product: [Eclipse Project] Platform Reporter: TL <tl.issues>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: carolynmacleod4, eclipse.felipe
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description TL CLA 2011-11-03 12:02:11 EDT
Build Identifier: 3.7.0.v3735b

Currently when using the DateTime widget with style SWT.TIME it displays the up/down spinner buttons. For UIs with restricted space and for a consistent look and feel with other textual input widgets, a style should be supported that creates no up/down buttons. This could even be interesting for SWT.DATE style to not create the dropdown button.

Reproducible: Always
Comment 1 Felipe Heidrich CLA 2011-11-03 13:49:52 EDT
I suspect we are using native controls, with the look provided by the OS. I don't think we can change that.

maybe what you need a custom date time control.
Comment 2 Carolyn MacLeod CLA 2011-11-03 15:02:07 EDT
On Windows, the native DateTime (DATETIMEPICK_CLASS) always has up/down arrows or a drop-down button, as specified by the DTS_UPDOWN style bit. I am not sure how difficult it would be to reach into the native control to remove these.

On Mac, the native DateTime (NSDatePicker) can have the up/down buttons removed by NSDatePicker.setDatePickerStyle: NSTextFieldDatePickerStyle.

On Linux, there is no native GTK DateTime, so we emulate it.

Given that this might require some hacking to get it going on Windows, we are unlikely to implement this any time soon. Please feel free to try your hand at hacking the Windows, Cocoa, and Gtk (java) code, and providing a patch. I would be happy to make the time to review a multi-platform patch, but I will not have time to do the implementation.

Do you know of any applications that use this?

If you are only developing for Linux, perhaps this "GtkxEntryMask" (with type ENTRYMASK_DATETIME) might help you: http://gtkwidgexts.sourceforge.net/docs/tutorial.html.
Comment 3 Carolyn MacLeod CLA 2011-11-03 15:07:15 EDT
Also, I have not looked at these, but there are some custom SWT controls that you may find useful:
http://www.eclipse.org/nebula/  (DateTimeFormatter looks like what you might want)
or http://sourceforge.net/projects/swt-datepicker/
Good luck.
Comment 4 TL CLA 2011-11-04 11:53:38 EDT
Thanks to both of you for the helpful comments. I only looked into the gtk code when posting this request and I assumed it would be handled the same way on different OSs - wrong assumption.

The nebula widgets look quite promising for my purposes.

So concerning my wishes, this request could be closed.

Sorry for the inconvenience.
Comment 5 Carolyn MacLeod CLA 2011-11-04 12:01:57 EDT
No worries! Thanks - I'll close it.