Bwidget Source Code
Check-in [ac17439246]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Additional fixes from Eric Boudaillier.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ac1743924631e7cb896d24e5bca60c90b6f50f0b
User & Date: ericm 2000-02-19 02:07:03
Context
2000-02-19
02:12
* images/target.xbm: Placeholder for actual icon.

* color.tcl: Change env(BWIDGET_LIBRARY) to ::BWIDGET::LIBRARY; changed proc "dialogue" to "dialog"

* pkgIndex.tcl: Updated function spec for color.tcl.

* widget.tcl: Various minor speed tweaks; added a reverse mapping from component widget options -> mega-widget options so that subcget can be faster.

* entry.tcl: * dropsite.tcl: * dragsite.tcl: * arrow.tcl: Tcl list'd the specs for Widget::declare calls.

* combobox.tcl: Removed extraneous ListBox::use call. check-in: 25c5681556 user: ericm tags: trunk

02:07
Additional fixes from Eric Boudaillier. check-in: ac17439246 user: ericm tags: trunk
2000-02-17
18:37
* notebook.tcl: Added an extra check to move the leftmost tab a touch to the right when it is not selected (again, to make the tabs more Windows-like). Also replaced redundant [string equal] checks with a stored pre-check (ie, set foo [string equal ...]). check-in: 4f04c7bef8 user: ericm tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to arrow.tcl.

21
22
23
24
25
26
27
28
29

30
31
32
33
34
35
36
37
38
39

40
41
42
43
44
45

46
47
48
49

50
51
52
53

54


55
56
57
58
59
60
61
62
63
64
65
#     - ArrowButton::_release
#     - ArrowButton::_repeat
# ------------------------------------------------------------------------------

namespace eval ArrowButton {

    Widget::tkinclude ArrowButton button :cmd \
        include {
            -borderwidth -bd  -background -bg -relief

            -highlightbackground -highlightcolor -highlightthickness -takefocus}

    Widget::declare ArrowButton {
        {-type                Enum button 0 {arrow button}}
        {-dir                 Enum top    0 {top bottom left right}}
        {-width               Int 15 0 {=0}}
        {-height              Int 15 0 {=0}}
        {-ipadx               Int 0  0 {=0}}
        {-ipady               Int 0  0 {=0}}
        {-clean               Int 2  0 {=0 =2}}

        {-activeforeground    TkResource "" 0 button}
        {-activebackground    TkResource "" 0 button}
        {-disabledforeground  TkResource "" 0 button}
        {-foreground          TkResource "" 0 button}
        {-state               TkResource "" 0 button}


        {-troughcolor     TkResource ""     0 scrollbar}
        {-arrowbd         Int        1      0 {=1 =2}}
        {-arrowrelief     Enum       raised 0 {raised sunken}}


        {-command         String "" 0}
        {-armcommand      String "" 0}
        {-disarmcommand   String "" 0}
        {-repeatdelay     Int 0 0 {=0}}

        {-repeatinterval  Int 0 0 {=0}}



        {-bd              Synonym -borderwidth}
        {-fg              Synonym -foreground}
    }
    DynamicHelp::include ArrowButton balloon

    proc ::ArrowButton { path args } { return [eval ArrowButton::create $path $args] }

    proc use {} {}

    bind BwArrowButton <Enter>           {ArrowButton::_enter %W}






|
|
>
|

|
<
|
|
|
|
|
|
>
|
|
|
<
|
<
>
|
|
|
<
>
|
<
|
<
>
|
>
>
|
<
<
<







21
22
23
24
25
26
27
28
29
30
31
32
33

34
35
36
37
38
39
40
41
42
43

44

45
46
47
48

49
50

51

52
53
54
55
56



57
58
59
60
61
62
63
#     - ArrowButton::_release
#     - ArrowButton::_repeat
# ------------------------------------------------------------------------------

namespace eval ArrowButton {

