Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form loading flash
Message
 
À
19/05/2016 23:44:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01636239
Message ID:
01636673
Vues:
139
Nice.

One additional complication on my end is that all windows are desktop windows, not MDI windows and that's what induces the focus issues. As I mentioned flashing isn't really an issue for me, it's getting focus set and making sure the new windows pop to the top of the Window stack properly. In many cases the original form just refuses to give up focus.

I've tried a million things to make this work, and I've got it 'working' but it's one of the many UI quirks with FoxPro applications that make it such a pain in the butt to work with any more. I have similar apps doing roughly the same sort of thing in .NET WinForms and WPF apps (including the ActiveX -> new top level windows) and it just works as expected. Unfortunately a few apps are stuck in FoxPro, so no choice...


+++ Rick ---

>I have an editor for SCX/VCX that uses an ActiveX component -- it is based on CodeMax. From this ActiveX I pop-up many native VFP forms which are over CodeMax. The forms are all modeless by design. I do not have any modal forms (the editor runs inside of VFP and I did not want the modal behavior). To 'simulate' a modal form, I first grey-out the main form via the class from Bernard Bout (bbLightBox class). This class actually takes a screen-shot of the current form (my main form) and then paints it in an image control via GDIx, sets all components to Visible=False, sets the Image to Visible=True and moves it to the top of the z-order (there is alpha blending to darken the image). Now the child pop-up form appears. The Activate() event of the image control (and main form) redirects the user back to the child pop-up form should they try to re-select the main form. I use RAISEEVENTS() command in the child form (commandbutton.click event) to pass data back to the main form from the child pop-up form. The main form is then responsible for destroying the child form and restoring the main form (form controls back to Visible=True and the image to Visible=False and to back of z-order). BINDEVENTS is used in the main form to bind to the child form's QueryUnload and Release events (another reason the forms are modeless -- they have to be created in order to bind to its events). This way if the user closes the child form via the upper right hand close button the main form is restored.
>
>No flashing has ever been noticed... Just a clean pop-up of child forms over what appears to be the editor component but is actually just an image control. The calls to the child forms are similar to:
>
>
>LOCAL loChildForm
>DO FORM GetMaterialsFromSearch WITH thisform, True, DATE() NAME loChildForm
>IF VARTYPE(loChildForm) = "O"
>	thisform.SetModalBindEvents(loChildForm)
>ENDIF
>
>
>The Init() event of the child form sets the lightbox:
>
>
>LPARAMETERS toMainForm, tlAllowOrder, tdOrderDate
>thisform.OrderDate  = tdOrderDate
>thisform.MainForm   = toMainForm
>thisform.AllowOrder = tlAllowOrder
>toMainForm.clsLightBox.ShowLightBoxInContainer(True)
>
>
>The main form has to be passed to the child form since RAISEEVENTS needs this to call the main form (from click event method code in button to close form):
>
>
>RAISEEVENT(thisform.MainForm, "OnFormGetMaterialsFromSearch", True, loMaterials)
>
>
>The BINDEVENTS is done in SetModalBindEvents() method of the main form as follows:
>
>
>LPARAMETERS toChildForm
>thisform.ChildForm = toChildForm
>BINDEVENT(toChildForm, "QueryUnload", thisform, "ReleaseChildForm")
>BINDEVENT(toChildForm, "Release", thisform, "ReleaseChildForm")
>
>
>The ReleaseChildForm() method:
>
>
>thisform.ChildForm.Hide()
>thisform.clsLightBox.ResetLightBox()
>UNBINDEVENT(thisform.ChildForm, "QueryUnload", thisform, "ReleaseChildForm")
>UNBINDEVENT(thisform.ChildForm, "Release", thisform, "ReleaseChildForm")
>thisform.ChildForm.Release()
>thisform.ChildForm = .NULL.
>
>
>Note: I have made my own changes to Bernard's class for controlling which controls are set to Visible=False as I only set the ActiveX controls; his class does all controls if I remember correctly. I did this for performance reasons when there are a lot of controls in the form.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform