/* AR_MS (AR) -- Autorouter Mouse Action */ /* AR_MS (AR) -- Autorouter Mausaktion */ /* -- EXECUTED AFTER LEFT MOUSE BUTTON ACTIVATION IN WORK AREA -- */ /* // Copyright (c) 2001-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 (080401) ENHANCEMENT: // Added center/pan window function. // 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 (020906) ENHANCEMENT: // Added optimizer and batch program options to context menus. // rl (020618) RELEASED FOR BAE V5.4. // rl (010625) RELEASED FOR BAE V5.0. // rl (010621) ENHANCEMENT: // Added program calling sequence support. // rl (010110) ORIGINAL CODING. // // DESCRIPTION // // The ar_ms User Language program is automatically // activated when pressing the left mouse button in // the work area while the program is idle. ar_ms // lists a menu of functions for the element at the // given mouse position. */ // Includes #include "std.ulh" // User Language standard include // Disable undo state request #pragma ULCALLERNOUNDO // Messages string UPRABORT = M_UPRABORT(); // Menu names string AR_2_0 = M("&Voll-Autoplace" ,"&Full Autoplacer"); string AR_3_0 = M("&Voll-Autorouter" ,"&Full Autorouter"); string AR_3_1 = M("&Optimierer" ,"&Optimizer"); string AR_3_2 = M("&Einlesen Bahnen" ,"&Load Traces"); string AR_3_3 = M("%Programm-Set&up" ,"%Batch Set&up"); string AR_3_4 = M("Programm-Sta&rt" ,"Batch Sta&rt"); string AR_3_5 = M("&Kompletter Initiallauf","&Complete Initial Run"); string AR_4_0 = M("%&Single Net Route","%Route Single &Net"); string AR_4_1 = M("&Bauteil routen" ,"Route Single &Part"); string AR_7_X = M("%&Optionen" ,"%&Options"); string AR_7_Y = M("&Steuerung" ,"&Control Parameters"); string AR_7_Z = M("&Strategie" ,"&Strategy"); string MI_OPEN = M("&Laden" ,"L&oad"); string MI_ZOOMPAN = M("%Fenster &Mitte" ,"%Center/&Pan Window"); string MI_PARAM = M("%&Einstellungen","%&Settings"); // INI file parameter name definitions #define PAR_MOUSEREP "MOUSEREP_STD" // Mouse command repeat mode int MOUSEREP = bae_iniintval(PAR_MOUSEREP,0) /* Mouse command repeat mode */; typedef struct mnudes { // Menu definition descriptro string t /* Menu text */; string p /* Menu program name */; int c /* Class restriction */; } MNUITEML[] /* Menu item list */; typedef struct fmnudes { // Figure index menu def. descriptor int typ /* Figure list element type */; MNUITEML iteml /* Menu item list */; } FMNUL[] /* Figure index menu list definition */; static FMNUL fmnul = { { L_FIGNREF, { // Named reference functions { AR_4_0,"#400:ml",(-1) }, { AR_4_1,"#401:ml",(-1) }, { AR_2_0,"#200",(-1) }, { AR_3_0,"#300",(-1) }, { AR_3_5,"#305",(-1) }, { AR_3_1,"#301",(-1) }, { AR_3_2,"#302",(-1) }, { AR_7_X,"#5003",(-1) }, { AR_7_Y,"#5004",(-1) }, { AR_7_Z,"#5005",(-1) }, { AR_3_3,"#5006",(-1) }, { AR_3_4,"#304",(-1) }, { MI_ZOOMPAN,"#105:ml",(-1) } } }, { (-1), { // General functions { AR_2_0,"#200",(-1) }, { AR_2_0,"#200",(-1) }, { AR_3_0,"#300",(-1) }, { AR_3_5,"#305",(-1) }, { AR_3_1,"#301",(-1) }, { AR_3_2,"#302",(-1) }, { AR_7_X,"#5003",(-1) }, { AR_7_Y,"#5004",(-1) }, { AR_7_Z,"#5005",(-1) }, { MI_PARAM,"#5001",(-1) }, { AR_3_3,"#5006",(-1) }, { AR_3_4,"#304",(-1) } } } }; // Global variables double x,y /* Mouse position */; // Main program void main() { // Check if no element loaded if (bae_planddbclass()==DDBCLUNDEF) { // Query the function selection switch (bae_askmenu(2,MI_OPEN,UPRABORT)) { // Load case 0 : if (MOUSEREP&0x02) bae_storecmdbuf(0, "#903",bae_plainmenutext(MI_OPEN)); bae_callmenu(903); break; default : ; } return; } // Get the mouse position bae_wsmouse(x,y,0); contextfunc(); bae_clriactqueue(); } void contextfunc() { index L_FIGURE fig /* Figure list index */; int tidx /* Type index */; int tcount /* Type count */; int icount /* Item count */; int mcount /* Menu item count */; STRINGS mnul /* Menu item list */; int mnuidxl[] /* Menu index list */; int res /* Menu selection result */; int i /* Loop control variable */; // Loop for all types tcount=arylength(fmnul); for (tidx=0;tidx=mcount) break; // Call the element program if (MOUSEREP&0x02) bae_storecmdbuf(0,fmnul[tidx].iteml[mnuidxl[res]].p, bae_plainmenutext(fmnul[tidx].iteml[mnuidxl[res]].t)); ulsystem(fmnul[tidx].iteml[mnuidxl[res]].p,0); break; } } // User Language program end