    Widget::tkinclude ArrowButton button :cmd \
	    include [list \
		-borderwidth -bd \
		-background -bg -relief -highlightbackground \
		-highlightcolor -highlightthickness -takefocus]

    Widget::declare ArrowButton [list \

	    [list -type		Enum button 0 [list arrow button]] \
	    [list -dir		Enum top    0 [list top bottom left right]] \
	    [list -width	Int	15	0	[list =0]] \
	    [list -height	Int	15	0	[list =0]] \
	    [list -ipadx	Int	0	0	[list =0]] \
	    [list -ipady	Int	0	0	[list =0]] \
	    [list -clean	Int	2	0	[list =0 =2]] \
	    [list -activeforeground	TkResource	""	0 button] \
	    [list -activebackground	TkResource	""	0 button] \
	    [list -disabledforeground 	TkResource	""	0 button] \

	    [list -foreground		TkResource	""	0 button] \

	    [list -state		TkResource	""	0 button] \
	    [list -troughcolor		TkResource	""	0 scrollbar] \
	    [list -arrowbd	Int	1	0	[list =1 =2]] \
	    [list -arrowrelief	Enum	raised	0	[list raised sunken]] \

	    [list -command		String	""	0] \
	    [list -armcommand		String	""	0] \

	    [list -disarmcommand	String	""	0] \

	    [list -repeatdelay		Int	0	0	[list =0]] \
	    [list -repeatinterval	Int	0	0	[list =0]] \
	    [list -bd	Synonym	-borderwidth] \
	    [list -fg	Synonym	-foreground] \
	    ]



    DynamicHelp::include ArrowButton balloon

    proc ::ArrowButton { path args } { return [eval ArrowButton::create $path $args] }

    proc use {} {}

    bind BwArrowButton <Enter>           {ArrowButton::_enter %W}

Changes to color.tcl.

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
...
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
    tkwait variable SelectColor::_selection
    update
    BWidget::grab release $frame
    destroy $top
    update
    Widget::destroy $top
    if {$_selection == $count} {
        return [eval dialogue $path $args]
    } else {
        return [lindex $colors $_selection]
    }
}


proc SelectColor::dialogue {path args} {
    variable _baseColors
    variable _userColors
    variable _widget
    variable _selection
    variable _image
    variable _hsv

................................................................................
                         [hsvToRgb [expr $x/196.0] [expr (196-$y)/196.0] 0.85]] \
                    -to $x $y [expr $x+4] [expr $y+4]
            }
        }
    }
    $c1 create image  0 0 -anchor nw -image $_image
    $c1 create bitmap 0 0 \
        -bitmap @[file join $::env(BWIDGET_LIBRARY) "images" "target.xbm"] \
        -anchor nw -tags target

    set _selection -1
    set _widget(fcolor) $fg
    set _widget(chs)    $c1
    set _widget(cv)     $c2
    set rgb             [winfo rgb $path [Widget::cget $path:SelectColor -color]]






|






|







 







|







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
...
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
    tkwait variable SelectColor::_selection
    update
    BWidget::grab release $frame
    destroy $top
    update
    Widget::destroy $top
    if {$_selection == $count} {
        return [eval dialog $path $args]
    } else {
        return [lindex $colors $_selection]
    }
}


proc SelectColor::dialog {path args} {
    variable _baseColors
    variable _userColors
    variable _widget
    variable _selection
    variable _image
    variable _hsv

................................................................................
                         [hsvToRgb [expr $x/196.0] [expr (196-$y)/196.0] 0.85]] \
                    -to $x $y [expr $x+4] [expr $y+4]
            }
        }
    }
    $c1 create image  0 0 -anchor nw -image $_image
    $c1 create bitmap 0 0 \
        -bitmap @[file join $::BWIDGET::LIBRARY "images" "target.xbm"] \
        -anchor nw -tags target

    set _selection -1
    set _widget(fcolor) $fg
    set _widget(chs)    $c1
    set _widget(cv)     $c2
    set rgb             [winfo rgb $path [Widget::cget $path:SelectColor -color]]