Hi all.
Im revisiting this issue again (thought I had fixed) as when I run my
application on a tft monitor running large fonts (120dpi) I get
overlapping of the fonts.
I searched through this wonderful knowledge base for the mails I posted
previously and found the code snippet from WarrenS that adds some code
to forms.pas and the tcustomform.readstate procedure.
I made this change but for some reason it is either not working or it
is not picking the code up.
I have set breakpoints in the code to see if it is being executed and
from what I can see the procedure isnt being called at all.
Is there sopmething special I am supposed to do when modifying the
forms.pas file or will changes be picked up when I next compile? If
this is the case why isnt the code being called?
Cheers
Chris Veale
>>> [EMAIL PROTECTED]<[EMAIL PROTECTED]> 11/02/2004
4:37:44 p.m. >>>
Warren Slater asked re form scaling:
> If any one has a better way of doing this comments would be
appreciated.
I found that the most elegant way to fixing the large fonts scaling
issue
was to patch the code in Forms so that the scaling code included
scaling the
form size as well the controls sizes. By default the code doesn't
change the
size of the form only the control on it. So my modified code in
TCustomForm.ReadState reads like:
if FTextHeight <> NewTextHeight then
begin
Scaled := True;
// Added this bit
if (sfWidth in ScalingFlags) and (FClientWidth = 0) then
Width := MulDiv(Width, NewTextHeight, FTextHeight);
if (sfHeight in ScalingFlags) and (FClientHeight = 0) then
Height := MulDiv(Height, NewTextHeight, FTextHeight);
// End of added bit
ScaleScrollBars(NewTextHeight, FTextHeight);
ScaleControls(NewTextHeight, FTextHeight);
if sfWidth in ScalingFlags then
FClientWidth := MulDiv(FClientWidth, NewTextHeight,
FTextHeight);
if sfHeight in ScalingFlags then
FClientHeight := MulDiv(FClientHeight, NewTextHeight,
FTextHeight);
end;
end;
This corrects most of the scaling issues to do with large fonts and
form
sizing.
Cheers, Max.
______________________________________________________
The contents of this e-mail are privileged and/or confidential to the
named recipient and are not to be used by any other person and/or
organisation. If you have received this e-mail in error, please notify
the sender and delete all material pertaining to this e-mail.
______________________________________________________
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi