[Tkabber-dev] r1117 - in branches/tkabber-tabbar: . ifacetk

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Apr 18 22:17:35 MSD 2007


Author: sergei
Date: 2007-04-18 22:17:34 +0400 (Wed, 18 Apr 2007)
New Revision: 1117

Modified:
   branches/tkabber-tabbar/ChangeLog
   branches/tkabber-tabbar/ifacetk/buttonbar.tcl
Log:
	* ifacetk/buttonbar.tcl: Added support for multicolumn vertical
	  tabbar.


Modified: branches/tkabber-tabbar/ChangeLog
===================================================================
--- branches/tkabber-tabbar/ChangeLog	2007-04-18 05:05:41 UTC (rev 1116)
+++ branches/tkabber-tabbar/ChangeLog	2007-04-18 18:17:34 UTC (rev 1117)
@@ -3,6 +3,9 @@
 	* ifacetk/buttonbar.tcl: Configure tabbar container width to ensure
 	  that vertical tabbar has correct width.
 
+	* ifacetk/buttonbar.tcl: Added support for multicolumn vertical
+	  tabbar.
+
 2007-04-17  Sergei Golovan  <sgolovan at nes.ru>
 
 	* ifacetk/buttonbar.tcl: Restored reconfiguring button text on

Modified: branches/tkabber-tabbar/ifacetk/buttonbar.tcl
===================================================================
--- branches/tkabber-tabbar/ifacetk/buttonbar.tcl	2007-04-18 05:05:41 UTC (rev 1116)
+++ branches/tkabber-tabbar/ifacetk/buttonbar.tcl	2007-04-18 18:17:34 UTC (rev 1117)
@@ -187,6 +187,7 @@
 	catch {unset data(raisecmd,$name)}
 	catch {unset data(text,$name)}
 	catch {unset data(width,$name)}
+	catch {unset data(height,$name)}
 	_redraw $path
     }
 }
@@ -385,21 +386,32 @@
 	    }
 	}
     } else {
-	# TODO: multiple columns
-	set rows $num
-	grid rowconfigure $path $num -weight 10000000 -minsize 0
+	set h [winfo height $path]
 
 	set c 0
 	set r 0
+	set th 0
+	set num 0
 	foreach name $data(buttons) {
-	    grid [_but $path $name] -column $c -row $r -sticky nsew
-	    grid rowconfigure $path $r -weight 0 -minsize 0
-	    incr r
-	    if {$r >= $rows} {
+	    set but [_but $path $name]
+
+	    if {[info exists data(height,$name)]} {
+		incr th $data(height,$name)
+	    } else {
+		incr th [winfo reqheight $but]
+	    }
+	    if {($c > 0 && $r >= $num) || ($c == 0 && $th > $h)} {
 		set r 0
 		incr c
+	    } elseif {$c == 0} {
+		incr num
 	    }
+	    grid $but -column $c -row $r -sticky nsew
+	    grid rowconfigure $path $r -weight 0 -minsize 0
+	    grid columnconfigure $path $c -weight 0 -minsize $max
+	    incr r
 	}
+	grid rowconfigure $path $num -weight 10000000 -minsize 0
     }
 }
 
@@ -503,6 +515,7 @@
 	set data(width,$name) $w
 	_reconfigure_text $path $name
     }
+    set data(height,$name) [winfo height $but]
 }
 
 



More information about the Tkabber-dev mailing list