- Main Page
- Classes
- Files

- File List

# contextmenu.h

    00001 #ifndef _CONTEXT_MENU_H_
    00002 #define _CONTEXT_MENU_H_
    00003
    00004 #include "gadget.h"
    00005 #include "gadgetstyle.h"
    00006 #include "gadgeteventhandler.h"
    00007 #include "listbox.h"
    00008
    00009 namespace WoopsiUI {
    00010
    00011         class ContextMenuItem;
    00012
    00019         class ContextMenu : public Gadget, public GadgetEventHandler {
    00020         public:
    00021
    00029                 ContextMenu(GadgetStyle* style = NULL);
    00030
    00036                 virtual void addOption(const WoopsiString& text, u32 value);
    00037
    00041                 virtual void reset();
    00042
    00047                 inline void setOpener(Gadget* gadget) { _opener = gadget; };
    00048
    00053                 inline Gadget* getOpener() { return _opener; };
    00054
    00062                 virtual void getPreferredDimensions(Rect& rect) const;
    00063
    00068                 virtual void handleReleaseEvent(const GadgetEventArgs& e);
    00069
    00074                 virtual void handleReleaseOutsideEvent(const GadgetEventArgs& e);
    00075
    00076         private:
    00077                 Gadget* _opener;
    00078                 ListBox* _listbox;
    00086                 virtual void drawContents(GraphicsPort* port);
    00087
    00094                 virtual void drawBorder(GraphicsPort* port);
    00095
    00101                 virtual void onResize(u16 width, u16 height);
    00102
    00106                 virtual inline ~ContextMenu() { };
    00107
    00111                 inline ContextMenu(const ContextMenu& contextMenu) : Gadget(contextMenu) { };
    00112         };
    00113 }
    00114
    00115 #endif