Re: sub dialogs and parameter passing

From: [at]} <Gérard>
Date: Wed, 25 Jun 2003 12:39:24 +0200


Hello Erik,
 
What you try to write is called a modal dialog. This kind of dialog is opposed to the philosophy of BlackBox. To understand this point, you should look at the help file "Docu/Tut-Tot.odc" and search the word "modal". For an example of a non-modal dialog that corresponds to what you have in mind, you can look at:
 
    http://home.t-online.de/home/a.h.zinn/#Tabmult
 
Regards.
 
Gérard

----- Original Message -----
From: Erik Spaans
To: blackbox{([at]})nowhere.xy
Sent: Tuesday, June 24, 2003 10:22 PM
Subject: sub dialogs and parameter passing

Hello,

I'm trying to figure out how to program with seperate sub dialogs driven by
a main controlling module.

An example: From a main module 'Matrix' I want to start up a dialog 'NeoUi'
with it's attending module 'Neo'. If someone enters say a name in the dialog
I want it to be passed back to the Matrix main program.

The problem I have is that using in the Matrix module
StdCmds.OpenAuxDialog('D:/BlackBox/Ex/Rsrc/NeoUi',''); (* RESOURCE
FILE of NEO *)
starts the dialog, but does not allow for passing parameters back and forth.


>From the Matrix module I obviously have to call a procedure within Neo which

allows passing back the name, i.e. with a parameter. Something like:

MODULE ExMatrix;
IMPORT StdCmds,ExNeo,StdLog;
VAR
name : ExNeo.NAME;

PROCEDURE Do*;
BEGIN
ExNeo.Get(name);
StdLog.String(name);
END Do;

END ExMatrix.
ExMatrix.Do


MODULE ExNeo;
IMPORT Dialog,StdCmds;
TYPE NAME* = ARRAY 20 OF CHAR;
VAR
Dlg* : RECORD
Name* : NAME;
END;

PROCEDURE Get*(OUT name : NAME);
BEGIN
StdCmds.OpenAuxDialog('D:/BlackBox/Ex/Rsrc/NeoUi','NEO'); (*
RESOURCE FILE of NEO *)
name := Dlg.Name;
END Get;

PROCEDURE Accept*;
BEGIN
StdCmds.CloseDialog;
END Accept;

END ExNeo.

But the Get procedure does not 'wait' until a name is entered in the dialog
and the Accept button is clicked before filling name. Instead it returns the
Dlg.name value before it is filled (blank). Only on the second execute does
it return the entered value.
That's obviously not desirable. Besides the whole approach seems rather
convuluted. Can anyone help (example)?

Erik








Received on Wed Jun 25 2003 - 12:39:24 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:29:10 UTC