Problem with managing the forms
Cyril P.
Meung Sur Loire, France

Nov 22, 2011
23 Posts

0  |  0  

Re: Problem with managing the forms


I have an issue to manage my forms in Ateasy 8 (No problem under Ateasy 4):
At the beginning of the program (in the event OnInit of the system) I am loading a form, which is a simple form with a log, using this command "Load hStandaloneDebugLog,False,0"
so its a non modal form and my program continue its execution.
Then in the event OnInitSystem I am creating a thread to manage and load all my standard GUI.
The original code to manage my standard GUI under Ateasy 4 was done to load my forms in modal way.
The problem is under Ateasy 8, if I do that, I am not able to use the debug form loaded at the beginning.
The debug form is not anymore accessible.
So I've changed my code in my thread to manage my GUIs to load the form in non modal way, but "simulated" it, using this code :
Load (GUIController.hformMainMenu),false
! wait until unload is called
while (GUIController.hformMainMenu.hWnd)
    WaitForEvent(10) !don't consume 100% cpu

This helps to have access to the debug form but it causes another problem in other condition.
In fact, when I have my main form displayed sometimes I need to display another form (like a message box OK or something like that) on the top of my main form.
If I load the form non modal to keep access to the debug form, the message box OK don't block my main form and if I click on an object of the main form the code will be executed. Which I won't.
If I load the message box OK in modal way, I have no access to my debug form.

Is there a way to fix that and works like on ateasy 4?

Solution Available
DrATEasy (Ron Y.)
Mission Viejo, CA

Nov 22, 2011
334 Posts

1  |  0  

Re: Problem with managing the forms

This is similar to Visual Basic behavior - creating a modal window disable all process windows. The way around it is to continue and load the main form and its message form in modal mode as before and then manually enable the debug form using the AForm.Enabled property (i.e. frmModal.Enabled=True) -- this must be called inside each loaded modal form's OnLoad() event since the load statement does not return.

Cyril P.
Meung Sur Loire, France

Nov 23, 2011
23 Posts

0  |  0  

Re: Problem with managing the forms

Hello Ron,

thank you very much, it resolves my problem.

Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]