views:

57

answers:

2

I'm having trouble with the SWT DateTime widget.

I use DateTime, CCombo, and Text boxes as cell editors. CCombo and DateTime may be (and actually, almost always are) taller than the table itself and should extend past the bottom of the table to allow the user to choose any of the entries.

CCombo is doing this fine. If there's a single row in the table and the CCombo represents a dropdown of, say, five entries, the dropdown menu drops below the table to allow the user to choose:

+----------------------------------------------------+
| Table                                              |
+-------------------------------+================+---+
| Item 1       Item 2           | Item 3a      v |   |
| Item 4       Item 5           | Item 3b        |   |
+-------------------------------| Item 3c        |---+
                                | Item 3d        |
                                | Item 3e        |
                                +================+

DateTime is not. It's getting cut off and any part of the widget that appears below the table boundary is not shown.

+----------------------------------------------------+
| Table                                              |
+-------------------------------+================+---+
| Item 1       Item 2           | <  May 2008  > |   |
| Item 4       Item 5           | S M T W T F S  |   |
+-------------------------------+================+---+
                                 (there should be
                                     more here!) 

Anyone have any idea what I might be doing wrong? I've tweaked editor.minimumWidth and editor.minimumHeight for the TableEditor, but these seem to affect only the DateTime component's height and weight, and not its relationship with its parent component, the table.

Haven't found anything online, so I'm assuming that I'm stupidly forgetting to do something extremely critical.

I can include (stripped-down) code if need be, just request what you need below.

Thanks all!

+1  A: 

which style did you assign to the widget? i used SWT.DROP_DOWN and it worked for me

calendar = new DateTime(parent, SWT.DROP_DOWN);

Mughi
That's basically what I need, though it's Win32 only for now. http://dev.eclipse.org/newslists/news.eclipse.platform.swt/msg44876.html
Tenner
A: 

You could put the SWT,CALENDAR version of the DateTime widget in a dialog.

You would then bring up the dialog with a button that has a calendar image. The button would follow the SWT.DATE version of the DateTime widget in your form.

Here's the calendar image I used for my buttons.

You would have to synchronize the underlying Calendar models in the two widgets.

Gilbert Le Blanc