Adding scrolling Horizantal to Custom textField

Hello

I wrote a BasicEditField to measure

How to add horizantal scroll to this custom field...?

I added the following, but the text does not appear...

HFM HorizontalFieldManager = new HorizontalFieldManager (Manager.HORIZONTAL_SCROLL |) Manager.NO_HORIZONTAL_SCROLLBAR);
CustomTextField c1 = new CustomTextField ("Enter1:", "", 100, EditField.FILTER_DEFAULT |) EditField.FIELD_LEFT, 200);
HFM. Add (C1);
Add (HFM);

Please find my custom here class

SerializableAttribute public class CustomTextField extends BasicEditField
{
private int labelWidth;
public CustomTextField (label As String, String initialValue, int maxNumChars, long style, int fieldWidth)
{
Super (label, initialValue, maxNumChars, style);
labelWidth = getFont () .getAdvance (label);
this.fieldWidth = fieldWidth;
}
public int getPreferredWidth()
{return fieldWidth ;}
public int getPreferredHeight()
{return super.getPreferredHeight () ;}
protected void layout (int width, int height)
{
width = getPreferredWidth();
height = getPreferredHeight();
Super.Layout (width, height);
super.setExtent (width, height);
}
protected void drawFocus (graphics graphics, boolean on)
{super.drawFocus(graphics, on) ;}
protected void paint (Graphics graphics)
{
int w = getWidth();
int h = getHeight();
graphics.drawRect (labelWidth, 0, (o-labelWidth), h);
Super.Paint (Graphics);
}
}

Can you please provide a way to add the scroll horizantal bar at this by displaying the text correctly.

Thanks in advance

Please take a look at the developer following the journal article.  He's an example of what you're trying to accomplish.

http://NA.BlackBerry.com/eng/developers/resources/journals/jul_2005/creating_textbox_field.jsp

Tags: BlackBerry Developers

