Re: solving for various font sizes



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
.



Relevant Pages

  • Re: solving for various font sizes
    ... More and more users are using larger fonts and this is causing lots ... I would like to have a real fix for this problem--and am willing to ... The TGridPanel and TFlowPanel controls can help for this. ... So if you have a checkbox on your form you might do this in the ...
    (borland.public.delphi.non-technical)
  • Re: Making fields in a form enable/disable when check box selected
    ... controls disabled until your user has checked the Flight_Req_d checkbox. ... the user first wanted a flight and now does not want a flight), ... > fields to sort of work but have struck a problem that I could do with some ...
    (microsoft.public.access.forms)
  • RE: Display a record - several questions
    ... ObjectDataSource set up to get the correct record on a select. ... sub controls in the certain tepmlate and modify them. ... How do I display a RadioButtonList and CheckBox value where it is ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Prevent edits - unexpected effects
    ... were to click the 'Complete' checkbox on a new record w/o first having ... If the check box is true, this will lock it. ... Therefore the subform control is locked well. ... Even unbound controls ...
    (microsoft.public.access.forms)
  • Re: Checkbox advice needed
    ... "I don't know if I should start by just putting some forms controls directly ... If you use ActiveX controls, a checkbox named ... Private Sub chkApproved_Change ... Say you have individual checkboxes like: ...
    (microsoft.public.word.vba.general)