Re: solving for various font sizes
- From: "JED" <nospam@xxxxxxxxxx>
- Date: 10 Oct 2007 17:02:17 -0700
Ed Dressel wrote:
I've got lots of individual data input fields, with lots of labels.
More and more users are using larger fonts and this is causing lots
of problems.
I would like to have a real fix for this problem--and am willing to
invest a lot of time to fix it.
Is there a good process to go through when laying out labels &
editors?
The TGridPanel and TFlowPanel controls can help for this. The main
report view of my QC Client (the new one) is based on a TGridPanel.
Takes some time to get setup (needs some work in this respect) but once
it is correct, it is golden.
Margins, Padding and these new components where all introduced to help
with layouts.
Unless it is a vertical market application (and very vertical) - I
would suggest not to turn off Scaling. The user is expecting his fonts
to be larger than normal for a reason.
There are some issues with the components mentioned (the flowpanel
needs to support scrollbars for one) but these will come (well fingers
crossed they will).
The internals of these controls also need to be modified a bit (guess
the writer didn't think people would want to create descendants) but
that couldn't be done because of the non-breaking nature of D2007.
You can generally get away with not even needing these added items if
you space your form nicely, use autosize labels, set control anchors
for your edits. The biggest PITA might be fact that RadioButtons and
Checkboxes don't have an autosize property.
A method like this can be your friend.
function AdjustForFontSize(const AValue: Integer): Integer; inline;
begin
result := MulDiv(AValue, Screen.PixelsPerInch, 96);
end;
Basically it will adjust the Value passed in to be larger if the
current PixelsPerInch is greater than 96.
Naturally if you design at a DPI of 120, you need to change the 96 to
120.
So if you have a checkbox on your form you might do this in the
constructor. Assuming that the Width for the CheckBox fits the caption
under 96 dpi.
CheckBox1.Width := AdjustForFontSize(CheckBox1.Width);
Don't forget about control height as well although generally I'll make
controls (checkbox, radiobutton) a little taller by default.
--
TJSDialog - TaskDialog for other operating systems:
http://www.jed-software.com/jsd.htm
Visual Forms IDE Add In: http://www.jed-software.com/vf.htm
Blog: http://jedqc.blogspot.com
.
- Follow-Ups:
- Re: solving for various font sizes
- From: Jan Derk
- Re: solving for various font sizes
- From: Andy Vines
- Re: solving for various font sizes
- References:
- solving for various font sizes
- From: Ed Dressel
- solving for various font sizes
- Prev by Date: Re: CrossKylix discontinued
- Next by Date: Re: solving for various font sizes
- Previous by thread: Re: solving for various font sizes
- Next by thread: Re: solving for various font sizes
- Index(es):
Relevant Pages
|