PGE Engine
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | Friends | List of all members
PGE_Menu Class Reference

Public Types

enum  menuAlignment { HORIZONTAL, VERTICLE }
 

Public Member Functions

 PGE_Menu (menuAlignment align=VERTICLE, int itemGap=0)
 
 PGE_Menu (const PGE_Menu &menu)
 
void addMenuItem (QString value, QString title="", std::function< void()> _extAction=([]() ->void{}))
 
void addBoolMenuItem (bool *flag, QString value, QString title="", std::function< void()> _extAction=([]() ->void{}))
 
void addIntMenuItem (int *intvalue, int min, int max, QString value, QString title, bool rotate=false, std::function< void()> _extAction=([]() ->void{}))
 
void addNamedIntMenuItem (int *intvalue, QList< NamedIntItem > _items, QString value, QString title, bool rotate=false, std::function< void()> _extAction=([]() ->void{}))
 
void addKeyGrabMenuItem (KM_Key *key, QString value, QString title, SDL_Joystick *joystick_device=NULL)
 
void setValueOffset (int offset)
 
void setItemWidth (int width)
 
void clear ()
 Clean all menuitems.
 
void selectUp ()
 move selection cursor up
 
void selectDown ()
 move selection cursor down
 
void scrollUp ()
 Scroll by mousewheel.
 
void scrollDown ()
 Scroll by mousewheel.
 
void selectLeft ()
 switch to left (for lists)
 
void selectRight ()
 switch to right (for lists)
 
void acceptItem ()
 Accept currently selected item.
 
void rejectItem ()
 Reject menu.
 
void resetState ()
 Reset state after acception or rejection.
 
void setMouseHoverPos (int x, int y)
 
void setMouseClickPos (int x, int y)
 
int findItem (int x, int y)
 
void reset ()
 Reset menu to initial state.
 
void setItemsNumber (int q)
 Set number of item which will show on screen.
 
void sort ()
 Sort menu items in alphabetic order.
 
void render ()
 Draw menu on screen.
 
bool isSelected ()
 Is menu was accepted or rejected.
 
bool isAccepted ()
 Is menu was accepted, else rejected.
 
bool isKeyGrabbing ()
 Is a key grabbing mode.
 
bool processJoystickBinder ()
 Is a joystick key grabbing mode.
 
void storeKey (int scancode)
 
menuAlignment getAlignment ()
 
const PGE_Menuitem currentItem ()
 Returns current menu item entry.
 
int currentItemI ()
 Returns index of current menu item.
 
void setCurrentItem (int i)
 Sets current index of menuitem.
 
int line ()
 Returns number of current line where cursor is located on screen.
 
void setLine (int ln)
 Sets current line number.
 
int offset ()
 Returns scrolling offset from begin of menu list.
 
void setOffset (int of)
 Sets scrolling offset from begin of menu list.
 
PGE_Rect rect ()
 Returns rectangle of menu box.
 
PGE_Rect rectFull ()
 Returns rectangle of menu box include sliders.
 
int topOffset ()
 Offset.
 
void setPos (int x, int y)
 Sets current position of menu box.
 
void setPos (PGE_Point p)
 Sets current position of menu box.
 
void setSize (int w, int h)
 Sets size of menu box.
 
void setSize (PGE_Size s)
 Sets size of menu box.
 
void setTextLenLimit (int maxlen, bool strict=false)
 
int getMenuItemGap ()
 
bool isKeygrabViaKey () const
 
void setKeygrabViaKey (bool value)
 

Friends

class PGE_KeyGrabMenuItem
 

Constructor & Destructor Documentation

PGE_Menu::PGE_Menu ( menuAlignment  align = VERTICLE,
int  itemGap = 0 
)

Init menu font

Member Function Documentation

void PGE_Menu::setMouseHoverPos ( int  x,
int  y 
)

Set hovering mouse position. Will be selected item which under mouse


The documentation for this class was generated from the following files: