Set clip="true" in the surrounding view to make the text only visible within the borders.
Sebastian Am 05.09.2012 18:13 schrieb "Baskar Rajendran" <[email protected]>: > Seba > > I tried with your solution but the text overlaps the view, please find the > screenshot attached.. > if i set the text height to be the view's height - the scrollbar is not > scrollable as it fits the view. > > -baskar > > On Wed, Sep 5, 2012 at 2:01 PM, [email protected] < > [email protected]> wrote: > >> I can't say from your code snippet if that will work or not. >> You might try to continue working on that or your might try an >> alternative. >> >> One alternative might be to simply put a text box in front of the >> customScrollEdittext in case it is enabled = false. >> Something like: >> <view visible="${ !parent.enabled }" width="xxx" height="yyyy" >> bgcolor="0xFFFFFF"> >> <text multline="true" text="$REF" width="${ parent.width-14 }"/> >> <om_vscrollbar/> >> </view> >> Put this text box in front of the other text box but only make it >> visible when the text is disabled. >> >> Sebastian >> >> 2012/9/4 Baskar Rajendran <[email protected]>: >> > Seba >> > >> > I understood if the Parent property is disabled the scrollbar itself >> > becomes not enabled / visible /clickable . >> > I tried to set enabled to true for the scrollbar reference in >> > scrolledittext.lzx and it didnt work. here's my changes >> > since i am changing the generic code i would give this input it tries to >> > call the changes >> > >> > *customScrollEdittext.lzx changes* >> > >> > <scrolledittext name="_cbtext" width="$once{ parent.width-1 }" x="1" >> y="1" >> > bgcolor="0xFFFFFF" styleable="false" >> > height="$once{ parent.height-1 }" text="${ parent.text }" >> > vscrollbarclassname="om_vscrollbar" >> > multiline="true" fontsize="11" enabled="${ parent.enabled }" >> > *changeScrollbarState="true" >> > */> >> > >> > >> > >> > *scrolledittext.lzx changes : _vs is scrollbar reference* >> > >> > * <attribute name="changeScrollbarState" type="boolean" >> > value="false" />* >> > >> > <method name="init"> >> > super.init(); >> > this.ensurevscrollbar(); >> > * if(this.changeScrollbarState)* >> > * { * >> > * this._vs.enabled ="true"; // *didn't work >> > * this._vs._enabled="true"; // *didn't work >> > * this._vs.visible = "true"; // *didn't work >> > * }* >> > setvscrollwidthfromvisibility(this['_vs'] ? >> this._vs.visible : >> > false); >> > this.myDel = new lz.Delegate(this, >> > "setvscrollwidthfromvisibility", this['_vs'], "onvisible"); >> > </method> >> > >> > Is this correct ? If not correct can i know where exactly change the >> > reference >> > >> > -baskar >> > >> > On Tue, Sep 4, 2012 at 8:04 PM, [email protected] < >> [email protected] >> >> wrote: >> > >> >> You might try to get a reference to the scrollbar in the >> >> scrolledittext and manually set enabled to true for the scrollbar. >> >> >> >> Sebastian >> >> >> >> 2012/9/4 Baskar Rajendran <[email protected]>: >> >> > Seba >> >> > >> >> > Scrollbar is not clickable.. but the text gets changed when focus >> set to >> >> > text box and you use down arrow key. >> >> > Not editable works fine , but i want to use the scrollbar to be >> >> clickable , >> >> > so that the text can be changed on based on the scrollbar move >> >> > >> >> > Thanks >> >> > Baskar >> >> > >> >> > On Tue, Sep 4, 2012 at 7:41 PM, [email protected] < >> >> [email protected] >> >> >> wrote: >> >> > >> >> >> Hi Baskar, >> >> >> >> >> >> you will have to have a look at the source code of >> "scrolledittext.lzx" >> >> >> I guess the enabled true/false will simply put a view in front of >> the >> >> >> text. But I am not sure however. >> >> >> Is the the scrollbar still clickable if enabled is false or can you >> >> >> still click and move it but the text will simply not change? >> >> >> >> >> >> Sebastian >> >> >> >> >> >> 2012/9/4 Baskar Rajendran <[email protected]>: >> >> >> > Hi >> >> >> > >> >> >> > I appreciate if you could help me .. >> >> >> > >> >> >> > >> >> >> > I am trying to modify this customScrollEdittext.lzx by adding an >> >> >> attribute >> >> >> > enabled, so that we could mark it false for not to be edited. It >> works >> >> >> but >> >> >> > the scroll doesnt function if enabled='false' >> >> >> > >> >> >> > <?xml version="1.0" encoding="UTF-8" ?> >> >> >> > <!-- >> >> >> > Licensed to the Apache Software Foundation (ASF) under one >> >> >> > or more contributor license agreements. See the NOTICE file >> >> >> > distributed with this work for additional information >> >> >> > regarding copyright ownership. The ASF licenses this file >> >> >> > to you under the Apache License, Version 2.0 (the >> >> >> > "License"); you may not use this file except in compliance >> >> >> > with the License. You may obtain a copy of the License at >> >> >> > >> >> >> > http://www.apache.org/licenses/LICENSE-2.0 >> >> >> > >> >> >> > Unless required by applicable law or agreed to in writing, >> >> >> > software distributed under the License is distributed on an >> >> >> > "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY >> >> >> > KIND, either express or implied. See the License for the >> >> >> > specific language governing permissions and limitations >> >> >> > under the License. >> >> >> > >> >> >> > --> >> >> >> > <library> >> >> >> > >> >> >> > <include href="incubator/scrolledittext.lzx" /> >> >> >> > >> >> >> > <class name="customScrollEdittext" extends="view" > >> >> >> > <attribute name="text" value="" type="string" /> >> >> >> > >> >> >> > *<attribute name="enabled" type="boolean"/>* >> >> >> > >> >> >> > >> >> >> > <event name="ontextChange" /> >> >> >> > >> >> >> > <attribute name="labelid" type="number" >> >> setter="setLabelId(labelid)" >> >> >> /> >> >> >> > <method name="setLabelId" args="_labelid" > >> >> >> > this.labelid = _labelid; >> >> >> > >> this.setAttribtue('text',canvas.getLabelName(this.labelid)); >> >> >> > </method> >> >> >> > >> >> >> > <method name="getText"> >> >> >> > return this._cbtext.getText(); >> >> >> > </method> >> >> >> > >> >> >> > <view name="_face" bgcolor="0xFFFFFFF" >> >> >> > width="$once{parent.width}" >> >> >> > height="$once{parent.height}" /> >> >> >> > >> >> >> > <view name="v_border" height="1" bgcolor="$once{ >> >> >> > canvas.getThemeColor('secondBorderColor') }" >> >> width="$once{parent.width}" >> >> >> /> >> >> >> > <view name="h_border" width="1" y="1" bgcolor="$once{ >> >> >> > canvas.getThemeColor('secondBorderColor') }" >> >> height="$once{parent.height >> >> >> > -1}" /> >> >> >> > >> >> >> > <scrolledittext name="_cbtext" width="$once{ parent.width-1 }" >> >> x="1" >> >> >> > y="1" bgcolor="0xFFFFFF" styleable="false" >> >> >> > height="$once{ parent.height-1 }" text="${ parent.text }" >> >> >> > vscrollbarclassname="om_vscrollbar" >> >> >> > multiline="true" fontsize="11" *enabled="${ parent.enabled } */> >> >> >> > >> >> >> > >> >> >> > </class> >> >> >> > >> >> >> > </library> >> >> >> > >> >> >> > Thanks >> >> >> > Baskar >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> >> Sebastian Wagner >> >> >> https://twitter.com/#!/dead_lock >> >> >> http://www.webbase-design.de >> >> >> http://www.wagner-sebastian.com >> >> >> [email protected] >> >> >> >> >> >> >> >> >> >> >> -- >> >> Sebastian Wagner >> >> https://twitter.com/#!/dead_lock >> >> http://www.webbase-design.de >> >> http://www.wagner-sebastian.com >> >> [email protected] >> >> >> >> >> >> -- >> Sebastian Wagner >> https://twitter.com/#!/dead_lock >> http://www.webbase-design.de >> http://www.wagner-sebastian.com >> [email protected] >> > >
