4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "bcbitmap.inc"
26 #include "bcsubwindow.h"
32 class BC_Toggle : public BC_SubWindow
35 BC_Toggle(int x, int y,
38 const char *caption = "",
39 int bottom_justify = 0,
40 int font = MEDIUMFONT,
44 virtual int handle_event() { return 0; };
46 void set_radial(int value);
47 int set_value(int value, int draw = 1);
48 void set_select_drag(int value);
49 int update(int value, int draw = 1);
50 void reposition_window(int x, int y);
53 void set_status(int value);
54 static void calculate_extents(BC_WindowBase *gui,
70 int set_images(VFrame **data);
71 void set_underline(int number);
72 int cursor_enter_event();
73 int cursor_leave_event();
74 // In select drag mode these 3 need to be overridden and called back to.
75 virtual int button_press_event();
76 virtual int button_release_event();
77 int cursor_motion_event();
78 int repeat_event(int64_t repeat_id);
79 virtual int draw_face(int flash, int flush /* = 1 */);
93 BC_Pixmap *images[TOGGLE_IMAGES];
96 char caption[BCTEXTLEN];
101 // Start of text background
106 // Width of text background
119 class BC_Radial : public BC_Toggle
125 const char *caption = "",
126 int font = MEDIUMFONT,
130 class BC_CheckBox : public BC_Toggle
136 const char *caption = "",
137 int font = MEDIUMFONT,
142 const char *caption = "",
143 int font = MEDIUMFONT,
145 virtual int handle_event();
146 static int calculate_h(BC_WindowBase *gui, int font=MEDIUMFONT);
148 static void calculate_extents(BC_WindowBase *gui, int *w, int *h,
149 const char *caption=0, int font=MEDIUMFONT);
153 class BC_Label : public BC_Toggle
159 int font = MEDIUMFONT,