Revision: 3150
http://vexi.svn.sourceforge.net/vexi/?rev=3150&view=rev
Author: clrg
Date: 2008-10-28 15:27:05 +0000 (Tue, 28 Oct 2008)
Log Message:
-----------
Fix bug where font/fontsize were not being respected or worse (throwing
exceptions)
Modified Paths:
--------------
trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/block.t
trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/edit.t
trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/word.t
Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/block.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/block.t
2008-10-28 06:07:57 UTC (rev 3149)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/block.t
2008-10-28 15:27:05 UTC (rev 3150)
@@ -199,6 +199,8 @@
var update = t.fontheight == t.minheight;
t.fontheight = vexi.ui.font.height(t.font, t.fontsize, "dy");
if (update) t.minheight = t.fontheight;
+ var n = t.numchildren;
+ for (var i=0; n>i; i++) t[i][trapname] = v;
static.reflowBlock(t);
}
Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/edit.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/edit.t 2008-10-28
06:07:57 UTC (rev 3149)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/edit.t 2008-10-28
15:27:05 UTC (rev 3150)
@@ -1579,8 +1579,8 @@
}
// assign trap functions
- thisbox.font ++= static.fontWrite;
- thisbox.fontsize ++= static.fontWrite;
+ thisbox.font ++= static.generalWrite;
+ thisbox.fontsize ++= static.generalWrite;
thisbox.multiline ++= static.generalWrite;
thisbox.textalign ++= static.generalWrite;
thisbox.textcolor ++= static.generalWrite;
@@ -1599,29 +1599,18 @@
static.getTextUpToWord = .block..getTextUpToWord;
static.getIndInWord = .word..getIndInWord;
- /** propagates font/fontsize writes to children */
- static.fontWrite = function(v) {
+ /** trap to propagate property write to all blocks */
+ static.generalWrite = function(v) {
var f = trapee[trapname];
cascade = v;
if (f != trapee[trapname]) {
var n = trapee.numchildren;
- for (var i=0; n>i; i++) {
- if (trapee[i][trapname] == f) {
+ for (var i=0; n>i; i++)
+ if (trapee[i][trapname] == f)
trapee[i][trapname] = v;
- trapee[i].reflow();
- }
- }
}
}
- /** trap to propagate property write to all blocks */
- static.generalWrite = function(v) {
- cascade = v;
- var n = trapee.numchildren;
- for (var i=0; n>i; i++)
- if (trapee[i][trapname] != v) trapee[i][trapname] = v;
- }
-
/** whether to wrap text at the edge of the box */
static.wraptextWrite = function(v) {
cascade = v;
Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/word.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/word.t 2008-10-28
06:07:57 UTC (rev 3149)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/word.t 2008-10-28
15:27:05 UTC (rev 3150)
@@ -25,13 +25,13 @@
// initialize from parent block
if (arguments[0]) {
var arg0 = arguments[0];
- font = arg0.font;
- fontsize = arg0.fontsize;
parent = arg0.parent;
+ $t.font = $o.font = font = arg0.font;
+ $t.fontsize = $o.fontsize = fontsize = arg0.fontsize;
$t.textcolor = arg0.textcolor;
// initialize minheight
minheight = vexi.ui.font.height(font, fontsize, "dy");
- }
+ } else throw "word arguments missing";
// assign static functions to properties
highlight ++= static.highlightWrite;
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