public abstract class CanvasMenu extends CanvasCore
Modifier and Type | Field and Description |
---|---|
static int |
MENU_BUTTON_ACTION
Data stored for default buttons
|
static int |
MENU_BUTTON_SPLITCACHEID
Data stored for default buttons
|
static int |
MENU_BUTTON_TEXTID
Data stored for default buttons
|
int |
menu_current_id
The id of the current menu
|
int |
menu_current_selected_item
The id of the currently selected menu item
|
int[] |
menu_data
The current menu
|
static int |
MENU_DEFINITION_NUMITEMS
The definitions block that is at the start of all menus arrays
|
static int |
MENU_DEFINITION_PREVIOUS_MENU_ITEM
The definitions block that is at the start of all menus arrays
|
static int |
MENU_DEFINITION_TYPE
The definitions block that is at the start of all menus arrays
|
static int |
MENU_HEADER_SPLITCACHEID
Data stored for default headers
|
static int |
MENU_HEADER_TEXTID
Data stored for default headers
|
static int |
MENU_ITEM_TFS_FLAGS_MASK |
static int |
MENU_ITEM_TFS_SIZE_MASK |
static int |
MENU_ITEM_TFS_TYPE_MASK |
static int |
MENU_ITEM_TYPE_SIZE_FLAGS
Each item has as its first item its size and type : (type << 24) | (typeflags) | size
|
static int |
MENU_ITEMTYPE_BUTTON
Default item types (these must all be in the 0xff000000 range)
|
static int |
MENU_ITEMTYPE_HEADER
Default item types (these must all be in the 0xff000000 range)
|
static int |
MENU_ITEMTYPE_SOFTKEY
The only item type the system needs to know about
|
static int |
MENU_ITEMTYPE_TEXT
Default item types (these must all be in the 0xff000000 range)
|
static int |
MENU_SOFTKEY_ACTION
Data stored for softkeys
|
static int |
MENU_SOFTKEY_FWRD
Data stored for softkeys
|
static int |
MENU_SOFTKEY_FWRD_VALUE_BACK
The values for the fwrd/back softkey item for softkey menu item
|
static int |
MENU_SOFTKEY_FWRD_VALUE_FWRD
The values for the fwrd/back softkey item for softkey menu item
|
static int |
MENU_SOFTKEY_TEXTID
Data stored for softkeys
|
static int |
MENU_TEXT_SPLITCACHEID
Data stored for default text items
|
static int |
MENU_TEXT_TEXTID
Data stored for default text items
|
static int |
NUM_MENU_BUTTON_FIELDS
Data stored for default buttons
|
static int |
NUM_MENU_DEFINITION_FIELDS
The definitions block that is at the start of all menus arrays
|
static int |
NUM_MENU_HEADER_FIELDS
Data stored for default headers
|
static int |
NUM_MENU_SOFTKEY_FIELDS
Data stored for softkeys
|
static int |
NUM_MENU_TEXT_FIELDS
Data stored for default text items
|
app_status, APPSTATE_INIT, APPSTATUSFLAG_INTERRUPTED_BY_UNKNOWN, APPSTATUSFLAG_PAUSED, instance, KEYFLAG_0, KEYFLAG_1, KEYFLAG_2, KEYFLAG_3, KEYFLAG_4, KEYFLAG_5, KEYFLAG_6, KEYFLAG_7, KEYFLAG_8, KEYFLAG_9, KEYFLAG_DELETE, KEYFLAG_DOWN, KEYFLAG_FIRE, KEYFLAG_HASH, KEYFLAG_LEFT, KEYFLAG_RIGHT, KEYFLAG_RIGHT_MOUSE_CLICK, KEYFLAG_SELECT, KEYFLAG_SOFTKEYBACK, KEYFLAG_SOFTKEYFWRD, KEYFLAG_STAR, KEYFLAG_START, KEYFLAG_UP, KEYFLAG_VOLUMEDOWN, KEYFLAG_VOLUMEUP, keys_pressed, keys_repeated, loading_progress, pointer_pressed, pointer_repeated, pointer_x, pointer_y, QATESTS_ENABLED, qatests_triggered, regions_pressed, regions_repeated, render_after_update, SIZE_TOUCHSCREEN_REGION_INFO, TOUCHSCREEN_REGION_INFO_BRX, TOUCHSCREEN_REGION_INFO_BRY, TOUCHSCREEN_REGION_INFO_KEYFLAGS, TOUCHSCREEN_REGION_INFO_TLX, TOUCHSCREEN_REGION_INFO_TLY, touchscreen_regions
back_softkey_string, fwrd_softkey_string, NEED_TO_RENDER_SOFTKEYS, softkey_add_back, softkey_add_fwrd
app_state, APPSTATEFLAG_LOADING, last_fixed_update_time_ms, last_variable_update_time_ms, main_thread, MS_PER_UPDATE, previous_app_state
internal_key_mappings
CURRENT_SCREEN_HEIGHT, CURRENT_SCREEN_PPI, CURRENT_SCREEN_WIDTH, UPDATE_SCREEN_DIMENSIONS
Constructor and Description |
---|
CanvasMenu() |
Modifier and Type | Method and Description |
---|---|
void |
menuAdjustCurrentSelectedItem(int adjustment,
int mask,
boolean wrap)
Adjusts the currently selected menu item
|
void |
menuBack()
Goes back to the previous menu, and sets the appropriate selected item
|
int |
menuGetSoftkeyIndex(boolean fwrd)
Gets the index for one of the softkey in the current menu data structure
|
void |
menuInjectItem(int menu_id,
int item_id,
int[] item_data)
Injects a new menu item into a menu
|
int[] |
menuItemButton(int text_id,
int flags,
int action)
Creates a button item for the menus
|
int[] |
menuItemHeader(int text_id)
Create a header item for the menus
|
int |
menuItemIndex(int item_id)
Returns the index in the array of the specified item in the current menu
|
int |
menuItemIndex(int menu_id,
int item_id)
Returns the index in the array of the specified item in the specified menu
|
int[] |
menuItemSoftkey(int text_id,
boolean fwrd,
int action)
Creates a softkey item for the menus
|
int[] |
menuItemText(int text_id)
Creates a text item for the menus
|
void |
menuLoad(int menu_id,
int mask)
(An override that will always create the softkeys)
|
void |
menuLoad(int menu_id,
int mask,
boolean auto_create_softkeys)
Loads a menu
|
void |
menuRemoveItem(int menu_id,
int item_id)
Removes a menu item from a menu
|
changeAppStateTo, clearTouchscreenRegion, fixedRateUpdate, hideNotify, keyAction, pointerAction, pointerDragged, quit, releaseAllKeys, runOnce, setTouchscreenRegion, showNotify, sleep, variableRateUpdate
setSoftkeys
run, startLoading, startMainThread, stopMainThread
findKeyBitflag, initKeysAndTouch, keyPressed, keyReleased, pointerPressed, pointerReleased
initInterrupts
updateScreenDimensions
paint, render, syncPaint
flushGraphics, flushGraphics, getKeyStates
getGameAction, getHeight, getKeyCode, getKeyName, getWidth, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, isDoubleBuffered, repaint, repaint, serviceRepaints, setFullScreenMode
public static final int MENU_DEFINITION_NUMITEMS
public static final int MENU_DEFINITION_PREVIOUS_MENU_ITEM
public static final int MENU_DEFINITION_TYPE
public static final int NUM_MENU_DEFINITION_FIELDS
public static final int MENU_ITEM_TYPE_SIZE_FLAGS
public static final int MENU_ITEM_TFS_TYPE_MASK
public static final int MENU_ITEM_TFS_FLAGS_MASK
public static final int MENU_ITEM_TFS_SIZE_MASK
public static final int MENU_ITEMTYPE_SOFTKEY
public static final int MENU_SOFTKEY_TEXTID
public static final int MENU_SOFTKEY_FWRD
public static final int MENU_SOFTKEY_ACTION
public static final int NUM_MENU_SOFTKEY_FIELDS
public static final int MENU_SOFTKEY_FWRD_VALUE_BACK
public static final int MENU_SOFTKEY_FWRD_VALUE_FWRD
public int[] menu_data
public int menu_current_id
public int menu_current_selected_item
public static final int MENU_ITEMTYPE_HEADER
public static final int MENU_ITEMTYPE_TEXT
public static final int MENU_ITEMTYPE_BUTTON
public static final int MENU_HEADER_TEXTID
public static final int MENU_HEADER_SPLITCACHEID
public static final int NUM_MENU_HEADER_FIELDS
public static final int MENU_TEXT_TEXTID
public static final int MENU_TEXT_SPLITCACHEID
public static final int NUM_MENU_TEXT_FIELDS
public static final int MENU_BUTTON_TEXTID
public static final int MENU_BUTTON_SPLITCACHEID
public static final int MENU_BUTTON_ACTION
public static final int NUM_MENU_BUTTON_FIELDS
public void menuLoad(int menu_id, int mask, boolean auto_create_softkeys)
menu_id
- MENUID_ of the itemmask
- A mask to check against the objects flags to see if it could be selectedauto_create_softkeys
- Should the softkeys be automatically created (if included in the menu definition)public void menuLoad(int menu_id, int mask)
public void menuBack()
public int menuItemIndex(int menu_id, int item_id)
public int menuItemIndex(int item_id)
public void menuAdjustCurrentSelectedItem(int adjustment, int mask, boolean wrap)
adjustment
- Adjustment valuemask
- Mask to use when looking for next itemwrap
- Should the adjustment cycle (true), or stop at the limits of the data array (false)public int menuGetSoftkeyIndex(boolean fwrd)
fwrd
- Fwrd softkey (true) or back softkey (false)public void menuInjectItem(int menu_id, int item_id, int[] item_data)
menu_id
- The MENUID_ of the appropriate menuitem_id
- The position in the item array to inject this itemitem_data
- The item-data (built in items can be retrieved from the menuItem... methods)public void menuRemoveItem(int menu_id, int item_id)
menu_id
- The MENUID_ of the appropriate menuitem_id
- The position in the item array to remove an itempublic int[] menuItemHeader(int text_id)
public int[] menuItemText(int text_id)
text_id
- TextIDpublic int[] menuItemButton(int text_id, int flags, int action)
text_id
- TextIDflags
- Any flags (e.g. visibility) (must fit in the 0x00ffff00 mask)action
- ID of what should happen when this item is selectedpublic int[] menuItemSoftkey(int text_id, boolean fwrd, int action)
text_id
- TextIDfwrd
- Is this the forward softkey?action
- ID of what should happen when this item is selected