Check-in [88b0a147be]
Not logged in

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

Overview
Comment:tweaks in ttk treeview and tksqlite to make double click work again
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 88b0a147be001e9ce59d3191eaca2b5299aa6012
User & Date: chw 2019-07-12 21:52:58
References
2019-07-26
14:35 Closed ticket [711718152b]: TkSql Not working plus 5 other changes artifact: b5c3cbd854 user: chw
Context
2019-07-13
05:26
in TSB cheatsheet add notes about tsb::asciimath check-in: 7c79ecb7a4 user: chw tags: trunk
2019-07-12
21:52
tweaks in ttk treeview and tksqlite to make double click work again check-in: 88b0a147be user: chw tags: trunk
16:21
update sqlite to version 3.29.0 check-in: 513d4da72a user: chw tags: trunk
Changes

Changes to assets/tksqlite0.5.13/tksqlite.tcl.

5630
5631
5632
5633
5634
5635
5636

5637
5638
5639
5640
5641
5642
5643
	ttk::frame .dbtree.f -style TEntry -border 2
	ttk::scrollbar .dbtree.f.y  -command {.dbtree.f.tree yview}

	ttk::treeview .dbtree.f.tree -pad 1 -show {tree} \
		-yscrollcommand {.dbtree.f.y set}
	bind .dbtree.f.tree <<TreeviewSelect>> {::Cmd::updateProperty}
	bind .dbtree.f.tree <<TreeviewOpen>>   {::Dbtree::openItem %W}

	Cmd::bindTextFocusTtkEntry .dbtree.f.tree .dbtree.f 
	
	# Flatten relief
	style layout Tree2 {
		Tree2.label -sticky nswe
	}
	style configure Tree2 -relief flat -background white







>







5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
	ttk::frame .dbtree.f -style TEntry -border 2
	ttk::scrollbar .dbtree.f.y  -command {.dbtree.f.tree yview}

	ttk::treeview .dbtree.f.tree -pad 1 -show {tree} \
		-yscrollcommand {.dbtree.f.y set}
	bind .dbtree.f.tree <<TreeviewSelect>> {::Cmd::updateProperty}
	bind .dbtree.f.tree <<TreeviewOpen>>   {::Dbtree::openItem %W}
	bind .dbtree.f.tree <<TreeviewToggle>> {::Dbtree::openItem %W}
	Cmd::bindTextFocusTtkEntry .dbtree.f.tree .dbtree.f 
	
	# Flatten relief
	style layout Tree2 {
		Tree2.label -sticky nswe
	}
	style configure Tree2 -relief flat -background white

Changes to jni/sdl2tk/doc/ttk_treeview.n.

469
470
471
472
473
474
475
476

477
478




479
480
481
482
483
484
485
Again, \fBcolumn #0 always refers to the tree column\fR.
.SH "VIRTUAL EVENTS"
.PP
The treeview widget generates the following virtual events.
.IP <<TreeviewSelect>>
Generated whenever the selection changes.
.IP <<TreeviewOpen>>
Generated just before setting the focus item to \fB\-open true\fR.

.IP <<TreeviewClose>>
Generated just after setting the focus item to \fB\-open false\fR.




.PP
The \fBfocus\fR and \fBselection\fR widget commands can be used
to determine the affected item or items.
'\" Not yet:
'\" In Tk 8.5, the affected item is also passed as the \fB\-detail\fR field
'\" of the virtual event.
.SH "STYLING OPTIONS"







|
>

|
>
>
>
>







469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
Again, \fBcolumn #0 always refers to the tree column\fR.
.SH "VIRTUAL EVENTS"
.PP
The treeview widget generates the following virtual events.
.IP <<TreeviewSelect>>
Generated whenever the selection changes.
.IP <<TreeviewOpen>>
Generated just before setting the focus item to \fB\-open true\fR
if the item has children.
.IP <<TreeviewClose>>
Generated just after setting the focus item to \fB\-open false\fR
if the item has children.
.IP <<TreeviewToggle>>
Generated just after setting the focus item if it has no children.
However, the state of \fB\-open\fR is not toggled automatically.
.PP
The \fBfocus\fR and \fBselection\fR widget commands can be used
to determine the affected item or items.
'\" Not yet:
'\" In Tk 8.5, the affected item is also passed as the \fB\-detail\fR field
'\" of the virtual event.
.SH "STYLING OPTIONS"

Changes to jni/sdl2tk/library/ttk/treeview.tcl.

334
335
336
337
338
339
340


341


342
343
344
345
346
347
348
349
}

## Toggle -- toggle opened/closed state of item
#
proc ttk::treeview::Toggle {w item} {
    # don't allow toggling on indicators that
    # are not present in front of leaf items


    if {[$w children $item] == {}} {


        return
    }
    # not a leaf, toggle!
    if {[$w item $item -open]} {
	CloseItem $w $item
    } else {
	OpenItem $w $item
    }







>
>

>
>
|







334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
}

## Toggle -- toggle opened/closed state of item
#
proc ttk::treeview::Toggle {w item} {
    # don't allow toggling on indicators that
    # are not present in front of leaf items
    # but let the caller decide by its handling
    # of the <<TreeviewToggle>> event
    if {[$w children $item] == {}} {
	$w focus $item
	event generate $w <<TreeviewToggle>>
	return
    }
    # not a leaf, toggle!
    if {[$w item $item -open]} {
	CloseItem $w $item
    } else {
	OpenItem $w $item
    }