/* TOOLBAR (STD) -- Toolbar */ /* TOOLBAR (STD) -- Toolbar */ /* // Copyright (c) 1997-2012 Oliver Bartels F+E, Muenchen // Author: Roman Ludwig // Changes History: // rl (120427) RELEASED FOR BAE V7.8. // rl (101019) RELEASED FOR BAE V7.6. // rl (100303) ENHANCEMENT: // Added edit/info loop buttons. // rl (091027) RELEASED FOR BAE V7.4. // rl (081118) ENHANCEMENT: // Added grid control buttons. // rl (081014) RELEASED FOR BAE V7.2. // rl (080723) ENHANCEMENT: // Added move/delete/group selection buttons. // rl (071029) RELEASED FOR BAE V7.0. // rl (070803) ENHANCEMENT: // Added any layer color button support. // rl (070426) ENHANCEMENT: // Added color palette save button configuration bae.ini entry. // rl (070222) ENHANCEMENT: // Added tooltips. // rl (060829) RELEASED FOR BAE V6.8. // rl (050906) RELEASED FOR BAE V6.6. // rl (040921) ENHANCEMENT: // Fixed erroneous display for multiple doc. layer rows. // rl (040830) RELEASED FOR BAE V6.4. // rl (040429) ENHANCEMENT: // Added schematic quick draw buttons support. // rl (040301) ENHANCEMENT: // Added documentary layer color button support. // rl (030912) RELEASED FOR BAE V6.2. // rl (030514) ENHANCEMENT: // Added layer color button support. // rl (021209) RELEASED FOR BAE V6.0. // rl (020618) RELEASED FOR BAE V5.4. // rl (010625) RELEASED FOR BAE V5.0. // rl (001113) ENHANCEMENT: // Added mouse mode control item. // rl (000509) RELEASED FOR BAE V4.6. // rl (991014) RELEASED FOR BAE V4.4. // rl (990415) ENHANCEMENT: // Added multiple attribute window support. // mb (981002) RELEASED FOR BAE V4.2. // mb (981002) CHANGE: // Adapted to new implicit program call facility (bae_*). // mb (980723) ENHANCEMENT: // File New/Save buttons introduced. // mb (980713) ENHANCEMENT: // Help icon introduced to toolbar. // rl (980526) ENHANCEMENT: // File Open button introduced. // mb (980420) CHANGE: // Inline documentation changed. // rl (980324) ENHANCEMENT: // Added symbol attribute get/set window to SCM toolbar. // rl (971125) RELEASED FOR BAE V4.0. // rl (970603) ORIGINAL CODING. // // DESCRIPTION // // The toolbar User Language program displays a toolbar providing // advanced and frequently used functions and features such as // display function short-cuts, design view management, info and // report function access, automatic SCM part attribute settings, // etc. */ // Includes #include "popdraw.ulh" // User Language popup draw. util. #include "lay.ulh" // User Language layout utilities // Enforce standard caller type #pragma ULCALLERSTD // Disable undo state request #pragma ULCALLERNOUNDO // INI file parameter name definitions #define PAR_TB_CPALROW "TB_CPALROW_LAY"// Toolbar color palette button row #define PAR_TB_DRAWBUT "TB_DRAWBUT_LAY"// Toolbar draw buttons flag #define PAR_TB_CSAVBUT "TB_CSAVBUT_LAY"// Toolbar color save button enable #define PAR_TB_INPGRID "TB_INPGRID_STD"// Toolbar input grid button enable #define PAR_TB_BACKGRID "TB_BACKGRID_STD"// Toolb. background grid button enable // Messages string UPRINPGRID = M("Eingabe","Input"); string UPRBACKGRID = M("Anzeige","Display"); string REPINPGRID = M("Eingaberaster setzen","Set Input Grid"); string REPBACKGRID = M("Hintergrundraster setzen","Set Display Grid"); string REPZOOMPANL = M("Fenster Mitte setzen","Center/Pan Window"); string REPZOOMPANR = M("Zoom Uebersicht","Zoom Overview"); string REPINFO = M("Info","Info"); string REPHELP = M("Hilfemenu","Help Menu"); string REPTOOLBAR = M("Toolbarposition setzen","Set Toolbar Position"); string REPZOOMINL = M("Zoom groesser","Zoom In"); string REPZOOMINR = M("Zoom groesser, mindestens bis zum Hintergrundraster", "Zoom In, at Least to Background Grid"); string REPZOOMOUT = M("Zoom kleiner","Zoom Out"); string REPZOOMWND = M("Zoom Fenster","Zoom Window"); string REPLRMOUSE = M("Linke Maustaste: %s\nRechte Maustaste: %s", "Left mouse button: %s\nRight mouse button: %s"); string REPFILENEWL = M("Neues Element anlegen","Create New Element"); string REPFILENEWR = M("Elementerzeugungsfavoriten", "Element Creation Favorites"); string REPFILEOPENL = M("Element laden","Load Element"); string REPFILEOPENR = M("Elementfavoriten","Element Favorites"); string REPFILESAVEL = M("Speichern","Save"); string REPFILESAVER = M("Speichern unter","Save As"); string REPGERBOPENL = M("Gerberdaten laden","Load Gerber Data"); string REPGERBOPENR = M("Bohrdaten laden","Load Drill Data"); string REPGERBSAVEL = M("Gerberdaten Ausgabe","Write Gerber Data"); string REPGERBSAVER = M("Bohrdaten Ausgabe","Write Drill Data"); string REPLMOUSEMODE = M("Funktion/Elementtypen fuer linke Maustaste setzen", "Set Function/Element Types for LMB"); string REPRMOUSEMODE = M("Funktion/Elementtypen fuer rechte Maustaste setzen", "Set Function/Element Types for RMB"); string REPHISTPREVL = M("zu vorherigem Element springen", "Return to Previous Element"); string REPHISTPREVR = M("Historienauswahl","History Selection"); string REPHISTNEXTL = M("zu naechstem Element springen", "Skip to Next Element"); string REPHISTNEXTR = M("Historienauswahl","History Selection"); string REPFAVORITESL = M("Favoritenfunktionen","Favorite Functions"); string REPFAVORITESR = M("Rasterfavoriten","Favorite Grids"); string REPDRAGMODE = M("Dragmodus setzen","Set Drag Mode"); string REPMOVELEM = M("Elemente bewegen","Move Elements"); string REPEDTELEM = M("Elemente editieren","Edit Elements"); string REPDELELEM = M("Elemente loeschen","Delete Elements"); string REPDELCORN = M("Ecken loeschen","Delete Corners"); string REPGRPELEM = M("Elemente selektieren/deselektieren", "Selecte/Deselect Elements"); string REPINFOELEM = M("Elemente abfragen","Query Elements"); string REPMACROS = M("Makros aufrufen/erzeugen/verwalten", "Macro Call/Creation/Management"); string REPHISTORYL = M("Dateielementhistorie","File Element History"); string REPHISTORYR = M("Menufunktionshistorie","Menu Function History"); string REPNEWCON = M("Neue Verbindung","Add Connection"); string REPNEW2CON = M("Punkt zu Punkt Verbindung", "Point to Point Connection"); string REPNEWLINE = M("Neue Grafiklinie","Add Graphic Line"); string REPDOTLINE = M("Neue Punktlinie","Add Dot Line"); string REPNEWAREA = M("Neue Grafikflaeche","Add Graphic Area"); string REPNEWSTEXT = M("Neuer Standard Text","Add Standard Text"); string REPNEWCTEXT = M("Neuer Kommentartext","Add Commentary Text"); string REPDOCLINE = M("Neue Linie ","Add Line "); string REPDOCAREA = M("Neue Flaeche ","Add Area "); string REPDOCKO = M("Neue Sperrflaeche ","Add Keepout Area "); string REPDOCTEXT = M("Neuer Text ","Add Text "); string REPLOADCOL = M("%d. hinterlegte Farbpalette laden", "Load color table prefix%d"); string REPLAYCOLL = M("Farbe fuer %s setzen","Set %s color"); string REPLAYCOLR = M("%s ein-/ausblenden","Fade in/out %s"); string REPLAYPREF = M("Vorzugslage auf %s setzen\nDoppelklick: nur %s darstellen", "Set preferred layer to %s\nDouble klick: restrictz display to %s"); string REPSAVECOLL = M("Farben fuer 1/2/3/4 speichern", "Save color table for 1/2/3/4"); string REPSAVECOLR = M("Palettenprefix setzen", "Set color table name prefix"); string REPDEFCOLL = M("Defaultfarbpalette 'standard' laden", "Load default color table 'standard'"); string REPDEFCOLR = M("Farben laden", "Load Colors"); string REPWINRESTORE = M("Hinterlegten Bildausschnitt wiederherstellen", "Restore buffered zoom window"); string REPWININFO = M("Information zu hinterlegten Bildausschnitt anzeigen", "Display zoom window buffer info"); string REPWINCLEAR = M("Hinterlegten Bildausschnitt aus Buffer entfernen", "Delete zoom window from buffer"); string REPWINSELECT = M("Bildausschnitt fuer Buffer selektieren", "Select zoom window for buffer"); string REPWINSET = M("Aktuellen Bildausschnitt in Buffer hinterlegen", "Store current zoom window to buffer"); string REPSYMPLACE = M("Neue Symbolinstanz mit hinterlegten Daten platzieren", "Place new symbol instance with buffered data"); string REPSYMINFO = M("Information zu hinterlegten Symbol anzeigen", "Display symbol data buffer info"); string REPSYMCLEAR = M("Hinterlegte Symboldaten aus Buffer entfernen", "Delete symbol data from buffer"); string REPSYMGET = M("Daten eines maussselektierbaren Symbols in Buffer hinterlegen", "Transfer data of mouse selectable symbol to buffer"); string REPSYMSET = M("Hinterlegte Symboldaten aus Buffer auf mausselektierbare Symbole uebertragen", "Transfer buffer symbol data to mouse selectable symbols"); // Command string format #define FMTZOOMCMD "%s %s%d" #define FMTPOSCMD "%s %s" #define FMTLAYCMD "%s %s%d" #define FMTHISTCMD "%s %s" // Button definitions (must be one character and comply with toolzoom.ulc!) #define BUTVIEWSAVEPAL "a" #define BUTVIEWLOADPAL "b" #define BUTVIEWCLEAR "c" #define BUTVIEWREDISP "d" #define BUTVIEWDEFPAL "e" #define BUTVIEWFILEFAV "f" #define BUTVIEWGET 'g' #define BUTVIEWINFO "i" #define BUTVIEWLAYC "l" #define BUTVIEWHISTN "m" #define BUTVIEWHISTP "n" #define BUTVIEWPOSTO "p" #define BUTVIEWRESTORE "r" #define BUTVIEWSET "s" #define BUTVIEWTEXT "t" #define BUTVIEWLINE "u" #define BUTVIEWAREA "v" #define BUTVIEWZOOM "w" #define BUTVIEWPREFLAY "y" #define BUTVIEWFAVORITE "F" #define BUTVIEWMACRO "M" #define BUTVIEWHISTORY "H" #define BUTVIEWDEFPALD "d" #define BUTVIEWSAVEPALD "s" string BUTVIEWMOVE = M("B","M"); #define BUTVIEWEDIT "E" string BUTVIEWDELETE = M("L","D"); #define BUTVIEWGROUP "G" #define BUTVIEWQINFO "I" // User Language program names #define UL_BAE_ZOOM "bae_zoom" // ULP: BAE Zoom Action #define UL_FAVORITE "favorite" // ULP: Favorite management #define UL_GED_MS "ged_ms" // ULP: GED Mouse Action #define UL_HELP "help" // ULP: Online Help #define UL_HISTORY "history" // ULP: File History Call #define UL_INFO "info" // ULP: Info #define UL_TBATTACH "tbattach" // ULP: Attach Toolbar #define UL_TBDVSCM "tbdvscm" // ULP: SCM Toolbar Design View #define UL_TBDVLAY "tbdvlay" // ULP: Layout Toolbar Design View #define UL_MACRO "macro" // ULP: Macro management #define UL_MSMODE "msmode" // ULP: Mouse Mode Selection #define UL_SCM_MS "scm_ms" // ULP: SCM Mouse Action #define UL_ZOOMIN "zoomin" // ULP: Zoom In string ul_toolzoom /* ULP: Toolbar view maintenance */; // Globals #define TOOLROWS 4 // Toolbar rows static int TB_INPGRID = bae_iniintval(PAR_TB_INPGRID,1); // Toolbar input grid button enable static int TB_BACKGRID = bae_iniintval(PAR_TB_BACKGRID,1); // Toolbar background grid button enable static int TB_CPALROW = bae_iniintval(PAR_TB_CPALROW,1); // Toolbar color palette button row static int TB_CSAVBUT = bae_iniintval(PAR_TB_CSAVBUT,1); // Toolbar color save button enable static int TB_DRAWBUT = bae_iniintval(PAR_TB_DRAWBUT,1); // Toolbar doc. layer draw button rows double iconshift = (BUTSCALE+2*0.1)*pop_aspectratio() /* Icon shift distance */; int callertype=uliptype() /* Calling environment type */; double tbcols /* Toolbar columns count */; double tbrows /* Toolbar rows count */; double firstzcol /* First zoom window column */; double firsticol /* First icon column */; double zwsize /* Zoom window size */; int vertical = 0 /* Vertical toolbar flag */; int scmflag = 0 /* SCM flag */; int layflag = 0 /* Layout flag */; int crcolflags[] = { // Cross color black flags 0,0,0,1, 0,0,0,1, 0,0,1,1, 1,1,1,1 }; // Main program void main() { string cmdstr /* Command string */; string varname /* Global variable name */; string abutname /* Action button name */; string abutseq /* Action button sequence */; string abuttip /* Action button tooltip */; int abuttcol /* Action button text color */; int abutbcol /* Action button background color */; double dalx,daly /* Draw area lower corner */; double daux,dauy /* Draw area upper corner */; int tbattach /* Toolbar attachment mode */; int tbsize /* Toolbar size */; double ftbrows /* Float toolbar row counts */; int viewcount /* Design view count */; int bpos /* Button row/column index */; int i, j /* Loop control variables */; // Get/set the toolbar attachment mode if (varget(GV_TB_ATTACH,tbattach)) { // Toolbar attachment mode not globally defined // Set default toolbar attachment mode if (bae_swconfig(3)==BAE_WinPulldwn || bae_swconfig(3)==BAE_MotifPdwn) // Pulldown menu toolbar attachment tbattach=TB_ATTACH_PDW; else // Standard side menu toolbar attachment tbattach=TB_ATTACH_STD; // Store the toolbar attachment mode to global variable varset(GV_TB_ATTACH,tbattach); } // Set the toolbar size according to the toolbar attachment mode switch (tbattach) { // Bottom or top attachment case TB_ATTACH_BOT : case TB_ATTACH_TOP : tbsize=TOOLROWS; break; // Right or left attachment case TB_ATTACH_RGT : case TB_ATTACH_LFT : tbsize=ceil(pop_aspectratio()*TOOLROWS+1); vertical=1; break; // Assume fade-out request on default default : vardelete(GV_TB_ZOOMON); bae_settbsize(0,TB_ATTACH_BOT); return; } // Set the toolbar view maintenance UL program name switch (callertype) { case ULIPSCM : ul_toolzoom=UL_TBDVSCM; scmflag=1; break; case ULIPGED : case ULIPAR : ul_toolzoom=UL_TBDVLAY; layflag=1; break; case ULIPCAM : ul_toolzoom=UL_TBDVLAY; layflag=2; break; case ULIPCV : ul_toolzoom=UL_TBDVLAY; layflag=3; break; default : ul_toolzoom=""; } // Display the toolbar area if (vertical) bae_settbsize(tbsize+1,tbattach); else bae_settbsize(tbsize,tbattach); // Get the toolbar dimensions bae_tbsize(tbcols,tbrows); // Get the first icon position firsticol=vertical ? 5 : ceil(tbrows*pop_aspectratio()+2.0); // Activate the toolbar drawing area bae_popsetarea(1); // Get the first zoom window position if (vertical) { firstzcol=firsticol+1.0; bae_setstrpar(5,MM(REPFAVORITESL,REPFAVORITESR)); popicon_char(0.0,firstzcol,BUTSCALE, BUTVIEWFAVORITE,UL_FAVORITE,TCOLOR_BLACK,COLOR_LGRAY); bae_setstrpar(5,REPMACROS); popicon_char(iconshift,firstzcol, BUTSCALE,BUTVIEWMACRO,UL_MACRO,TCOLOR_BLACK,COLOR_LGRAY); bae_setstrpar(5,MM(REPHISTORYL,REPHISTORYR)); popicon_char(2.0*iconshift,firstzcol,BUTSCALE, BUTVIEWHISTORY,UL_HISTORY,TCOLOR_BLACK,COLOR_LGRAY); if (callertype==ULIPSCM || callertype==ULIPGED) { firstzcol+=1.6; bae_setstrpar(5,MM(REPMOVELEM,REPDRAGMODE)); popicon_char(0.0,firstzcol,BUTSCALE,BUTVIEWMOVE, (callertype==ULIPSCM ? UL_SCM_MS : UL_GED_MS)+":'m'", COLOR_BLUE,COLOR_LGRAY); bae_setstrpar(5,MM(REPEDTELEM,REPDRAGMODE)); popicon_char( iconshift,firstzcol,BUTSCALE,BUTVIEWEDIT, (callertype==ULIPSCM ? UL_SCM_MS : UL_GED_MS)+":'e'", COLOR_BLUE,COLOR_LGRAY); bae_setstrpar(5,MM(REPDELELEM,REPDELCORN)); popicon_char( 2.0*iconshift,firstzcol,BUTSCALE,BUTVIEWDELETE, (callertype==ULIPSCM ? UL_SCM_MS : UL_GED_MS)+":'d'", COLOR_BLUE,COLOR_LGRAY); firstzcol+=1.6; bae_setstrpar(5,REPGRPELEM); popicon_char(0.0,firstzcol,BUTSCALE,BUTVIEWGROUP, (callertype==ULIPSCM ? UL_SCM_MS : UL_GED_MS)+":'g'", COLOR_BLUE,COLOR_LGRAY); bae_setstrpar(5,REPINFOELEM); popicon_char( iconshift,firstzcol,BUTSCALE,BUTVIEWQINFO, (callertype==ULIPSCM ? "#117" : "112"), COLOR_BLUE,COLOR_LGRAY); } firstzcol+=2.0; // Display all user defined buttons for (i=bpos=0;i=3) bpos=0; } } else { firstzcol=firsticol+9.0; bae_setstrpar(5,MM(REPFAVORITESL,REPFAVORITESR)); popicon_char(firstzcol,0.0,BUTSCALE, BUTVIEWFAVORITE,UL_FAVORITE,TCOLOR_BLACK,COLOR_LGRAY); bae_setstrpar(5,REPMACROS); popicon_char(firstzcol,1.4,BUTSCALE, BUTVIEWMACRO,UL_MACRO,TCOLOR_BLACK,COLOR_LGRAY); bae_setstrpar(5,MM(REPHISTORYL,REPHISTORYR)); popicon_char(firstzcol,2.8,BUTSCALE, BUTVIEWHISTORY,UL_HISTORY,TCOLOR_BLACK,COLOR_LGRAY); if (callertype==ULIPSCM || callertype==ULIPGED) { firstzcol+=2.6; bae_setstrpar(5,MM(REPMOVELEM,REPDRAGMODE)); popicon_char(firstzcol,0.0,BUTSCALE,BUTVIEWMOVE, (callertype==ULIPSCM ? UL_SCM_MS : UL_GED_MS)+":'m'", COLOR_BLUE,COLOR_LGRAY); bae_setstrpar(5,MM(REPEDTELEM,REPDRAGMODE)); popicon_char(firstzcol,1.4,BUTSCALE,BUTVIEWEDIT, (callertype==ULIPSCM ? UL_SCM_MS : UL_GED_MS)+":'e'", COLOR_BLUE,COLOR_LGRAY); bae_setstrpar(5,REPDELELEM); popicon_char(firstzcol,2.8,BUTSCALE,BUTVIEWDELETE, (callertype==ULIPSCM ? UL_SCM_MS : UL_GED_MS)+":'d'", COLOR_BLUE,COLOR_LGRAY); firstzcol+=2.6; bae_setstrpar(5,REPGRPELEM); popicon_char(firstzcol,0.0,BUTSCALE,BUTVIEWGROUP, (callertype==ULIPSCM ? UL_SCM_MS : UL_GED_MS)+":'g'", COLOR_BLUE,COLOR_LGRAY); bae_setstrpar(5,REPINFOELEM); popicon_char(firstzcol,1.4,BUTSCALE,BUTVIEWQINFO, (callertype==ULIPSCM ? "#117" : "#112"), COLOR_BLUE,COLOR_LGRAY); } firstzcol+=4.0; // Display all user defined buttons for (i=bpos=0;i=3) bpos=0; } } // Reactivate the standard popup drawing area bae_popsetarea(0); // Get the zoom window size if (vertical) zwsize=ceil(2.0+4.0); else zwsize=ceil(1.0+tbrows*pop_aspectratio()); // Abort if no (valid) toolbar defined if (tbcols==0.0 || tbrows==0.0) return; // Set the float toolbar rows count if (vertical) { ftbrows=4.0; dalx=0.0; daly=firstzcol; daux=tbsize+1.0; dauy=firstzcol+(tbsize+1.0)/pop_aspectratio(); } else { ftbrows=tbrows; dalx=firstzcol; daly=0.0; daux=firstzcol+tbrows*pop_aspectratio(); dauy=ftbrows; } // Set the drawing area varset(GV_TB_ZOOMON,1); varset(GV_TB_ZOOMLX,dalx); varset(GV_TB_ZOOMLY,daly); varset(GV_TB_ZOOMUX,daux); varset(GV_TB_ZOOMUY,dauy); // Activate the toolbar drawing area bae_popsetarea(1); // Advance the first zoom window column if (vertical) firstzcol+=0.5+ceil((tbsize+1.0)/pop_aspectratio()); else firstzcol+=zwsize; // Define the icons deficons(); if (vertical) { if (TB_INPGRID) { bae_popdrawtext( firstzcol,0.0,TCOLOR_BLACK,TPOPBACKCOL,UPRINPGRID); bae_setstrpar(5,REPINPGRID); bae_popareachoice( firstzcol,0.0,firstzcol+2.0,8.0,"#9050"); varset(GV_TB_IGRIDX,0.0); varset(GV_TB_IGRIDY,firstzcol+1.2); firstzcol+=TB_BACKGRID ? 2.4 : 2.7; } if (TB_BACKGRID) { bae_popdrawtext( firstzcol,0.0,TCOLOR_BLACK,TPOPBACKCOL,UPRBACKGRID); bae_setstrpar(5,REPBACKGRID); bae_popareachoice( firstzcol,0.0,firstzcol+2.0,8.0,"#9051"); varset(GV_TB_BGRIDX,0.0); varset(GV_TB_BGRIDY,firstzcol+1.2); firstzcol+=2.7; } } else { if (TB_INPGRID) { bae_popdrawtext( 0.0,firstzcol,TCOLOR_BLACK,TPOPBACKCOL,UPRINPGRID); bae_setstrpar(5,REPINPGRID); bae_popareachoice( 0.0,firstzcol,2.0,firstzcol+8.0,"#9050"); varset(GV_TB_IGRIDX,firstzcol); varset(GV_TB_IGRIDY,1.0); } if (TB_BACKGRID) { bae_popdrawtext(TB_INPGRID ? 2.0 : 0.0,firstzcol, TCOLOR_BLACK,TPOPBACKCOL,UPRBACKGRID); bae_setstrpar(5,REPBACKGRID); bae_popareachoice(TB_INPGRID ? 2.0 : 0.0,firstzcol, TB_INPGRID ? 4.0 : 2.0,firstzcol+8.0,"#9051"); varset(GV_TB_BGRIDX,firstzcol); varset(GV_TB_BGRIDY,TB_INPGRID ? 3.0 : 1.0); } if (TB_INPGRID || TB_BACKGRID) firstzcol+=8.0; } if (ul_toolzoom!="") { // Define layer buttons if (layflag) { if (TB_CPALROW) colpalbuttondef(); if (TB_LCOL_CNT) layerbuttondef(); if (TB_PLCOL_CNT) powlayerbuttondef(); anylayerbuttondef(); doclayerbuttondef(); } // Define draw buttons if (scmflag) quickdrawbuttondef(); // Get the design view window count if (layflag==3) viewcount=0; else if (vertical) viewcount=(tbrows-firstzcol+0.5)/4.5; else viewcount=(tbcols-firstzcol)/zwsize; // Store the design view window count varset(GV_TB_DVN,viewcount); // Define the design view windows for (i=0;i=0) { // Display and activate the File/New button bae_setstrpar(5,MM(REPFILENEWL,REPFILENEWR)); popicon_filenew(iconcol,ICONYOFF+BUTSCALE+0.1,BUTSCALE, UL_FAVORITE+":'n'"); } iconcol+=iconshift; // Display and activate the File/Open button on request if (openmitem>=0) { bae_setstrpar(5,callertype==ULIPCV ? MM(REPGERBOPENL,REPGERBOPENR) : MM(REPFILEOPENL,REPFILEOPENR)); popicon_fileopen(iconcol,ICONYOFF+BUTSCALE+0.1,BUTSCALE, UL_FAVORITE+":'"+BUTVIEWFILEFAV+"'"); } iconcol+=iconshift; // Display and activate the File/Save button on request if (savemitem>=0) { bae_setstrpar(5,callertype==ULIPCV ? MM(REPGERBSAVEL,REPGERBSAVER) : MM(REPFILESAVEL,REPFILESAVER)); popicon_filesave( iconcol,ICONYOFF+BUTSCALE+0.1,BUTSCALE,itoa(savemitem)); iconcol+=iconshift; } // Display and activate the Mouse mode button on request iconcol=0.0; if (msmitem!="") { bae_getintpar(3,msmmode); if (msmmode&2) { bae_setstrpar(5,REPRMOUSEMODE); popicon_rmouse(iconcol,ICONYOFF+0.1+(vertical ? 2.0*BUTSCALE+0.1 : BUTSCALE),BUTSCALE,msmitem); } else { bae_setstrpar(5,REPLMOUSEMODE); popicon_lmouse(iconcol,ICONYOFF+0.1+(vertical ? 2.0*BUTSCALE+0.1 : BUTSCALE),BUTSCALE,msmitem); } } iconcol+=iconshift; if (ul_toolzoom!="" && layflag!=3) { if (varget(GV_TB_HISTMAX,histmax) || varget(GV_TB_HISTPOS,histpos) || varget(GV_TB_HISTBASE,histbase)) { histmax=histbase=0; histpos=0; } sprintf(cmdstr,FMTHISTCMD,UL_HISTORY,BUTVIEWHISTP); bae_setstrpar(5,MM(REPHISTPREVL,REPHISTPREVR)); if (popicon_left(iconcol,ICONYOFF+0.1+ (vertical ? 2.0*BUTSCALE+0.1 : BUTSCALE),BUTSCALE, histpos<=histbase ? 0 : 1,0,cmdstr)==0) { varset(GV_TB_HISTPX,iconcol); varset(GV_TB_HISTPY,ICONYOFF+0.1+(vertical ? 2.0*BUTSCALE+0.1 : BUTSCALE)); } iconcol+=iconshift; sprintf(cmdstr,FMTHISTCMD,UL_HISTORY,BUTVIEWHISTN); bae_setstrpar(5,MM(REPHISTNEXTL,REPHISTNEXTR)); if (popicon_right(iconcol,ICONYOFF+0.1+ (vertical ? 2.0*BUTSCALE+0.1 : BUTSCALE),BUTSCALE, (histpos+1)>=histmax ? 0 : 1,0,cmdstr)==0) { varset(GV_TB_HISTNX,iconcol); varset(GV_TB_HISTNY,ICONYOFF+0.1+(vertical ? 2.0*BUTSCALE+0.1 : BUTSCALE)); } iconcol+=iconshift; } else { iconcol+=2*iconshift; } } static void viewwindef(int viewidx) /* // Define a view window // Parameter : // int viewidx : Design view index */ { string cmdstr /* Command string */; string butstr /* Button string */; double x /* Design view window X offset */; double y /* Design view window Y offset */; double w /* Design view window width */; double h /* Design view window height */; int symbox /* Symbol data box flag */; // Get the zoom window offset x=vertical ? 0.0 : firstzcol+viewidx*zwsize; y=vertical ? firstzcol+viewidx*4.5 : 0.0; symbox= (scmflag && viewidx=1.0) { butstr= symbox ? BUTVIEWGET : BUTVIEWZOOM; sprintf(cmdstr,FMTZOOMCMD,ul_toolzoom,butstr,viewidx); bae_setstrpar(5,symbox ? REPSYMGET : REPWINSELECT); bae_poptextchoice(y,x,butstr,cmdstr); } // Display the design view set button if (tbrows>=2.0) { sprintf(cmdstr,FMTZOOMCMD,ul_toolzoom,BUTVIEWSET,viewidx); bae_setstrpar(5,symbox ? REPSYMSET : REPWINSET); bae_poptextchoice(y+TOOLROWS-1,x,BUTVIEWSET,cmdstr); } // Display the design view info button if (tbrows>=3.0) { sprintf(cmdstr,FMTZOOMCMD,ul_toolzoom,BUTVIEWINFO,viewidx); bae_setstrpar(5,symbox ? REPSYMINFO : REPWININFO); bae_poptextchoice(y+1,x,BUTVIEWINFO,cmdstr); } // Display the design view clear button if (tbrows>=4.0) { sprintf(cmdstr,FMTZOOMCMD,ul_toolzoom,BUTVIEWCLEAR,viewidx); bae_setstrpar(5,symbox ? REPSYMCLEAR : REPWINCLEAR); bae_poptextchoice(y+TOOLROWS-2,x,BUTVIEWCLEAR,cmdstr); } // Advance the zoom window offset x+=1.0; w=4.0*pop_aspectratio(); h=4.0; // Set the design view display area variables varset(GV_TB_DVX+itoa(viewidx),x); varset(GV_TB_DVY+itoa(viewidx),y); varset(GV_TB_DVW+itoa(viewidx),w); varset(GV_TB_DVH+itoa(viewidx),h); // Draw the zoom window rectangle pop_drawrect(x,y,w,h,COLOR_NONE,TCOLOR_BLACK); // Activate the window restore area sprintf(cmdstr,FMTZOOMCMD,ul_toolzoom,BUTVIEWRESTORE,viewidx); bae_setstrpar(5,symbox ? REPSYMPLACE : REPWINRESTORE); bae_popareachoice(y,x,y+h,x+w,cmdstr); } static void colpalbuttondef() /* // Define the color palette buttons */ { string cmdstr /* Command string */; string tipstr /* Tooltip string */; int nbut /* Neighbour button index */; int i /* Loop control variable */; // Display palette elements if (vertical) { for (i=1;i<=(TB_CSAVBUT ? 4 : 5);i++) { sprintf(cmdstr,FMTZOOMCMD,ul_toolzoom,BUTVIEWLOADPAL,i); sprintf(tipstr,REPLOADCOL,i); bae_setstrpar(5,tipstr); bae_poptextchoice(firstzcol,(i-1.0)*1.4,itoa(i),cmdstr); } sprintf(cmdstr,FMTZOOMCMD,ul_toolzoom,BUTVIEWLOADPAL,0); bae_setstrpar(5,MM(REPDEFCOLL,REPDEFCOLR)); bae_poptextchoice(firstzcol,7.5,BUTVIEWDEFPALD,cmdstr); if (layflag<2 && TB_CSAVBUT) { bae_setstrpar(5,MM(REPSAVECOLL,REPSAVECOLR)); sprintf(cmdstr,FMTPOSCMD,ul_toolzoom,BUTVIEWSAVEPAL); bae_poptextchoice(firstzcol,6.0,BUTVIEWSAVEPALD,cmdstr); } firstzcol+=1.2; } else { for (i=1;i<=(TB_CSAVBUT ? 2 : 3);i++) { nbut=i+(TB_CSAVBUT ? 2 : 3); sprintf(cmdstr,FMTZOOMCMD,ul_toolzoom,BUTVIEWLOADPAL,i); sprintf(tipstr,REPLOADCOL,i); bae_setstrpar(5,tipstr); bae_poptextchoice(i-1.0,firstzcol,itoa(i),cmdstr); sprintf(cmdstr,FMTZOOMCMD,ul_toolzoom,BUTVIEWLOADPAL, nbut); sprintf(tipstr,REPLOADCOL,nbut); bae_setstrpar(5,tipstr); bae_poptextchoice( i-1.0,firstzcol+1.0,itoa(nbut),cmdstr); } sprintf(cmdstr,FMTZOOMCMD,ul_toolzoom,BUTVIEWLOADPAL,0); bae_setstrpar(5,MM(REPDEFCOLL,REPDEFCOLR)); bae_poptextchoice(3.0,firstzcol,BUTVIEWDEFPALD,cmdstr); if (layflag<2 && TB_CSAVBUT) { sprintf(cmdstr,FMTZOOMCMD,ul_toolzoom,BUTVIEWSAVEPAL,i); bae_setstrpar(5,MM(REPSAVECOLL,REPSAVECOLR)); bae_poptextchoice(2.0,firstzcol,BUTVIEWSAVEPALD,cmdstr); } firstzcol+=2.5; } firstzcol+=0.5; } static void layerbuttondef() /* // Define the layer color buttons */ { string cmdstr /* Command string */; string tipstr /* Tooltip string */; string butstr /* Button string */; double bx /* Button base X pos. */; double by /* Button base Y pos. */; double x /* Layer color button X pos. */; double y /* Layer color button Y pos. */; double ix = (-1.0) /* Layer inv. text button X pos. */; double iy /* Layer inv. text button Y pos. */; double ilx = (-1.0) /* Layer inv. line button X pos. */; double ily /* Layer inv. line button Y pos. */; double iilx = (-1.0) /* Layer inv. line button X pos. */; double iily /* Layer inv. line button Y pos. */; int ycnt /* Layer color button Y count */; double curx = 0.0 /* Current button Y count */; double cury = 0.0 /* Current button Y count */; double w /* Layer color button width */; double h /* Layer color button height */; int color /* Layer color index */; int ccolor /* Layer cross color index */; int picklay = LAYERINV /* Pick layer */; int toplay = LAYERINV /* Plan top layer */; int itoplay = LAYERINV /* Plan top layer */; int laycode /* Documentary layer code */; int i /* Loop control variable */; // Get the first button position if (vertical) { bx=0; by=firstzcol; ycnt=((TB_LCOL_CNT&1) ? TB_LCOL_CNT+1 : TB_LCOL_CNT)/2; } else { bx=firstzcol; by=0; ycnt=tbrows; } // Set color button size w=1.5; h=1; // Get the pick layer if (callertype==ULIPGED) { if (ged_getpickmode()==0) picklay=ged_getpickpreflay(); } else if (varget(GV_TB_PICKLAST,picklay)) { picklay=LAYERINV; } varset(GV_TB_PICKLAY,picklay); // Get the plan top layer if (callertype==ULIPGED || callertype==ULIPCAM || callertype==ULIPAR) { toplay=lay_plantoplay(); varset(GV_TB_TOPLAY,toplay); if (toplay==1 && (itoplay=lay_planmidlaycnt())>0) itoplay++; else itoplay=LAYERINV; varset(GV_TB_ITOPLAY,itoplay); } // Display all buttons for (i=0;i15 || crcolflags[color]) ? COLOR_BLACK : COLOR_WHITE; } else { color=color&0x0FFFFF; ccolor=(-1); } // Draw the layer button rectangle pop_drawrect(x,y,w,h,color,TCOLOR_BLACK); // Activate the layer button area sprintf(cmdstr,FMTLAYCMD,ul_toolzoom,BUTVIEWLAYC,laycode); sprintf(tipstr,MM(REPLAYCOLL,REPLAYCOLR), layername(laycode),layername(laycode)); bae_setstrpar(5,tipstr); bae_popareachoice(y,x,y+h,x+w,cmdstr); // Check if color faded out if (ccolor>=0) // Draw cross lines crossbox(ccolor,x,y,w,h); // Get next layer button position cury++; if (cury>=ycnt) { curx++; cury=0; } } if (ix>=0.0) // Complement pick layer complementbox(ix,iy,ix+2.0,iy+1.0); if (ilx>=0.0) // Complement top layer line complementbox(ilx+1.0,ily+0.1,ilx+1.9,ily+0.9); if (iilx>=0.0) // Complement inner top layer line complementbox(iilx,iily+0.8,iilx+1.9,iily+1.0); if (vertical) { firstzcol+=ycnt+0.5; } else { h=ycnt; firstzcol+=ceil(TB_LCOL_CNT/h)*4.0+1.0; } } static void powlayerbuttondef() /* // Define the power layer color buttons */ { string cmdstr /* Command string */; string tipstr /* Tooltip string */; string butstr /* Button string */; double bx /* Button base X pos. */; double by /* Button base Y pos. */; double x /* Layer color button X pos. */; double y /* Layer color button Y pos. */; double ix = (-1.0) /* Layer inv. text button X pos. */; double iy /* Layer inv. text button Y pos. */; int ycnt /* Layer color button Y count */; double curx = 0.0 /* Current button Y count */; double cury = 0.0 /* Current button Y count */; double w /* Layer color button width */; double h /* Layer color button height */; int color /* Layer color index */; int ccolor /* Layer cross color index */; int picklay = LAYERINV /* Pick layer */; int laycode /* Current layer code */; int i /* Loop control variable */; // Get the first button position if (vertical) { bx=0; by=firstzcol; ycnt=((TB_PLCOL_CNT&1) ? TB_PLCOL_CNT+1 : TB_PLCOL_CNT)/2; } else { bx=firstzcol; by=0; ycnt=tbrows; } // Set color button size w=1.5; h=1; // Get the pick layer if (callertype==ULIPGED) { if (ged_getpickmode()==0) picklay=ged_getpickpreflay(); } else if (varget(GV_TB_PICKLAST,picklay)) { picklay=LAYERINV; } varset(GV_TB_PICKLAY,picklay); // Display all buttons for (i=0;i15 || crcolflags[color]) ? COLOR_BLACK : COLOR_WHITE; } else { color=color&0x0FFFFF; ccolor=(-1); } // Draw the layer button rectangle pop_drawrect(x,y,w,h,color,TCOLOR_BLACK); // Activate the layer button area sprintf(cmdstr,FMTLAYCMD,ul_toolzoom,BUTVIEWLAYC,laycode); sprintf(tipstr,MM(REPLAYCOLL,REPLAYCOLR), layername(laycode),layername(laycode)); bae_setstrpar(5,tipstr); bae_popareachoice(y,x,y+h,x+w,cmdstr); // Check if color faded out if (ccolor>=0) // Draw cross lines crossbox(ccolor,x,y,w,h); // Get next layer button position cury++; if (cury>=ycnt) { curx++; cury=0; } } if (ix>=0.0) // Complement pick layer complementbox(ix,iy,ix+2.0,iy+1.0); if (vertical) { firstzcol+=ycnt+0.5; } else { h=ycnt; firstzcol+=ceil(TB_PLCOL_CNT/h)*4.0+1.0; } } static void anylayerbuttondef() /* // Define the any layer color buttons */ { string varname /* Global variable name */; string layname /* Layer name */; string cmdstr /* Command string */; string tipstr /* Tooltip string */; double bx /* Button base X pos. */; double by /* Button base Y pos. */; double x /* Layer color button X pos. */; double y /* Layer color button Y pos. */; double ix = (-1.0) /* Layer inv. text button X pos. */; double iy /* Layer inv. text button Y pos. */; int ilen /* Layer inv. text length */; double w /* Layer color button width */; double h /* Layer color button height */; int color /* Layer color index */; int ccolor /* Layer cross color index */; int picklay = LAYERINV /* Pick layer */; int toplay = LAYERINV /* Plan top layer */; int laycode /* Layer code */; int curlen /* Cur. layer name length */; int maxlen = 0 /* Max. layer name length */; int gedflag = (callertype==ULIPGED ? 1 : 0) /* Layout editor environmemt flag */; int i /* Loop control variable */; // Get the first button position if (vertical) { bx=0.0; by=firstzcol; } else { bx=firstzcol; by=0.0; } // Set color button size w=1.5; h=1; // Get the pick layer if (gedflag) { if (ged_getpickmode()==0) picklay=ged_getpickpreflay(); } else if (varget(GV_TB_PICKLAST,picklay)) { picklay=LAYERINV; } varset(GV_TB_PICKLAY,picklay); // Get the plan top layer if (callertype==ULIPGED || callertype==ULIPCAM || callertype==ULIPAR) toplay=lay_plantoplay(); // Display all buttons for (i=0;i15 || crcolflags[color]) ? COLOR_BLACK : COLOR_WHITE; } else { color=color&0x0FFFFF; ccolor=(-1); } // Draw the layer button rectangle pop_drawrect(x,y,w,h,color,TCOLOR_BLACK); // Activate the layer button area sprintf(cmdstr, FMTLAYCMD,ul_toolzoom,BUTVIEWLAYC,laycode); sprintf(tipstr,MM(REPLAYCOLL,REPLAYCOLR), layername(laycode),layername(laycode)); bae_setstrpar(5,tipstr); bae_popareachoice(y,x,y+h,x+w,cmdstr); // Check if color faded out if (ccolor>=0) // Draw cross lines crossbox(ccolor,x,y,w,h); by+=1.0; if (!vertical && (i&0x03)==0x03) { by-=4.0; bx+=maxlen+w+1.0; firstzcol+=maxlen+w+1.0; maxlen=0.0; } } if (i==0) return; if (ix>=0.0) // Complement pick layer complementbox(ix,iy,ix+ilen,iy+1.0); if (vertical) firstzcol+=i+0.5; else if ((i&0x03)!=0) firstzcol+=maxlen+w+1.0; } static void doclayerbuttondef() /* // Define the documentary layer color buttons */ { string varname /* Global variable name */; string layname /* Layer name */; string cmdstr /* Command string */; string tipstr /* Tooltip string */; string butstr /* Button string */; double bx /* Button base X pos. */; double by /* Button base Y pos. */; double x /* Layer color button X pos. */; double y /* Layer color button Y pos. */; double ix = (-1.0) /* Layer inv. text button X pos. */; double iy /* Layer inv. text button Y pos. */; double w /* Layer color button width */; double h /* Layer color button height */; int color /* Layer color index */; int ccolor /* Layer cross color index */; int picklay = LAYERINV /* Pick layer */; int laybase /* Documentary layer base */; int laycode /* Documentary layer code */; int docidx /* Documentary layer index */; int gedflag = (callertype==ULIPGED ? 1 : 0) /* Layout editor environmemt flag */; int dbutflag = (gedflag && TB_DRAWBUT ? 1 : 0) /* Draw button creation flag */; int i, j /* Loop control variables */; // Get the first button position if (vertical) { bx=0.0; by=firstzcol; } else { bx=firstzcol; by=0.0; } // Set color button size w=1.5; h=1; // Get the pick layer if (gedflag) { if (ged_getpickmode()==0) picklay=ged_getpickpreflay(); } else if (varget(GV_TB_PICKLAST,picklay)) { picklay=LAYERINV; } varset(GV_TB_PICKLAY,picklay); // Display all buttons for (i=0;i>4; // Get layer name if (vertical) // 8 character name for vertical toolbar layname=strextract(bae_plainmenutext( lay_doclayname(docidx)),0,7); else // Short name for horizontal toolbar sprintf(layname,"D%d",docidx+1); // Display layer name bae_popdrawtext(by,bx,TCOLOR_BLACK,TPOPBACKCOL,layname); by++; // Display side buttons/color fields x=bx; y=by; for (j=0;j<=2;j++) { if (vertical) y=by; else x=bx; laycode=laybase+j; // Display layer string butstr= j==0 ? "1" : j==1 ? "2" : "B" ; sprintf(cmdstr,FMTLAYCMD, ul_toolzoom,BUTVIEWPREFLAY,laycode); sprintf(tipstr,REPLAYPREF, layername(laycode),layername(laycode)); bae_setstrpar(5,tipstr); bae_poptextchoice(y,x,butstr,cmdstr); if (picklay==laycode) { // Store inversion position ix=x; iy=y; } // Check if quick text/line/area buttons if (dbutflag && (lay_doclayside(docidx)==j || lay_doclayside(docidx)==(-1))) { if (vertical) { // Activate the line button area pop_drawline( x+0.1,y+1.8,x+0.7,y+1.2,TCOLOR_BLACK); sprintf(cmdstr, FMTLAYCMD,ul_toolzoom,BUTVIEWLINE,laycode); bae_setstrpar(5,REPDOCLINE+layername(laycode)); bae_popareachoice(y+1.0,x,y+2.0,x+0.8,cmdstr); // Activate the area button area pop_drawrect( x+0.9,y+1.2,0.6,0.6,TCOLOR_BLACK,-1); sprintf(cmdstr, FMTLAYCMD,ul_toolzoom,BUTVIEWAREA,laycode); bae_setstrpar(5, MM(REPDOCAREA+layername(laycode), REPDOCKO+layername(laycode))); bae_popareachoice( y+1.0,x+0.8,y+2.0,x+1.6,cmdstr); // Activate the text button area pop_drawline( x+1.7,y+1.2,x+2.3,y+1.2,TCOLOR_BLACK); pop_drawline( x+2.0,y+1.2,x+2.0,y+1.8,TCOLOR_BLACK); sprintf(cmdstr, FMTLAYCMD,ul_toolzoom,BUTVIEWTEXT,laycode); bae_setstrpar(5,REPDOCTEXT+layername(laycode)); bae_popareachoice( y+1.0,x+1.6,y+2.0,x+2.4,cmdstr); } else { // Activate the line button area pop_drawline( x+2.7,y+0.8,x+3.3,y+0.2,TCOLOR_BLACK); sprintf(cmdstr, FMTLAYCMD,ul_toolzoom,BUTVIEWLINE,laycode); bae_setstrpar(5,REPDOCLINE+layername(laycode)); bae_popareachoice(y,x+2.5,y+1.0,x+3.5,cmdstr); // Activate the area button area pop_drawrect( x+3.7,y+0.2,0.6,0.6,TCOLOR_BLACK,-1); sprintf(cmdstr, FMTLAYCMD,ul_toolzoom,BUTVIEWAREA,laycode); bae_setstrpar(5,REPDOCAREA+layername(laycode)); bae_popareachoice(y,x+3.5,y+1.0,x+4.5,cmdstr); // Activate the text button area pop_drawline( x+4.7,y+0.2,x+5.3,y+0.2,TCOLOR_BLACK); pop_drawline( x+5.0,y+0.2,x+5.0,y+0.8,TCOLOR_BLACK); sprintf(cmdstr, FMTLAYCMD,ul_toolzoom,BUTVIEWTEXT,laycode); bae_setstrpar(5,REPDOCTEXT+layername(laycode)); bae_popareachoice(y,x+4.5,y+1.0,x+5.5,cmdstr); } } x++; // Set the layer button display area variables varset(GV_TB_LCX+itoa(laycode),x); varset(GV_TB_LCY+itoa(laycode),y); varset(GV_TB_LCW+itoa(laycode),w); varset(GV_TB_LCH+itoa(laycode),h); // Get the layer color color=bae_getcolor(laycode); if (color<0) { color=((-color)-1)&0x0FFFFF; ccolor=(color>15 || crcolflags[color]) ? COLOR_BLACK : COLOR_WHITE; } else { color=color&0x0FFFFF; ccolor=(-1); } // Draw the layer button rectangle pop_drawrect(x,y,w,h,color,TCOLOR_BLACK); // Activate the layer button area sprintf(cmdstr, FMTLAYCMD,ul_toolzoom,BUTVIEWLAYC,laycode); sprintf(tipstr,MM(REPLAYCOLL,REPLAYCOLR), layername(laycode),layername(laycode)); bae_setstrpar(5,tipstr); bae_popareachoice(y,x,y+h,x+w,cmdstr); // Check if color faded out if (ccolor>=0) // Draw cross lines crossbox(ccolor,x,y,w,h); x+=2.0; y++; } if (vertical) { by+=dbutflag ? 2.0 : 1.0; } else { bx+=dbutflag ? 6.5 : 3.5; by-=1.0; } } if (i==0) { if (vertical && (TB_LCOL_CNT || TB_CPALROW)) firstzcol+=0.5; return; } if (ix>=0.0) // Complement pick layer complementbox(ix,iy,ix+1.0,iy+1.0); if (vertical) firstzcol+=(2.0+dbutflag)*i+0.5; else firstzcol+=(3.5+3.0*dbutflag)*i+1; } static void quickdrawbuttondef() /* // Define the quick draw buttons */ { string cmdstr /* Command string */; double x /* Layer color button X pos. */; double y /* Layer color button Y pos. */; // Draw the buttons if (vertical) { x=0.5; y=firstzcol; // Activate the line button area pop_drawline(x+0.4,y+0.7,x+0.4,y+0.4,TCOLOR_BLACK); pop_drawline(x+0.4,y+0.4,x+1.0,y+0.4,TCOLOR_BLACK); pop_drawline(x+1.0,y+0.4,x+1.0,y+0.1,TCOLOR_BLACK); sprintf(cmdstr,FMTLAYCMD,ul_toolzoom,BUTVIEWLINE,0); bae_setstrpar(5,MM(REPNEWLINE,REPNEWCON)); bae_popareachoice(y,x,y+0.8,x+1.4,cmdstr); // Activate the dotted line button area pop_drawline(x+1.8,y+0.7,x+1.8,y+0.625,TCOLOR_BLACK); pop_drawline(x+1.8,y+0.475,x+1.8,y+0.4,TCOLOR_BLACK); pop_drawline(x+1.8,y+0.4,x+1.95,y+0.4,TCOLOR_BLACK); pop_drawline(x+2.25,y+0.4,x+2.4,y+0.4,TCOLOR_BLACK); pop_drawline(x+2.4,y+0.4,x+2.4,y+0.325,TCOLOR_BLACK); pop_drawline(x+2.4,y+0.175,x+2.4,y+0.1,TCOLOR_BLACK); sprintf(cmdstr,FMTLAYCMD,ul_toolzoom,BUTVIEWLINE,1); bae_setstrpar(5,MM(REPDOTLINE,REPNEW2CON)); bae_popareachoice(y,x+1.4,y+0.8,x+2.8,cmdstr); // Activate the area button area pop_drawrect(x+3.2,y+0.1,0.6,0.6,TCOLOR_BLACK,-1); sprintf(cmdstr,FMTLAYCMD,ul_toolzoom,BUTVIEWLINE,2); bae_setstrpar(5,REPNEWAREA); bae_popareachoice(y,x+2.8,y+0.8,x+4.2,cmdstr); // Activate the text button area pop_drawline(x+4.6,y+0.1,x+5.2,y+0.1,TCOLOR_BLACK); pop_drawline(x+4.9,y+0.1,x+4.9,y+0.7,TCOLOR_BLACK); sprintf(cmdstr,FMTLAYCMD,ul_toolzoom,BUTVIEWTEXT,0); bae_setstrpar(5,REPNEWSTEXT); bae_popareachoice(y,x+4.2,y+0.8,x+5.6,cmdstr); // Activate the commentary text button area pop_drawline(x+6.0,y+0.1,x+6.6,y+0.1,13); pop_drawline(x+6.3,y+0.1,x+6.3,y+0.7,13); sprintf(cmdstr,FMTLAYCMD,ul_toolzoom,BUTVIEWTEXT,1); bae_setstrpar(5,REPNEWCTEXT); bae_popareachoice(y,x+5.6,y+0.8,x+7.0,cmdstr); firstzcol+=1.5; } else { x=firstzcol; y=0.0; // Activate the line button area pop_drawline(x+0.1,y+0.7,x+0.1,y+0.4,TCOLOR_BLACK); pop_drawline(x+0.1,y+0.4,x+0.7,y+0.4,TCOLOR_BLACK); pop_drawline(x+0.7,y+0.4,x+0.7,y+0.1,TCOLOR_BLACK); sprintf(cmdstr,FMTLAYCMD,ul_toolzoom,BUTVIEWLINE,0); bae_setstrpar(5,REPNEWLINE); bae_popareachoice(y,x,y+0.8,x+0.8,cmdstr); // Activate the dotted line button area pop_drawline(x+0.1,y+1.5,x+0.1,y+1.425,TCOLOR_BLACK); pop_drawline(x+0.1,y+1.275,x+0.1,y+1.2,TCOLOR_BLACK); pop_drawline(x+0.1,y+1.2,x+0.25,y+1.2,TCOLOR_BLACK); pop_drawline(x+0.55,y+1.2,x+0.7,y+1.2,TCOLOR_BLACK); pop_drawline(x+0.7,y+1.2,x+0.7,y+1.125,TCOLOR_BLACK); pop_drawline(x+0.7,y+0.875,x+0.7,y+0.8,TCOLOR_BLACK); sprintf(cmdstr,FMTLAYCMD,ul_toolzoom,BUTVIEWLINE,1); bae_setstrpar(5,REPDOTLINE); bae_popareachoice(y+0.8,x,y+1.6,x+0.8,cmdstr); // Activate the area button area pop_drawrect(x+0.1,y+1.7,0.6,0.6,TCOLOR_BLACK,-1); sprintf(cmdstr,FMTLAYCMD,ul_toolzoom,BUTVIEWLINE,2); bae_setstrpar(5,REPNEWAREA); bae_popareachoice(y+1.6,x,y+2.4,x+0.8,cmdstr); // Activate the text button area pop_drawline(x+0.1,y+2.5,x+0.7,y+2.5,TCOLOR_BLACK); pop_drawline(x+0.4,y+2.5,x+0.4,y+3.1,TCOLOR_BLACK); sprintf(cmdstr,FMTLAYCMD,ul_toolzoom,BUTVIEWTEXT,0); bae_setstrpar(5,REPNEWSTEXT); bae_popareachoice(y+2.4,x,y+3.2,x+0.8,cmdstr); // Activate the commentary text button area pop_drawline(x+0.1,y+3.3,x+0.7,y+3.3,13); pop_drawline(x+0.4,y+3.3,x+0.4,y+3.9,13); bae_setstrpar(5,REPNEWCTEXT); sprintf(cmdstr,FMTLAYCMD,ul_toolzoom,BUTVIEWTEXT,1); bae_popareachoice(y+3.2,x,y+4.0,x+0.8,cmdstr); firstzcol+=2.0; } } void crossbox(int ccolor,double x,double y,double w, double h) /* // Cross out rectangle box // Parameters : // int ccolor : Cross color index // double x : Rectangle X pos. // double y : Rectangle Y pos. // double w : Rectangle width // double h : Rectangle height */ { // Draw cross lines bae_clearpoints(); bae_storepoint(x,y,0); bae_storepoint(x+w,y+h,0); bae_popdrawpoly(ccolor,DM_REPLACE,PPFM_LINE); bae_clearpoints(); bae_storepoint(x+w,y,0); bae_storepoint(x,y+h,0); bae_popdrawpoly(ccolor,DM_REPLACE,PPFM_LINE); } void complementbox(double lx,double ly,double ux, double uy) /* // Complement rectangle box // Parameters : // double lx : Lower X pos. // double ly : Lower Y pos. // double ux : Upper X pos. // double uy : Upper Y pos. */ { // Complement rectangle content bae_clearpoints(); bae_storepoint(lx,ly,0); bae_storepoint(ux,ly,0); bae_storepoint(ux,uy,0); bae_storepoint(lx,uy,0); bae_popdrawpoly(TCOLOR_WHITE,DM_COMPLEMENT,PPFM_FILL); } string MM(string leftstr,string rightstr) /* // Build mouse button dependant tooltip string // Returns : // Tooltip string // Parameters : // string leftstr : Left mouse button action info // string rightstr : Right mouse button action info */ { string res /* Result string buffer */; sprintf(res,REPLRMOUSE,leftstr,rightstr); return(res); } // User Language program end