Revision: 4680
          http://sourceforge.net/p/vexi/code/4680
Author:   mkpg2
Date:     2014-03-21 13:22:39 +0000 (Fri, 21 Mar 2014)
Log Message:
-----------
Improve link. Now takes content, as an alternative to an icon.

Modified Paths:
--------------
    branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/link.t

Added Paths:
-----------
    branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/link.t

Modified: 
branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/link.t
===================================================================
--- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/link.t 
2014-03-20 22:21:53 UTC (rev 4679)
+++ branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/link.t 
2014-03-21 13:22:39 UTC (rev 4680)
@@ -1,7 +1,12 @@
 <!-- Copyright 2011 Web Enable IT -- all rights reserved -->
 
-<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="vexi.layout"
-    xmlns:role="org.vexi.lib.role" xmlns:theme="vexi.theme" 
xmlns:rdt="vexi.util.redirect">
+<vexi xmlns:ui="vexi://ui" 
+    xmlns:lang="vexi://lang"
+    xmlns:meta="vexi://meta" 
+    xmlns="vexi.layout"
+    xmlns:role="org.vexi.lib.role" 
+    xmlns:theme="vexi.theme" 
+    xmlns:rdt="vexi.util.redirect">
     <meta:doc>
         <author>Charles Goodwin</author>
         <name>Link</name>
@@ -10,24 +15,27 @@
     <role:clickable />
     <role:focusable />
     <role:tooltipable />
-    <ui:box margin="2" shrink="true">
+    <ui:box margin="2" shrink="true" redirect=":$content">
+        <lang:subtemplate property="Icon">
+            <icon id="icon" marginright="5" size="16"/>
+        </lang:subtemplate>
+                            
+            
         <theme:lib.focusborder id="focus" cursor="hand">
-        <pad padding="1">
-            <ui:box minheight="16">
-                <icon id="icon" display="false" marginright="5" size="16" />
-                <ui:box id="link" align="bottomleft" layout="layer" 
shrink="true">
-                    <ui:box id="text" />
-                    <ui:box id="hintline" height="1" fill="black" width="0" />
-                    <ui:box id="underline" height="1" fill="blue" 
display="false" />
-                </ui:box>
-            </ui:box>
-        </pad>
+               <pad padding="1">
+                   <ui:box minheight="16">
+                       <ui:Box id="content"/>
+                       <ui:box id="link" align="bottomleft" layout="layer" 
shrink="true">
+                           <ui:box id="text" />
+                           <ui:box id="hintline" height="1" fill="black" 
width="0" />
+                           <ui:box id="underline" height="1" fill="blue" 
display="false" />
+                       </ui:box>
+                   </ui:box>
+               </pad>
         </theme:lib.focusborder>
         
-        rdt..addRedirect(thisbox, $icon, "icon", "emblem");
         
         thisbox.th_focus = $focus;
-        thisbox.v_iconbox = $icon;
         thisbox.v_linkbox = $link;
         thisbox.v_textbox = $text;
         $text.v_hint = $hintline;
@@ -41,6 +49,7 @@
         
         thisbox.hint ++= static.hintWrite;
         thisbox.icon ++= static.iconWrite;
+        thisbox.emblem ++= static.iconWrite;
         
     </ui:box>
     
@@ -69,7 +78,16 @@
         trapee.visible ++= static.registerHint;
     }
     
-    static.iconWrite = function(v) { cascade = v; trapee.v_iconbox.display = 
v!=null and v!=""; }
+    static.iconWrite = function(v) {
+        trace(v);
+        if(trapee.v_iconbox==null){
+            trapee.v_iconbox = new trapee.Icon();
+            trapee[0] = trapee.v_iconbox; 
+        }
+           cascade = v;
+           trapee.v_iconbox.display = v!=null and v!=""; 
+        trapee.v_iconbox[trapname] = v;
+    }
     
     static.focusWrite = function(v) {
         cascade = v;

Added: branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/link.t
===================================================================
--- branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/link.t           
                (rev 0)
+++ branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/link.t   
2014-03-21 13:22:39 UTC (rev 4680)
@@ -0,0 +1,40 @@
+<!-- public domain -->
+
+<vexi xmlns:ui="vexi://ui" xmlns:wi="vexi.widget">
+    <wi:surface />
+    <ui:box orient="vertical">
+        <wi:link icon="configure" emblem="add" text="link 1">
+            thisbox.action ++= function(v){
+                trace("1");
+                return;
+            };
+        </wi:link>
+        <wi:link emblem="add" icon="document"  text="link 2">
+            thisbox.action ++= function(v){
+                trace("2");
+                return;
+            };
+        </wi:link>       
+        <wi:link text="link 3">
+            <wi:border id="area" fill="tomato" width="20" height="20" 
text="10" depth="1" border="black"/>
+            <ui:Box width="3"/>
+            thisbox.normal ++= function(v){
+                $area.border = $area.textcolor = "black";
+                cascade = v;
+            };
+            
+            thisbox.hover ++= function(v){
+                $area.border = $area.textcolor = "white";
+                cascade = v;
+            };
+            
+            thisbox.action ++= function(v){
+                trace("3");
+                return;
+            };
+        </wi:link>              
+       
+        vexi.ui.frame = thisbox;
+        
+    </ui:box>
+</vexi>

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to