Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26222
Modified Files:
Tag: devel_0_39
desire.tk desire.c
Log Message:
some more work on gop and [pd]
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.524
retrieving revision 1.1.2.525
diff -C2 -d -r1.1.2.524 -r1.1.2.525
*** desire.tk 23 Oct 2006 19:24:37 -0000 1.1.2.524
--- desire.tk 24 Oct 2006 16:08:57 -0000 1.1.2.525
***************
*** 1101,1106 ****
--- 1101,1109 ----
def View canvas= {c} {set @canvas $c}
+ def View visible {} {if {[info exists @inside_box]} {return $@inside_box} {return -1}}
+
# this returns the canvas actually exists/drawn
def View get_canvas {} {
+ if {[winfo exists .$self.c]} {return $self}
if {[winfo exists .$(a)canvas.c]} {
return $@canvas
***************
*** 1141,1144 ****
--- 1144,1148 ----
} else {
set @inside_box 0
+ $@canvas visible_children-= $self
}
} else {
***************
*** 1158,1161 ****
--- 1162,1166 ----
} else {
puts "skipping $self, don't draw it...."
+ $self delete
}
}
***************
*** 1173,1176 ****
--- 1178,1186 ----
return
}
+ if {$@gop} {
+ foreach x $@children {$x outside_of_the_box}
+ pd .$self close
+ return
+ }
switch [tk_messageBox -message [say save_changes?] -icon question -type yesnocancel -default cancel] {
yes {$self save; pd .$self close}
***************
*** 1438,1441 ****
--- 1448,1459 ----
}
+
+ def Canvas gop_rect {} {
+ # 0 -1 1 1 90 95 10 20
+ set rect [list $@xmargin $@ymargin [expr $@xmargin+$@pixwidth] [expr $@ymargin+$@pixheight]]
+ $self item GOPRECT rectangle $rect -outline [$self look fg]
+
+ }
+
def Canvas getscroll {} {}
***************
*** 1488,1491 ****
--- 1506,1510 ----
super
destroy .$self
+ if {$@gop} {foreach x $@children {$x changed}; $self changed}
}
***************
*** 1774,1778 ****
def Canvas draw {} {
! if {$@subpatch && $@canvas != "" && !$@gop} {super} ;# is for the [pd] box if applicable
if {[info exists @gop]} {
if {$@gop && ![winfo exists [$self widget]]} {super; $self draw_gop; return}
--- 1793,1797 ----
def Canvas draw {} {
! if {$@subpatch && $@canvas != "" && !$@gop} {if {![winfo exists [$self widget]]} {super}} ;# is for the [pd] box if applicable
if {[info exists @gop]} {
if {$@gop && ![winfo exists [$self widget]]} {super; $self draw_gop; return}
***************
*** 1782,1785 ****
--- 1801,1806 ----
[$self widget] configure -background $bg
$self adjust_scrollbars
+ if {$@gop} {$self gop_rect}
+
}
***************
*** 2131,2134 ****
--- 2152,2161 ----
}
+ def Canvas visible_children-= {children} {
+ if {[lsearch $@visible_children $children] >= 0} {
+ set @visible_children [lwithout $@visible_children $children]
+ } else {return}
+ }
+
def Canvas visible_children {} {return $@visible_children}
***************
*** 4077,4080 ****
--- 4104,4108 ----
set @width [lindex $mess 4]
set @height [lindex $mess 5]
+ if {!$@width} {set @width 85}; if {!$@height} {set @height 60}
if {[llength $mess] == 8} {
set @xmargin [lindex $mess 6]; set @ymargin [lindex $mess 7]
***************
*** 4106,4110 ****
def CanvasPropertiesDialog apply {} {
#pd .$@of donecanvasdialog $@xscale $@yscale $@graphme
! pd .$@of coords $@xfrom $@yfrom $@xto $@yto $@width $@height $@gop
#donecanvasdialogy sends back weird scientific notation values....
}
--- 4134,4139 ----
def CanvasPropertiesDialog apply {} {
#pd .$@of donecanvasdialog $@xscale $@yscale $@graphme
! pd .$@of coords $@xfrom $@yfrom $@xto $@yto $@width $@height $@gop $@xmargin $@ymargin
! $@of changed
#donecanvasdialogy sends back weird scientific notation values....
}
Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.185
retrieving revision 1.1.2.186
diff -C2 -d -r1.1.2.185 -r1.1.2.186
*** desire.c 14 Oct 2006 11:07:17 -0000 1.1.2.185
--- desire.c 24 Oct 2006 16:08:58 -0000 1.1.2.186
***************
*** 642,648 ****
--- 642,650 ----
void canvas_drawredrect(t_canvas *x, int doit) {
+ /*
if (doit) sys_mgui(canvas_getcanvas(x),"gop_rectangle","iiii",
x->xmargin, x->ymargin, x->pixwidth, x->pixheight);
else sys_mgui(canvas_getcanvas(x),"gop_rectangle_delete","");
+ */
}
***************
*** 2601,2607 ****
just show the bounding rectangle */
if (x->havewindow) {
! if (vis) sys_vgui(".x%lx.c create polygon %d %d %d %d %d %d %d %d %d %d -tags %s -fill #c0c0c0\n",
! (long)c, x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, tag);
! else sys_vgui(".x%lx.c delete %s\n", (long)c, tag);
return;
}
--- 2603,2609 ----
just show the bounding rectangle */
if (x->havewindow) {
! //if (vis) sys_vgui(".x%lx.c create polygon %d %d %d %d %d %d %d %d %d %d -tags %s -fill #c0c0c0\n",
! // (long)c, x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, tag);
! // else sys_vgui(".x%lx.c delete %s\n", (long)c, tag);
return;
}
***************
*** 4722,4726 ****
if (flags & CLOSED) {
numbertocolor(slot_getfloat(&x->fillcolor, template, data, 1), fill);
! sys_vgui(".x%lx.c create polygon\\\n", (long)canvas_getcanvas(canvas));
} else sys_vgui(".x%lx.c create line\\\n", (long)canvas_getcanvas(canvas));
for (i = 0; i < n; i++) sys_vgui("%d %d\\\n", pix[2*i], pix[2*i+1]);
--- 4724,4728 ----
if (flags & CLOSED) {
numbertocolor(slot_getfloat(&x->fillcolor, template, data, 1), fill);
! //sys_vgui(".x%lx.c create polygon\\\n", (long)canvas_getcanvas(canvas));
} else sys_vgui(".x%lx.c create line\\\n", (long)canvas_getcanvas(canvas));
for (i = 0; i < n; i++) sys_vgui("%d %d\\\n", pix[2*i], pix[2*i+1]);
***************
*** 5047,5051 ****
if (wonset >= 0) {
/* found "w" field which controls linewidth. The trace is a filled polygon with 2n points. */
! sys_vgui(".x%lx.c create polygon \\\n", (long)canvas_getcanvas(canvas));
for (i = 0, xsum = xloc; i < nelem; i++) {
if (xonset >= 0) usexloc = xloc + *(float *)(elem+elemsize*i+xonset);
--- 5049,5053 ----
if (wonset >= 0) {
/* found "w" field which controls linewidth. The trace is a filled polygon with 2n points. */
! //sys_vgui(".x%lx.c create polygon \\\n", (long)canvas_getcanvas(canvas));
for (i = 0, xsum = xloc; i < nelem; i++) {
if (xonset >= 0) usexloc = xloc + *(float *)(elem+elemsize*i+xonset);