Home » Eclipse Projects » Remote Application Platform (RAP) » Margin height incorrect sizing
Margin height incorrect sizing [message #126646] |
Tue, 31 March 2009 15:27  |
Eclipse User |
|
|
|
Originally posted by: peterka.jiri.gmail.com
Hi,
I noticed some incorrect sizing of RWT widgets. Specificaly there is a
gap above a Group and buttons even marginHeight is set to 0. You can
reproduce it with this fragment of code:
public int createUI() {
Display display = new Display ();
Shell shell = new Shell (display,SWT.NO_TRIM);
shell.setMaximized(true);
Group group = new Group(shell, SWT.NONE);
GridLayout gridLayout = new GridLayout (3, false);
gridLayout.marginWidth = 0;
gridLayout.marginHeight = 0;
gridLayout.horizontalSpacing = 0;
gridLayout.verticalSpacing = 0;
FillLayout fill = new FillLayout(SWT.FILL);
fill.marginHeight = 0;
fill.marginWidth = 0;
shell.setLayout (new FillLayout(SWT.FILL));
group.setLayout(gridLayout);
Button button0 = new Button (group, SWT.PUSH);
button0.setText ("button0");
GridData data = new GridData (SWT.BEGINNING, SWT.BEGINNING, false,
false, 1, 1);
button0.setLayoutData (data);
Button button1 = new Button (group, SWT.PUSH);
button1.setText ("button1");
data = new GridData (SWT.BEGINNING, SWT.BEGINNING, false, false, 1, 1);
button1.setLayoutData (data);
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ())
display.sleep ();
}
return 0;
}
Questions:
* Is it a bug?
* Is there any workaround how to avoid this?
Best regards
Jiri
|
|
| | |
Re: Margin height incorrect sizing [message #127006 is a reply to message #126993] |
Fri, 03 April 2009 03:32   |
Eclipse User |
|
|
|
Hi Jiri,
I'm using RAP from CVS HEAD. At least on Windows the SWT and RAP behave
the same. This space is used by Group text I suppose.
Best,
Ivan
Jiri Peterka wrote:
> Hi Ivan,
>
> Good to hear it's all right on your side, but my experience is
> different (see attached image):
>
> * SWT - there is no space between Group frame and the top of the button
> * RWT - there is 5px space regardless marginHeight is 0,3 or 5
>
> It's not a major problem but some limitation for precise positioning
>
> Tested on RAP 1.1.2 SR2, Firefox 3.0.7, Ubuntu 64bit
>
> Which version of RAP did you use?
>
> Jiri
>
>
> Ivan Furnadjiev wrote:
>> Hi Jiri,
>>
>> I've tested your snippet in SWT and RAP behave exactly the same as SWT.
>>
>> Best,
>> Ivan
>>
>
>
> ------------------------------------------------------------ ------------
>
|
|
| |
Re: Margin height incorrect sizing [message #128549 is a reply to message #127296] |
Sun, 19 April 2009 18:13   |
Eclipse User |
|
|
|
Originally posted by: peterka.jiri.gmail.com
Hi Ralf,
thanks for solution, custom theme should do that. Composite with border
works as well, nevertheless it has not the same style of frame as a
Group widget.
I know the way how to use CSS themes in full RAP application, but I
don't know how to do it in a pure RWT application (without platform,
extensions, bundles,...). How can I use CSS in such a application type?
Jiri
Ralf Sternberg wrote:
> Hi Jiri,
>
>> (see attached image):
>>
>> * SWT - there is no space between Group frame and the top of the button
>> * RWT - there is 5px space regardless marginHeight is 0,3 or 5
>
> Indeed, the Group box in RWT has some space above and below the upper
> line even when there is no text. You can configure this space in a
> custom theme. In SWT, this space is only there when a text is set. If
> this difference is a problem for you, please file a bug.
>
> If you use Group boxes without text often, you might also consider using
> simple Composites with a border instead.
>
> Best regards, Ralf
|
|
|
Re: Margin height incorrect sizing [message #128640 is a reply to message #128549] |
Mon, 20 April 2009 05:06  |
Eclipse User |
|
|
|
Jiri Peterka wrote:
> Hi Ralf,
>
> thanks for solution, custom theme should do that. Composite with border
> works as well, nevertheless it has not the same style of frame as a
> Group widget.
>
> I know the way how to use CSS themes in full RAP application, but I
> don't know how to do it in a pure RWT application (without platform,
> extensions, bundles,...). How can I use CSS in such a application type?
Please ssee this post:
http://dev.eclipse.org/newslists/news.eclipse.technology.rap /msg06094.html
>
> Jiri
>
>
> Ralf Sternberg wrote:
>> Hi Jiri,
>>
>>> (see attached image):
>>>
>>> * SWT - there is no space between Group frame and the top of the button
>>> * RWT - there is 5px space regardless marginHeight is 0,3 or 5
>>
>> Indeed, the Group box in RWT has some space above and below the upper
>> line even when there is no text. You can configure this space in a
>> custom theme. In SWT, this space is only there when a text is set. If
>> this difference is a problem for you, please file a bug.
>>
>> If you use Group boxes without text often, you might also consider using
>> simple Composites with a border instead.
>>
>> Best regards, Ralf
|
|
|
Goto Forum:
Current Time: Thu May 08 04:16:53 EDT 2025
Powered by FUDForum. Page generated in 0.03886 seconds
|