I have one form opened as modal. This form creates and shows another as modal.
When the second form closes the focus does not return into the main form.
I looked into source code of QForms and i saw that before the second form is being shown
it is already current and it is being saved as last focused form:


Screen.FSaveFocusedList.Insert(0, Screen.FFocusedForm); // FFocusedForm IS ALREADY THE SECOND FORM.
Screen.FFocusedForm := Self;
SaveCursor := Screen.Cursor;
Screen.Cursor := crDefault;
SaveCount := Screen.FCursorCount;
Include(FFormState, fsModal);
OldModalStack := ModalStack;
ModalStack := Self;
QOpenWidget_setWFlags(QOpenWidgetH(Handle), Cardinal(WidgetFlags_WType_Modal));
QOpenWidget_setWState(QOpenWidgetH(Handle), Cardinal(WidgetState_WState_Modal));
CaptureControl := GetCaptureControl;
try
SetCaptureControl(nil);
Show; // HERE IS THE SHOW METHOD !!!!





How could it be already focused when the method show has not been called.

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to