00001 #ifndef BCTOGGLE_H
00002 #define BCTOGGLE_H
00003
00004 #include "bcbitmap.inc"
00005 #include "bcsubwindow.h"
00006 #include "colors.h"
00007 #include "fonts.h"
00008 #include "vframe.inc"
00009
00010
00011 class BC_Toggle : public BC_SubWindow
00012 {
00013 public:
00014 BC_Toggle(int x, int y,
00015 VFrame **data,
00016 int value,
00017 char *caption = "",
00018 int bottom_justify = 0,
00019 int font = MEDIUMFONT,
00020 int color = -1);
00021 virtual ~BC_Toggle();
00022
00023 virtual int handle_event() { return 0; };
00024 int get_value();
00025 int set_value(int value, int draw = 1);
00026 void set_select_drag(int value);
00027 int update(int value, int draw = 1);
00028 void reposition_window(int x, int y);
00029 void enable();
00030 void disable();
00031 void set_status(int value);
00032 static void calculate_extents(BC_WindowBase *gui,
00033 VFrame **images,
00034 int bottom_justify,
00035 int *text_line,
00036 int *w,
00037 int *h,
00038 int *toggle_x,
00039 int *toggle_y,
00040 int *text_x,
00041 int *text_y,
00042 int *text_w,
00043 int *text_h,
00044 char *caption);
00045
00046 int initialize();
00047 int set_images(VFrame **data);
00048 void set_underline(int number);
00049 int cursor_enter_event();
00050 int cursor_leave_event();
00051
00052 virtual int button_press_event();
00053 virtual int button_release_event();
00054 int cursor_motion_event();
00055 int repeat_event(int64_t repeat_id);
00056 int draw_face();
00057
00058 enum
00059 {
00060 TOGGLE_UP,
00061 TOGGLE_UPHI,
00062 TOGGLE_CHECKED,
00063 TOGGLE_DOWN,
00064 TOGGLE_CHECKEDHI
00065 };
00066
00067 int has_caption();
00068
00069 BC_Pixmap *images[5];
00070 BC_Pixmap *bg_image;
00071 VFrame **data;
00072 char caption[BCTEXTLEN];
00073 int status;
00074 int value;
00075 int toggle_x;
00076 int toggle_y;
00077
00078 int text_x;
00079
00080 int text_text_x;
00081 int text_y;
00082
00083 int text_w;
00084 int text_h;
00085 int text_line;
00086 int bottom_justify;
00087 int font;
00088 int color;
00089 int select_drag;
00090 int enabled;
00091 int underline;
00092 int is_radial;
00093 };
00094
00095 class BC_Radial : public BC_Toggle
00096 {
00097 public:
00098 BC_Radial(int x,
00099 int y,
00100 int value,
00101 char *caption = "",
00102 int font = MEDIUMFONT,
00103 int color = -1);
00104 };
00105
00106 class BC_CheckBox : public BC_Toggle
00107 {
00108 public:
00109 BC_CheckBox(int x,
00110 int y,
00111 int value,
00112 char *caption = "",
00113 int font = MEDIUMFONT,
00114 int color = -1);
00115 BC_CheckBox(int x,
00116 int y,
00117 int *value,
00118 char *caption = "",
00119 int font = MEDIUMFONT,
00120 int color = -1);
00121 virtual int handle_event();
00122
00123
00124 int *value;
00125 };
00126
00127 class BC_Label : public BC_Toggle
00128 {
00129 public:
00130 BC_Label(int x,
00131 int y,
00132 int value,
00133 int font = MEDIUMFONT,
00134 int color = -1);
00135 };
00136
00137 #endif