/* BAE_DIAL (STD) -- BAE Dialog Box Action */ /* BAE_DIAL (STD) -- BAE Dialogbox-Aktion */ /* -- EXECUTED AFTER ACTIVATING A PERMANENT DIALOG BOX ITEM -- */ /* // Copyright (c) 2007-2013 Bartels System GmbH, Muenchen // Author: Roman Ludwig // Changes History: // rl (131029) RELEASED FOR BAE V8.0. // rl (120427) RELEASED FOR BAE V7.8. // rl (101019) RELEASED FOR BAE V7.6. // rl (091027) RELEASED FOR BAE V7.4. // rl (081014) RELEASED FOR BAE V7.2. // rl (071029) RELEASED FOR BAE V7.0. // rl (070125) ORIGINAL CODING: // // DESCRIPTION // // The bae_dial User Language program is automatically activated // when selecting a dialog box item with registered action code. // The dialog box activation data is transfered from the interaction queue // to global variables. */ // Includes #include "pop.ulh" // User Language popup utilities // Disable undo state request #pragma ULCALLERNOUNDO // Messages static string UPRDBOX = M("Dialogbox-Index ? ","Dialog Box Index ? "); static string UPRACTION = M("Dialogbox-Aktion ? ","Dialog Box Action ? "); static string UPRREASON = M("Aufruftyp ? ","Callback Reason ? "); static string UPRINTVAL = M("Integerwert ? ","Integer Value ? "); static string UPRNAME = M("Name ? ","Name ? "); // Global definitions #define MAXCMDSTRLEN 1024 // Max. input/command string length // Main program void main() { string str /* String buffer */; int boxidx /* Dialog box index */; int actcode /* Action code */; int reason /* Callback reason */; int intval /* Dialog box item integer value */; string name /* Dialog box item name */; string varname /* Variable name */; string actseq /* Action sequence */; // Get the dialog box index if ((str=askstr(UPRDBOX,MAXCMDSTRLEN))==UINPOPABORT) error_abort(); boxidx=atoi(str); // Get the action code if ((str=askstr(UPRACTION,MAXCMDSTRLEN))==UINPOPABORT) error_abort(); actcode=atoi(str); // Get the callback reason if ((str=askstr(UPRREASON,MAXCMDSTRLEN))==UINPOPABORT) error_abort(); reason=atoi(str); // Get the dialog box item integer value if ((str=askstr(UPRINTVAL,MAXCMDSTRLEN))==UINPOPABORT) error_abort(); intval=atoi(str); // Get the dialog box item name if ((name=askstr(UPRNAME,MAXCMDSTRLEN))==UINPOPABORT) error_abort(); // Build the action sequence variable name sprintf(varname,VAR_PDBOXSEQ,boxidx); if (varget(varname,actseq)) exit(0); // Store callback parameters varset(VAR_PDBOXIDX,boxidx); varset(VAR_PDBOXACT,actcode); varset(VAR_PDBOXREAS,reason); varset(VAR_PDBOXIVAL,intval); varset(VAR_PDBOXNAME,name); // Perform action sequence ulsystem_exit(actseq); } // User Language program end