Revision: 3194
http://vexi.svn.sourceforge.net/vexi/?rev=3194&view=rev
Author: clrg
Date: 2008-11-10 18:13:28 +0000 (Mon, 10 Nov 2008)
Log Message:
-----------
Fix basic property editor
Modified Paths:
--------------
trunk/widgets/org.vexi.guide/src/org/vexi/guide/property/basic.t
trunk/widgets/org.vexi.guide/src/org/vexi/guide/property/basicitem.t
Modified: trunk/widgets/org.vexi.guide/src/org/vexi/guide/property/basic.t
===================================================================
--- trunk/widgets/org.vexi.guide/src/org/vexi/guide/property/basic.t
2008-11-10 17:37:21 UTC (rev 3193)
+++ trunk/widgets/org.vexi.guide/src/org/vexi/guide/property/basic.t
2008-11-10 18:13:28 UTC (rev 3194)
@@ -10,19 +10,22 @@
</meta:doc>
<item />
- <wi:shadepane orient="vertical" title="Unsorted Properties">
+ <wi:shadepane orient="vertical" title="Unsorted Properties" padding="3 0">
<wi:check id="filtermanaged" text="Filter managed properties" />
<ui:box vshrink="true">
<wi:textfield id="newprop" shadowtext="[property]" />
<wi:textfield id="newval" shadowtext="[value]" />
<wi:button id="addprop" padding="0 2" text="Add" vshrink="false" />
</ui:box>
+ <wi:separator colspan="2" vshrink="true" />
<lay:pad padding="0 10">
<lay:grid id="content" cols="2">
- <ui:box text="Property" />
- <ui:box text="Value" />
+ <ui:box text=" Property " shrink="true" />
+ <ui:box>
+ <ui:box text="Value" />
+ <ui:box width="12" />
+ </ui:box>
</lay:grid>
- <wi:separator colspan="2" vshrink="true" />
</lay:pad>
var accessmap;
@@ -40,6 +43,7 @@
// using gridproxy so the 'basic' template is not directly
stored
// in the grid, rather it's children are. this forces us
to track
// the template box by maintaining a reference array
(proxies)
+ /* FIXME: re-assignment broken by gridproxy
if (proxies[i] == null) {
var b = .basicitem(vexi.box);
$content[i*2] = b;
@@ -50,6 +54,14 @@
c.value = target.properties[k];
c.target = target;
i++;
+ */
+ var c = .basicitem(vexi.box);
+ c.prop = k;
+ c.value = target.properties[k];
+ c.target = target;
+ proxies[i] = c;
+ $content[i*2] = c;
+ i++;
}
}
$addprop.enabled = v!=null;
@@ -58,7 +70,8 @@
while ($content[i*2]) {
$content[i*2] = null;
$content[i*2] = null;
- proxies[i+j].target = null;
+ // WTF - why is this removing items from the board???
+ //proxies[i+j].target = null;
proxies[i+j] = null;
j++;
}
@@ -67,7 +80,7 @@
$addprop.action ++= function(v) {
var p = $newprop.text;
if (target.properties[p]!=null) return;
- var c = .basic(vexi.box);
+ var c = .basicitem(vexi.box);
c.prop = p;
c.value = $newval.text;
c.target = target;
@@ -79,7 +92,7 @@
$newprop.KeyPressed ++= function(v) {
cascade = v;
var p = $newprop.text;
- $addprop.enabled = target and (p!="" and
target.properties[p]!=null);
+ $addprop.enabled = target and (p!="" and
target.properties[p]==null);
}
surface ++= function(v) {
Modified: trunk/widgets/org.vexi.guide/src/org/vexi/guide/property/basicitem.t
===================================================================
--- trunk/widgets/org.vexi.guide/src/org/vexi/guide/property/basicitem.t
2008-11-10 17:37:21 UTC (rev 3193)
+++ trunk/widgets/org.vexi.guide/src/org/vexi/guide/property/basicitem.t
2008-11-10 18:13:28 UTC (rev 3194)
@@ -1,7 +1,7 @@
<!-- Copyright 2008 -- all rights reserved -->
<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="vexi.widget"
- xmlns:lay="vexi.layout">
+ xmlns:lay="vexi.layout" xmlns:theme="vexi.theme"
xmlns:role="org.vexi.lib.role">
<meta:doc>
<author>Charles Goodwin</author>
</meta:doc>
@@ -10,25 +10,34 @@
<ui:box redirect=":$content">
<ui:box id="content">
<ui:box align="right" id="prop" shrink="true" />
- <ui:box>
+ <ui:box id="vals">
<textfield id="value" />
- <ui:box id="close" width="15">
+ <role:clickable id="close" cursor="hand" layout="layer"
height="12" width="12">
<bevel />
- <ui:box fill=":.image.close" />
- </ui:box>
+ <ui:box fill=":theme.image.close" shrink="true" />
+ </role:clickable>
</ui:box>
</ui:box>
- $close.Enter ++= function(v) { $close[0].bevel = "thinup"; cascade =
v; }
- $close.Leave ++= function(v) { $close[0].bevel = null; cascade = v; }
- $close.Press1 ++= function(v) { thisbox = null; return; }
+ thisbox.target;
+ $close.active ++= function(v) { $close[0].form = "thindown"; cascade =
v; }
+ $close.hover ++= function(v) { $close[0].form = "thinup"; cascade = v;
}
+ $close.normal ++= function(v) { $close[0].form = null; cascade = v; }
+
+ $close.action ++= function(v) {
+ target.setProperty($prop.text, null);
+ $prop.thisbox = null;
+ $vals.thisbox = null;
+ return;
+ }
+
v_gridcontent = $content;
thisbox.prop ++= function(v) { $prop.text = v; cascade = v; }
thisbox.value ++= function(v) { $value.text = v; cascade = v; }
- var setValue = function() { if (target) target.setProperty(prop,
$value.text); return; }
+ var setValue = function() { if (target) target.setProperty($prop.text,
$value.text); return; }
$value.action ++= setValue;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn