Output field Focus

I have a RichText field inside a VerticalFieldManager.  This value for money takes only a few lines.  I have two of them on the screen.  When I scroll using the wheel she starts most by the Senior Manager of VFM and scroll all the way to the bottom of the text in text VFM most high field before moving the low VFM Textbox.  Because text fields can have a large amount of text in there it takes a long time to go through all the text in the top of the page value for money before I go down one.  I would like to navigationMovement and if the text box has not been clicked then just move to the next text box.  The user can then move between the two and click never who he or she wants to read by clicking on it.  I need to be able to give up the selection or focus within navigationMovement.  I tried focusRelease and setFocus.  Maybe I need to do on the screen rather than on the optimization of resources.

Any help would be greatly appreciated.  I can post code samples if that would help.

Thanks in advance.

Peter thank you very much for your contribution.

I placed the invokelater in the onfocus method and it works actually pretty good.

This is my first java program and the first blackberry application, so I don't know that I'm not always the straight line.

I'm still trying to get use to the memory management model.  I can new the executable thread in the onFocus event?  It runs only once and I have no concern for leaks and memory fragmentation?  Also do not know how the run() method actually gets my VOR 'this->' pointer but he does.  Its similar magic.

In any case, I don't want to accept this as a solution, I again thank you and I will post the three methods that I placed on my VerticalFieldManager that contains a single field to RichText.

Maybe someone else has problems with the setVerticalScroll not taking effect.

    protected void onFocus(int direction)
    {
        super.onFocus(direction);

        //  Need to call setVerticalScroll a little later.  It looks like
        //  setFocus is overriding it.  If we call it later then it will
        //  actually take effect.
        UiApplication.getUiApplication().invokeLater(
            new Runnable()  {
                public void run()   {
                    setVerticalScroll(m_iCurrentLine * m_iFontHeight);
                }
            });
    }

    protected boolean navigationClick(int status, int time)
    {
        m_bScrollEnabled = m_bScrollEnabled == true ? false : true;
        return  true;
    }

    protected boolean navigationMovement(int dx, int dy, int status, int time)
    {
        if  (m_bScrollEnabled == true)
        {
            int     i_scrolloff =   (m_iCurrentLine + dy) * m_iFontHeight;
            if  (i_scrolloff < 0 || (i_scrolloff + getVisibleHeight()) > getVirtualHeight())
                return  true;       //  Eat the scroll event cause we're at the beginning or end

            m_iCurrentLine      +=  dy;
            setVerticalScroll(i_scrolloff);
            return  true;
        }
        else
        {
            //  If here then RichText field is not selected
            //  figure out which field currently has focus
            //  and move focus to next field
            Screen  scr         =   getScreen();
            int     i           =   scr.getFieldWithFocusIndex();
            Field   field       =   (i == (scr.getFieldCount() - 1)) ? scr.getField(0) : scr.getField(i + 1);
            field.setFocus();
        }
        return  false;
    }

Tags: BlackBerry Developers

