diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-24 21:55:39 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-24 21:55:39 (GMT) |
| commit | 6b08d1e2f9196ee2f6b810300e4aeb841b0d6a6d (patch) | |
| tree | d9272735c773766ff739a956282c317886f990ed /src/interface/ContextMenu.h | |
| parent | 7ef3f8cbe942c2f7ed47c4eea4248f21d407d71c (diff) | |
| download | powder-6b08d1e2f9196ee2f6b810300e4aeb841b0d6a6d.zip powder-6b08d1e2f9196ee2f6b810300e4aeb841b0d6a6d.tar.gz | |
Copy, cut and paste for Textboxes
Diffstat (limited to 'src/interface/ContextMenu.h')
| -rw-r--r-- | src/interface/ContextMenu.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/interface/ContextMenu.h b/src/interface/ContextMenu.h new file mode 100644 index 0000000..fb804c3 --- /dev/null +++ b/src/interface/ContextMenu.h @@ -0,0 +1,39 @@ +#ifndef The_Powder_Toy_ContextMenu_h +#define The_Powder_Toy_ContextMenu_h + +#include "Window.h" +#include "Appearance.h" +#include "Button.h" + +namespace ui +{ + +class ContextMenuItem +{ +public: + int ID; + std::string Text; + bool Enabled; + ContextMenuItem(std::string text, int id, bool enabled) : Text(text), ID(id), Enabled(enabled) {} +}; + +class ContextMenu: public ui::Window, public ButtonAction { + std::vector<Button*> buttons; + std::vector<ContextMenuItem> items; + bool isMouseInside; + ui::Component * source; +public: + ui::Appearance Appearance; + class ItemSelectedAction; + ContextMenu(Component * source); + virtual void ActionCallback(ui::Button *sender, int item); + virtual void AddItem(ContextMenuItem item); + virtual void RemoveItem(int id); + virtual void Show(ui::Point position); + virtual void OnDraw(); + virtual void OnMouseDown(int x, int y, unsigned button); + virtual ~ContextMenu() {} +}; +} + +#endif
\ No newline at end of file |
