Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The below code is a custom button field for bottom menu bar. This will be useful for your task. </p> <pre><code>public class PictureBackgroundButtonField extends BitmapField { MyTooltip _tooltip; Bitmap mNormal; Bitmap mFocused; Bitmap mActive; String text; int mWidth; int mHeight; int xpos1; public PictureBackgroundButtonField(String text,Bitmap normal, Bitmap focused, int xpos) { super(normal,FOCUSABLE); mNormal = normal; mFocused = focused; mWidth = mNormal.getWidth(); mHeight = mNormal.getHeight(); this.text=text; setMargin(0, 0, 0, 0); setPadding(0, 0, 0, 0); xpos1 = xpos; } public String getText() { return text; } public void setText(String text) { this.text=text; } protected void paint(Graphics graphics) { Bitmap bitmap = mNormal; if(isFocus()) { bitmap = mFocused; } else { bitmap = mNormal; } graphics.drawBitmap(0, 0, bitmap.getWidth(), bitmap.getHeight(), bitmap, 0, 0); } protected void drawFocus(Graphics graphics, boolean on) { } protected void onFocus(int direction) { //lbt.setText(text); invalidate(); super.onFocus(direction); if ( _tooltip != null ) { _tooltip.removeToolTip(); _tooltip = null; } // Display tooltip at 50,50 for 5 seconds _tooltip = MyTooltip.addToolTip(UiApplication.getUiApplication(), text, xpos1, 270, 1); } protected void onUnfocus() { //lbt.setText(""); invalidate(); super.onUnfocus(); if ( _tooltip != null ) { // We have displayed a Tooltip - remove it _tooltip.removeToolTip(); _tooltip = null; } } public int getPreferredWidth() { return mWidth; } public int getPreferredHeight() { return mHeight; } protected void layout(int width, int height) { setExtent(mWidth, mHeight); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload