开发者

SWT DateTime control used as table editor doesn't extend past bottom of table

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 ex开发者_开发百科tend 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!


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);


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