// Author: Juan Carlos De Abreu (jcabreur@gmail.com)
//
// This file define a class inherent from Control that allow put a check box in
// a window.

#ifndef GUI_CHECKBOX_H__
#define GUI_CHECKBOX_H__

#include "../global.h"
#include "../Includes/OpenGL.h"
#include "../Includes/Basic.h"
#include "control.h"

BEGIN_TEG_NAMESPACE();
BEGIN_NAMESPACE(gui);

class CheckBox : public Control {
 public:
  // Checkbox constructor and destructor.
  // is_checked = false
  CheckBox(int x, int y, bool is_checked);
  ~CheckBox();

  // Accessor and mutator methods to CheckBox attributes.
  inline bool is_checked() const { return is_checked_; }
  inline void set_is_checked(bool is_checked) { is_checked_ = is_checked; }

  // Method to switch the flag is_checked_.
  inline void ToggleIsChecked() { is_checked_ = !is_checked_; }

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

 protected:
  // CheckBox  attributes, check box size and a flag to know if the check box
  // is checked.
  static const int kCheckBoxSize = 16;
  bool is_checked_;
};

END_NAMESPACE(gui);
END_TEG_NAMESPACE();

#endif  // GUI_CHECKBOX_H__