Similar Questions

  • Field focuses do not

    Hello

    For me RichTextField get does not it comes by default white background and black text. So please help me to fix the sentence. Why he isn't getting focused with the specified color.

    Here is the code I use.

     Phone = new ExRichTextField(sphone){
                int _bgColor;
                int _txtcolor;
                    public void onFocus(int direction) {
                  _bgColor = Color.ORANGE;
                  _txtcolor=Color.BLACK;
                      invalidate();
                      super.onFocus(direction);
                       Phone.setPhoneNumber(sphone);
                        Phonenumber=this.getPhoneNumber();
                         s.addMenuItem(new MenuItem("call",1,1) {
    
       public void run() {
        makeCall(Phonenumber);
    
       }
      });
    
           }
    
           public void onUnfocus() {
                  super.onUnfocus();
                 _bgColor = Color.ALICEBLUE;
                 _txtcolor=Color.BLACK;
                    invalidate();
                    s.removeAllMenuItems();
           }
    
                               public void paint(Graphics g) {
                                   g.setColor(_bgColor);
                                   g.setColor(_txtcolor);
                                    super.paint(g);
                            }
                    };
    
    class ExRichTextField extends RichTextField {
    
                public ExRichTextField(String text) {
                    super(text,Field.FOCUSABLE);
    
            }
    
    }
    

    I have trouble reading your code, because you seem to have a combination of substitutions that I'm not sure.  Here is an example which I think is what you want in terms of development.  You can find a way add/remove the item from the menu in this treatment.

    class ExRichTextField extends RichTextField {
        int _bgColor = Color.ALICEBLUE; // initially unfocused
        int _txtcolor = Color.BLACK;
    
        public ExRichTextField(String text) {
            super(text,Field.FOCUSABLE);
        }
    
        public void onFocus(int direction) {
            super.onFocus(direction);
            _bgColor = Color.ORANGE;
            _txtcolor=Color.BLACK;
            invalidate();
        }
    
        public void onUnfocus() {
            super.onUnfocus();
            _bgColor = Color.ALICEBLUE;
            _txtcolor=Color.BLACK;
            invalidate();
        }
    
         public void paint(Graphics g) {
             g.setBackgroundColor(_bgColor);
             g.clear();
             g.setColor(_txtcolor);
             super.paint(g);
         }
    
    }
    
  • Field Focusable problem

    Hi all

    In my program, there is 1 HorizontalFieldManager and 2 AbsoluteFieldManager

    Now, I add 2 AFM of HFM and it looks like this

    __ ___ __ ___ __ __

    |    AFB1 |    AFM2 |

    ----------------------------

    the problem is when I add a buttonField, ButtonField.Focusable in AFM2

    When the application is run, the starting point should not be the AFB1 but it's my buttonField

    I think that happens because of the buttonfield Focusable

    If anyone knows how to fix this help please me, all I want is to ensure that the application starting point will be to first vfm.

    Thank you

    on the screen display, the first Focus field gets focus.
    There are no fields in AFB1, how to get the focus?

    You can put a nullfield in this, or any other field focusable.

  • Custom ButtonField Field.FOCUSABLE + Field.FIELD_HCENTER

    I am doing a custom button class that can change the color of the button when it is concentrated AND make it Central on the screen, I can make one of these but not both.

    This is the constructor for the class CustomButtonField

       public CustomButtonField(String text){
            super(Field.FOCUSABLE);
            this.text = text;
            //this.highlightColour = 0x18333C;
            FontFamily fFam = null;
            try {
                fFam = FontFamily.forName("Arial");
            } catch (ClassNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
                    Font font = fFam.getFont(Font.PLAIN, 20);
            Font defaultFont = font;
            fieldHeight = defaultFont.getHeight() + padding;
            fieldWidth = defaultFont.getAdvance(text) + (padding * 2);
            this.setPadding(2, 2, 2, 2);
    
        }
    

    Evolution:

    Super (Field.FOCUSABLE)

    TO

    Super (Field.FIELD_HCENTER)

    allows me to do the other, but not both at the same time, all clues?

    Thank you!

    Super(Field.FOCUSABLE |) Field.FIELD_HCENTER);

  • Problem in the scroll bars when the screen is not any field focus...

    Hi all

    I have a screen on which I need to display a list of items. and the list total appears at the bottom of the list. everything works fine if the lily a few number of lines. but as soon as the number of rows and Lily exceeds the length of the screen, there is the problem. I don't see the total at the bottom because I can't scroll the list. Here is the code in my class. in the class list, I use a CustomGridManager, which shows data in a table (I downloaded it). I made a few changes in the present. the code for this handler is also attached. Please tell me what changes should I make, so that the screen can be the object of a scroll. (Please go through the code)...

    SerializableAttribute public class MyClass extends {screen

    public MyClass (dataList DataList []) {}

    Super(Manager.VERTICAL_SCROLLBAR |) Manager.VERTICAL_SCROLL);

    Super();

    int noOfColumns = 2;

    int noOfRows = dataList.length;

    int [] columnWidth = {50.50};

    CustomGridManager gfmHeader = new CustomGridManager (noOfColumns, 0, columnWidth);

    Adding headers

    LabelField lblHdrCol1 = new LabelField ("Col1");

    gfmHeader.add (lblHdrCol1);

    LabelField lblHdrCol2 = new LabelField ("Col2");

    gfmHeader.add (lblHdrCol2);

    VerticalFieldManager vfmTitle = new VerticalFieldManager();

    vfmTitle.add (new LabelField ("my class"));

    vfmTitle.add (gfmHeader);

    setTitle (vfmTitle);

    Addition of body

    GFM CustomGridManager = new CustomGridManager (noOfColumns, 0, columnWidth);

    for (int i = 0; i)< noofrows;="">

    LabelField lblICol1 = new LabelField (dataList [i] .getCol1 ());

    GFM. Add (lblICol1);

    LabelField lblICol2 = new LabelField (dataList [i] .getCol2 ());

    GFM. Add (lblICol2);

    Adding a footer

    CustomGridManager gfmFooter = new CustomGridManager (noOfColumns, 0, columnWidth);

    LabelField lblFtrTotal = new LabelField ("Total");

    gfmFooter.add (lblFtrTotal);

    LabelField lblFtrValue = new LabelField ("CalculatedValue");

    gfmFooter.add (lblFtrValue);

    Add (gfmHeader);

    Add (new SeparatorField());

    Add (GFM);

    Add (new SeparatorField());

    Add (gfmFooter);

    Add (new SeparatorField());

    }

    ======================================================

    SerializableAttribute public class CustomGridManager extends Manager {}

    private int [] columnWidths;

    private int [] staticColumnWidth;

    private int columns;

    private int allRowHeight = - 1;

    /**

    * Built a new CustomGridManager with the number of columns specified.

    * Lines will be added to the need to display the fields.

    * Fields will be added to the grid in the order they are added to this Manager.

    to complete each row from left to right:

    *

    * For example, a Manager 2 column:

    *

    * [Field1] [Field2]

    * [Field3] [Field4]

    * [Sphere5]

    *

    * Column widths are equal, and the Manager will attempt to use the entire available width.

    Each line height will be equal to the height of the field higher in the same row.

    * Styles positional field are met, then the fields that are smaller than the row/column

    * they can be set to left, right, up down, or centered. They have by default at the top left.

    *

    @param columns number of columns in the grid

    @param style

    */

    public GridFieldManager (columns int, long style) {}

    Super(Manager.VERTICAL_SCROLLBAR |) Manager.VERTICAL_SCROLL);

    Super (style);

    This.colonnes = columns;

    }

    /**

    *

    @param columns columns number of columns in the grid

    @param style

    @param columnWidths width of each column in a table

    */

    public GridFieldManager (columns int, long style, int [] columnWidths) {}

    Super(Manager.VERTICAL_SCROLLBAR |) Manager.VERTICAL_SCROLL);

    Super (style);

    This.colonnes = columns;

    this.staticColumnWidth = columnWidths;

    }

    protected boolean navigationMovement (int dx, int dy, int, int time status) {}

    int focusIndex = getFieldWithFocusIndex();

    While (dy > 0) {}

    focusIndex += columns;

    {If (focusIndex > = {getFieldCount())}

    Returns false; The focus moves on this manager

    }

    else {}

    Field f = getField (focusIndex);

    If (f.isFocusable ()) {/ / only move the focus on the fields of the object of focus}

    f.setFocus ();

    -DY;

    }

    }

    }

    While (dy< 0)="">

    focusIndex = columns;

    If (focusIndex< 0)="">

    Returns false;

    }

    else {}

    Field f = getField (focusIndex);

    If (f.isFocusable ()) {}

    f.setFocus ();

    DY ++;

    }

    }

    }

    While (dx > 0) {}

    focusIndex ++;

    {If (focusIndex > = {getFieldCount())}

    Returns false;

    }

    else {}

    Field f = getField (focusIndex);

    If (f.isFocusable ()) {}

    f.setFocus ();

    -DX;

    }

    }

    }

    While (dx< 0)="">

    -focusIndex;

    If (focusIndex< 0)="">

    Returns false;

    }

    else {}

    Field f = getField (focusIndex);

    If (f.isFocusable ()) {}

    f.setFocus ();

    DX ++;

    }

    }

    }

    Returns true;

    }

    protected void sublayout (int width, int height) {}

    int y = 0;

    columnWidths = new int [columns];

    If (staticColumnWidth == null: staticColumnWidth.length)<= 0)="">

    for (int i = 0; i)< columns;="" i++)="">

    columnWidths [i] = width/columns;

    }

    } else {}

    for (int i = 0; i)< columns;="" i++)="">

    columnWidths [i] = (width * staticColumnWidth [i]) / 100;

    }

    }

    On the field [] fields = Field [new columnWidths.length];

    currentColumn int = 0;

    rowHeight = 0 int;

    for (int i = 0; i)< getfieldcount();="" i++)="">

    fields [currentColumn] = getField (i);

    layoutChild (fields [currentColumn], columnWidths [currentColumn], height-y);

    If (fields [currentColumn] .getHeight () > rowHeight) {}

    rowHeight = fields [currentColumn] .getHeight ();

    }

    currentColumn ++;

    {If (currentColumn == columnWidths.length | I == {getFieldCount () - 1)}

    int x = 0;

    If (this.allRowHeight > = 0) {}

    rowHeight = this.allRowHeight;

    }

    for (int c = 0; c)< currentcolumn;="" c++)="">

    long fieldStyle is fields [c] .getStyle ();.

    int fieldXOffset = 0;

    long fieldHalign = fieldStyle & Field.FIELD_HALIGN_MASK;

    If (fieldHalign == Field.FIELD_RIGHT) {}

    fieldXOffset = columnWidths [c] - fields [c] .getWidth ();

    }

    Else if (fieldHalign == Field.FIELD_HCENTER) {}

    fieldXOffset = (columnWidths [c] - fields [c] .getWidth ()) / 2;

    }

    int fieldYOffset = 0;

    long fieldValign = fieldStyle & Field.FIELD_VALIGN_MASK;

    If (fieldValign == Field.FIELD_BOTTOM) {}

    fieldYOffset = rowHeight - fields [c] .getHeight ();

    }

    Else if (fieldValign == Field.FIELD_VCENTER) {}

    fieldYOffset = (rowHeight-fields [c] .getHeight ()) / 2;

    }

    setPositionChild (fields [c], x + fieldXOffset, y + fieldYOffset);

    x += columnWidths [c];

    }

    currentColumn = 0;

    y += rowHeight.

    }

    If (y > = height) {}

    break;

    }

    }

    totalWidth int = 0;

    for (int i = 0; i)< columnwidths.length;="" i++)="">

    totalWidth += columnWidths [i];

    }

    setExtent (totalWidth, Math.min (y, height));

    }

    }

    Do you really want now fields is active.

    You can try adding a NullField after your Manager - a NullField is active, if it does not size.

    Other than that, you can try the substitution of navigationMovement and Manager.setVerticalScroll to go up and down the window scrolling.  I think it should work, although I never did.  You can control the scope of the first Manager to ensure that you do not have to scroll through to the end.

  • Missing in the psadmin output field

    I have a 'problem' with a ps admin command. It is this command:
    C:\apps\psoft\hrms9\appserv > cmd /c C:\apps\psoft\hrms9/appserv/psadmin Pei sstatus d DH9849OR

    Usually, when this command is executed, there is an impression off the screen of seven fields. I have a system in which the last row print is missing the seventh field. (I hope you can bear with the formatting. "I can't understand how to cite this output to make it look nice in the post).

    Name of PROG queue name Grp name ID RqDone made load current Service

    PW3G3 50412 0 1454 72700 BBL.exe (IDLE)
    PSMONITORSRV.e MONITOR 1 0 0 (INACTIVE)
    PSAESRV.exe 00101.00001 AESRV 1 112 5600 (IDLE)
    PSAESRV.exe 00101.00002 AESRV 2 0 0 (INACTIVE)
    PSAESRV.exe 00101.00003 AESRV 3 0 0 (INACTIVE)
    PSPRCSRV.exe SCHEDQ BASIC 101 0 0 (INACTIVE)
    PSMSTPRC.exe MSTRSCHQ BASE 102 0 0 (INACTIVE)
    PSDSTSRV.exe DSTQ 103 328 16400 BASE

    C:\apps\psoft\hrms9\appserv >

    As you can see, the last field is missing. There is no (IDLE). I would like to know if this is expected behavior, and if it is, what it means? Is there a problem with the system, and what can I do about it?
    Thank you

    -Josh

    Another question, activated the notification on the RTC Server definition page? If this is the case, her remember you set an SMTP server as well in the CRP configuration file, or turn it off.

    In any case, according to your last output (not able to stop the CRP), I think that the distribution agent queue hangs, somehow, you can have a large number of reports, please, report the status of the process (maybe they are stuck to the 'Report' status) and the error messages in the log file that might help identify the root cause. One way to avoid collisions is to increase the number of instances PSDSTSRV, change the min = 2 max = value 4 or higher.

    Nicolas.

  • eSign text tags-specification of output field dimensions

    Hello

    Is there a code to specify the dimensions of the field of a field created by the text tags?

    For reasons of appearance purely, I would like to set the fields of the form to have a specific dimension, as I would if I put them manually.

    In particular, the free text field, such as {{Address_es_:signer}} }}

    Advice?

    For those who are interested:

    "So you can make the multiline field and using the text tag.

    {{FieldName_es_:signer1:multiline(12)}}

    If the spacing between the first braces and last will determine the length of the field

    If it is multi line there is packaging of Word and the text will depend on the length of the field

    also the width of the field will depend on the font size of the first braces.


    So in this area of free text, example the '12' is the number of lines


    all width of the {{}} determines the width of the field so just fill with spaces to fit your needs...

  • How to set focus on PaneManager Field after it is created.

    I'm trying to set the focus to the first title of the pane Manager view... for the first title in the tab...

    Content is dispaying the first tab on the opening screen.

    I tried these ways.

    LabelField historyTitleField = new LabelField ("History", Field.FOCUSABLE |) Field.FIELD_HCENTER);
    Component = new part (historyTitleField, value);

    After setting PaneManagerView added this line to set the default focus: historyTitleField.setFocu ();

    It did not work...

    I have tried both the options below:

    paneManagerView.getField (0) .setFocus ();   Did not work

    paneView.setFieldWithFocus (historyTitleField);  Not work...

    Anyone has an idea... How to set the first title of the focus of the Manager pane tab?

    try to wrap it in an invokelater

  • Make the fields within a focusable VerticalFieldManager

    This should be rather trivial, but I can't get fields inside a verticalfieldmanager accept and behave focusable and allow the cursor movement is visible.

    I have a popupscreen. He has created with a verticalfieldmanager (code to follow).

    Inside that I need another manager of vertical field so I can view a list of fields in a section with scrolling and always allowed to display items at the top or at the bottom of the context menu without being invaded by the central list.

    After having none of the fields in the list has the focus.

    The environment is JRE4.5 + 8300 on the Simulator.

    Appreciate any comment. /Jeff

    Code for popup:

    public static class ScrollingPopup extends PopupScreen {}
    VerticalFieldManager innerFieldManager;

    public ScrollingPopup() {}
    Super (new VerticalFieldManager());
    innerFieldManager = new VerticalFieldManager (VerticalFieldManager.FOCUSABLE |) VerticalFieldManager.VERTICAL_SCROLL | VerticalFieldManager.VERTICAL_SCROLLBAR) {}
    protected void sublayout (int maxWidth, maxHeight int) {}
    int newHeight = (int) (Display.getHeight () * 0.5);
    Super.sublayout (maxWidth, newHeight);
    setExtent (maxWidth, newHeight);
    }
    };
    I tried with a VerticalFieldManager default, but it made no difference
    innerFieldManager = new VerticalFieldManager (VerticalFieldManager.FOCUSABLE |) VerticalFieldManager.VERTICAL_SCROLL | VerticalFieldManager.VERTICAL_SCROLLBAR);
    for (int i = 0; i)< 10;="" ++i)="">
    innerFieldManager.add (new LabelField ("item" + i));
    }
    Add (innerFieldManager);
    innerFieldManager.setFocus ();
    Add (new SeparatorField());
    Add (new LabelField ("label attached to the bottom"));
    super.onDisplay ();
    }
    }

    Sorry only looked at this briefly, but remember that the Blackberry does not focus on managers, he focuses on the fields.  It "scrolls" focusable field to the field focusable.  In this case, you add LabelFields loads, which are not, by default, the object of focus.  So I suggest you must make them active, or add some NullFields, that are focusable but no presence of the user interface.  I hope this helps.

  • Storm cannot focus on the field that wasn't a show on the first screen

    Hi all

    I have an application works very well on all devices except the device of the storm.

    If there are field mutil-focus on the screen, if the fields are not display when the display is launched,

    even if you move the screen to show, it can be still not developed.

    my request:

    /*
     * App.java
     *
     * © , 2003-2005
     * Confidential and proprietary.
     */
    
    import net.rim.device.api.ui.*;
    import net.rim.device.api.ui.container.*;
    import net.rim.device.api.ui.component.*;
    
    /**
     *
     */
    public class App extends UiApplication{
        public static void main(String arg[]){
            UiApplication app = new App();
            app.enterEventDispatcher();
        }
        public App() {
            pushScreen(new AScreen());
        }
        public class AScreen extends MainScreen
        {
            private VerticalFieldManager vfm = new VerticalFieldManager();
            public AScreen()
            {
                super(NO_VERTICAL_SCROLL);
                PartScrollableManager man = new PartScrollableManager(true);
                this.add(man);
                man.addHeadField(new ButtonField("Head"));
                for(int i=0;i<2;i++){
                    man.addBodyField(new LabelField("label"+String.valueOf(i),Field.USE_ALL_HEIGHT|Field.USE_ALL_WIDTH|Field.FOCUSABLE));
                }
                man.addBodyField(vfm);
                addField();
                for(int i=3;i<10;i++){
                    man.addBodyField(new LabelField("label"+String.valueOf(i),Field.USE_ALL_HEIGHT|Field.USE_ALL_WIDTH|Field.FOCUSABLE));
                }
                //man.addFootField(new ButtonField("Foot"));
                //man.addFootField(new EditField("Foot",""));
            }
    
            private void addField()
            {
                for(int i=0;i<9;i++){
                    vfm.add(new EditField(String.valueOf(i),""));
                }
            }
    
            public boolean trackwheelClick(int status,int time){
                Field f = this.getLeafFieldWithFocus();
                if(f instanceof ButtonField){
                    synchronized(UiApplication.getEventLock()){
                        if(vfm.getFieldCount()==0){
                            addField();
                        }else
                            vfm.deleteAll();
                    }
                    return true;
                 }
                 return false;
            }
        }
    }
    
    /*
     * PartScrollableManager.java
     *
     * © , 2003-2005
     * Confidential and proprietary.
     */
    
    import net.rim.device.api.ui.component.*;
    import net.rim.device.api.ui.container.*;
    import net.rim.device.api.ui.*;
    import net.rim.device.api.system.Display;
    
    /**
     *
     */
    public class PartScrollableManager extends VerticalFieldManager{
    
        private int MANGER_HEIGHT = Display.getHeight();
        private VerticalFieldManager headManager;
        private VerticalFieldManager footManager;
        private VerticalFieldManager bodyManager;
        private boolean isBorder;
        int rheight = 0;
        public PartScrollableManager(boolean border) {
            super(USE_ALL_HEIGHT | USE_ALL_WIDTH | NO_VERTICAL_SCROLL);
            isBorder = border;
            headManager = new VerticalFieldManager(USE_ALL_WIDTH |NO_VERTICAL_SCROLL);
            footManager = new VerticalFieldManager(USE_ALL_WIDTH |NO_VERTICAL_SCROLL);
            bodyManager = new VerticalFieldManager(USE_ALL_WIDTH |VERTICAL_SCROLL){
                protected void sublayout(int width,int height)
                {
                    int count = this.getFieldCount();
                    int h = 0;
                    for(int i=0;ithis.getHeight()) return super.touchEvent(ev);
                if(ev.getEvent()==TouchEvent.DOWN){
                    try{
                        setFocus(ev.getX(1),ev.getY(1),0);
                    }catch(Throwable ex){
                        System.out.println("ex : " +ex.toString());
                    }
                }
                boolean result = super.touchEvent(ev);
                int size = ev.getMovePointsSize();
                if(size>=2){
                    int vheight = this.getVirtualHeight();
                    int dheight = this.getVisibleHeight();
                    int xs[] = new int[size];
                    int ys[] = new int[size];
                    int ts[] = new int[size];
                    ev.getMovePoints(1,xs,ys,ts);
                    int dy = ys[size - 1] - ys[0];
                    verticalScroll = Math.min(Math.max(verticalScroll - dy, 0), rheight - dheight);
                    try{
                        setVerticalScroll(verticalScroll);
                    }catch(Throwable ex){
                        System.out.println("ex : " +ex.toString());
                    }
                }
                return result;
            }
    
            };
            this.add(headManager);
            this.add(bodyManager);
            this.add(footManager);
            headManager.add(new SeparatorField());
            footManager.add(new SeparatorField());
        }
    
        private void drawBorder(Graphics g)
        {
            int color = g.getColor();
            g.setColor(Color.BLACK);
            XYRect rect = g.getClippingRect();
            g.drawRect(0,0,rect.width,rect.height);
        }
    
        public void addHeadField(Field f){
            headManager.insert(f,headManager.getFieldCount()-1);
        }
        public void addFootField(Field f){
            footManager.add(f);
        }
    
        public void addBodyField(Field f){
            bodyManager.add(f);
        }
        public void setHeight(int height){
            MANGER_HEIGHT = height;
        }
        protected void sublayout(int width,int height)
        {
           layoutChild(headManager,width,height);
           layoutChild(footManager,width,height);
           layoutChild(bodyManager,width,height);
           setPositionChild(headManager,0,0);
           setPositionChild(bodyManager,0,headManager.getHeight());
           setPositionChild(footManager,0,Display.getHeight()-footManager.getHeight());
           setExtent(Display.getWidth(),MANGER_HEIGHT);
        }
    }
    

    What is wrong with my code?

    any advice would be appreciated.

    Hi guys,.

    I found the reason.

    for touchscreen, when setExtent, you define the actual size, so when you scroll, it will work correctly.

    Otherwise, so just set as visiable, it will never be setFocus on the field which is visible beyond.

    I guess RIM internal API regal setExtent is life-size on the touch screen, not even as no touchscreen.

    It is visiable size and size of the actual content.

    See you soon.

  • What is the best way to catch the change event of Focus of the field on the screen.

    Hi all

    I want to trace the change event of focus field, since my setFieldChangeListener and FocusChangeListener domain for a specific use. I can't put that kind of receiver.

    I want to use fieldChaneNotify, however, it does not call at the level of the screen.

    Is there a better way to track field focus change listener?

    I tried fieldChangeNotify and moveFocus... negative screen level...

    Thank you

    Sorry not sure I understand this.

    From what I understand, your problem seems to be that your field only supports a FocusChangeListener, so you can not add another.  Extend the scope to take in charge several FocusChangeListeners and is not your problem solved?  This seems a more elegant way that attempts to manipulate a change mechanism.

  • DASYLab Write Data Module output Format

    When writing the fields in an output file in ASCII mode with the option writing data Module and copy entries, entered the order in writing? Or, if the output field order can be changed? I guess the order of the output being written is 0. n. I can redraw the module so that the entry order corresponds to the order of output you want, but it makes the messy Visual design. I would like to be able to specify that the entries (copied to the outputs) are 1.n and written as 0.. n-1 and the 0th entry is written to the nth output. If I can manipulate their order in the module or do I redirect the entries to match the order of final output?

    Thank you

    The list of strings in the target file is determined by the entries in the module. They are always written 0... n.

    There is no way to change the order inside the module. You need to link the entries in the order you want to that they have written.

    The option of copy entered in any module is simply a way to keep tidy worksheet. It allows to "pass" the module. No processing is done, and the output channels are exactly the same as the input modules.

    Checking the option in the module to write data does not affect the file that is created.

  • Epsillon (electrochemistry). DAT want to tracing of data output

    I am using electrochemistry Epsillon material.  The output is a. DAT file (which can be read as text in Notepad).  I want to know if someone can help me to have LabView read the desired direction. DAT, take the 2 columns of data and output field.  It would be extremely useful.  I tried dat help in the forums, I don't need the file to be converted to excel and then out again since I have two columns, I need.  Any help would be greatly appreciated.

    Thank you

    Because the file is not download the extension, I downloaded here.

    http://www.qfpost.com/file/d?g=dagfbieV7


  • String following line - Style field list button

    Hi all

    Below I have attached two images of liststylebuttonfield,

    1. in the first picture

    True line-'connected to 3 organization... ". ', display line-'connected to 3 organization... ". »

    the remaining letters are present in the background of the image.

    I give the width = totalwidth - lefticon.getwidth ();

    2. in the second picture

    True line-'connected to 3 organization... ". ', display line-"Connected to eveniment 3.

    the remaining letters are hiding.

    I give the width = totalwidth - lefticon.getwidth () - balloonIcon.getwidth () - actionIcon.getwidth ();

    How to give to the next line of width/auto for this problem.

    Below I attach my code for your reference...

    package com.samples.toolkit.ui.component;
    
    import java.util.Calendar;
    
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.system.Characters;
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.DrawStyle;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.TouchEvent;
    import net.rim.device.api.ui.Touchscreen;
    import net.rim.device.api.ui.Ui;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.component.LabelField;
    
    public class TestFeedListStyleField extends Field {
        Font myFont = Font.getDefault().derive(Font.SERIF_STYLE,5, Ui.UNITS_pt);
        Font myFont1 = Font.getDefault().derive(Font.BOLD,5, Ui.UNITS_pt);
        public static int DRAWPOSITION_TOP = 0;
        public static int DRAWPOSITION_BOTTOM = 1;
        public static int DRAWPOSITION_MIDDLE = 2;
        public static int DRAWPOSITION_SINGLE = 3;
        private static final int CORNER_RADIUS = 18;
        private static final int HPADDING = Display.getWidth() <= 320 ? 6 : 8;
        private static final int VPADDING = 4;
    
        private static final int COLOR_BACKGROUND = 0xFFFFFF;
        private static final int COLOR_BORDER = 0xBBBBBB;
        private static final int COLOR_BACKGROUND_FOCUS = 0x186DEF;
         public MyLabelField _labelField,_labelField1, _labelField2,_labelField3;
    
         private Bitmap _caret;
         private int _rightOffset;
            private int _leftOffset;
            private int _labelHeight,_labelHeight1,_labelHeight2,_labelHeight3;
            private Bitmap _leftIcon;
            private Bitmap _actionIcon;
            private Bitmap _ballon;
            private int _drawPosition = -1;
            private String _labelField1test;
    
        public TestFeedListStyleField(Bitmap icon,String label, String label1, String lable2,String lable3, Bitmap balloon,Bitmap caret,
                long style) {
             super( USE_ALL_WIDTH | Field.FOCUSABLE );
            _leftIcon = icon;
             _labelField = new MyLabelField(label, style );
             _labelField1 = new MyLabelField(label1, style );
             _labelField2=new  MyLabelField(lable2,style);
            _labelField3=new  MyLabelField(lable3,style);
            _ballon=balloon;
            _actionIcon=caret;
            _labelField1test=label1;
            _labelField.setFont(myFont);
            _labelField1.setFont(myFont);
            _labelField2.setFont(myFont1);
            _labelField3.setFont(myFont);
    //      Imagelistner imglistner = new Imagelistner();
    //      _actionIcon.
        }
    
        public TestFeedListStyleField(String label, String label1, String lable2,Bitmap caret,
                long style) {
             super( USE_ALL_WIDTH | Field.FOCUSABLE );
             _labelField = new MyLabelField(label, style );
             _labelField1 = new MyLabelField(label1, style );
             _labelField2=new  MyLabelField(lable2,style);
            _actionIcon=caret;
            _labelField1test=label1;
            _labelField1.setFont(myFont);
            _labelField2.setFont(myFont);
    //      Imagelistner imglistner = new Imagelistner();
    //      _actionIcon.
        }
    
        public void setDrawPosition( int drawPosition )
        {
            _drawPosition = drawPosition;
        }
         public String toString()
            {
                return _labelField.toString();
            }
    
        protected void layout(int width, int height) {
            if( Touchscreen.isSupported() ) {
            }
    
            _leftOffset = HPADDING;
            if( _leftIcon != null ) {
                _leftOffset += _leftIcon.getWidth() + HPADDING;
            }
    
            _rightOffset = HPADDING;
            if( _caret != null ) {
                _rightOffset += _caret.getWidth() + HPADDING;
            }
            _labelField.layout( width - _leftOffset - _rightOffset, height );
            _labelHeight = _labelField.getHeight();
            int labelWidth = _labelField.getWidth();
    
            _labelField1.layout( width - _leftOffset - _rightOffset, height );
            _labelHeight1 = _labelField1.getHeight();
            int labelWidth1 = _labelField1.getWidth();
    
            _labelField2.layout( width - _leftOffset - _rightOffset, height );
            _labelHeight2 = _labelField2.getHeight();
            int labelWidth2 = _labelField2.getWidth();
    
            _labelField3.layout( width - _leftOffset - labelWidth1 - _rightOffset, height );
            _labelHeight3 = _labelField3.getHeight();
            int labelWidth3 = _labelField3.getWidth();
    
            if( _labelField.isStyle( DrawStyle.HCENTER ) ) {
                _leftOffset = ( width - labelWidth ) / 2;
            } else if ( _labelField.isStyle( DrawStyle.RIGHT ) ) {
                _leftOffset = width - labelWidth - HPADDING - _rightOffset;
            }
    
            if( _labelField1.isStyle( DrawStyle.HCENTER ) ) {
                _leftOffset = ( width - labelWidth1 ) / 2;
            } else if ( _labelField.isStyle( DrawStyle.RIGHT ) ) {
                _leftOffset = width - labelWidth1 - HPADDING - _rightOffset;
            }
            if( _labelField2.isStyle( DrawStyle.HCENTER ) ) {
                _leftOffset = ( width - labelWidth2 ) / 2;
            } else if ( _labelField.isStyle( DrawStyle.RIGHT ) ) {
                _leftOffset = width - labelWidth2 - HPADDING - _rightOffset;
            }
    
            int extraVPaddingNeeded = 0;
    //      if( _labelHeight < _targetHeight ) {
    //          // Make sure that they are at least 1.5 times font height
    //          extraVPaddingNeeded =  ( _targetHeight - _labelHeight ) / 2;//( _targetHeight - _labelHeight ) / 2;
    //      }
            if( _leftIcon != null ) {
                  if( _labelHeight+_labelHeight1 < _leftIcon.getHeight() ) {
                      // Make sure that they are at least 1.5 times font height
                      extraVPaddingNeeded =  _leftIcon.getHeight();//( _targetHeight - _labelHeight ) / 2;
                  }
                  else if( _labelHeight+_labelHeight1 > _leftIcon.getHeight() ){
                    extraVPaddingNeeded =  _labelHeight+_labelHeight1;
                  }
            }
            else{
                if( _labelHeight+_labelHeight1 < _actionIcon.getHeight() ) {
                      // Make sure that they are at least 1.5 times font height
                      extraVPaddingNeeded =  _leftIcon.getHeight();//( _targetHeight - _labelHeight ) / 2;
                  }
                  else if( _labelHeight+_labelHeight1 > _actionIcon.getHeight() ){
                    extraVPaddingNeeded =  _labelHeight+_labelHeight1;
                  }
            }
    
          setExtent( width,  (int) (extraVPaddingNeeded*1.1) );
    
        }
          public void setText( String text )
            {
                _labelField.setText( text );
                updateLayout();
            }
    
        protected void paint(Graphics g) {
    
            // Left Bitmap
            if( _leftIcon != null ) {
                g.drawBitmap( HPADDING, VPADDING, (int) (_leftIcon.getWidth()*2), (int) (_leftIcon.getHeight()*3), _leftIcon, 0, 0 );
            }
    
    //        // Text  ( getHeight() - _labelHeight ) / 2, ( getHeight() - _actionIcon.getHeight() ) / 2,  //(int) (VPADDING*.5)
            try {
                g.pushRegion( _leftOffset, (int) (VPADDING*.5), getWidth() - _leftOffset - _rightOffset, _labelHeight, 0, 0 ); //getWidth() - _leftOffset - _rightOffset
                _labelField.paint( g );
            } finally {
                g.popContext();
            }
    
            try {
                g.pushRegion(  (int) (getWidth() - _leftIcon.getWidth()*.6 ), (int) (VPADDING*.5), getWidth() - _leftOffset - _labelField1.getWidth()- _rightOffset, _labelHeight3, 0, 0 ); //getWidth() - _leftOffset - _rightOffset
                _labelField3.paint( g );
            } finally {
                g.popContext();
            }
    
            try {
                g.pushRegion(_leftOffset, _labelHeight, getWidth() - _leftOffset - _rightOffset, _labelHeight1, 0, 0 ); //getWidth() - _leftOffset - _rightOffset
    //            String test6=_labelField1test.charAt(0)+" ".toString();
    //
    //            if(test6.trim().equals("0")){
    ////                 Dialog.alert("Success....");
    //             }
    //             else{
    //               Dialog.alert("Failure....");
                    _labelField1.paint( g );
    //             }
            } finally {
                g.popContext();
            }
    
            if( _leftIcon != null ) {
                try {
                    g.pushRegion((int) (HPADDING+_leftIcon.getWidth()), (int) (_labelHeight*1.5+_labelHeight1), getWidth() - (_leftIcon.getWidth()*2 ), (int) ((_leftIcon.getHeight()-_labelHeight-_labelHeight1)*.9),5, 5 ); //getWidth() - _leftOffset - _rightOffset
    //              g.pushRegion((int) (HPADDING+_leftIcon.getWidth()*1.1), (int) (_labelHeight*1.5+_labelHeight1), (int) (getWidth() - _leftIcon.getWidth()- _ballon.getWidth()- _actionIcon.getWidth()), (int) ((_leftIcon.getHeight()-_labelHeight-_labelHeight1)*.9), 0, 0 ); //getWidth() - _leftOffset - _rightOffset
                    _labelField2.paint( g );
                } finally {
                    g.popContext();
                }
            }
            // Right (Action) Bitmap
            if( _actionIcon != null ) {
                g.drawBitmap(  (int) (getWidth() - _leftIcon.getWidth()*.6 ), (int) (VPADDING*7.8), _ballon.getWidth(), _ballon.getHeight(), _ballon, 0, 0 );
                g.drawBitmap( getWidth() - HPADDING - _actionIcon.getWidth(), (int) (VPADDING*7), _actionIcon.getWidth(), _actionIcon.getHeight(), _actionIcon, 0, 0 );
            }
    
            // BootomGrid
    //        g.drawBitmap( (int) (HPADDING+_leftIcon.getWidth()*1.3), _labelHeight+_labelHeight1, 0, 0, _actionIcon, _drawPosition, _drawPosition );
    //        g.drawBitmap( (int) (HPADDING+_leftIcon.getWidth()*1.3), _labelHeight+_labelHeight1,  0, 0, _actionIcon, _drawPosition, _drawPosition );
    //        g.drawBitmap( (int) (HPADDING+_leftIcon.getWidth()*1.3), _labelHeight+_labelHeight1,  0, 0, _actionIcon, _drawPosition, _drawPosition );
    //        g.drawBitmap( (int) (HPADDING+_leftIcon.getWidth()*1.3), _labelHeight+_labelHeight1,  0, 0, _actionIcon, _drawPosition, _drawPosition );
    //        g.drawBitmap( (int) (HPADDING+_leftIcon.getWidth()*1.3), _labelHeight+_labelHeight1,  0, 0, _actionIcon, _drawPosition, _drawPosition );
    //
        }
    
        protected void paintBackground( Graphics g )
        {
            if( _drawPosition < 0 ) {
                // it's like a list field, let the default background be drawn
                super.paintBackground( g );
                return;
            }
    
            int oldColour = g.getColor();
    
            int background = g.isDrawingStyleSet( Graphics.DRAWSTYLE_FOCUS ) ? COLOR_BACKGROUND_FOCUS : COLOR_BACKGROUND; //COLOR_BACKGROUND_FOCUS
            try {
                if( _drawPosition == 0 ) {
                    // Top
                    g.setColor( background );
                    g.fillRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
                    g.setColor( COLOR_BORDER );
                    g.drawRoundRect( 0, 0, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
                    g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
                } else if( _drawPosition == 1 ) {
                    // Bottom
                    g.setColor( background );
                    g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
                    g.setColor( COLOR_BORDER );
                    g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
                } else if( _drawPosition == 2 ) {
                    // Middle
                    g.setColor( background );
                    g.fillRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
                    g.setColor( COLOR_BORDER );
                    g.drawRoundRect( 0, -CORNER_RADIUS, getWidth(), getHeight() + 2 * CORNER_RADIUS, CORNER_RADIUS, CORNER_RADIUS );
                    g.drawLine( 0, getHeight() - 1, getWidth(), getHeight() - 1 );
                } else {
                    // Single
                    g.setColor( background );
                    g.fillRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
                    g.setColor( COLOR_BORDER );
                    g.drawRoundRect( 0, 0, getWidth(), getHeight(), CORNER_RADIUS, CORNER_RADIUS );
                }
            } finally {
                g.setColor( oldColour );
            }
        }
    
        protected void drawFocus( Graphics g, boolean on )
        {
            if( _drawPosition < 0 ) {
                super.drawFocus( g, on );
            } else {
                boolean oldDrawStyleFocus = g.isDrawingStyleSet( Graphics.DRAWSTYLE_FOCUS );
                try {
                    if( on ) {
                        g.setDrawingStyle( Graphics.DRAWSTYLE_FOCUS, true );
                    }
                    paintBackground( g );
                    paint( g );
                } finally {
                    g.setDrawingStyle( Graphics.DRAWSTYLE_FOCUS, oldDrawStyleFocus );
                }
            }
        }
    
        protected boolean keyChar( char character, int status, int time )
        {
            if( character == Characters.ENTER ) {
                clickButton();
                return true;
            }
            return super.keyChar( character, status, time );
        }
    
        protected boolean navigationClick( int status, int time )
        {
            if (status != 0) clickButton();
            return true;
        }
    
        protected boolean trackwheelClick( int status, int time )
        {
            if (status != 0)
            clickButton();
            return true;
        }
    
        //#ifndef VER_4.1.0 | 4.0.0
            protected boolean invokeAction( int action )
            {
                switch( action ) {
                    case ACTION_INVOKE: {
                        clickButton();
                        return true;
                    }
                }
                return super.invokeAction( action );
            }
        //#endif        
    
        /**
         * A public way to click this button
         */
        public void clickButton()
        {
            fieldChangeNotify( 0 );
        }
    
    //#ifndef VER_4.6.1 | VER_4.6.0 | VER_4.5.0 | VER_4.2.1 | VER_4.2.0
        protected boolean touchEvent( TouchEvent message )
        {
            int x = message.getX( 1 );
            int y = message.getY( 1 );
            if( x < 0 || y < 0 || x > getExtent().width || y > getExtent().height ) {
                // Outside the field
                return false;
            }
            switch( message.getEvent() ) {
    
                case TouchEvent.UNCLICK:
                    clickButton();
                    return true;
            }
            return super.touchEvent( message );
        }
    //#endif 
    
        public void setDirty( boolean dirty ) {}
        public void setMuddy( boolean muddy ) {}
    
         private static class MyLabelField extends LabelField
            {
    
                public MyLabelField( String text, long style )
                {
                    super( text, style );
                }
    
                public void layout( int width, int height )
                {
                    super.layout( width, height );
                }   
    
                public void paint( Graphics g )
                {
                    super.paint( g );
                }
            }
         class Imagelistner implements FieldChangeListener {
                public void fieldChanged(Field field, int context) {
    
                }
    
                }
    

    Thank you...

    Hi all
    I solved this problem... Thank you for watching my problem...
    And I create the component 'Image + String + box' with search (like the single selection) If you need it please send mail...
    Kind regards
    NGO

  • Problem with fieldChanged() and custom button field

    Hello

    I created a custom button class by extending LabelField.  I chose LabelField over field because the LabelField contains desirable properties that are already being implemented.  The only problem I'm having has to do with the change listener.  It seems to 'steal' the event click on other areas in my application.

    For example, when I click on the custom button, a popupscreen with a listfield opens. When I click on an item in the listfield, then the fieldChanged() of custom button is called again...

    Can you see anything wrong with my code?

    package com.rantnetwork.fields;
    
    import com.rantnetwork.app.Constants;
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.Ui;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.decor.BackgroundFactory;
    import net.rim.device.api.ui.decor.BorderFactory;
    
    public class CustomButtonField extends LabelField {
    
        private boolean highlighted = false;
    
        public CustomButtonField(String text, long style) {
            super(text, style | Field.FOCUSABLE | LabelField.ELLIPSIS);
    
            setPadding(10, 0, 10, 5);
    
            setFont(Font.getDefault().derive(Font.BOLD,
                    Constants.DEFAULT_FONT_SIZE, Ui.UNITS_pt));
    
            setBackground(BackgroundFactory.createLinearGradientBackground(
                    0x163d7c, 0x163d7c, 0x03162d, 0x03162d));
            setBorder(BorderFactory
                    .createBevelBorder(new XYEdges(1, 1, 1, 1), new XYEdges(
                            Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK),
                            new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                    Color.BLACK)));
    
        }
    
        public int getPreferredWidth() {
            return Display.getWidth() / 3;
        }
    
        protected void paint(Graphics graphics) {
            graphics.setColor(Color.WHITE);
            super.paint(graphics);
        }
    
        protected void drawFocus(Graphics graphics, boolean on) {
            // Do nothing
        }
    
        protected boolean navigationClick(int status, int time) {
            fieldChangeNotify(1);
            return true;
        }
    
        protected void onFocus(int direction) {
            if (!highlighted) {
                setBackground(BackgroundFactory.createLinearGradientBackground(
                        0x4bb7df, 0x4bb7df, 0x1b96da, 0x1b96da));
                setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1),
                        new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK,
                                Color.BLACK, Color.BLACK)));
            }
        }
    
        protected void onUnfocus() {
            if (!highlighted) {
                setBackground(BackgroundFactory.createLinearGradientBackground(
                        0x163d7c, 0x163d7c, 0x03162d, 0x03162d));
                setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1),
                        new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK,
                                Color.BLACK, Color.BLACK)));
            }
        }
    
        public void showHighlighted(boolean focus) {
            if (focus) {
                highlighted = true;
                setBackground(BackgroundFactory.createLinearGradientBackground(
                        0x4bb7df, 0x4bb7df, 0x1b96da, 0x1b96da));
                setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1),
                        new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK,
                                Color.BLACK, Color.BLACK)));
            } else {
                highlighted = false;
                setBackground(BackgroundFactory.createLinearGradientBackground(
                        0x163d7c, 0x163d7c, 0x03162d, 0x03162d));
                setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1),
                        new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK,
                                Color.BLACK, Color.BLACK)));
            }
            invalidate();
        }
    
        public boolean isHighlighted() {
            return highlighted;
        }
    
    }
    

    behrk2 wrote:

    Now, I'm not sure why customButton.setText (calling) would trigger the fieldChanged().  Can anyone think of a reason why he can do?

    Thank you!

    Can you think of a reason why we can't do that? The field has changed, after all! Of course, the context (second argument to fieldChanged) will be PROGRAMMATIC in this case, that might be a pretty good indication for you. But not invoke fieldChanged at all would be wrong.

    This is why I don't like the idea of extending LabelField and not just the field for your custom badges - you have much less control over his behavior. If you want an example showing how to create abstract off-screen buttons, take a look at BaseButtonField and his descendants in managers, fields and advanced buttons.

Maybe you are looking for