36 mouse_down(0), right_down(0), shift_down(0), show_menu(false),
37 action(0), menu(0), menu_item(0), selected(0),
38 text_color(
Color::White), back_color(
Color::Black)
75 static DWORD rbutton_latch = 0;
100 if (!mouse_con || !mouse_con->
Active()) {
111 int keep_menu =
false;
182 int extra_width = 16;
186 menu_rect.w =
width/2;
191 if (menu_rect.w > max_width)
192 max_width = menu_rect.w;
199 locked_item = item.
value();
206 menu_rect.h = max_height + 6;
207 menu_rect.w = max_width + extra_width;
209 if (menu_rect.x + menu_rect.w >=
width)
210 menu_rect.x =
width - menu_rect.w - 2;
212 if (menu_rect.y + menu_rect.h >=
height)
213 menu_rect.y =
height - menu_rect.h - 2;
218 Rect item_rect = menu_rect;
230 Rect fill_rect = item_rect;
238 if (menu_rect.Contains(mx, my)) {
239 if (my >= fill_rect.
y && my <= fill_rect.
y+fill_rect.
h) {
243 if (locked_item && locked_item->
GetMenu() == m)
247 else if (!locked_item || locked_item->
GetMenu() != m) {
257 else if (item.
value() != locked_item) {
268 subx = menu_rect.x + max_width + extra_width;
269 suby = fill_rect.
y - 3;
285 item_rect.
x + max_width + extra_width - 8,
292 int left = item_rect.
x + max_width + 10;
293 int top = item_rect.
y + 1;
300 arrow[1].x = left + 8;
301 arrow[1].y = top + 4;
303 arrow[2].y = top + 8;
308 item_rect.
y += line_height;
312 if (subx + 60 >
width)
313 subx = menu_rect.x - 60;