 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
SamFelis Guest
|
Posted: Fri Oct 28, 2005 8:58 pm Post subject: Issues w/ High Resolution/Non-Standard Font (>96 DPI) in dyn |
|
|
I've got a Delphi 7 application containing forms that resize themself based
on whether the user wants to see all the fields or just the required
fields. I also have a catch-all form that is resized on FormCreate
depending how it's going to be used.
In development, I use the standard 96 DPI font setting and a resolution of
1280x1024. This works fine during runtime.
I ran into an issue where if the DPI setting is NOT 96, the font size is
skewed and some of the controls aren't where they should be when I resize
the forms. I got around this by getting the DPI setting and multiplying
the "standard" value by the ratio and the controls appear in the
appropriate places (e.g., btnOK.Top := 350 * grFontSize [where grFontSize
is the ratio]).
However, this doesn't work on monitors with wide screen resolutions (such
as 1400x1050). When this occurs, the dynamic controls are higher on the
form than where they should be and are typically under (or over) other
controls.
Without doing a lot of "btnOK.Top := memDesc.Top + memDesc.Height + 32"
type hard coding to take this into consideration, is there something I
could do within Delphi that would automagically set the controls so they
appear properly?
|
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Sat Oct 29, 2005 12:09 pm Post subject: Re: Issues w/ High Resolution/Non-Standard Font (>96 DPI) in |
|
|
In article <Xns96FDACCFFECBFshadowsomewherecom (AT) 207 (DOT) 105.83.66>, SamFelis wrote:
| Quote: | I've got a Delphi 7 application containing forms that resize themself based
on whether the user wants to see all the fields or just the required
fields. I also have a catch-all form that is resized on FormCreate
depending how it's going to be used.
In development, I use the standard 96 DPI font setting and a resolution of
1280x1024. This works fine during runtime.
|
I hate people with 20/20 vision <g>, they always forget that not everybody is so
fortunate when they design applications. Applications hardwired to use 8pt fonts
would be completely unusable for me on your system, for example.
| Quote: | I ran into an issue where if the DPI setting is NOT 96, the font size is
skewed and some of the controls aren't where they should be when I resize
the forms.
|
Have you set the Scaled property of the forms to true of false? Do you use
TrueType fonts only on your forms? Anything else does not scale properly.
| Quote: | I got around this by getting the DPI setting and multiplying
the "standard" value by the ratio and the controls appear in the
appropriate places (e.g., btnOK.Top := 350 * grFontSize [where grFontSize
is the ratio]).
However, this doesn't work on monitors with wide screen resolutions (such
as 1400x1050). When this occurs, the dynamic controls are higher on the
form than where they should be and are typically under (or over) other
controls.
|
You have to keep in mind that the height of controls is automatically adjusted
depending on the font height for several frequently used control classes (labels,
edits, combo boxes, for example). If the font does not scale properly (is not TT)
that can lead to misalignments.
| Quote: |
Without doing a lot of "btnOK.Top := memDesc.Top + memDesc.Height + 32"
type hard coding to take this into consideration, is there something I
could do within Delphi that would automagically set the controls so they
appear properly?
|
Well, theoretically setting Scaled to true, leaving a bit of buffer spacing
between your controls, and using TT fonts only should deal with resolution
changes between design and run-time environments. In praxi
it does not always work out, you have to test your form in different resolutions
to be sure, especially with these new high res-monitors configured to higher
logical resolutions than 120 dpi (the standard large font settings).
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
|
|
| Back to top |
|
 |
Francesco Savastano Guest
|
Posted: Sat Oct 29, 2005 7:08 pm Post subject: Re: Issues w/ High Resolution/Non-Standard Font (>96 DPI) in |
|
|
My suggestion: Do your Font, Form and control scaling by yourself by putting
some code in the oncreate event of your forms if you want to get nice
results on every screen. For example in my shareware program I have Scaled
property set to false on every form and I do the scaling myself and assign a
different font size depending on different resolutions. This can be worth or
not depending from the kind of software you are creating and the kind
controls you are going to use.
I smile when I see many professional applications having impossible to read
labels or very small buttons on my 1600x1400 screen resolution and I think
that here I did a better job letting my users use the program at whatever
resolution they have..
--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"SamFelis" <samfelis (AT) email (DOT) com> ha scritto nel messaggio
news:Xns96FDACCFFECBFshadowsomewherecom (AT) 207 (DOT) 105.83.66...
| Quote: |
I've got a Delphi 7 application containing forms that resize themself
based
on whether the user wants to see all the fields or just the required
fields. I also have a catch-all form that is resized on FormCreate
depending how it's going to be used.
In development, I use the standard 96 DPI font setting and a resolution of
1280x1024. This works fine during runtime.
I ran into an issue where if the DPI setting is NOT 96, the font size is
skewed and some of the controls aren't where they should be when I resize
the forms. I got around this by getting the DPI setting and multiplying
the "standard" value by the ratio and the controls appear in the
appropriate places (e.g., btnOK.Top := 350 * grFontSize [where grFontSize
is the ratio]).
However, this doesn't work on monitors with wide screen resolutions (such
as 1400x1050). When this occurs, the dynamic controls are higher on the
form than where they should be and are typically under (or over) other
controls.
Without doing a lot of "btnOK.Top := memDesc.Top + memDesc.Height + 32"
type hard coding to take this into consideration, is there something I
could do within Delphi that would automagically set the controls so they
appear properly?
|
|
|
| Back to top |
|
 |
SamFelis Guest
|
Posted: Mon Oct 31, 2005 1:23 pm Post subject: Re: Issues w/ High Resolution/Non-Standard Font (>96 DPI) in |
|
|
"Peter Below (TeamB)" <100113.1101 (AT) compuXXserve (DOT) com> wrote in
news:VA.0000c1f3.006bbed3 (AT) nomail (DOT) please:
| Quote: | Have you set the Scaled property of the forms to true of false? Do you
use TrueType fonts only on your forms? Anything else does not scale
properly.
|
Scaled is set to true on the form and I'm using Verdana (which I understand
to be a TrueType font, although it doesn't have the TT by it in the font
pick list). And everything DOES scale fine, as long as I don't define the
control coordinates at run-time. Once I do that, I have to take into
consideration the resolution and DPI settings.
| Quote: | You have to keep in mind that the height of controls is automatically
adjusted depending on the font height for several frequently used
control classes (labels, edits, combo boxes, for example). If the font
does not scale properly (is not TT) that can lead to misalignments.
Well, theoretically setting Scaled to true, leaving a bit of buffer
spacing between your controls, and using TT fonts only should deal
with resolution changes between design and run-time environments. In
praxi it does not always work out, you have to test your form in
different resolutions to be sure, especially with these new high
res-monitors configured to higher logical resolutions than 120 dpi
(the standard large font settings).
|
Yeah, in practice the use of a ratio variable to reset the location of the
controls worked EXCEPT when the screen resolution was widescreen (e.g.,
1400x1050). For widescreen resolutions, I continued to experience the
"hidden" controls.
One thing I've determined is that I've got some further testing to do,
that's for sure. Thanks for the input!
-sam
|
|
| Back to top |
|
 |
SamFelis Guest
|
Posted: Mon Oct 31, 2005 1:26 pm Post subject: Re: Issues w/ High Resolution/Non-Standard Font (>96 DPI) in |
|
|
"Francesco Savastano"
<francosavastano (AT) TakeThisOutFromAddress (DOT) virgilio.it> wrote in
news:4363c896$1 (AT) newsgroups (DOT) borland.com:
| Quote: | My suggestion: Do your Font, Form and control scaling by yourself by
putting some code in the oncreate event of your forms if you want to
get nice results on every screen.
|
This is definitly on the list of to-dos, but right now, there are other,
higher priority enhancements that I've got to take care of.
| Quote: | I smile when I see many professional applications having impossible to
read labels or very small buttons on my 1600x1400 screen resolution
and I think that here I did a better job letting my users use the
program at whatever resolution they have..
|
A good interface is of the utmost importance to me, however, if I can't
test at those high resolutions (my various monitors won't go that high),
I've got to cross my fingers and hope for the best. Maybe St. Nick will
bring me a new video card for Christmas. ;-)
|
|
| Back to top |
|
 |
SamFelis Guest
|
Posted: Mon Oct 31, 2005 2:25 pm Post subject: Re: Issues w/ High Resolution/Non-Standard Font (>96 DPI) in |
|
|
Just as a followup to the group (and to save others from the headaches I
caused myself), I fixed this (or so it would seem based on my testing thus
far) by simply setting the form font to what I want.
Once I set the form's Font to Verdana and Scaled to True, it didn't matter
what the resolution was, the buttons would show up where they were supposed
to with no additional computations.
Live and learn, I guess.
|
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Mon Oct 31, 2005 7:59 pm Post subject: Re: Issues w/ High Resolution/Non-Standard Font (>96 DPI) in |
|
|
In article <Xns97005FA47A97shadowsomewherecom (AT) 207 (DOT) 105.83.66>, SamFelis wrote:
| Quote: | Yeah, in practice the use of a ratio variable to reset the location of the
controls worked EXCEPT when the screen resolution was widescreen (e.g.,
1400x1050). For widescreen resolutions, I continued to experience the
"hidden" controls.
|
The number of pixels is not so important, the logical resolution (pixels per logical inch)
has a much bigger effect since it affects the font scaling done by the VCL when
scaled is true.
| Quote: | One thing I've determined is that I've got some further testing to do,
that's for sure. Thanks for the input!
|
Right. MS finally realized that this placement of UI controls in device-dependent units
(pixels) is a bad idea in this age of widely diverging display resolutions, but we'll have to
live with it for some years yet, i'm afraid.
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|