Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Center Form on Rotation
Message
 
 
À
19/01/2017 11:44:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01646851
Message ID:
01646865
Vues:
28
>>>But then, Dmitry, don't you need to center the VFP screen, first? If you center a child form inside the main VFP window, it centers against the VFP _Screen window, not against your device screen. Unless, of course, your VFP main form is running maximized.
>>>
>>>Anyway, a stabilized version of this code would fit in a subclass, instead of replicating it in every form of your project (if you're not using subclasses, and instantiating VFP base classes instead, perhaps you could consider refactoring your project - but that is a different story).
>>
>>The VFP screen (main window) always runs maximized. And when I rotate the tablet I don't see a problem with the entire main window. But the currently open form then moves to the left-most position (on rotation). So I will need to move it to the center.
>>All windows are bases on the VFP form class in a separate .VCX. So I will need to add the code to the base form and then every form using this base class should be ok. I think. So far I am not 100% sure where to put your "centering" code (that is, in which method the code should go). Or maybe in INIT method?
>
>If your application is running maximized, then it should be ok.
>
>In the your class, add the ReCenter method. In the Init, add the event binding, and the unbinding to the destroy event code. That should be enough (at least, that what I think, but in a few hours I will try it for myself, at home).

Sorry for a very newbie question. Does you code:
BINDEVENT(_Screen, "DisplayOrientation", This, "ReCenter")
mean that every time the value of the VFP main window (_screen) DisplayOrientation changes, call ReCenter method?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform