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
|