Revision: 4505 http://sourceforge.net/p/vexi/code/4505 Author: clrg Date: 2013-04-05 02:07:22 +0000 (Fri, 05 Apr 2013) Log Message: ----------- WIP
Modified Paths: -------------- branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/lib/text/edit.t branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/lib/widget/scrollpane.t branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/lib/widget/textarea.t branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/theme/classic/textarea.t Modified: branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/lib/text/edit.t =================================================================== --- branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/lib/text/edit.t 2013-03-31 20:20:09 UTC (rev 4504) +++ branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/lib/text/edit.t 2013-04-05 02:07:22 UTC (rev 4505) @@ -3,8 +3,10 @@ <vexi xmlns:ui="vexi://ui" xmlns:text="org.vexi.lib.text"> <ui:box layout="place" align="topleft"> + thisbox.from_y; + thisbox.fullheight; + thisbox.multiline = true; - thisbox.scroll = null; thisbox.v_text = ""; var tip = false; @@ -29,6 +31,11 @@ return; } + thisbox.from_y ++= function(v) { + cascade = v; + reflowText(); + } + const NEWLINE = 0; const WHITESPACE = 1; const ALPHA_NUMERIC = 2; @@ -56,14 +63,13 @@ const line_height = vexi.ui.font.height(font, fontsize, "dy"); thisbox.reflowText = function() { - trace("reflowText"); clear(); if (!multiline) { addLine(v_text); return; } - var from_y = scroll.viewy; + const from_y = thisbox.from_y; var t = v_text; var line_start = 0; @@ -77,7 +83,6 @@ const addLine = function(v) { const line_y = line_height * line_count; if ((line_y + line_height > from_y) and (from_y + height > line_y)) { -// trace("adding: "+v); const b = new text.line(); b.text = v; b.minheight = line_height; @@ -96,9 +101,6 @@ const n = t.charCodeAt(i); const n_type = getCharType(n); -// if (600 >= i) -// trace(i+": "+c+", "+n_type+", ("+line_width+" / "+width+"), ("+line_start+"->"+line_end+")"); - // NEWLINE immediately breaks // and resets everything to that point if (n_type == NEWLINE) { @@ -147,7 +149,7 @@ addLine(t.substring(line_start, line_end)+" "); } - thisbox.scrollheight = (line_count+1) * line_height; + fullheight = (line_count+1) * line_height; } </ui:box> Modified: branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/lib/widget/scrollpane.t =================================================================== --- branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/lib/widget/scrollpane.t 2013-03-31 20:20:09 UTC (rev 4504) +++ branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/lib/widget/scrollpane.t 2013-04-05 02:07:22 UTC (rev 4505) @@ -39,10 +39,10 @@ hshrink ++= v_constrainPaneH; vshrink ++= v_constrainPaneV; - const sync_vp = function(v) { cascade = v; v_viewport[trapname] = v; } - const sync_vp_0 = function(v) { cascade = v; v_viewport[0][trapname] = v; } -// const sync_ui = function(v) { cascade = v; th_uiport[trapname] = v; } - const sync_ui_0 = function(v) { cascade = v; th_uiport[0][trapname] = v; } + const sync_to_vp = function(v) { cascade = v; v_viewport[trapname] = v; } + const sync_to_vp_0 = function(v) { cascade = v; v_viewport[0][trapname] = v; } +// const sync_to_to_ui = function(v) { cascade = v; th_uiport[trapname] = v; } + const sync_to_ui_0 = function(v) { cascade = v; th_uiport[0][trapname] = v; } /** th_uiport is used in case the viewport is virtual * in which case uiport represents the ui area that @@ -56,10 +56,10 @@ virtualvertical = virtualvertical; virtualhorizontal = virtualhorizontal; // required as scrollbars act on viewport not uiport - v_viewport[0].x ++= sync_ui_0; - v_viewport[0].y ++= sync_ui_0; - th_uiport.height ++= sync_vp; - th_uiport.width ++= sync_vp; + v_viewport[0].x ++= sync_to_ui_0; + v_viewport[0].y ++= sync_to_ui_0; + th_uiport.height ++= sync_to_vp; + th_uiport.width ++= sync_to_vp; } th_hscroll ++= static.assignViewport; @@ -68,18 +68,18 @@ virtualvertical ++= function(v) { cascade = v; if (v) { - th_uiport[0].width --= sync_vp_0; + th_uiport[0].height --= sync_to_vp_0; } else { - th_uiport[0].width ++= sync_vp_0; + th_uiport[0].height ++= sync_to_vp_0; } } virtualhorizontal ++= function(v) { cascade = v; if (v) { - th_uiport[0].height --= sync_vp_0; + th_uiport[0].width --= sync_to_vp_0; } else { - th_uiport[0].height ++= sync_vp_0; + th_uiport[0].width ++= sync_to_vp_0; } } @@ -112,6 +112,7 @@ vbody.x = vbody.y = 0; vbody.width = vbody.height = 0; vport[0] = vbody; + vbody.height ++= function(v) { cascade = v; trace(new vexi.js.Exception(v)); } return vport; } Modified: branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/lib/widget/textarea.t =================================================================== --- branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/lib/widget/textarea.t 2013-03-31 20:20:09 UTC (rev 4504) +++ branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/lib/widget/textarea.t 2013-04-05 02:07:22 UTC (rev 4505) @@ -44,12 +44,32 @@ // } } - /** set up editbox */ + /** forwards v_edit.fullheight to th_scroll view */ + static.fullheightToScroll = function(v) { + cascade = v; + trapee.v_scroll.v_viewport[0].height = v; + } + + /** forwards v_edit.fullheight to th_scroll view */ + static.viewyToEdit = function(v) { + cascade = v; + trapee.v_edit.from_y = -v; + } + + /** set up editbox NOTE: this gets set after th_scroll */ static.v_editWrite = function(v) { cascade = v; - trace("here "+v+", "+trapee.th_scroll); + + var scroll = trapee.th_scroll; + scroll.virtualvertical = true; + v.multiline = true; - v.scroll = trapee.th_scroll; + v.v_scroll = scroll; + v.fullheight ++= fullheightToScroll; + + var view = scroll.v_viewport[0]; + view.v_edit = v; + view.y ++= viewyToEdit; } /** pass on focus notification to editbox */ Modified: branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/theme/classic/textarea.t =================================================================== --- branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/theme/classic/textarea.t 2013-03-31 20:20:09 UTC (rev 4504) +++ branches/org.vexi-vexi.widgets_editrefactor/src_main/org/vexi/theme/classic/textarea.t 2013-04-05 02:07:22 UTC (rev 4505) @@ -7,7 +7,6 @@ <bevel redirect=":$content" fill="white" form="down"> <scrollpane id="content" autohide="true" /> - trace("here"); th_scroll = $content; </bevel> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn