Lephisto/src/gui_container.h

30 lines
674 B
C++

#pragma once
/* Parent of all widgets that contain other widgets. */
#include <list>
#include "gui_widget.h"
namespace Gui {
class Container : public Widget {
public:
bool OnMouseDown(MouseButtonEvent* e);
bool OnMouseUp(MouseButtonEvent* e);
void DeleteAllChildren(void);
virtual void Draw(void);
virtual void ShowAll(void);
virtual void HideAll(void);
private:
bool HandleMouseEvent(MouseButtonEvent* e);
protected:
void PrependChild(Widget* w, float x, float y);
void AppendChild(Widget* w, float x, float y);
struct widget_pos {
Widget* w;
float pos[2];
};
std::list<widget_pos> m_children;
};
}