Package totalcross.ui

Interface ListBox.CustomDrawingItem

  • Enclosing class:
    ListBox

    public static interface ListBox.CustomDrawingItem
    An interface that makes easier to draw custom items. Example:
     class ItemSeek implements ListBox.CustomDrawingItem {
            int tpsinc;
            boolean admin;
            String plat, date;
     
            ItemSeek(String s) {
                    // 21Wi2014/12/05
                    tpsinc = s.charAt(0) - '0';
                    admin = s.charAt(1) == '1';
                    plat = s.substring(2, 4);
                    date = s.substring(4);
            }
     
            public void onItemPaint(Graphics g, int dx, int dy, int w, int h) {
                    g.drawText(data, dx, dy);
                    // and also other items
            }
     }
     
    Since:
    TotalCross 3.1
    • Method Detail

      • onItemPaint

        void onItemPaint​(Graphics g,
                         int dx,
                         int dy,
                         int w,
                         int h)