Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Scaling Form-Screen Resolution

136 views
Skip to first unread message

Robert F. Tulloch

unread,
Jun 1, 1999, 3:00:00 AM6/1/99
to
Hello:

I am trying to scale form as I do in Delphi-TI2861. I see no such
info for CPP.
In Delphi use TFooClass/TControl to access protected font property.
Can't get something similar to work in CPP. Anyone have any experience
with scaling in CPP?

Thanks

Best regards

ea...@my-deja.com

unread,
Jun 1, 1999, 3:00:00 AM6/1/99
to
Try "ScaledBy()".
Save the "PixelsPerInch" of your development system in a #define or
constand, and get the "PixelsPerInch" of the runtime system.
Use these two values in "ScaledBy()".

Helmut

In article <37536440...@ibm.net>,


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

ea...@my-deja.com

unread,
Jun 1, 1999, 3:00:00 AM6/1/99
to
This is a correction to my last posting:

Correct is: "ChangeScale()" [instead of "ScaledBy()"

Helmut

In article <7ivtb1$uli$1...@nnrp1.deja.com>,

Mark Cashman (TeamB) (BCB)

unread,
Jun 1, 1999, 3:00:00 AM6/1/99
to
Robert -

Please post your question in

borland.public.cppbuilder.vcl

which is the best forum for questions about forms, components and user
interface issues.

Also consider searching http://www.deja.com. There have been several
threads in recent months on this issue.

Hope this helps.

--
------
Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------

Robert F. Tulloch

unread,
Jun 2, 1999, 3:00:00 AM6/2/99
to
Hi:

I posted it here because there is no Programming NG and I thought
this most appropriate.
Thanks.
Best regards

Robert F. Tulloch

unread,
Jun 2, 1999, 3:00:00 AM6/2/99
to
Hi:

Tried searching per your suggestion. Found many on Delphi and MS.
None related to BCB. Perhaps search was wrong structure. Any
suggestions?

Thanks

Best regards

Stefan Hoffmeister (TeamB)

unread,
Jun 2, 1999, 3:00:00 AM6/2/99
to
: "Robert F. Tulloch" <tul...@ibm.net> wrote:

> Tried searching per your suggestion. Found many on Delphi

Delphi and BCB are the same beast in a different language.

--
Stefan Hoffmeister (TeamB) http://www.econos.de/
Please do apply judgement when sending email.

Robert F. Tulloch

unread,
Jun 2, 1999, 3:00:00 AM6/2/99
to
Hi:

Don't know about that. I have already found differences in the
vcl(specifically in TDBNavigator: No BeforeAction in BCB). Anyway, I
have the scaling working fine in Delphi. Works perfectly (except 640 x
480). Cannot get it anywhere near working in BCB using exact same
approach. I will try again.

Thanks

Best regards

Stefan Hoffmeister (TeamB)

unread,
Jun 3, 1999, 3:00:00 AM6/3/99
to
: "Robert F. Tulloch" <tul...@ibm.net> wrote:

> Don't know about that. I have already found differences in the
>vcl

I specifically ran a DIFF on the complete Delphi 4.03 and C++Builder 4.00
source code.

There were no material differences.

Robert F. Tulloch

unread,
Jun 3, 1999, 3:00:00 AM6/3/99
to
Hi: Had to quickly change and repost this as it was an abortion I had
commented out!!

"Robert F. Tulloch" wrote:
>
> Well unfortunately, I am using BCB 1 and Delphi 3. Out of touch I guess.
> Anyway, the following:
> ----------------------------------------------------------
> From header file:
>
> class TFooClass : public TWinControl
> {
> __published:
__property Controls;
> __property Font;
> public:
> TFooClass();
> };
>
> -----------------------------------------------------------
> Part of FormCreate
>
> if (Screen->Width == ScreenWidth) {
> Height = Height * floor(ScaledScreenHeight/ScreenHeight);
> Width = Width * floor(Screen->Width/ScreenWidth);
> ChangeScale(Screen->Width, ScreenWidth);
> Factor = (Width/OldFormWidth);
> for(int i = 0; i < ControlCount; i++ )
> FooClass->Controls[i]->Font->Size = Factor * FooClass->Controls[i]->Font->Size;
> }
>
> Resizes the form but fails on the font scaling. FooClass is a new
> TFooClass. ControlCount shows in watch as 2 when there are probably 50
> controls on the form. Have had all sorts of weird things. At one point
> it said the * was an invalid pointer ref. but that "went" away. Error is that Font is not accessable.
>
> Best regards

0 new messages