#ifndef WIDGET_H_INCLUDED
#define WIDGET_H_INCLUDED

#include <vector>
#include "graphics.hpp"
#include "color.h"

/// Õs widget osztály

class widget
{
public:
    /// ---- Mezők ----
    mutable unsigned int x,y;
    mutable unsigned int width, height;
    bool tabStop;
    bool focus;
    bool visible;

    /// ---- Konstruktor ----
    widget(int x0, int y0, unsigned int width0, unsigned int height0);
    /// ---- Destruktor ----
    ~widget() {}

    /// ---- Események ----
    virtual void onClick(int posX, int posY, char button) = 0;
    virtual void onMouseUp(int posX, int posY, char button) = 0;
    virtual void onMouseMove(int posX, int posY) = 0;
    virtual void onKeyPress(char keyCode) = 0;
    virtual void onKeyUp(char keyCode) = 0;
    virtual void onTick() = 0;

    /// ---- Események és kirajzolás ----
    bool event (genv::event &ev);
    virtual void draw() const = 0;
};

extern std::vector<widget*> widgets;

extern const unsigned int X;
extern const unsigned int Y;

extern const unsigned int t;

// int >> string konverzió
std::string convert(int temp);

#endif // WIDGET_H_INCLUDED
