left anchor window title in tab buttons

This commit is contained in:
Stefan Frederik 2022-01-13 15:40:20 +01:00
parent 6c85ceaad8
commit acae16d106
6 changed files with 18 additions and 10 deletions

View File

@ -260,8 +260,15 @@ in this case only the verilog-related global property has some definition. This
<h3>WIRE OBJECT</h3>
<p>
Example: <kbd>N 890 -130 890 -110 {lab=ANALOG_GND}</kbd><br>
The net 'N' tag is followed by the end point coordinates x1,y1 - x2,y2
The net 'N' tag is followed by the end point coordinates x1,y1 - x2,y2.
(stored and read as double precision numbers) and a property string, used in this case to name the net.
In most cases you don't need to specify attributes for nets (one exception is the <kbd>bus</kbd> attribute)
as the <kbd>lab</kbd> attribute is set by xschem when creating a netlist or more generally when
building the connectivity.
This means that almost always nets in a xschem schematic are set as in following example:<br>
<kbd>N 890 -130 890 -110 {}</kbd><br>
Xschem schematic files store only geometrical data and attributes of the graphic primitives,
the connectivity and the logical network is obtained by xschem.
</p>
<h3>LINE OBJECT</h3>
<p>
@ -283,7 +290,7 @@ in this case only the verilog-related global property has some definition. This
followed by the number of points (integer),
the x,y coordinates of the polygon points and the property string (empty in this example).
If the last point is coincident to the first point a closed polygon is drawn.
A 'fill=true' arribute may be given to fill a cloded polygon, in this case a polygon line looks like:<br>
A 'fill=true' arribute may be given to fill a closed polygon, in this case a polygon line looks like:<br>
<kbd>P 3 5 2450 -210 2460 -170 2500 -170 2510 -210 2450 -210 {fill=true}</kbd><br>
</p>
<h3>ARC OBJECT</h3>

View File

@ -97,7 +97,8 @@ p{padding: 15px 30px 10px;}
while <kbd>vcenter=true</kbd> centers text in the perpendicular (to reading) direction.
the 2 attributes may be set both to get full centered text box.<br>
A <kbd>weight=bold</kbd> attribute may be given for bold text, while a <kbd>slant=italic</kbd> or
<kbd>slant=oblique</kbd> may specify italic or slanted text.
<kbd>slant=oblique</kbd> may specify italic or slanted text.<br>
A <kbd>hide=true</kbd> will make the specified text invisible when the symbol is displayed as a component in a schematic.
</p>
<img src="xschem_elements_02.png">
<p>

View File

@ -2286,7 +2286,7 @@ static void show_node_measures(int measure_p, double measure_x, double measure_p
diffy = xctx->graph_values[idx][measure_p] - yy1;
diffx = measure_x - measure_prev_x;
yy = yy1 + diffy / diffx * (xctx->graph_cursor1_x - measure_prev_x);
if(SIGN0(gr->gy1) != SIGN0(gr->gy2) && fabs(yy) < 1e-4 * fabs(gr->gh)) yy = 0.0;
if(XSIGN0(gr->gy1) != XSIGN0(gr->gy2) && fabs(yy) < 1e-4 * fabs(gr->gh)) yy = 0.0;
if(yy != 0.0 && fabs(yy * gr->unity) < 1.0e-3) {
fmt1="%.2e";
fmt2="%.2e%c";
@ -2416,7 +2416,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr)
last = ofs;
for(p = ofs ; p < ofs + xctx->graph_npoints[dset]; p++) {
xx = gv[p];
wrap = (sweep_idx == 0 && cnt > 1 && SIGN(xx - prev_x) != SIGN(prev_x - prev_prev_x));
wrap = (sweep_idx == 0 && cnt > 1 && XSIGN(xx - prev_x) != XSIGN(prev_x - prev_prev_x));
if(first != -1) { /* there is something to plot ... */
if(xx > end || xx < start || /* ... and we ran out of graph area ... */
wrap) { /* ... or sweep variable changed direction */
@ -2445,7 +2445,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr)
point[poly_npoints].x = S_X(xx);
if(dataset == -1 || dataset == sweepvar_wrap) {
if(measure_p == -1 && flags & 2 && cnt) { /* cursor1: show measurements on nodes in graph */
if(SIGN(xx - xctx->graph_cursor1_x) != SIGN(prev_x - xctx->graph_cursor1_x)) {
if(XSIGN(xx - xctx->graph_cursor1_x) != XSIGN(prev_x - xctx->graph_cursor1_x)) {
measure_p = p;
measure_x = xx;
measure_prev_x = prev_x;

View File

@ -1172,7 +1172,7 @@ static void create_new_tab(int *window_count, const char *fname)
/* tcl code to create the tab button */
my_snprintf(nn, S(nn), "%d", n);
tclvareval(
"button ", ".tabs.x", nn, " -padx 2 -pady 0 -text Tab2 "
"button ", ".tabs.x", nn, " -padx 2 -pady 0 -anchor nw -text Tab2 "
"-command \"xschem new_schematic switch_tab .x", nn, ".drw\"", NULL);
tclvareval("bind .tabs.x",nn," <ButtonPress> {swap_tabs %X %Y press}", NULL);
tclvareval("bind .tabs.x",nn," <ButtonRelease> {swap_tabs %X %Y release}", NULL);

View File

@ -323,8 +323,8 @@ extern char win_temp_dir[PATH_MAX];
strcmp(type,"show_label") && strcmp(type,"iopin")))
#define IS_LABEL_OR_PIN(type) (!(strcmp(type,"label") && strcmp(type,"ipin") && strcmp(type,"opin") && strcmp(type,"iopin")))
#define IS_PIN(type) (!(strcmp(type,"ipin") && strcmp(type,"opin") && strcmp(type,"iopin")))
#define SIGN(x) ( (x) < 0 ? -1 : 1)
#define SIGN0(x) ( (x) < 0 ? -1 : (x) > 0 ? 1 : 0)
#define XSIGN(x) ( (x) < 0 ? -1 : 1)
#define XSIGN0(x) ( (x) < 0 ? -1 : (x) > 0 ? 1 : 0)
/* floor not needed? screen coordinates always positive <<<< */
/* #define X_TO_SCREEN(x) ( floor(((x)+xctx->xorigin)* xctx->mooz) ) */

View File

@ -3721,7 +3721,7 @@ proc setup_tabbed_interface {} {
if { $tabbed_interface } {
if { ![winfo exists .tabs] } {
frame .tabs
button .tabs.x0 -padx 2 -pady 0 -text Main -command "xschem new_schematic switch_tab .drw"
button .tabs.x0 -padx 2 -pady 0 -anchor nw -text Main -command "xschem new_schematic switch_tab .drw"
bind .tabs.x0 <ButtonPress> {swap_tabs %X %Y press}
bind .tabs.x0 <ButtonRelease> {swap_tabs %X %Y release}
button .tabs.add -padx 0 -pady 0 -text { + } -command "xschem new_schematic create"