A basic graphics package for the LPC4088 Display Module.

Dependents:   lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI lpc4088_displaymodule_fs_aid ... more

Fork of DMBasicGUI by EmbeddedArtists AB

Application/Button.h

Committer:
embeddedartists
Date:
2014-12-11
Revision:
0:4977187e90c7
Child:
1:46c8df4608c8

File content as of revision 0:4977187e90c7:

#ifndef BUTTON_h
#define BUTTON_h

#include "lpc_swim.h"

class Button {
public:
  Button(const char* caption, COLOR_T* fb, uint16_t x, uint16_t y, uint16_t width, uint16_t height);
  void setAction(void (*func)(uint32_t arg), uint32_t arg) { _func = func; _funcArg = arg; }
  void setCaption(const char* caption);
  void setColors(COLOR_T bg, COLOR_T fg, COLOR_T bgPressed, COLOR_T fgPressed);
  bool handle(uint16_t x, uint16_t y, bool pressed);
  void draw();

private:
  const char* _caption;
  int _capx, _capy;
  //uint16_t _x0, _y0, _x1, _y1;
  COLOR_T _bgCol, _fgCol, _bgColPressed, _fgColPressed;
  bool _enabled, _pressed;
  void (*_func)(uint32_t arg);
  uint32_t _funcArg;
  SWIM_WINDOW_T _win;
};

#endif /* BUTTON_h */