3.6.4.14 Enlarger (macro)

Creates the ZoomRect object in the active graph window. It also creates a graph window named Enlarged. The Enlarged window represents the portion of the original active graph window covered by the ZoomRect object. You can alter the portion of the original graph window that is covered by the ZoomRect object by clicking on the Enlarger tool while pressing CTRL and then dragging out the desired rectangle in the window.

Definition:

Def  Enlarger.Ctrl {
      %B=%H;
      active = %B!page.active;
      run.section(File,PrepareCopyFormats);
      CopyZoomFormat;
      doc -e Open (win -i); // iconize non minimized windows
      GetNamedWin  Enlarged; // create or activate graph window
      layer -ic %B active; 
      run.section(file,PasteFormats);
      pasteformatsdialog 0;	
      layer 0;
      // clean stored style to ensure proper plot info to be added
      UserPlot.text$="%B"; 
      // Store User's Plot name into a memory object
      UserLayer.text$=$(active);
      win -a %B; // activate unenlarged graph window
      layer -s active; // activate layer active
      label -p 50 50; // create label in middle of layer
      draw -n ZoomRect -File Read ZoomRect.OGO; // read object
      win -system Tile;
      ZoomRect.script=0;
      #!v1=;v2=;v3=;v4=;%H=;
      ZoomRect.dx=(v3-v1);
      ZoomRect.dy=(v4-v2);
      ZoomRect.x=(v1+zoomrect.dx/2);
      ZoomRect.y=(v2+zoomrect.dy/2);
      ZoomRect.script=4;
      draw -n ZoomRect -Run; 
};

Example:

The following script activates the ZoomRect object in the active graph window.

Enlarger.Ctrl;