Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Display problem on increasing font size
Display problem on increasing font size [message #506092] Wed, 06 January 2010 00:02 Go to next message
Biju  is currently offline Biju
Messages: 4
Registered: January 2010
Junior Member
Hi,

For the view, when i increase the OS font size on Windows Vista some parts of the view are cut. I have a group and labels in it. I have given grabExcessHorizhontal as true for the group and horizontalAlignment as GridData.FILL for the labels. If I set configurer.setInitialSize(new Point(400, 300)); in preWindowOpen() method, when I change font size then also the window size will remain same and some labels are not visible.

Is there any way to set the initial window size to fit all componets and adjust automatically with OS property changes?

Thanks,
Biju
Re: Display problem on increasing font size [message #506264 is a reply to message #506092] Wed, 06 January 2010 12:38 Go to previous messageGo to next message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
Registered: July 2009
Senior Member
Hi Biju,

If you're using layouts for all of your widget layout then your controls
should all open to sizes that are appropriate given the current font. To be
notified of subsequent changes in the OS font or colour you can add a
SWT.Settings listener to the Display, as shown in
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet235.java?view=co .
When you receive this event you can resize your controls accordingly (eg.-
if you're using layouts everywhere then call layout() on a parent
Composite).

HTH,
Grant


"Biju" <biju.t@tcs.com> wrote in message
news:hi15hv$h3p$1@build.eclipse.org...
> Hi,
>
> For the view, when i increase the OS font size on Windows Vista some parts
of the view are cut. I have a group and labels in it. I have given
grabExcessHorizhontal as true for the group and horizontalAlignment as
GridData.FILL for the labels. If I set configurer.setInitialSize(new
Point(400, 300)); in preWindowOpen() method, when I change font size then
also the window size will remain same and some labels are not visible.
>
> Is there any way to set the initial window size to fit all componets and
adjust automatically with OS property changes?
>
> Thanks,
> Biju
Re: Display problem on increasing font size [message #506337 is a reply to message #506264] Wed, 06 January 2010 18:59 Go to previous messageGo to next message
Biju  is currently offline Biju
Messages: 4
Registered: January 2010
Junior Member
Thanks for the replay Grant.

But im setting the initial window size in preWindowOpenMethod() as configurer.setInitialSize(new Point(335, 300)); So its always opening the window in that size even if I increased the font and some controls are cut.
The controls are visible if I expand the window.
I want the outer window to be of just enough size in all case to fit all controls. I tried setting shell.setMinimumSize(335, 300);. But in that case the window is expaning too large on increasing font.

Or can i override the os properties in code. (I'm changing the dpi to 144)

[Updated on: Thu, 07 January 2010 00:29]

Report message to a moderator

Re: Display problem on increasing font size [message #507226 is a reply to message #506337] Tue, 12 January 2010 09:51 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
Registered: July 2009
Senior Member
If you want to allocate just enough space to fit your controls then
specifying a hardcoded size anywhere is probably not a good thing to do. I
don't know what "configurer" is in your description, but is there any way
that you can just not call setInitialSize()? Or, if you must call this, you
can ask one of your Controls (like your top-most Composite) for its
preferred size with Control.computeSize(SWT.DEFAULT, SWT.DEFAULT), and then
pass this result to setInitialSize(). A Control's preferred size will take
the current font size into account.

HTH,
Grant


"Biju" <biju.t@tcs.com> wrote in message
news:hi3pq1$12g$1@build.eclipse.org...
> Thanks for the replay Grant.
>
> But im setting the initial window size in preWindowOpenMethod() as
configurer.setInitialSize(new Point(335, 300)); So its always opening the
window in that size even if I increased the font and some controls are cut.
> The controls are visible if I expand the window.
> I want the outer window to be of just enough size in all case to fit all
controls. I tried setting shell.setMinimumSize(335, 300);. But in that case
the window is expaning too large on increasing font. Can u please guide me
on the issue?
Previous Topic:Complex preference page tutorial
Next Topic:How to keep view open when changing perspective?
Goto Forum:
  


Current Time: Wed Jul 23 04:01:55 EDT 2014

Powered by FUDForum. Page generated in 0.08049 seconds