Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Shell.computeTrim()
Shell.computeTrim() [message #446889] Sun, 05 December 2004 22:35 Go to next message
James Cooper is currently offline James CooperFriend
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 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
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.
>
Previous Topic:focus lost after closing msg dialog
Next Topic:No Display.getCurrent() when opening Swing Component
Goto Forum:
  


Current Time: Thu Apr 18 23:53:38 GMT 2024

Powered by FUDForum. Page generated in 0.01805 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top