Added new command option "box remove" that removes the cursor box

from the layout window.  The main reason for this is to keep the
box out of the image when doing "plot svg".  The "plot" command was
also modified to always do a plot of the entire cell in the active
layout window if the box is not present.
This commit is contained in:
Tim Edwards 2020-10-08 13:50:14 -04:00
parent dc99e382dd
commit 581ad6041b
4 changed files with 27 additions and 14 deletions

View File

@ -1 +1 @@
8.3.63 8.3.64

View File

@ -545,6 +545,7 @@ selGetArrayFunc(selUse, use, trans, arg)
* box size [width height] * box size [width height]
* box position [llx lly] [-edit] * box position [llx lly] [-edit]
* box values [llx lly urx ury] [-edit] * box values [llx lly urx ury] [-edit]
* box remove
* box select * box select
* *
* box <direction> <distance> | cursor * box <direction> <distance> | cursor
@ -581,14 +582,15 @@ selGetArrayFunc(selUse, use, trans, arg)
#define BOX_SIZE 2 #define BOX_SIZE 2
#define BOX_POSITION 3 #define BOX_POSITION 3
#define BOX_VALUES 4 #define BOX_VALUES 4
#define BOX_SELECT 5 #define BOX_REMOVE 5
#define BOX_MOVE 6 #define BOX_SELECT 6
#define BOX_GROW 7 #define BOX_MOVE 7
#define BOX_SHRINK 8 #define BOX_GROW 8
#define BOX_CORNER 9 #define BOX_SHRINK 9
#define BOX_EXISTS 10 #define BOX_CORNER 10
#define BOX_HELP 11 #define BOX_EXISTS 11
#define BOX_DEFAULT 12 #define BOX_HELP 12
#define BOX_DEFAULT 13
void void
CmdBox(w, cmd) CmdBox(w, cmd)
@ -601,6 +603,7 @@ CmdBox(w, cmd)
"size [width height] set or return box size", "size [width height] set or return box size",
"position [llx lly] [-edit] set or return box position", "position [llx lly] [-edit] set or return box position",
"values [llx lly urx ury] [-edit] set or return box coordinates", "values [llx lly urx ury] [-edit] set or return box coordinates",
"remove remove cursor box from display",
"select set box to selection bounding box", "select set box to selection bounding box",
"move <direction> <distance> move box position", "move <direction> <distance> move box position",
"grow <direction> <distance> expand box size", "grow <direction> <distance> expand box size",
@ -661,6 +664,12 @@ CmdBox(w, cmd)
windCheckOnlyWindow(&w, DBWclientID); windCheckOnlyWindow(&w, DBWclientID);
if (option == BOX_REMOVE)
{
DBWSetBox((CellDef *)NULL, &GeoNullRect);
return;
}
/*----------------------------------------------------------*/ /*----------------------------------------------------------*/
/* Check for the command options which do not require a box */ /* Check for the command options which do not require a box */
/* to be present. */ /* to be present. */

View File

@ -176,11 +176,11 @@ CmdPlot(w, cmd)
if ((!ToolGetBox(&boxRootDef, &scx.scx_area)) || if ((!ToolGetBox(&boxRootDef, &scx.scx_area)) ||
(scx.scx_use->cu_def != boxRootDef)) (scx.scx_use->cu_def != boxRootDef))
{ {
TxError("The box and cursor must appear in the same window\n"); /* If no box is specified, then use the cell in the layout */
TxError(" for plotting. The box indicates the area to\n"); /* window, and plot the entire cell using the cell bounding */
TxError(" plot, and the cursor's window tells which\n"); /* box as the area to plot. */
TxError(" cells are expanded and unexpanded).\n");
return; scx.scx_area = scx.scx_use->cu_def->cd_bbox;
} }
scx.scx_trans = GeoIdentityTransform; scx.scx_trans = GeoIdentityTransform;
mask = crec->dbw_visibleLayers; mask = crec->dbw_visibleLayers;

View File

@ -614,6 +614,10 @@ proc magic::repaintwrapper { win } {
proc magic::boxview {win {cmdstr ""}} { proc magic::boxview {win {cmdstr ""}} {
if {${cmdstr} == "exists" || ${cmdstr} == "help" || ${cmdstr} == ""} { if {${cmdstr} == "exists" || ${cmdstr} == "help" || ${cmdstr} == ""} {
# do nothing. . . informational only, no change to the box # do nothing. . . informational only, no change to the box
} elseif {${cmdstr} == "remove"} {
set framename [winfo parent $win]
if {$framename == "."} {return}
${framename}.titlebar.pos configure -text "no box"
} elseif {[info level] <= 1} { } elseif {[info level] <= 1} {
# For NULL window, find all layout windows and apply update to each. # For NULL window, find all layout windows and apply update to each.
if {$win == {}} { if {$win == {}} {