////////////////////////////////////////////////////////////////////////////////
// GLWindowContainer.h
// Copyright Bjoern Ganster
// Developed since 2006
////////////////////////////////////////////////////////////////////////////////

#ifndef GLWindowContainer__H
#define GLWindowContainer__H

#include "GLWindow.h"
#include <vector>
using namespace std;

////////////////////////////////////////////////////////////////////////////////
// Base class for container windows

class GLWindowContainer: public GLWindow {
public:
   // Constructor
   GLWindowContainer (const char* className, int class_ID, GLWindow* _parent = NULL, int _left = 0, int _top = 0, 
                      int _width = 0, int _height = 0);

   // Destructor
   ~GLWindowContainer() OVERRIDE;

   // Render
   void render(int x, int y, int w, int h) OVERRIDE;

   // Events
   void keypressed(BGKey /*key*/, bool /*shiftHeld*/, bool /*ctrlHeld*/, bool /*down*/, bool /*repeat*/) OVERRIDE;
   GLWindow* buttonStateChanged(int /*button*/, bool /*down*/, int /*x*/, int /*y*/) OVERRIDE;
   void mouseMoved (int /*x*/, int /*y*/) OVERRIDE;

   // Add/remove children
   void add (GLWindow* win) OVERRIDE;
   int remove (GLWindow* win) OVERRIDE;
   void clear ();
   size_t getWindowCount () const OVERRIDE;
   GLWindow* getSubWin (size_t i);
   const GLWindow* getSubWin (size_t i) const;
   
   // Remove all child windows
   void removeAll() OVERRIDE;

protected:
   vector <GLWindow*> windows;
   GLWindow* focused;
};

#endif
