ClientParms - display a dialog with multiple lines of data entry for the client to fill-in and return |
Scroll Prev Top Next More |
The ClientParms calls will display a dialog with multiple lines of data entry for the client to fill-in and return.
MacroDialogRC ClientParms(MacroButtons buttons [, MacroMessageType icon]
MacroDialogRC ClientParms(MacroParms parmsObj, MacroButtons buttons |
parmsObj
Optional. An initialized MacroParms object. When provided as the first parameter the object passed will be set as the active parms property for the active macro. By supporting a unique MacroParms object, multiple MacroParms class objects can be initialized in a server macro and used based on logic. Simplest case is to initialized a MacroParms object as the ServerMacro.parms property, as in the Example below.
buttons
Required. Buttons to be displayed. See MacroButtons enumeration; you can combine multiple values with the OR | symbol.
icon
Optional. Icon to be displayed. See MacroMessageType enumeration. Default = MacroMessageType.question
timeout
Optional. Number of milliseconds to wait for client response. -1 means no timeout (indefinite wait). Default value is -1 (indefinite wait)
Your macro code will wait until the user enters values and clicks on a button unless the timeout parameter is used. You can then check on which button was clicked by setting a MacroDialogRC value as the return and using the MacroDialogRC in logic.
The ServerMacro.parms property will be set as the active MacroParms object when this call is made, and any inquiries into the client data entries should reference this.parms.
public override MacroRunResult run()
{
this.parms = new MacroParms("Logon Parameters", "Please Enter your UserID and Password",
new MacroParm[]
{
new MacroParm("UserID","uid","Simmy","Enter the UserID"),
new MacroParm("Password","pw",null,"Enter the Password-hint: host",FVInpEnum.password)
});
MacroDialogRC rc = this.ClientParms(MacroButtons.ok | MacroButtons.cancel, MacroMessageType.info);
if (rc == MacroDialogRC.ok)
{
this.oScreen.putCommand(parms["uid"].text+"[enter]", 2000);
this.oScreen.putCommand("2[enter]", 2000);
this.oScreen.putCommand(parms["uid"].text+"[tab]"+parms["pw"].text+"[enter]", 2000);
if (oScreen.getText(1,1,3)=="DFH")
{
this.oScreen.putCommand("[clear]", 1000);
this.oScreen.putCommand("info[enter]");
}
}
return MacroRunResult.ok;
}