#include <CardLayoutPanel.h>
Public Types | |
enum | CardLayoutDir { DOING_NOTHING , GOING_LEFT , GOING_RIGHT } |
Public Member Functions | |
CardLayoutPane (const DrawableIcon *left, const DrawableIcon *right, MenuTouchScreenManager *optionalTouch, bool monoDisplay) | |
void | forMenu (ItemDisplayProperties *titleProps, ItemDisplayProperties *itemProps, GraphicsDeviceRenderer *gfxRenderer, bool titleNeeded) |
void | notInUse () |
void | setEnablementForSub (MenuItem *item, bool onOrOff) |
bool | isSubMenuCardLayout (MenuItem *item) |
CardLayoutDir | prepareAndPaintButtons (GraphicsDeviceRenderer *renderer, int active, int countOfItems, bool titleActive) |
void | touched (const TouchNotification ¬ification) |
const Coord & | getMenuLocation () |
const Coord & | getMenuSize () |
const Coord & | getTitleSize () |
Card layout is a layout where a single item (and possibly a title) are shown on the display with left and right indicators (or buttons on a touch screen). This class does most of the layout level calculations to make some attempt at taking new layouts outside of the core. If more new layouts are created, we'll formalize this into some kind of interface and tidy up the code in the renderer. On touch screens the buttons will work with touch.
left | the icon for the left button |
right | the icon for the right button |
optionalTouch | if using touch, provide the touch manager, otherwise null. |
CardLayoutPane::CardLayoutPane | ( | const DrawableIcon * | left, |
const DrawableIcon * | right, | ||
MenuTouchScreenManager * | optionalTouch, | ||
bool | monoDisplay | ||
) |
Creates a card layout with the left and right buttons, ready for use later when a card layout is presented. This class does most of the layout level calculations to make some attempt at taking new layouts outside of the core. If more new layouts are created, we'll formalize this into some kind of interface and tidy up the code in the renderer. On touch screens the buttons will work with touch.
left | the icon for the left button |
right | the icon for the right button |
optionalTouch | if using touch, provide the touch manager, otherwise null. |
monoDisplay | if the display is mono |
void CardLayoutPane::forMenu | ( | ItemDisplayProperties * | titleProps, |
ItemDisplayProperties * | itemProps, | ||
GraphicsDeviceRenderer * | gfxRenderer, | ||
bool | titleNeeded | ||
) |
When a menu is presented in card layout this will be called when full re-draw is requested to set up the layout and prepare the available sizes.
titleProps | the display properties that the buttons should use |
gfxRenderer | the renderer used to draw with |
titleNeeded | if the title is needed or not. |
void CardLayoutPane::notInUse | ( | ) |
When a card layout menu is going off display, this is called to reset anything adjust for the card layout.
void CardLayoutPane::setEnablementForSub | ( | MenuItem * | item, |
bool | onOrOff | ||
) |
Use this to add or remove submenus from the card layout
item | the item to check (or null for root) |
onOrOff | if it should use card layout |
bool CardLayoutPane::isSubMenuCardLayout | ( | MenuItem * | item | ) |
Check if a given menu item is using card layout.
item | the item to check (or null for root) |
CardLayoutPane::CardLayoutDir CardLayoutPane::prepareAndPaintButtons | ( | GraphicsDeviceRenderer * | renderer, |
int | active, | ||
int | countOfItems, | ||
bool | titleActive | ||
) |
Call this every time the renderer paint runs, it makes sure the buttons are up to date and also returns if any buttons have been pressed.
renderer | the renderer |
active | the currently active item index |
countOfItems | the number of items |
|
virtual |
Part of the touch observer interface, called when there is a touch event .
notification | the touch notification |
Implements tcgfx::TouchObserver.
|
inline |
|
inline |
|
inline |