How can I get my software to adapt to the size of the screen
Posted: Fri Jun 29, 2018 12:36 pm
hello Roger
How can I get my software to adapt to the size of the screen that each PC has?
I'm using this code that I saw xDemo, but it does not look good.
nWidth := AppDeskTop():currentSize()[1]
nHeight := AppDeskTop():currentSize()[2]
nWindowRow := 0
IF nWidth <= 800
nWindowWidth := 640
nWindowHeight := 500
cSayFont := '8.Arial'
cGetFont := '9.Courier New'
nColPixels := 7
nRowPixels := 20
ELSEIF nWidth <= 1024
nWindowWidth := 800
nWindowHeight := 600
cSayFont := '9.Arial'
cGetFont := '10.Courier New'
nColPixels := 8.5
nRowPixels := 24
ELSEIF nWidth <= 1280
nWindowWidth := 1000
nWindowHeight := 800
cSayFont := '10.Arial'
cGetFont := '11.Courier New'
nColPixels := 10
nRowPixels := 28
ELSE
nWindowWidth := 1200
nWindowHeight := 1000
cSayFont := '11.Arial'
cGetFont := '12.Courier New'
nColPixels := 11.5 && 11.5
nRowPixels := 32 && 32
ENDIF
IF nWindowRow+nWindowHeight > AppDeskTop():currentSize()[2]
nWindowRow := AppDeskTop():currentSize()[2]-nWindowHeight
ENDIF
How can I get my software to adapt to the size of the screen that each PC has?
I'm using this code that I saw xDemo, but it does not look good.
nWidth := AppDeskTop():currentSize()[1]
nHeight := AppDeskTop():currentSize()[2]
nWindowRow := 0
IF nWidth <= 800
nWindowWidth := 640
nWindowHeight := 500
cSayFont := '8.Arial'
cGetFont := '9.Courier New'
nColPixels := 7
nRowPixels := 20
ELSEIF nWidth <= 1024
nWindowWidth := 800
nWindowHeight := 600
cSayFont := '9.Arial'
cGetFont := '10.Courier New'
nColPixels := 8.5
nRowPixels := 24
ELSEIF nWidth <= 1280
nWindowWidth := 1000
nWindowHeight := 800
cSayFont := '10.Arial'
cGetFont := '11.Courier New'
nColPixels := 10
nRowPixels := 28
ELSE
nWindowWidth := 1200
nWindowHeight := 1000
cSayFont := '11.Arial'
cGetFont := '12.Courier New'
nColPixels := 11.5 && 11.5
nRowPixels := 32 && 32
ENDIF
IF nWindowRow+nWindowHeight > AppDeskTop():currentSize()[2]
nWindowRow := AppDeskTop():currentSize()[2]-nWindowHeight
ENDIF