Article ID: 130132
Article Last Modified on 2/9/2000
* Start of Scalprog.prg
#DEFINE nFormScalemodeSet 3 && 0 - Foxels; 3 - Pixels.
SET CLASSLIB TO scalmode.vcx ADDITIVE
DO FORM scaltest.SCX
scaltest.SCALEMODE=nFormScalemodeSet && Sets form scalemode to
&& value in #DEFINE statement.
nOldscalemode=scaltest.SCALEMODE && Saves form scalemode.
scaltest.ADDOBJECT("Container_test1","Container_test")
* The following line sets the form scalemode to the desired scalemode
* saved in the scalemode property added to container. Comment this to
* see the behavior of adding Foxel sized object to Pixel scalemode form.
scaltest.SCALEMODE=scaltest.Container_test1.SCALEMODE
WITH scaltest.Container_test1
.VISIBLE=.T.
.ADDOBJECT("cmdcommand1","commandbutton")
WITH .cmdcommand1 && Appropriate for Foxel scalemode
.LEFT=7
.TOP=5
.HEIGHT=2
.WIDTH=20
.VISIBLE=.T.
ENDWITH
ENDWITH
scaltest.SCALEMODE=nOldscalemode && Resets form scalemode
RELEASE CLASSLIB scalmode
* End of Scalprog.prg
* Start of Scalprg2.prg
#DEFINE nFormScalemodeSet 0 && Toggle between 0 and 3 to demonstrate.
SET CLASSLIB TO scalmode.vcx ADDITIVE
DO FORM scaltest.SCX
scaltest.SCALEMODE = nFormScalemodeSet
scaltest.ADDOBJECT("Container_test1","Container_test")
scaltest.CAPTION=STR(nFormScalemodeSet) && Sets caption to scalemode.
WITH scaltest.Container_test1
.VISIBLE=.T.
.ADDOBJECT("cmdcommand1","commandbutton")
WITH .cmdcommand1
DO CASE
CASE scaltest.SCALEMODE=0 && Foxels.
.LEFT=7 && Appropriate for Foxel scalemode.
.TOP=5
.HEIGHT=2
.WIDTH=20
CASE scaltest.SCALEMODE=3 && Pixels.
.LEFT=40 && Appropriate for Pixels scalemode.
.TOP=80
.HEIGHT=34
.WIDTH=120
ENDCASE
.VISIBLE=.T.
ENDWITH
ENDWITH
RELEASE CLASSLIB scalmode
* End Scalprg2.prg
Additional query words: VFoxWin
Keywords: kbcode KB130132