Shell.computeTrim() [message #446889] |
Sun, 05 December 2004 22:35 |
James Cooper Messages: 4 Registered: July 2009 |
Junior Member |
|
|
Hi,
I want to create a Shell that has a specified client width and height, so
I do the following:
Rectangle trim = shell.computeTrim(0, 0, ClientWidth, ClientHeight);
shell.setBounds(ClientLeft, ClientTop, trim.width, trim.height);
This works fine if the shell has no menubar, but comes up short if it does.
This isn't much of a problem except that Decorations.computeTrim seems to
take into account the size of the menubar if it's present (Windows
version).
So really what I need to know is does SWT consider the menubar to be part
of the client area and if so, how can I find out the height of the menubar?
(If it helps the app I'm working on dynamically creates an SWT GUI by
parsing Visual Basic .frm files. I also feel that dynamically creating SWT
menus will be a pain but that's a matter for another day!)
Thanks in advance,
James.
|
|
|
Re: Shell.computeTrim() [message #446936 is a reply to message #446889] |
Mon, 06 December 2004 17:37 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
The menu bar is part of the trim. If there is a bug on a non-Windows
platform, please enter a bug report.
"James Cooper" <cooperjames_at@at_eircom.dot.net> wrote in message
news:cp02f1$ijt$1@www.eclipse.org...
> Hi,
>
> I want to create a Shell that has a specified client width and height, so
> I do the following:
>
> Rectangle trim = shell.computeTrim(0, 0, ClientWidth, ClientHeight);
> shell.setBounds(ClientLeft, ClientTop, trim.width, trim.height);
>
> This works fine if the shell has no menubar, but comes up short if it
does.
> This isn't much of a problem except that Decorations.computeTrim seems to
> take into account the size of the menubar if it's present (Windows
> version).
>
> So really what I need to know is does SWT consider the menubar to be part
> of the client area and if so, how can I find out the height of the
menubar?
>
> (If it helps the app I'm working on dynamically creates an SWT GUI by
> parsing Visual Basic .frm files. I also feel that dynamically creating SWT
> menus will be a pain but that's a matter for another day!)
>
> Thanks in advance,
>
> James.
>
|
|
|
Powered by
FUDForum. Page generated in 0.01805 seconds