You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.3 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*******************************************************************************
  2. ** A Transparency box control for FTLK 1.3.x
  3. ** =========================================================================
  4. ** (C) Copyright 2013 , rageworx@gmail.com
  5. *******************************************************************************/
  6. #ifndef __FL_TRANSBOX_H__
  7. #define __FL_TRANSBOX_H__
  8. #include <FL/Fl.H>
  9. #include <FL/Fl_Box.H>
  10. #include <FL/fl_draw.H>
  11. #include <FL/Fl_Image.H>
  12. class Fl_TransBox : public Fl_Box
  13. {
  14. public:
  15. Fl_TransBox(int x,int y,int w,int h, char* l = 0);
  16. virtual ~Fl_TransBox();
  17. public:
  18. void color(Fl_Color c);
  19. void set_alpha(unsigned char a);
  20. void set_dragEnabled(bool enabled) { dragEnabled = enabled; }
  21. void set_displayimage(Fl_Image* aimg) { dispimg = aimg; }
  22. public:
  23. unsigned char get_alpha() { return alpha; }
  24. protected:
  25. int handle(int e);
  26. void resize(int x, int y, int w, int h);
  27. void draw();
  28. private:
  29. void fill_buffer();
  30. private:
  31. unsigned char* buffer;
  32. unsigned char r;
  33. unsigned char g;
  34. unsigned char b;
  35. unsigned char alpha;
  36. Fl_RGB_Image* img;
  37. bool dragEnabled;
  38. Fl_Image* dispimg;
  39. };
  40. #endif /// __FL_TRANSBOX_H__