r885: Don't delete a borrowed frame.
[cinelerra_cv/ct.git] / guicast / bctoggle.h
blobb4bc8d9596130c51252ea0b1e9d15ec52356ce1a
1 #ifndef BCTOGGLE_H
2 #define BCTOGGLE_H
4 #include "bcbitmap.inc"
5 #include "bcsubwindow.h"
6 #include "colors.h"
7 #include "fonts.h"
8 #include "vframe.inc"
11 class BC_Toggle : public BC_SubWindow
13 public:
14 BC_Toggle(int x, int y,
15 VFrame **data,
16 int value,
17 char *caption = "",
18 int bottom_justify = 0,
19 int font = MEDIUMFONT,
20 int color = -1);
21 virtual ~BC_Toggle();
23 virtual int handle_event() { return 0; };
24 int get_value();
25 int set_value(int value, int draw = 1);
26 void set_select_drag(int value);
27 int update(int value, int draw = 1);
28 void reposition_window(int x, int y);
29 void enable();
30 void disable();
31 void set_status(int value);
32 static void calculate_extents(BC_WindowBase *gui,
33 VFrame **images,
34 int bottom_justify,
35 int *text_line,
36 int *w,
37 int *h,
38 int *toggle_x,
39 int *toggle_y,
40 int *text_x,
41 int *text_y,
42 int *text_w,
43 int *text_h,
44 char *caption);
46 int initialize();
47 int set_images(VFrame **data);
48 void set_underline(int number);
49 int cursor_enter_event();
50 int cursor_leave_event();
51 // In select drag mode these 3 need to be overridden and called back to.
52 virtual int button_press_event();
53 virtual int button_release_event();
54 int cursor_motion_event();
55 int repeat_event(int64_t repeat_id);
56 int draw_face();
58 enum
60 TOGGLE_UP,
61 TOGGLE_UPHI,
62 TOGGLE_CHECKED,
63 TOGGLE_DOWN,
64 TOGGLE_CHECKEDHI
67 int has_caption();
69 BC_Pixmap *images[5];
70 BC_Pixmap *bg_image;
71 VFrame **data;
72 char caption[BCTEXTLEN];
73 int status;
74 int value;
75 int toggle_x;
76 int toggle_y;
77 // Start of text background
78 int text_x;
79 // Start of text
80 int text_text_x;
81 int text_y;
82 // Width of text background
83 int text_w;
84 int text_h;
85 int text_line;
86 int bottom_justify;
87 int font;
88 int color;
89 int select_drag;
90 int enabled;
91 int underline;
92 int is_radial;
95 class BC_Radial : public BC_Toggle
97 public:
98 BC_Radial(int x,
99 int y,
100 int value,
101 char *caption = "",
102 int font = MEDIUMFONT,
103 int color = -1);
106 class BC_CheckBox : public BC_Toggle
108 public:
109 BC_CheckBox(int x,
110 int y,
111 int value,
112 char *caption = "",
113 int font = MEDIUMFONT,
114 int color = -1);
115 BC_CheckBox(int x,
116 int y,
117 int *value,
118 char *caption = "",
119 int font = MEDIUMFONT,
120 int color = -1);
121 virtual int handle_event();
124 int *value;
127 class BC_Label : public BC_Toggle
129 public:
130 BC_Label(int x,
131 int y,
132 int value,
133 int font = MEDIUMFONT,
134 int color = -1);
137 #endif