I 'm creating a dialog for Tablet application with 12 BTNBMP buttons
I not have the tablet also and I not Know the resolution screen of Tablet
I think it can have 1280 x 800 Pixel But I am not sure
I wish create a dialog and it must run good on all resolutions.
How I can make it ?
How I can test a resolution ?
To try any resolution I pass on exe two parameters
sample : Myapp.exe 800 600 and on my Function Main I have
Code: Select all
Function Main(cPar1,cpar2)
I read on a file INI the parameter I need sample :
Code: Select all
nres1=1024
nres2=700
the problem i create the dialog with btnbmp buttons
I make a test but when I change the resolution the buttons not resize .... any solution ?
My small test
Code: Select all
#include "FiveWin.ch"
// test creating dialog with btnbmp for tablet menu
Function Test()
Local oDlgTablet
Local aBtnMenu:= array(12)
Local aBtnMenuImage:=array(12)
Local aBtnMenuTitle:=array(12)
Local n
Local oFont
Local nMINWidth := 800//::cResTablet1
Local nMINHeight := 600//::cResTablet2
Local nMAXWidth := GETSYSMETRICS( 0 ) //risoluzione orizzontale
Local nMAXHeight := GETSYSMETRICS( 1 ) //risoluzione verticale
Local nSizeWBtn :=90
Local nSizeHBtn :=90
Local nSizeWSpace :=20
Local nSizeHSpace :=10
Local cTitle:= "Test menu button Tablet"
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlgTablet SIZE nMINWidth,nMINHeight ;
FONT oFont;
TITLE cTitle
oDlgTablet:nStyle := nOr( WS_OVERLAPPED,WS_THICKFRAME,WS_MAXIMIZEBOX, 0 )//WS_SYSMENU
For n= 1 to 12
@ 5,50 BTNBMP aBtnMenu[n] FILE aBtnMenuImage[n] ;
PROMPT aBtnMenuTitle[n] FLAT SIZE nSizeWBtn,nSizeHBtn ;
PIXEL OF oDlgTablet COLOR CLR_WHITE, RGB( 120,136,85 ) ACTION NIL
Next n
oDlgTablet:aMinMaxInfo = { GETSYSMETRICS( 0 ), GETSYSMETRICS( 1 ),; // xMaxSize, yMaxSize
0, 0,; // xMaxPosition, yMaxPosition
nMINWidth, nMINHeight,; // xMinTrackSize, yMinTrackSize
nMAXWidth, nMAXHeight }
oDlgTablet:bResized := { || ;
oRect := oDlgTablet:GetCliRect(), ;
aBtnMenu[1]:nLeft := oRect:nLeft +10 ,;
aBtnMenu[2]:nLeft := oRect:nLeft +nSizeWBtn+nSizeWBtn+15,;
aBtnMenu[3]:nLeft := oRect:nLeft +nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+20 ,;
aBtnMenu[4]:nLeft := oRect:nLeft +nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+25,;
aBtnMenu[5]:nTop := oRect:nTop +nSizeWBtn+nSizeWBtn+20,;
aBtnMenu[5]:nLeft := oRect:nLeft +10,;
aBtnMenu[6]:nTop := oRect:nTop +nSizeWBtn+nSizeWBtn+20,;
aBtnMenu[6]:nLeft := oRect:nLeft +nSizeWBtn+nSizeWBtn+15,;
aBtnMenu[7]:nTop := oRect:nTop +nSizeWBtn+nSizeWBtn+20,;
aBtnMenu[7]:nLeft := oRect:nLeft +nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+20 ,;
aBtnMenu[8]:nTop := oRect:nTop +nSizeWBtn+nSizeWBtn+20,;
aBtnMenu[8]:nLeft := oRect:nLeft +nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+25,;
aBtnMenu[9]:nTop := oRect:nTop +nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+30,;
aBtnMenu[9]:nLeft := oRect:nLeft +10 ,;
aBtnMenu[10]:nTop := oRect:nTop +nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+30,;
aBtnMenu[10]:nLeft := oRect:nLeft +nSizeWBtn+nSizeWBtn+15,;
aBtnMenu[11]:nTop := oRect:nTop +nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+30,;
aBtnMenu[11]:nLeft := oRect:nLeft +nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+20 ,;
aBtnMenu[12]:nTop := oRect:nTop +nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+30,;
aBtnMenu[12]:nLeft := oRect:nLeft +nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+nSizeWBtn+25 }
ACTIVATE DIALOG oDlgTablet //CENTERED
RETURN NIL