/* ZOOMIN (STD) -- Zoom In */ /* ZOOMIN (STD) -- Zoom groesser */ /* -- INTENDED FOR KEY-CALL USE -- */ /* // 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 (091021) RELEASED FOR BAE V7.4. // rl (081014) RELEASED FOR BAE V7.2. // rl (080605) ENHANCEMENT: // Added turbo zoom to background grid option. // rl (071029) RELEASED FOR BAE V7.0. // rl (060829) RELEASED FOR BAE V6.8. // rl (050906) RELEASED FOR BAE V6.6. // rl (040831) RELEASED FOR BAE V6.4. // rl (030904) RELEASED FOR BAE V6.2. // rl (030715) ENHANCEMENT: // Improved mouse positioning in side menu environment. // rl (021209) RELEASED FOR BAE V6.0. // rl (020802) CHANGE: // Changed zoom destination window to preserve mouse position // in element to allow subsequent zooms without mouse move. // rl (020618) RELEASED FOR BAE V5.4. // rl (011023) BUGFIX: // Enabled call in CAM-View environment. // rl (010625) RELEASED FOR BAE V5.0. // rl (000509) RELEASED FOR BAE V4.6. // rl (990625) RELEASED FOR BAE V4.4. // rl (990623) BUGFIX: // Zoom to windows center if mouse outside window // rl (980910) RELEASED FOR BAE V4.2. // mb (980420) CHANGE: // Clear dialog line at end. // rl (970929) RELEASED FOR BAE V4.0. // rl (970725) IMPROVEMENT: // Zoom to mouse position // rl (970604) ORIGINAL CODING. // // DESCRIPTION // // The zoomin User Language program performs a // zoom in/zoom larger display command. */ // Includes #include "std.ulh" // User Language standard include // Disable undo state request #pragma ULCALLERNOUNDO // INI file parameter name definitions #define PAR_ZOOMCENTER "ZOOMCENTER_STD" // Zoom center mode // Globals #define MINGRIDSTEP 0.003 // Min. display grid step value #define SMALLVAL 0.00000001 // Small compare value static int PULLDOWN = bae_swconfig(3)==BAE_WinPulldwn || bae_swconfig(3)==BAE_MotifPdwn /* BAE Pulldown menus software flag */; // Main program void main() { double gx, gy /* Grid dimensions */; double msx, msy /* Mouse workspace coordinates */; double mxoff, myoff /* Mouse position offset */; double wlx, wux /* Window hor. boundary */; double wly, wuy /* Window ver. boundary */; double wcx, wcy /* Window center coordinates */; double xshrink, yshrink /* Shrink values */; double curzoom /* Current zoom factor */; int warpmode = 0 /* Mouse coordinate warp mode */; int rangedis /* Range check disabled flag */; // Check if right mouse button activation notification if (bae_peekiact() && bae_getactmenu()<0) { askstr("",1024); bae_getbackgrid(gx,gy); bae_getdblpar(2,curzoom); if (gx>SMALLVAL && gy>SMALLVAL && (gx*curzoomgy ? gy : gx))); exit(0); } } // Abort if invalid plan class if (bae_planddbclass()==DDBCLUNDEF) error_class(); // Get current workspace window dimension wlx=bae_wswinlx(); wly=bae_wswinly(); wux=bae_wswinux(); wuy=bae_wswinuy(); // Check window size if (wlx==wux || wly==wuy) error_class(); // Get the mouse workspace position bae_wsmouse(msx,msy,0); // Check if mouse within workspace window if (msx>wlx && msxwly && msy