Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modal forms launched by dockable forms
Message
From
01/01/2021 07:47:33
Antonio Lopes (Online)
BookMARC
Coimbra, Portugal
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Modal forms launched by dockable forms
Miscellaneous
Thread ID:
01677685
Message ID:
01677685
Views:
112
Dear All,

I'm checking on the possibility of using dockable forms in an MDI application, but I'm facing a problem while mixing dockable and non-dockable forms in the same screen. The problem gets more acute if there are modal forms involved, although it shows up with non dockable modeless forms, as well.

When there are dockable forms open, non-dockable forms are always shown behind. If a new form is a modal form, it means that the user will not be granted access to the modal dialog if there is no sufficient screen space to display the new form. At the same time, the dockable form remains disabled until the the modal form is closed.

The following snippet demonstrates the issue, and the attached picture shows how the various launched forms are arranged. Is there any workaround? Or am I missing something, obvious or obscure?

If you're willing to try the snippet, please save any current work in your IDE: you may have not sufficient screen space to close VFP9 properly if the modal form is left completely hidden under the docked forms.
LOCAL DF1 AS dockableForm
LOCAL DF2 AS dockableForm
LOCAL DF3 AS dockableForm

m.DF1 = CREATEOBJECT("dockableForm", "modalForm")
m.DF2 = CREATEOBJECT("dockableForm", "nonModalForm")
m.DF3 = CREATEOBJECT("dockableForm", "nonModalDockableForm")

m.DF1.Dock(3)
m.DF2.Dock(4, m.DF1)
m.DF3.Dock(4, m.DF1)

READ EVENTS

DEFINE CLASS modalForm AS Form

	WindowType = 1
	AlwaysOnTop = .T.
	AutoCenter = .T.

	ADD OBJECT tb AS TextBox

ENDDEFINE

DEFINE CLASS nonModalForm AS Form

	WindowType = 0

	ADD OBJECT tb AS TextBox

ENDDEFINE

DEFINE CLASS nonModalDockableForm AS Form

	WindowType = 0
	Dockable = 1

	ADD OBJECT tb AS TextBox

ENDDEFINE

DEFINE CLASS dockableForm AS Form

	Dockable = 1
	typeOfSubform = "modalForm"
	SubForm = .NULL.

	ADD OBJECT cb AS CommandButton WITH AutoSize = .T.

	PROCEDURE Init (typeSF AS String)

		This.typeOfSubform = EVL(m.typeSF, "modalForm")
		This.Caption = This.Caption + " " + This.typeOfSubform
		This.cb.Caption = This.typeOfSubform

	ENDPROC

	PROCEDURE cb.click

		Thisform.SubForm = CREATEOBJECT(Thisform.typeOfSubform)
		Thisform.SubForm.Show()

	ENDPROC

	PROCEDURE Destroy
		CLEAR EVENTS
	ENDPROC

ENDDEFINE
----------------------------------
António Tavares Lopes
Next
Reply
Map
View

Click here to load this message in the networking platform