Board index » cppbuilder » Scaling Form-Screen Resolution

Scaling Form-Screen Resolution

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

 

Re:Scaling Form-Screen Resolution


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.ABB97...@ibm.net>,
  "Robert F. Tulloch" <tult...@ibm.net> wrote:

Quote
> 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

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

Re:Scaling Form-Screen Resolution


This is a correction to my last posting:

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

Helmut

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

Quote
  ea...@my-deja.com wrote:
> 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.ABB97...@ibm.net>,
>   "Robert F. Tulloch" <tult...@ibm.net> wrote:
> > 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

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

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

Re:Scaling Form-Screen Resolution


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 Temp{*word*203}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
------

Re:Scaling Form-Screen Resolution


Hi:

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

Re:Scaling Form-Screen Resolution


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

Re:Scaling Form-Screen Resolution


: "Robert F. Tulloch" <tult...@ibm.net> wrote:

Quote
>   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.

Re:Scaling Form-Screen Resolution


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

Re:Scaling Form-Screen Resolution


: "Robert F. Tulloch" <tult...@ibm.net> wrote:

Quote
>   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.

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

Re:Scaling Form-Screen Resolution


Hi: Had to quickly change and repost this as it was an {*word*59} I had
commented out!!

Quote
"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;
Quote
>    __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

Other Threads