PDA

View Full Version : Custom Dialog - how to display



nnjcsc
10-09-2003, 03:40 PM
Under the User Interface, I created a new dialog called TestDialog. I created it by right clicking on All Dialogs, then New Dialog. I have added installscript to display the dialog using:

Declarations.....
prototype TestDialog(STRING);

In OnFirstUIBefore......

nResult = TestDialog(szData);

and created a function, but do not know what to add to the function......

function TestDialog(szData)
begin
end;

The install script compiles and other dialogs display when I run the setup, but my new custom dialog does not display.

There is help on custom dialogs, but I cannot tell which type of custom dialog the help is refering to. Dialogs from the User Interface built in dialog editor, or from a custom dll. The help is not very clear on this.

Thanks.

alex42
10-10-2003, 05:10 AM
the basic code for a dialog function should look like this:

function MyDlg()

STRING sDlg;
BOOL bDone;
INT nResult, nDlgReturn;

begin

sDlg = "MyDlg";

nResult = EzDefineDialog(sDlg, ISUSER, sDlg, 0);
if (nResult != 0) then
return -1;
endif;

bDone = FALSE;

repeat
nResult = WaitOnDialog(sDlg);
switch (nResult)
case DLG_INIT:

case DLG_CLOSE:
Do(EXIT);

case NEXT:
bDone = TRUE;
nDlgReturn = NEXT;

case BACK:
bDone = TRUE;
nDlgReturn = BACK;

case 9: // Cancel Button
Do(EXIT);

endswitch;
until bDone;

EndDialog(sDlg);
ReleaseDialog(sDlg);

return nDlgReturn;
end;


Take a look in your IS folder. Theres the code to all default dialogs somewhere, you can see how to react to certain events, etc.