Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Automatically adjusting labels depending on system dpi
Automatically adjusting labels depending on system dpi [message #461094] Thu, 15 September 2005 22:42 Go to next message
Chris is currently offline ChrisFriend
Messages: 97
Registered: July 2009
Member
Hi,

I have a SWT application which runs perfectly when the OS uses fonts
with 96 dpi, but when I set the fonts to 120 dpi, the labels are displayed
with missing text and some textfields are shifted or overlap other
widgets. For the majority of my widgets, I use the FormLayout. Is there
any way to automatically (and nicely) adjust the labels and textfields so
that everything displays correctly.

I saw in some other post (about a different topic) that someone was
measuring the text size (using the font metrics) and setting the label's
with accordingly. Is this the right way? Does anybody have some code
snippet to share?

Thank you in advance,
Regards,
Chris
Re: Automatically adjusting labels depending on system dpi [message #461585 is a reply to message #461094] Mon, 26 September 2005 22:38 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Can you post a very small example that shows the problem? Thanks.

"Chris" <clarose_germany@yahoo.ca> wrote in message
news:a0c0734277e06c4f85be3e906ec8a470$1@www.eclipse.org...
> Hi,
>
> I have a SWT application which runs perfectly when the OS uses fonts
> with 96 dpi, but when I set the fonts to 120 dpi, the labels are displayed
> with missing text and some textfields are shifted or overlap other
> widgets. For the majority of my widgets, I use the FormLayout. Is there
> any way to automatically (and nicely) adjust the labels and textfields so
> that everything displays correctly.
>
> I saw in some other post (about a different topic) that someone was
> measuring the text size (using the font metrics) and setting the label's
> with accordingly. Is this the right way? Does anybody have some code
> snippet to share?
>
> Thank you in advance,
> Regards,
> Chris
>
>
Previous Topic:Tree SWT.FULL_SELECTION
Next Topic:TabFolder with TabItems with own Popup Menu ?
Goto Forum:
  


Current Time: Thu Apr 25 08:26:19 GMT 2024

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

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

Back to the top