// Author: Juan Carlos De Abreu (jcabreur@gmail.com)
//
// This file define a class inherent from Frame that allow build a window.

#ifndef GUI_WINDOW_H__
#define GUI_WINDOW_H__

#include "vector"
#include "string"

#include "../global.h"
#include "frame.h"
#include "button.h"
#include "text.h"
#include "panel.h"
#include "check_box.h"
#include "radio_button.h"

BEGIN_TEG_NAMESPACE();
BEGIN_NAMESPACE(gui);

// TODO: check if the window was created with a value less than MIN_GUI ..
#define MIN_GUI_WINDOW_WIDHT	20
	
// Definition of the structure of a window
class Window : public Frame {
  public:
  // Window constructor and destructor.
  Window(int x, int y, int width, int height, std::tstring caption);
  ~Window();

	// Method's
//	void render(void) const;	// Method to render the window
  inline float z_order() const { return z_order_; }
  inline std::vector<Button>& button() { return button_; }
  inline std::vector<Text>& text() { return text_; }
  inline std::vector<Panel>& panel() { return panel_; }
  inline std::vector<CheckBox>& check_box() { return check_box_; }
  inline std::vector<RadioButton>& radio_button() { return radio_button_; }
  inline void set_z_order(float z_order) { z_order_ = z_order; }
  inline void set_caption(const std::tstring& caption) { caption_ = caption; }

  // Method to display the window.
  virtual void Render() const;


  void addButton(int x, int y, int width, int height, const char *caption);	//funcion para agregar un boton a la ventana
  void addText(int x, int y, const char *caption);	// funcion para agregarle un texto a la ventana
  void addPanel(int x, int y, int width, int height);	// funcion para agregarle un panel a la ventana
  void addCheckBox(int x, int y, bool checked);	// funcion para agregarle un checkbox a la ventana
  void addRadioButton(int x, int y, bool checked, int group);	// funcion para agregarle un radioButton a la ventana

 private:
  // Window attibutes.
  float alpha;							// nivel de transparencia de la ventana
  float z_order_;							// .....(falta)
  std::tstring caption_;
  std::vector<Button> button_;				// botones de la ventana
  std::vector<Text> text_;					// textos de la ventana
  std::vector<Panel> panel_;				// panel de la ventana
  std::vector<CheckBox> check_box_;			// checkbox's de la ventana
  std::vector<RadioButton> radio_button_;	// radioButton's de la ventana
};

END_NAMESPACE(gui);
END_TEG_NAMESPACE();

#endif  // GUI_WINDOW_H__
