#ifndef __MenuBar__
#define __MenuBar__

#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 "PopupMenu.h"

#include <vector>



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


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

    void addItem(MenuItem* item);

    virtual void setCaption(const wchar_t* caption);

    void adjustSizeForCaption();

    bool isDropDownListShown();
    void showDropDownList(bool showList);

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

    PopupMenu* _list;
};

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

    void addMenu(Menu* menu);

    void adjustMenuPositions();

    bool getOpened();
    void setOpened(bool opened);

    Menu* getOpenMenu();
    void  closeMenus();

    virtual void setSize(Size& size);

protected:
    bool _opened;
    std::vector<Menu*> _menus;
};


#pragma warning(pop)


#endif