#ifndef CONTROL_H__
#define CONTROL_H__

#include <windows.h>

class Controller
{
public:
   Controller(HWND hwnd) 
      : _hwnd(hwnd), _button_width(50), _button_heigth(100), _x(0), _y(0), _znak(' ')
   {
      _pressed[0] = _pressed[1] = _pressed[2] = false;
      _n_buttons  = GetSystemMetrics(SM_CMOUSEBUTTONS);
      _mouse_szer = _n_buttons*_button_width;
      _mouse_wys  = 2*_button_heigth;
   }

   void OnPaint (HDC hdc);
   int OnCreate (WPARAM wParam, LPARAM lParam); 
   int OnMouseMove (short int x, short int y, HWND hwnd);
   int OnButtonDown (int n);
   int OnButtonUp   (int x);
   int OnChar (TCHAR znak);
   int OnKeyDown (int znak);

   void RysujKlawisz(HDC hdc, int n, bool obwodka = true);
   void RysujUchwyt (HDC hdc, bool obwodka = true);
   void RysujObwodke(HDC hdc);

private:
   const int _button_width;
   const int _button_heigth;


   bool _pressed[3];

   HWND _hwnd;
   int _x;          // "polozenie" lewego-gornego punktu myszy
   int _y;          // "polozenie" lewego-gornego punktu myszy
   int _client_x;
   int _client_y;
   int _n_buttons; // ile przyciskow ma mysz
   int _mouse_szer;
   int _mouse_wys;
   char _znak;
};
#endif
