File: buttons.h

package info (click to toggle)
craft 3.5-10
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,000 kB
  • ctags: 1,602
  • sloc: cpp: 3,794; makefile: 2,319; ansic: 857; sh: 385
file content (85 lines) | stat: -rw-r--r-- 2,290 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef buttons_h
#define buttons_h

/*======================================================================*/
/*= CHANGES AND UPDATES                                                =*/
/*======================================================================*/
/*= date   person file       subject                                   =*/
/*=--------------------------------------------------------------------=*/
/*=                                                                    =*/
/*= 0707 hua    buttons.h    created                                   =*/
/*=                                                                    =*/
/*======================================================================*/

#include "stdio.h"
#include "string.h"

#include "win.h"
#include "io.h"
#include "bool.h"
#include "xmath.h"

/*----------------------------------------------------------------------*/
/* CLASS menu (deklarations)                                            */
/*----------------------------------------------------------------------*/

#define default_button_font  "-misc-*-*-*-*-*-*-*-*-*-*-*-*-*"

class button
  {public:

     Pixmap background;
     win    *w;
     
     char   button_dir [128];
     char   label      [128];
     bool   is_icon;
     bool   with_repeat;
     
     bool   is_pressed;

     int    x;
     int    y;
     int    dx;
     int    dy;

     int    x_label;
     int    y_label;

     int    dx_border;
     int    dy_border;

     int    border_color_light;
     int    border_color_dark;
     int    button_color;
     int    label_color;

     char   label_font [128];
     

     button (win  *b_w,
             char b_label [],
             int  b_x,
             int  b_y,
             bool b_with_repeat = false,
             int  b_dx          = by_default,
             int  b_dy          = by_default,
             int  b_dx_border   = by_default,
             int  b_dy_border   = by_default,
             int  b_label_color = by_default,
             char *b_label_font = NULL);
             
     
     ~button ();

     void press ();
     void press (bool mode);
     bool eval  (int  &button);
     bool eval  ();
     void write (char label_string []);
     void write (char label_string [], bool is_pressed);

  };

#endif