Similar Questions

  • When I send someone a document I changed if his crossing of the stuff or by adding arrows, when the customer print, it does not show my changes, I'm going through our prices so visitors cannot see and when the customer print them they can see prices?

    When I send someone a document I changed if his crossing of the stuff or by adding arrows, when the customer print, it does not show my changes, I'm going through our prices so visitors cannot see and when the customer print them they can see prices?

    You probably use drawing markup tools. There are options to print with or without annotations. You can not change this.

    If you don't want them to see the prices, either remove the original document and recreate the pdf without them there or you can use the redaction tools in the full paid for version of Adobe Acrobat Pro.

  • custom textfield click event do not consume of RET.

    Hi all

    I implemented a custom text field that extends the BasicEditField...

    public CustomTextField (String txt) {}
    Super ("", txt, 300, BasicEditField.EDITABLE |) BasicEditField.FOCUSABLE | BasicEditField.ACTION_INVOKE);
    isSearchBox = true;
    textFieldFont = textFieldFont.derive (Font.PLAIN, 12);
    textFieldHeight = textFieldFont.getHeight ();
    textFieldWidth = Graphics.getScreenWidth () - 90;
    setText (txt);
    }

    It's my constuctor...

    When textfield already contains text, it does not consume event back.  It shows all the other essential characters but when at the beginning, I click back (from keyboard simulator) no action will take place. Although he has to take because I have no overrided any other method to do anything manually.

    Please if anyone know what to do. Please let me know.

    Thank you.

    Do not use onfocus and unfocus handle and the text field

    {} public boolean keyDown (int keyCode, int time) this method with caution... never return true for all keydowns...

  • webkit-too-full-scrolling in a custom showcase

    Hey everybody,

    I'm hoping to use the scrolling speed in a custom window. It would seem that this is not possible, but I hope someone has a tower in their bag.

    I tested my code and everything works until it goes into the Viewer.

    Thank you

    -Scott

    Try

    overflow: scroll;

    -webkit-too-full-scrolling: touch;

    Work in my custom windows

  • string adding scroll up

    Hello

    I have a string indicator loop where each time by a certain time I concatenate several data by using shift, as shown in the simplified annex registers.

    The new data are added to the top of the indicator and the old data is pushed down

    Is it possible to have the new strings added at the bottom of the indicator and the strings more pushed up?  He would rather be a standard terminal window.

    I'm using labview 8.2.

    Thank you.

    Hey,.

    I just tried and seems to be what you want... I did loop to test...

    It may be useful

    HS

  • How to display the vertical scroll bar in custom painted screen?


    a simple and intelligent search forum and I solved the problem.

    Screen does not scroll without an active field before and after the Manager of the vertical.

    I just addedd a NullField before the Manager and everything works fine!

    Thank you

  • Adding alert IOM r1 custom

    Hello

    IOM r2 is it possible to create your alerts customized for user form, for example there is a field title in IOM, while uttering selected Admins user "Mr" as title. Later he wants to replace "Mr" with a null value. We want to show alert admin on this particular scenario. While the null value is not defined as a title. Title is just an example there are other areas on which we want to apply this validation.

    So my question is, IS it possible in IOM r1? if so someone can you please share with me a pointer.

    Thank you!!!


    Yes, you can view the custom alert. You can use

    ValidationFailedException ex = new ValidationFailedException();

    ex.setErrorCode ("username already used");

    Hope this will help you

  • Position Y of the image stand out live when adding scrolling effects

    When published / live images (JPG) are replaced on 25 pixels down from its design mode. When I delete these effects of scrolling, the position is again normal.

    there- position of elements may seem "fixed" but in fact, the items are allowed to be "pushed down" where some content above it tends to require a bit more vertical space. As a block of text, reinvest with an additional line, due to the subtle differences in due (different hyphenation of text) line breaks and rendering of fonts in browsers. That's why Muse values of distance between points more, for y-stations.

    This is something very difficult and delicate, especially in the Muse, because the application tries to help you position things exactly, but we must also respect the rules very strict and strong on the web. Some trial and error with the consolidation and alignment of items could help make items to be at least in their correct relative position. Cut blocks of text a little slack, making them a bit bigger that necessary Autonomous (shows that dotted line that appears when you have too much shortened), helps to keep objects below the expected of the framework text safety distance (not the text real lines) above them. And pay attention to any additional empty return!

    So try to live with this little difference, or try to find or make a clever relative positioning in your design. Judging your current design, I'd just leave it as what.

  • adding properties to my custom components

    I do a custom container videoplayer and want to be able to reference the source of the video of the tag my custom as component component mxml "myvideoplayer" looks like this:
    < vbox >
    "< videoDisplay source ="? How can I do this? "/ >
    < hbox id = "orders" / >
    < / vobx >

    If the component is based on a vbox, not a videoplayer...
    and in my application
    < application >
    < myns:myVideoPlayer videosource = "somemovie.mov" / >
    < / application >

    Thank you...

    all you have to do is to create a public property or getter/setter combo in your base vbox component:





    I created "altSource" simply to demonstrate how to create a list dropdown bindable getter/setter. The trick is to make sure you include the [Bindable] tag so that the attribute of the source of the video component is updated every time that your public var Gets the value:



  • ITS filter - adding several filters with the same custom attribute

    Hello

    I added the attributes of custom search and am able to add a filter to the doOracleSearch method.

    filter [0] = new filter (New Integer (100), 'NUMBER', 'equal', 10020);

    Now I have to add another filter for the same attribute of research with or condition, how can I do this...

    I tried the following...

    filter [0] = new filter (New Integer (100), 'NUMBER', 'equal', 10020);
    filter [1] = new filter (New Integer (100), 'NUMBER', 'equal', 10049);

    But how do I specify it's or and the code above does not work.

    Thank you.
    Vermorel.

    Here is an example of this using 11 g. Note that you need to connect programmatically if the data is secure.

    Create the search service and to define the URL of SOAP
    SearchService OracleSearchService = new OracleSearchService();
    searchService.setSoapURL ("http://myserver:7777/recherche/requete/oraclesearch"); ")

    Download the data to the research group
    DataGroup dataGroup = new DataGroup();
    dataGroup.setGroupName ("MyGroup");
    DataGroup dataGroups [] = new DataGroup [1];
    dataGroups [0] = dataGroup;

    Get a list of all the attributes to fetch
    Attribute [] attributesAll = searchService.getAllAttributes("en");
    ArrayList attributeIds = new ArrayList ();
    for (attribute a: attributesAll)
    {
    attributeIds.add (a.getId ());
    }
    Integer [] attributeIdArrayAll = Integer [attributeIds.size (new)];
    attributeIdArrayAll = attributeIds.toArray (attributeIdArrayAll);

    Create filters (BE sure THAT THE FILTER ID IS CORRECT - I do not pretend you code it but rather browse the list of all of the above attributes and get ID like that)
    Filter [] myFilters is new filter [2];.
    myFilters [0] = new filter (124, "Number", "EQUAL", "129224");
    myFilters [1] = new filter (124, "Number", "EQUAL", "123730");

    Request (be SURE to USE ' or ' as the operator between the filters)
    Result OracleSearchResult = searchService.doOracleSearch ("", 0, 50, false, false, dataGroups, "fr", null, true, 'or', myFilters, attributeIdArrayAll);

    Get number
    int hits = result.getEstimatedHitCount () .intValue ();

    Print results
    ResultElement [] resElements = result.getResultElements ();
    for (int i = 0; i)< reselements.length;="">
    {
    Download the document
    ResultElement doc = resElements;
    }

    I hope this helps!

  • My textfield does not display a scroll bar

    How to make the installation of the scroll bar on my textField.

    myTex.htmlText = myText;

    myTex.worldWrap = true;

    myTex.multiline = true;

    myTex.scrollV = true;

    TextArea is better in performance and seamless scrolling. But he is relatively "heavy".

    If your not having performance issues, you can go to TextArea.

    One last thing, the text box will give you less control over text formatting directly, but you can access

  • Question view screen with custom fields

    I've developed a class that extends the scope and Implements DrawStyle. The field contains a bitmap with text drawn on the left of the it... nothing too complicated. I made focasable, has erased layout and drawFocus, painting, etc., but I'm having a Visual anomaly.

    On my screen (no title), I added a LabelField (non-active), and then a BitmapField (non-Focus), followed by a number of my custom fields. When the first screen, everything looks great. My first custom control has focus and is drawn as such.

    The problem occurs when I scroll through the custom control 3rd to 4th (causing the screen scroll), the 2nd custom control appears twice, the 3rd is missing and the 4th has the focus. There are also some white background that starts to show through (my controls are all black and is so the bottom of the screen and other controls).

    Of course, I'm having some trouble of painting, but it is certainly related to scrolling.

    What methods should be overritten in a custom control to ensure the scrolling will work properly?

    Which must be defined in the screen?

    1. prepare your screen unscrollable as:

    Super (NO_VERTICAL_SCROLL);

    2 use a VerticalFieldManager to add all of your components.

    Make sure verticalManager Scrollable and set its size and background color.

    Something like:

            mainManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR)
            {
                //setting background color
                protected void paintBackground(Graphics graphics)
                {
                    graphics.setBackgroundColor(0x00000000);
                    graphics.clear();
                    super.paint(graphics);
                }
                //setting its height and width
                protected void sublayout( int maxWidth, int maxHeight )
                {
                    int width = Display.getWidth();
                    int height = Display.getHeight();
                    super.sublayout( width, height);
                    setExtent( width, height);
                }
            };
    

    3. now add this to your screen.

    Now your screen does not scroll and you will not get the white background at the end.

    Let me know if you have any questions.

    Concerning

    Bika

  • How do I move TextField?

    Hello

    I have a problem: I have a VerticalFieldManager with the width w and height H and in good conditions, new textField is created and added (it takes whenever new TextField is created, the reason is not important here).

    VerticalFieldManager has the right height (smaller than the screen size). My problem is that when there are too many textFields, they are hidden and I have to scroll down. and I want to my text moves automatically, once it reaches the height of the fieldManager.

    I tried to use textField.setCursorPosition (), but it did not help.

    I hope I describe clearly what is my problem. Did anyone have any suggestions?

    Kind regards

    Try Field.setFocus ().

  • Scroll event: movieclip instead of dynamic text

    Hello everyone. I am very very new to actionscript, so probably my question sounds a bit ridiculous.

    I'm putting an Arabic text to scroll with a custom scroll bar. So I found a nice video in youtube , all this with a dynamic text field. It works wonderful for Latin characters (from left to right and separated from the letters) but unfortunately not for Arabic characters (they don't connect). In fact, I do not use just a movieclip with the text instead of the dynamic text field. But I don't know how to change the actionscript code for the video instead of the dynamic text field.

    Here I show you the code for the scrolling text in a dynamic text field (it's a small code), on the stage, I got just the dynamic text field (instance name: texto_txt), the scroll bar (a vertical line, the name of the instance: scrollBar_mc) and the scrolling itself (a small rectangle, the instance name (:scrollHandle_mc):

    var content: String = "cjeihfirehjfejlkfjkerjfirjfejifjrijwkjfirwjeknlkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkllllllll";

    texto_txt. Text = content;
    texto_txt.WordWrap = true;

    var min: number = scrollHandle_mc.y;

    var max: number = min +(scrollBar_mc.height-scrollHandle_mc.height);

    var range: number = max - min;

    var arrastrando: Boolean = false;

    the var limits: Rectangle = new Rectangle (scrollHandle_mc.x, scrollHandle_mc.y, 0, scrollBar_mc.height - scrollHandle_mc.height);

    scrollHandle_mc.addEventListener (MouseEvent.MOUSE_DOWN, arrastrandoScroll);

    stage.addEventListener (MouseEvent.MOUSE_UP, stopIt);

    function arrastrandoScroll(mouseEvent:MouseEvent)

    {

    scrollHandle_mc.startDrag (false, bounds);

    arrastrando = true;

    scrollHandle_mc.addEventListener (Event.ENTER_FRAME, progress);

    }

    function stopIt(mouseEvent:MouseEvent)

    {

    scrollHandle_mc.stopDrag ();

    arrastrando = false;

    }

    function progress(e:Event)

    {

    var moverScroll:Number = scrollHandle_mc.y - min;

    var p: Number = moverScroll/range;

    If (arrastrando is true)

    {

    texto_txt.scrollV = % * texto_txt.maxScrollV;

    }

    }

    What I want to do is clear the dynamic text field and use rather a movieclip (text_mc) which already includes the text, the bounding box would be a mask. How can I change the actionscript code? Could someone help me?

    It isn't really a question of mathematics, as it is a logical reasoning, but if you plan to do things with the lineup, you expect better familiarize themselves with the learning of mathematics as well.  Programming and math go hand in hand.

    This is a simplified explanation of what your code should-> if you move the wheel of 25% of the total distance, it can move, then the movieclip should be moved 25% of the distance, he can move (in the sense of oppostie).

    Your scroll handle can be moved from a predefined distance.  In your code, this is called the "range".  See if you can understand how this value is determined in 3 lines of code.

    var min: number = scrollHandle_mc.y;

    var max: number = min +(scrollBar_mc.height-scrollHandle_mc.height);

    var range: number = max - min;

    Later depending on your progress, you can see where the handle of the scrollbar values com into play again to determine where to place the textfield object.  But if we change that to be the movieclip, it becomes more similar to the following...

    function progress(e:Event)

    {

    var moverScroll:Number = scrollHandle_mc.y - min;

    var p: Number = moverScroll/range;

    If (arrastrando is true)

    {

    yourMC.y = % * (yourMCmaxY-yourMCminY) + yourMCMinY;

    where yourMCmaxY-yourMCminY's range of movement of the mc

    who is likely to be negative since yMax is likely< ymin="" for="" the="">

      }

    }

  • Why is there not an option to create a custom for a simple telephone touch label?

    Why is there not an option to create a custom for a simple telephone touch label? 9. new version of iOS.

    There are. What makes you think there isn't. When you click to add a phone number, click label, and then scroll down to Custom. Type away.

Maybe you are looking for

  • Contact seems to be always in offline mode

    I have a contact who seems to be always in offline mode, even if she is actually online. This means that I can't do a video call to her, only to send messages. But she can call me video. What can I or she do to change this?

  • Qosmio F30 - how to get started using the external CD/DVD drive?

    Hello Mr President I have a Qosmio F30. My CD/DVD drive does not work. I have the USB CD/DVD drive, but I think that F30 does not support external USB CD/DVD drive to boot to the top. Please help me. Now, how can I boot Windows XP CD?

  • IdeaPad Y450 problem with an external hard drive

    Whenever I start to start windows 7, I have to disconnect WD mybook from my laptop each time otherwise it will just pass through the bios screen and then enter halt (black screen with cursor blinking...), if I happen to forget unplug the hd, I just d

  • 2.1.55 blur service is temporarily unavailable

    OK last night I updated my phone and he ended up freezing on me a bit, even if subsequently. I ended up having to do a factory reset. Now, I can not connect to Motoblur to use the XT. I tried to use my regular account, in addition to creating an acco

  • Some parts of our site are currently unavailable.

    Hello We receive orders from our restaurant through the hpeprint.com service.  When the service goes down, we don't reeive not any notice.  The service seems to be down now.  The web site displays a message 'some parts of our site are currently unava