/* UIFDUMP (STD) -- Menu Assignments and Key Bindings Dump */ /* UIFDUMP (STD) -- Menue- und Tastaturbelegung ausgeben */ /* // Copyright (c) 1995-2012 Oliver Bartels F+E, Muenchen // Author: Manfred Baumeister // Changes History: // rl (120427) RELEASED FOR BAE V7.8. // rl (101019) RELEASED FOR BAE V7.6. // rl (091021) 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 (021015) CHANGE: // Adopted to new help database file name. // rl (020618) RELEASED FOR BAE V5.4. // rl (020207) ENHANCEMENT: // Introduced environment variable BAE_PARLIB for // database file name. // rl (010625) RELEASED FOR BAE V5.0. // rl (000509) RELEASED FOR BAE V4.6. // rl (990625) RELEASED FOR BAE V4.4. // rl (980910) RELEASED FOR BAE V4.2. // mb (980713) CHANGE: // SQL table ulhelptab renamed to ul_helptab // to avoid compatibility problems. // mb (980710) ENHANCEMENT: // Dynamic multi-language support introduced. // mb (980706) CHANGE: // Menu item format strings extended to allow for special chars. // mb (980706) BUGFIX: // Pulldown menu number setting(s) corrected in dumpmenu. // rl (970929) RELEASED FOR BAE V4.0. // mb (970616) ENHANCEMENT: // Applied CAM View User Language support. // mb (970130) BUGFIX: // Changed name of global variable BAEPARAM to // BAEPARAMDB in order to avoid name conflict when // including "mnu.ulh". // mb (960919) RELEASED FOR BAE V3.4. // mb (950729) IMPROVEMENT: // Analyze/report key assignments for Windows user // interface. // mb (950722) IMPROVEMENT: // Report output directed to screen with dump option // instead of file. // mb (951012) IMPROVEMENT: // Performing BAE_Demo_check(2) before starting output. // mb (950123) ORIGINAL CODING. // // DESCRIPTION // // The uifdump User Language program generates lists the menu // assignments and key bindings of the currently active BAE // program module. The listing is displayed in a popup menu // with file output option. // // WARNINGS // // Program tries to access SQL database table "ul_helptab" from // SQL/DDB file "ulchelp.vdb" within BAE programs directory // to retrieve User Language program short descriptions. */ // Includes #include "mnu.ulh" // User Language menu utilities #include "sql.ulh" // User Language SQL utilities // Disable undo state request #pragma ULCALLERNOUNDO // Messages #define DE_REPSCANMENU "Scannen Menuebelegung %s..." #define EN_REPSCANMENU "Scanning menu assignments %s..." #define DE_REPSCANKEYS "Scannen Tastaturbelegung..." #define EN_REPSCANKEYS "Scanning key bindings..." #define DE_ITMALL "(ALLE)" #define EN_ITMALL "(ALL)" #define DE_FMTMENUHD "UL Interpreter %s / Menuebelegung :" #define EN_FMTMENUHD "UL Interpreter %s / Menu Assignments :" #define DE_FMTINFOMENU "Infofeld %03d {" #define EN_FMTINFOMENU "Info Field %03d {" #define DE_FMTMAINMENU "Hauptmenu %03d {" #define EN_FMTMAINMENU "Main Menu %03d {" #define DE_FMTSTDMENU "Menu %03d '%s' {" #define EN_FMTSTDMENU "Menu %03d '%s' {" #define DE_FMTDISPMENU "Online Bilddarstellungsmenu %03d {" #define EN_FMTDISPMENU "Online Display Menu %03d {" #define DE_FMTSUBMENU "Submenu %03d {" #define EN_FMTSUBMENU "Sub Menu %03d {" #define DE_FMTFCTKEYHD "UL Interpreter %s / Funktionstastenbelegung :" #define EN_FMTFCTKEYHD "UL Interpreter %s / Function Key Assignments :" #define DE_FMTSTDKEYHD "UL Interpreter %s / Standardtastenbelegung :" #define EN_FMTSTDKEYHD "UL Interpreter %s / Standard Key Assignments :" #define DE_FMTMENUKEYS " TASTEN : %s (MEHRFACHZUWEISUNG(EN) : %d)" #define EN_FMTMENUKEYS " KEYS : %s (MULTIPLE ASSIGNMENT(S) : %d)" string UPRFEXIT = M_UPRFEXIT(); string REPSCANMENU = M(DE_REPSCANMENU,EN_REPSCANMENU); string REPSCANKEYS = M(DE_REPSCANKEYS,EN_REPSCANKEYS); string ITMALL = M(DE_ITMALL ,EN_ITMALL ); string FMTMENUHD = M(DE_FMTMENUHD ,EN_FMTMENUHD ); string FMTINFOMENU = M(DE_FMTINFOMENU,EN_FMTINFOMENU); string FMTMAINMENU = M(DE_FMTMAINMENU,EN_FMTMAINMENU); string FMTSTDMENU = M(DE_FMTSTDMENU ,EN_FMTSTDMENU ); string FMTDISPMENU = M(DE_FMTDISPMENU,EN_FMTDISPMENU); string FMTSUBMENU = M(DE_FMTSUBMENU ,EN_FMTSUBMENU ); string FMTFCTKEYHD = M(DE_FMTFCTKEYHD,EN_FMTFCTKEYHD); string FMTSTDKEYHD = M(DE_FMTSTDKEYHD,EN_FMTSTDKEYHD); string FMTMENUKEYS = M(DE_FMTMENUKEYS,EN_FMTMENUKEYS); #define FMTFCTKEY " < F%2d > ==> %-8s -- %s" #define FMTSTDKEY " < %c > ==> %-8s -- %s" #define FMTMENUITEM " %02d (%08x): %-22s ==> %-8s -- %s" #define FMTMENUKITM " %02d (%08x): %-*s %-22s ==> %-8s -- %s" #define FMTMENUEND " }" // Setup and SQL/DB file names string BAEULHLPDB = strgetconffilename(ULHLPVNAME,ULHLPFNAME,1); // UL interpreter definitions STRINGS ulipidl = { // UL interpreter id list "SCM", // Schematic Editor "GED", // Layout Editor "AR" , // Autorouter "CAM", // CAM Processor "CED", // Chip Editor "CV" , // CAM View ITMALL // All UL interpreters (optional!) }; int uliptypl[] = { // UL interpreter type list ULIPSCM, // Schematic Editor ULIPGED, // Layout Editor ULIPAR , // Autorouter ULIPCAM, // CAM Processor ULIPCED, // Chip Editor ULIPCV // CAM View }; int ulipn = arylength(ulipidl)-1 /* UL interpreter count */; // Menu and key definitions #define MAINMENUNUM 50 // Main menu number #define INFOMENUNUM 51 // Info field menu number #define DISPMENUNUM 99 // Online display menu number #define MAXMENUNUM 999 // Maximum menu number #define MAXMENULINE 99 // Maximum menu line number #define MINFCTKEY 1 // Minimum function key code #define MAXFCTKEY 128 // Maximum function key code #define MINSTDKEY 32 // Minimum standard key code #define MAXSTDKEY 128 // Maximum standard key code // (Language-specific) SQL commands #define H_SELECT_EN "select cmt_en from ul_helptab where progname=%s;" #define H_SELECT_DE "select cmt_de from ul_helptab where progname=%s;" string h_select = M(H_SELECT_DE,H_SELECT_EN); // Globals string sqlcommand /* SQL command string */; string curcomment /* Current comment */; STRINGS repl /* Report list */; int repn = 0 /* Report count */; // Main program void main() { // Generate menu assignments and key bindings report menureport(); } /*________________________________________________________________*/ // Menu and key assignments report void menureport() /* // Dump currently defined menu assignments and key definitions */ { int menunum /* Menu number */; string progname /* Program name buffer */; int i /* Loop control variable */; // Dump the menu assignments header sprintf(repl[repn],FMTMENUHD,getcurulipname()); repn++; repl[repn++]=""; // Dump the info field menu dumpmenu(INFOMENUNUM); // Dump the main menu dumpmenu(MAINMENUNUM); // Dump the standard menus for (menunum=0;menunum=0;i--) newkey(keys[i],allkeys,multikey); MKN=maxint(MKN,strlen(keys)); // Print header if not yet done if (!headerout) { // Test if standard menu switch (menunum) { case INFOMENUNUM : sprintf(repl[repn],FMTINFOMENU,menunum); repn++; break; case MAINMENUNUM : sprintf(repl[repn],FMTMAINMENU,menunum); repn++; break; case DISPMENUNUM : sprintf(repl[repn],FMTDISPMENU,menunum); repn++; break; default : if (menunum0) sprintf(repl[repn],FMTMENUKITM,menuline,menuclfield, MKN+2,"<"+keys+">","'"+menutext+"'", progname,curcomment); else sprintf(repl[repn],FMTMENUITEM,menuline,menuclfield, "'"+menutext+"'",progname,curcomment); repn++; } // Print the menu footer if (headerout) { if (allkeys) { sprintf(repl[repn],FMTMENUKEYS,allkeys,multikey); repn++; } sprintf(repl[repn],FMTMENUEND); repn++; repl[repn++]=""; } } void newkey(char key,string keys,int multikey) /* // Store a new key to sorted key table // Parameters : // char key : Key character to be stored // string keys : Sorted key table // int multikey : Multiple key counter (IO parameter!) */ { int slb = 0 /* Search lower boundary */; int sub = strlen(keys)-1/* Search upper boundary */; int sidx /* Search index */; char newkey /* New key character buffer */; // Get and upper case the new key newkey=toupper(key); // Loop until search area empty while (slb<=sub) { // Get the search index sidx=(slb+sub)>>1; // Increment the multiple key counter if keys equal if (newkey==keys[sidx]) multikey++; // Compare entries; update the search area if (newkeyslb;sidx--) keys[sidx]=keys[sidx-1]; keys[slb]=newkey; } /*________________________________________________________________*/ // UL interpreter list routines string getcurulipname() /* // Get current UL interpreter name // Return value : // interpreter name, or all if unknown */ { int i /* Loop control variable */; // Loop thru the UL interpreter list for (i=0;i=strlen(mistr)) return; // Scan menu item string for delimiter character(s) for (cl='\0',i=0;(c=mistr[i])!='\0';i++) { // Test on delimiter character if (c==DELCHR) { // Test last character if (cl==DELCHR) cl='\0'; else cl=c; } else { // Add char to keys if last char is delimit. if (cl==DELCHR) keys+=c; // Store current character cl=c; } } } /*________________________________________________________________*/ // SQL/DB selection callback functions int commselfunc(string dstr,int dint,double ddbl, int dval,int dtype,string dtable,string dfield,int didx) /* // Comment selection callback function // Return value : // zero if done or (-1) on data error // Parameters : // string dstr : String/Date data // int dint : Integer/Boolean data // double ddbl : Float data // int dval : Data valid flag // int dtype : Data type // string dtable : Data table name // string dfield : Data field name // int didx : Data output field index */ { // Store comment curcomment=dstr; // Return without errors return(0); } // User Language program end