Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reduce/Enlarge windows isometrically
Message
 
 
À
09/07/1997 14:31:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00039056
Message ID:
00039167
Vues:
30
>>I would set the initial values in the INIT method of the form:
>>
>>ThisForm.LastHeight = ThisForm.Height
>>ThisForm.LastWidth = ThisForm.Width
>>
>>You can then call your resizing function in the Resize method of the form.
>
>
>You misunderstand me, a bit. Let's assume, the user strecth the width of the window
>for bigger size. Then the program have to adjust the height the window to ensure the original ratio.
>The problem is, that in the resize event code, the program have to decide which window size
>was changed, to match the other size to this. I thought, that it's easy to recognize the changing if
>there are old values to compare to. But what does old value mean in this case? I am not certain, if
>I set a property in the resize event (all the time, when it is called) and adjust the size based on this,
>I get the right method, because resize event is called continously during resizing.
>I hoped, probably probably there is a well known
>algorythm for this, which I don't know, because I am a newcomer in VFP.
>
>But thank you again for your answer:
>BB

Better way:

In form's INIT method:

ThisForm.nRatio = ThisForm.Height/ThisForm.Width

In form's RESIZE method:

*
* Below, you have to decide which change takes precedent -
* the height or width. Move the second case statement and its contents
* before "case ThisForm.Height" if you want the opposite precedence.
*
do case
case ThisForm.Height <> ThisForm.LastHeight
* keep the current height, but adjust the width
ThisForm.Width = ThisForm.Height/nRatio
case ThisForm.Width <> ThisForm.LastWidth
* keep the current width, but adjust the height
ThisForm.Height = nRatio * ThisForm.Width
endcase

That's all it should take.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform