head	1.3;
access;
symbols
	iwidgets-4-0-1:1.3
	iwidgets-4-0-0:1.3
	iwidgets_overhaul:1.1.0.6
	iwidgets-2-2-0:1.1.1.1
	lucent:1.1.1
	tclpro-1-5-0:1.1
	tclpro-1-4-1:1.1
	tclpro-1-4-0:1.1
	itcl-3-2-0:1.1
	ajuba-ajuba2-2-0:1.1
	scriptics-sc-2-0-b5:1.1
	scriptics-sc-2-0-fixed:1.1
	scriptics-sc-2-0-b2:1.1
	scriptics-sc-2-0-b1:1.1
	scriptics-sc-1-1:1.1
	scriptics-sc-1-1-b1:1.1
	scriptics-sc-1-1-branch:1.1.0.4
	scriptics-sc-1-1-base:1.1
	scriptics-sc-1-0:1.1
	scriptics-sc-1-0-branch:1.1.0.2
	scriptics-sc-1-0-base:1.1
	scriptics-bc-1-0-b1:1.1
	scriptics-tclpro-1-3-0:1.1
	scriptics-tclpro-1-3-b4:1.1
	itcl-3-1-0:1.1
	scriptics-tclpro-1-3-b3:1.1
	scriptics-tclpro-1-2:1.1
	scriptics-tclpro-1-2-b2:1.1
	scriptics-tclpro-1-2-b1:1.1
	scriptics-tclpro-1-2-a1:1.1
	itcl-3-0-1:1.1
	itcl3-0-1:1.1
	stanton:1.1;
locks; strict;
comment	@# @;


1.3
date	2001.08.20.19.14.11;	author smithc;	state Exp;
branches;
next	1.2;

1.2
date	2001.08.07.19.56.47;	author smithc;	state Exp;
branches;
next	1.1;

1.1
date	98.07.27.18.51.50;	author stanton;	state Exp;
branches
	1.1.1.1
	1.1.6.1;
next	;

1.1.1.1
date	2001.04.25.04.01.15;	author davygrvy;	state Exp;
branches;
next	;

1.1.6.1
date	2001.08.07.19.18.25;	author smithc;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Updating demos for Iwidgets4.0.0 release.
@
text
@# ----------------------------------------------------------------------
#  DEMO: scrolledcanvas in [incr Widgets]
# ----------------------------------------------------------------------
package require Iwidgets 4.0

option add *textBackground seashell
. configure -background white

iwidgets::scrolledcanvas .canv -labeltext "Scrolledcanvas" \
    -vscrollmode dynamic -hscrollmode dynamic -autoresize yes

pack .canv -expand yes -fill both -padx 4 -pady 4
.canv xview moveto 0
.canv yview moveto 0


button .zoomin -text "Zoom In" -command {
    .canv scale all 0 0 2 2
    .canv configure -scrollregion [.canv bbox all]
}
pack .zoomin -side left -expand yes -padx 4 -pady 4

button .zoomout -text "Zoom Out" -command {
    .canv scale all 0 0 0.5 0.5
    .canv xview moveto 0
    .canv yview moveto 0
    .canv configure -scrollregion [.canv bbox all]
}
pack .zoomout -side left -expand yes -padx 4 -pady 4


bind [.canv component canvas] <ButtonPress-1> {add_rectangle %W %x %y}
bind [.canv component canvas] <B1-Motion> {add_rectangle %W %x %y}

proc add_rectangle {win x y} {
    set x [$win canvasx $x]
    set y [$win canvasy $y]

    $win create rectangle \
        [expr $x-4] [expr $y-4] \
        [expr $x+4] [expr $y+4] \
        -outline "" -fill red

    $win configure -scrollregion [$win bbox all]
}
@


1.2
log
@Merging iwidgets_overhaul branch to CVS head.
@
text
@d4 1
a4 1
package require Iwidgets 3.0
@


1.1
log
@Initial revision
@
text
@a0 1
#!/bin/sh
a3 2
#\
exec itkwish "$0" ${1+"$@@"}
a5 2
# itkwish interprets the rest...
# ----------------------------------------------------------------------
@


1.1.6.1
log
@This merge is from the iwidgets_overhaul branch created by Chad Smith
to extract the [incr Widgets] from the [incr Tcl] distribution.  See
the CHANGES file for a list of changes I made to this distribution.
The new [incr Widgets] version number is 4.0.0.
@
text
@d1 1
d5 2
d9 2
@


1.1.1.1
log
@import of current 2.2.0
@
text
@d6 2
a7 2
exec itkwish -f "$0" ${1+"$@@"}
package require -exact Iwidgets 2.2
d24 1
d32 1
d37 2
a38 2
bind [.canv component scrCanvas] <ButtonPress-1> {add_rectangle %W %x %y}
bind [.canv component scrCanvas] <B1-Motion> {add_rectangle %W %x %y}
d41 2
a42 12
    set bbox [$win bbox all]
    if {$bbox != ""} {
        set w [expr [lindex $bbox 2]-[lindex $bbox 0]]
        set x0 [lindex [$win cget -scrollregion] 0]
        set x0 [expr $x0+[lindex [$win xview] 0]*$w]
        set h [expr [lindex $bbox 3]-[lindex $bbox 1]]
        set y0 [lindex [$win cget -scrollregion] 1]
        set y0 [expr $y0+[lindex [$win yview] 0]*$h]
    } else {
        set x0 0
        set y0 0
    }
d45 2
a46 2
        [expr $x0+$x-4] [expr $y0+$y-4] \
        [expr $x0+$x+4] [expr $y0+$y+4] \
d48 2
@

