/* BAE_TOOL (STD) -- BAE Toolbar Action */ /* BAE_TOOL (STD) -- BAE Toolbar-Aktion */ /* -- EXECUTED AFTER ACTIVATING A TOOLBAR ITEM -- */ /* // Copyright (c) 1997-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 (091020) RELEASED FOR BAE V7.4. // rl (081014) RELEASED FOR BAE V7.2. // rl (071029) RELEASED FOR BAE V7.0. // rl (060829) RELEASED FOR BAE V6.8. // rl (050906) RELEASED FOR BAE V6.6. // rl (040811) RELEASED FOR BAE V6.4. // rl (030904) RELEASED FOR BAE V6.2. // rl (021209) RELEASED FOR BAE V6.0. // rl (020618) RELEASED FOR BAE V5.4. // rl (010626) RELEASED FOR BAE V5.0. // rl (000508) RELEASED FOR BAE V4.6. // rl (990625) RELEASED FOR BAE V4.4. // rl (980910) RELEASED FOR BAE V4.2. // rl (980910) ENHANCEMENT: // Changed to V4.2 general access program. // mb (980711) ENHANCEMENT: // Dynamic multi-language support introduced. // rl (980526) IMPROVEMENT: // Clear dialog line after action query. // rl (970929) RELEASED FOR BAE V4.0. // rl (970603) ORIGINAL CODING: // // DESCRIPTION // // The bae_tool User Language program is automatically activated // when selecting a toolbar item. The action to be activated depends // on the input string encountered by the bae_tool program. On // integer input, a menu call request is assumed, otherwise a // User Language program call request is assumed. Both input string // types optionally allow for the specification of a blank-seperated // parameter string to be passed to the interaction queue of the // subsequently called menu function or User Language program. */ // Includes #include "std.ulh" // User Language standard include // Disable undo state request #pragma ULCALLERNOUNDO // Messages static string UPRACTION = M("Toolbar-Aktion ? ","Toolbar Action ? "); // Global definitions #define MAXCMDSTRLEN 1024 // Max. input/command string length #define UL_SAVEELAS "saveelas" // Main program void main() { string actionstr /* Action string */; string paramstr /* Parameter string */; int cmd /* Command code */; int spos /* Seperator position */; // Get the action string actionstr=askstr(UPRACTION,MAXCMDSTRLEN); // Check if abort request if (actionstr=="\003") error_abort(); // Extract the parameter string spos=strscannext(actionstr," ",0,1); paramstr=strextract(actionstr,spos,strlen(actionstr)); actionstr=strextract(actionstr,0,spos-2); // Store the parameter string if (paramstr) { bae_clriactqueue(); bae_storetextiact(1,paramstr); } // Check the action type if (isdigit(actionstr[0])) { // Get the command code cmd=atoi(actionstr); // Check if right mouse button save as command if (cmd==201 && (uliptype()==ULIPSCM || uliptype()==ULIPGED) && actionstr[strlen(actionstr)-1]=='!') ulsystem(UL_SAVEELAS,0); // Check if right mouse button drill save command else if (cmd==201 && uliptype()==ULIPCV && actionstr[strlen(actionstr)-1]=='!') bae_callmenu(205); else // Perform menu call bae_callmenu(cmd); } else { // Check if right mouse button activation notification if (paramstr=="" && actionstr[strlen(actionstr)-1]=='!') { bae_clriactqueue(); bae_storetextiact(1,"!"); actionstr[strlen(actionstr)-1]='\0'; } // Perform User Language program call ulsystem(actionstr,0); } } // User Language program end