Revision: 1755
http://svn.sourceforge.net/vexi/?rev=1755&view=rev
Author: mkpg2
Date: 2007-03-26 09:37:40 -0700 (Mon, 26 Mar 2007)
Log Message:
-----------
Development. the vars view
Modified Paths:
--------------
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/core/model.t
Added Paths:
-----------
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/image/
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/image/array.png
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/image/object.png
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/image/primitive.png
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/leaf.t
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/value.t
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/varview.t
core/trunk/org.vexi.debugclient/src_dev/
core/trunk/org.vexi.debugclient/src_dev/testvarview.t
Modified: core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/core/model.t
===================================================================
--- core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/core/model.t
2007-03-26 16:10:19 UTC (rev 1754)
+++ core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/core/model.t
2007-03-26 16:37:40 UTC (rev 1755)
@@ -23,6 +23,14 @@
static.vars_threadid; // Thread ID of current vars
static.vars_callpos; // Callpos ID of current vars
+ static.vars_getNode = function(path){
+ var r = vars;
+ for(var i=0; path.length>i; i++){
+ r = r[path[i]].value;
+ };
+ return r;
+ };
+
///////
// THREADS
///////
Added:
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/image/array.png
===================================================================
(Binary files differ)
Property changes on:
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/image/array.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/image/object.png
===================================================================
(Binary files differ)
Property changes on:
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/image/object.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/image/primitive.png
===================================================================
(Binary files differ)
Property changes on:
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/image/primitive.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/leaf.t
===================================================================
--- core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/leaf.t
(rev 0)
+++ core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/leaf.t
2007-03-26 16:37:40 UTC (rev 1755)
@@ -0,0 +1,26 @@
+<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta"
+ xmlns="org.vexi.debugclient.ui.vars"
+ xmlns:model="org.vexi.debugclient.core.model"
+ xmlns:th="org.vexi.theme.win2k"
+ xmlns:rdrt="vexi.util.redirect">
+
+ <!-- REMARK copied from org.vexi.theme.win2k.tree
+ so that we have the same order/layout of the icons
+ (leaf.t is not implemented in the widgets yet...)-->
+ <ui:box>
+ <ui:box minwidth="16" minheight="2" shrink="true">
+ <ui:box id="hsplit" width="3" />
+ <ui:box>
+ <ui:box id="htrail" fill=".image.tree_dash_h"
packed="false" vshrink="true" x="3" />
+ <ui:box id="handle" align="left" display="false"
fill=".image.tree_minus" shrink="true" />
+ </ui:box>
+ </ui:box>
+ <th:focusborder id="focus" align="left" show="false"
shrink="true">
+ <ui:box id="image" fill=".image.primitive" shrink="true" />
+ <ui:box width="3" />
+ <ui:box id="label" text="Default" shrink="true" />
+ </th:focusborder>
+ rdrt..addRedirect(thisbox, $image, "fill");
+ rdrt..addRedirect(thisbox, $label, "font", "fontsize", "text",
"textcolor");
+ </ui:box>
+</vexi>
Added: core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/value.t
===================================================================
--- core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/value.t
(rev 0)
+++ core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/value.t
2007-03-26 16:37:40 UTC (rev 1755)
@@ -0,0 +1,15 @@
+<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta"
+ xmlns="org.vexi.debugclient.ui.vars"
+ xmlns:model="org.vexi.debugclient.core.model"
+ xmlns:th="org.vexi.theme.win2k"
+ xmlns:rdrt="vexi.util.redirect">
+
+ <ui:box>
+ <th:focusborder id="focus" align="left" show="false"
shrink="true">
+ <!-- HACK hardcoding correct height here (should be as
+ tall as an element in the var tree so they line up-->
+ <ui:box id="label" shrink="true" minheight="15"/>
+ </th:focusborder>
+ rdrt..addRedirect(thisbox, $label, "font", "fontsize", "text",
"textcolor");
+ </ui:box>
+</vexi>
Added:
core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/varview.t
===================================================================
--- core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/varview.t
(rev 0)
+++ core/trunk/org.vexi.debugclient/src/org/vexi/debugclient/ui/vars/varview.t
2007-03-26 16:37:40 UTC (rev 1755)
@@ -0,0 +1,119 @@
+<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta"
+ xmlns="org.vexi.debugclient.ui.vars"
+ xmlns:model="org.vexi.debugclient.core.model"
+ xmlns:wi="vexi.widget">
+ <ui:box>
+ <wi:bevel form="down">
+ <wi:scrollpane shrink="false" cols="1" autohidehorizontal="true"
autohidevertical="true" >
+ <wi:splitpane orient="horizontal">
+ <ui:box>
+ <ui:box id="orchard" vshrink="true" align="topleft"
cols="1" shrink="true"/>
+ </ui:box>
+ <wi:divider/>
+ <ui:box>
+ <ui:box id="vals" cols="1" shrink="true" align="top"/>
+ </ui:box>
+ </wi:splitpane>
+ </wi:scrollpane>
+ </wi:bevel>
+ var createNode; // Defined later
+
+ var loadChildren = function(v) {
+ if(v){
+ vexi.log.info("loadChildren " + trapee.parent + "," + trapee.type);
+ //if(!v or trapee.numchildren > 1) return;
+ var path = [];
+ var currentNode;
+ for(currentNode = trapee;
+ currentNode!=null;
+ currentNode = currentNode.parent){
+ // Type information is required to be certain to be able to
recover variable child of
+ // a js object as any jsobject can be used as the key.
+ var str = "";
+ if(currentNode.type!=null) str = ":" + currentNode.type;
+ path[path.length] = currentNode.text + str;
+ }
+ path.reverse();
+ vexi.log.info(path.join(","));
+
+ // REMARK - naming here all wrong (node in model confused with
+ // node in widget tree)
+ var node = model..vars_getNode(path);
+ if((typeof(node))=="object"){
+ for(var k in node){
+ trapee[trapee.numchildren] = createNode(node[k],
trapee);
+ };
+// vexi.log.info(node);
+
+ }else{
+ // fetch
+ vexi.thread = function(t){
+
+ };
+ // Don't cascade, we don't want to open the node yet
+ return;
+ }
+ }else{
+ /// SHRINK
+
+ }
+ }
+
+ createNode = function(jsvar, parent){
+ vexi.log.info("creating " + jsvar.name);
+ var isexpandable = (jsvar.type == "object" || jsvar.type == "array");
+ var node = isexpandable ? wi.tree(vexi.box) : .leaf(vexi.box);
+ node.align = "left";
+ node.text = jsvar.name;
+ node.parent = parent;
+ node.fill = .image[jsvar.type];
+
+ var valbox = .value(vexi.box);
+ var type = jsvar.type;
+ var value;
+ if (type == "primitive"){
+ // Prevent value from being to big (causing rendering slowness)
+ value =
(20>jsvar.value.length)?jsvar.value:jsvar.value.substring(0,20) + "...";
+ }else if (type == "object"){
+ value = "{id="+jsvar.id+"}";
+ }else if (type == "array"){
+ value = "["+jsvar.length+"]";
+ }else if (type == "function"){
+ value = "{"+jsvar.location+"}";
+ }else{
+ value = "??";
+ }
+
+ valbox.text = value;
+ $vals[$vals.numchildren] = valbox;
+ if (isexpandable) {
+ node[0] = vexi.box;
+ node[0].vshrink = true;
+ node[0].display = false;
+ node.display ++= loadChildren;
+ }
+ return node;
+
+ }
+
+ /* Set variable view */
+ var update = function(vars){
+
+ vexi.log.info(vars);
+ while($orchard.numchildren)$orchard[0]=null;
+ if(vars==null){ return;}
+ for(var k in vars){
+ vexi.log.info(k);
+ var node = createNode(vars[k],null);
+ //node.value = vars[k];
+ $orchard[numchildren] = node;
+ };
+ }
+
+ // Listen
+ model..vars ++= function(v){
+ update(v);
+ };
+
+ </ui:box>
+</vexi>
Added: core/trunk/org.vexi.debugclient/src_dev/testvarview.t
===================================================================
--- core/trunk/org.vexi.debugclient/src_dev/testvarview.t
(rev 0)
+++ core/trunk/org.vexi.debugclient/src_dev/testvarview.t 2007-03-26
16:37:40 UTC (rev 1755)
@@ -0,0 +1,37 @@
+<vexi xmlns:ui="vexi://ui"
+ xmlns="org.vexi.debugclient.ui.vars"
+ xmlns:model="org.vexi.debugclient.core.model"
+ xmlns:wi="vexi.widget">
+ <wi:surface/>
+ <!-- <ui:box fill="white">
+ <wi:tree text="moo">
+ <wi:tree text="moo">
+ <ui:box text="a"/>
+ <ui:box text="b"/>
+ </wi:tree>
+ <wi:tree text="ra">
+ <ui:box text="c"/>
+ </wi:tree>
+ </wi:tree>
+
+ vexi.ui.frame = thisbox;
+
+ </ui:box> -->
+
+ <varview maxwidth="200" maxheight="200" fill="white">
+ vexi.ui.frame = thisbox;
+ model..vars = {
+ obj:{name:"obj", type:"object", value:{
+ nestedobj:{name:"nestedobj", type:"object",
value:{
+ x:{name:"x", type:"primitive",
value:"1"},
+ y:{name:"y", type:"object",
value:""}}},
+ mumra:{name:"mumra", type:"primitive",
value:"1"},
+ nestedarr:{name:"nestedarr", type:"?",
value:""},
+ foo:{name:"foo", type:"primitive",
value:"bar"}}},
+ array:{name:"array", type:"array", value:""},
+ prim:{name:"prim", type:"primitive", value:5},
+ "func":{name:"func", type:"function",
location:"sourcefile:984", value:5}
+ };
+
+ </varview>
+</vexi>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn