Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Screen res
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00202130
Message ID:
00202502
Vues:
14
>>I have an app that looks beautiful in 1024x768 but is basically unusable in 800x660. Is there any general strategy for handling this?
>
>Well, the general rule is to design at the lowest possible resolution a user may use, usually 640x480. Doesn't mean you have to always design at that res., but you need to stop and check it often. I keep a second PC next to me at low res. for just such business...
>
>You're beyond that point, so you can try 2 options that come to mind:
>
>1) Go back to development stage at lower res., and adjust it.
>2) Try runtime resizing using sysmetric, etc.


This class could help you

DEFINE CLASS ENVIRONMENT AS CUSTOM && CLASSE INDEPENDANTE DU CLIENT
bAdjustScreen = .F.
nDevHeight = 800
nDevWidth = 600
nFontSize = 8
nScreenHeight = 1
nScreenWidth = 1
nCorrectFactor = 1

PROCEDURE INIT
WITH THIS
IF SYSMETRIC(1) != .nDevHeight
.bAdjustScreen = .T.
.nScreenHeight = (SYSMETRIC(1) / .nDevHeight)
.nScreenWidth = (SYSMETRIC(2) / .nDevWidth)
.nCorrectFactor = INT((SYSMETRIC(1) / .nDevHeight) * .nFontSize)
ENDIF
ENDWITH
ENDPROC

PROCEDURE SetResolution
PARAMETERS hObject
LOCAL i, lnIndiceCol
_SCREEN.LOCKSCREEN = .T.
IF THIS.bAdjustScreen
DO CASE

CASE UPPER(hObject.BASECLASS) $ "FORM" && PAGEFRAME" && CONTAINER" Le container il le fera par la forme ou le pageframe ou son conteneur parent
WITH hObject
.HEIGHT = .HEIGHT*THIS.nScreenHeight
.WIDTH = .WIDTH*THIS.nScreenHeight
.TOP = .TOP*THIS.nScreenWidth
.LEFT = .LEFT*THIS.nScreenWidth
ENDWITH
THIS.SetResolutionObject(hObject)

CASE UPPER(hObject.BASECLASS) $ "PAGEFRAME"
FOR i = 1 TO hObject.PAGECOUNT
THIS.SetResolutionObject(hObject.PAGES(i))
ENDFOR

CASE UPPER(hObject.BASECLASS) $ "CONTAINER"
THIS.SetResolutionObject(hObject)

CASE UPPER(hObject.BASECLASS) $ "COMMANDGROUP"
FOR lnIndiceCol = 1 TO hObject.BUTTONCOUNT && Détermine combien il y a de colonnes
WITH hObject.BUTTONS(lnIndiceCol)
.HEIGHT = .HEIGHT*THIS.nScreenHeight
.WIDTH = .WIDTH*THIS.nScreenHeight
.TOP = .TOP*THIS.nScreenWidth
.LEFT = .LEFT*THIS.nScreenWidth
ENDWITH
ENDFOR

CASE UPPER(hObject.BASECLASS) $ "GRID"
FOR lnIndiceCol = 1 TO hObject.COLUMNCOUNT && Détermine combien il y a de colonnes
WITH hObject.COLUMNS(lnIndiceCol)
.WIDTH = .WIDTH*THIS.nScreenHeight
ENDWITH
ENDFOR

CASE UPPER(hObject.BASECLASS) $ "OPTIONGROUP"
FOR lnIndiceCol = 1 TO hObject.BUTTONCOUNT && Détermine combien il y a de colonnes
WITH hObject.BUTTONS(lnIndiceCol)
.HEIGHT = .HEIGHT*THIS.nScreenHeight
.WIDTH = .WIDTH*THIS.nScreenHeight
.TOP = .TOP*THIS.nScreenWidth
.LEFT = .LEFT*THIS.nScreenWidth
ENDWITH
ENDFOR

ENDCASE
ENDIF
*THISFORM.Refresh
_SCREEN.LOCKSCREEN = .F.
ENDPROC

PROCEDURE SetResolutionObject
PARAMETERS hObject
LOCAL i
FOR i = 1 TO hObject.CONTROLCOUNT
WITH hObject.CONTROLS(i)
* lnFontSize=FONTMETRIC(1)/lnFontSize

* lnFontSize=FONTMETRIC(1)/lnFontSize
.HEIGHT = .HEIGHT*THIS.nScreenHeight
.WIDTH = .WIDTH*THIS.nScreenHeight
.TOP = .TOP*THIS.nScreenWidth
.LEFT = .LEFT*THIS.nScreenWidth
ENDWITH
ENDFOR
ENDPROC
ENDDEFINE
Analystik Team
1430 Belanger
Montreal (Quebec)
Canada
(514) 278-2727
analyste@analystik.ca
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform