#ifndef __PopupMenu__
#define __PopupMenu__

#ifndef GUI_DLL 
    #ifdef GUI_BUILD
	    #define GUI_DLL __declspec(dllexport)
    #else
	    #define GUI_DLL __declspec(dllimport)
        #pragma comment(lib, "WindowManager.lib")
    #endif
#endif

#include "Window.h"
#include "Label.h"

#include <vector>


#pragma warning(push)
#pragma warning(disable:4251)


class GUI_DLL MenuItem;
class GUI_DLL PopupMenu;


class GUI_DLL MenuItem : public Label {
public:
    MenuItem(const wchar_t* caption = L"");
    virtual ~MenuItem();

    virtual void setSize(Size& size);

    PopupMenu* getSubMenu();
    void setSubMenu(PopupMenu* subMenu);

protected:
    void onMouseEnter(Event& event);
    void onMouseLeave(Event& event);

    PopupMenu* _subMenu;
};

class GUI_DLL PopupMenu : public Window {
public:
    PopupMenu(Window* parent = 0);
    virtual ~PopupMenu();

    void addItem(MenuItem* item);

protected:
    class SideStrip;
    SideStrip* _sideStrip;

    std::vector<MenuItem*> _items;

    float _maxWidth;
};


#pragma warning(pop)

#endif