When the controls are resized, the fonts also are resized proportionately.
Sample:
- Code: Select all Expand view RUN
- #include "fivewin.ch"
function Main()
local oDlg, oFont, aBtn[ 3 ]
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-16
DEFINE DIALOG oDlg SIZE 500,400 PIXEL TRUEPIXEL RESIZABLE ;
FONT oFont TITLE "Relative coordinaes"
@ 40,40 BTNBMP aBtn[ 1 ] FILE "..\bitmaps\pngs\image8.png" ;
SIZE -40,60 PIXEL OF oDlg 2007 CENTER GDIP
@ 250,40 BTNBMP aBtn[ 2 ] FILE "..\bitmaps\pngs\2.png" ;
SIZE 150,120 RELATIVE PIXEL OF oDlg 2007 GDIP
@ -0.4,-0.5 BTNBMP aBtn[ 3 ] PROMPT "Note Book" FILE "..\bitmaps\pngs\image7.png" ;
SIZE 0.35, 0.35 PIXEL OF oDlg 2007 GDIP
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
To start with, this feature is now implemented for TBtnBmp and is being extended to other controls
Sample.2:
- Code: Select all Expand view RUN
- #include "fivewin.ch"
function Main()
local oDlg, oFont, oBrw, aBtn[ 3 ]
USE CUSTOMER NEW SHARED
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-16
DEFINE DIALOG oDlg SIZE 500,400 PIXEL TRUEPIXEL RESIZABLE ;
FONT oFont TITLE "Relative coordinaes"
@ 20,40 XBROWSE oBrw SIZE -40,-120 PIXEL OF oDlg ;
DATASOURCE "CUSTOMER" AUTOCOLS CELL LINES NOBORDER
oBrw:CreateFromCode()
@ -80,40 BTNBMP aBtn[ 1 ] PROMPT "LEFT" SIZE 100,40 PIXEL OF oDlg FLAT GDIP ;
COLOR CLR_WHITE,CLR_GREEN
@ -80,0.4 BTNBMP aBtn[ 1 ] PROMPT "CENTER" SIZE 100,40 PIXEL OF oDlg FLAT GDIP ;
COLOR CLR_WHITE,CLR_GREEN
@ -80,-140 BTNBMP aBtn[ 1 ] PROMPT "RIGHT" SIZE 100,40 PIXEL OF oDlg FLAT GDIP ;
COLOR CLR_WHITE,CLR_GREEN
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil