Revision: 3091 http://vexi.svn.sourceforge.net/vexi/?rev=3091&view=rev Author: clrg Date: 2008-08-19 11:47:14 +0000 (Tue, 19 Aug 2008)
Log Message: ----------- More work towards resolution independence Modified Paths: -------------- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/edit.t trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/table.t trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/row.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-08-19 02:16:38 UTC (rev 3090) +++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/edit.t 2008-08-19 11:47:14 UTC (rev 3091) @@ -1578,32 +1578,14 @@ syncCursorAndOffset(true); } - /** set property p to v on all blocks */ - var setOnBlocks = function(p, v) { - var n = numchildren; - for (var i=0; n>i; i++) - if (thisbox[i][p] != v) thisbox[i][p] = v; - } - - /** whether to wrap text at the edge of the box */ - thisbox.wraptext ++= function(v) { - cascade = v; - setOnBlocks("multiline", v); - } - - /** trap to propagate property write to all blocks */ - var propagateToBlocks = function(v) { - cascade = v; - setOnBlocks(trapname, v); - } - // assign trap functions - thisbox.font ++= propagateToBlocks; - thisbox.fontsize ++= propagateToBlocks; - thisbox.multiline ++= propagateToBlocks; - thisbox.textalign ++= propagateToBlocks; - thisbox.textcolor ++= propagateToBlocks; - thisbox.wrapwidth ++= propagateToBlocks; + thisbox.font ++= static.fontWrite; + thisbox.fontsize ++= static.fontWrite; + thisbox.multiline ++= static.generalWrite; + thisbox.textalign ++= static.generalWrite; + thisbox.textcolor ++= static.generalWrite; + thisbox.wraptext ++= static.wraptextWrite; + thisbox.wrapwidth ++= static.generalWrite; // initialize the empty edit widget thisbox[0] = .block(vexi.box, blockargs); @@ -1612,10 +1594,41 @@ </ui:box> + // convenient access to block/word functions static.getTextFromWord = .block..getTextFromWord; static.getTextUpToWord = .block..getTextUpToWord; static.getIndInWord = .word..getIndInWord; + /** propagates font/fontsize writes to children */ + static.fontWrite = 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) { + 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; + var n = numchildren; + for (var i=0; n>i; i++) thisbox[i].multiline = v; + } + /** generate a set of text blocks from a string by splitting it at newlines */ static.getBlocksFromString = function(t) { var blocks = []; Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/table.t =================================================================== --- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/table.t 2008-08-19 02:16:38 UTC (rev 3090) +++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/table.t 2008-08-19 11:47:14 UTC (rev 3091) @@ -1,6 +1,6 @@ <!-- Copyright 2007 - see COPYING for details [LGPL] --> -<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="vexi.widget" +<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="vexi.theme" xmlns:rdt="vexi.util.redirect"> <meta:doc> <author>Charles Goodwin</author> @@ -67,16 +67,15 @@ thisbox.fill2; var setRowHeight = function(v) { - var h = rowtemplate..rowheight; - if (!h) throw "rowtemplate..rowheight must be a valid integer (>0)"; - rowheight = h; + if (!v) throw "rowtemplate..rowheight must be a valid integer (>0)"; + rowheight = v; if (fetchData) forceFetchData(); } var rowheightWrite = function(v) { cascade = v; setRowheight(v); } // dynmamic mode only (fetchData set) - var rowtemplate = .table.row; + var rowtemplate = .row; var rowheight = rowtemplate..rowheight; rowtemplate..rowheight ++= rowheightWrite; @@ -126,6 +125,7 @@ /* sanity control */ start = vexi.math.max(start, 0); count = vexi.math.min(rowcount-start, count); + vexi.log.info("callFetchData: "+rowheight+", "+start+", "+count); var data = fetchData(start, count, sortby ? th_head.indexof(sortby) : 0, sortasc); startindex = start; if (data) loadData(data); Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/row.t =================================================================== --- trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/row.t 2008-08-19 02:16:38 UTC (rev 3090) +++ trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/row.t 2008-08-19 11:47:14 UTC (rev 3091) @@ -29,10 +29,12 @@ minheight = static.rowheight; </lib:row> - + + // the rowheight is required for dynamic tables static.rowheight = 6 + vexi.ui.font.height(vexi.ui.font.defaultstream, vexi.ui.fontsize.medium, "dy"); + /** update the rowheight to adapt to default font height */ static.fontWrite = function(v) { cascade = v; rowheight = 6 + 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 Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn