Revision: 4384 http://vexi.svn.sourceforge.net/vexi/?rev=4384&view=rev Author: clrg Date: 2012-05-19 08:55:11 +0000 (Sat, 19 May 2012) Log Message: ----------- Feature. Assign 'createTab' function to tabpane and a '+' tab appears.
Modified Paths: -------------- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/tabpane.t trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/tabpane.t trunk/org.vexi-vexi.widgets/src_main/vexi/widget/tabpane.t Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/tabpane.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/tabpane.t 2012-05-19 08:35:22 UTC (rev 4383) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/tabpane.t 2012-05-19 08:55:11 UTC (rev 4384) @@ -17,12 +17,16 @@ thisbox.displayclose = false; thisbox.tabpolicy; thisbox.taborder = new vec(); + thisbox.th_add; thisbox.th_head; thisbox.th_headwrap; thisbox.th_tablist; thisbox.v_content; thisbox.v_tabwidthtotal = 0; + // to be implemented by user + thisbox.createTab; + var tabgroup = null; /** (un)displays the close buttons */ @@ -225,6 +229,22 @@ } } + thisbox.createTab ++= function(v) { + cascade = v; + if (th_add) { + th_add.display = v!=null; + } + } + + thisbox.th_add ++= function(v) { + cascade = v; + v.action ++= function(v) { + if (createTab) + thisbox.add(createTab()); + return; + } + } + thisbox.th_next ++= function(v) { cascade = v; v.action ++= function(v) { return; } Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/tabpane.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/tabpane.t 2012-05-19 08:35:22 UTC (rev 4383) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/tabpane.t 2012-05-19 08:55:11 UTC (rev 4384) @@ -1,21 +1,32 @@ -<!-- Copyright 2011 - see COPYING for details [LGPL] --> +<!-- Copyright 2012 - see COPYING for details [LGPL] --> -<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="vexi.theme" - xmlns:lib="org.vexi.lib.widget"> +<vexi xmlns:ui="vexi://ui" + xmlns:meta="vexi://meta" + xmlns:role="org.vexi.lib.role" + xmlns:lib="org.vexi.lib.widget" + xmlns:wi="vexi.widget" + xmlns="vexi.theme"> + <meta:doc> <author>Charles Goodwin</author> </meta:doc> - + <lib:tabpane /> <ui:box redirect=":$content"> <ui:box align="topleft" layout="place" minwidth="100" minheight="100"> - <bevel id="content" form="up" thickness="2" y="30" /> + <bevel id="content" form="up" y="30" /> <ui:box id="wrap" minheight="32" vshrink="true"> <button id="prev" display="false"> <ui:box fill=":.image.arrowleft" /> </button> <ui:box id="headwrap" align="topleft" layout="place"> - <ui:box id="head" shrink="true" /> + <ui:box vshrink="true" align="top"> + <ui:box id="head" shrink="true" /> + <wi:tab id="add" display="false" selected="false"> + <ui:box fill=":.image.add" shrink="true" /> + </wi:tab> + <ui:box /> + </ui:box> </ui:box> <button id="next" display="false"> <ui:box fill=":.image.arrowright" /> @@ -24,6 +35,7 @@ </ui:box> </ui:box> + thisbox.th_add = $add; thisbox.th_head = $head; thisbox.th_headwrap = $headwrap; thisbox.th_next = $next; Modified: trunk/org.vexi-vexi.widgets/src_main/vexi/widget/tabpane.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/vexi/widget/tabpane.t 2012-05-19 08:35:22 UTC (rev 4383) +++ trunk/org.vexi-vexi.widgets/src_main/vexi/widget/tabpane.t 2012-05-19 08:55:11 UTC (rev 4384) @@ -25,6 +25,10 @@ See vexi.widget.tab for information on how to customize tabs i.e. so you can set more than just the text. + + If you assign a function to the 'createTab' property, then + a '+' tab appears. + e.g. createTab = function() { return vexi.box; } </usage> </meta:doc> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn