46 } |
46 } |
47 } else if (wi->type == WWT_SCROLLBAR || wi->type == WWT_SCROLL2BAR || wi->type == WWT_HSCROLLBAR) { |
47 } else if (wi->type == WWT_SCROLLBAR || wi->type == WWT_SCROLL2BAR || wi->type == WWT_HSCROLLBAR) { |
48 ScrollbarClickHandler(w, wi, e.click.pt.x, e.click.pt.y); |
48 ScrollbarClickHandler(w, wi, e.click.pt.x, e.click.pt.y); |
49 } |
49 } |
50 |
50 |
51 w->wndproc(w, &e); |
|
52 |
|
53 if (w->desc_flags & WDF_STD_BTN) { |
51 if (w->desc_flags & WDF_STD_BTN) { |
54 if (e.click.widget == 0) { |
52 if (e.click.widget == 0) { /* 'X' */ |
55 DeleteWindow(w); |
53 DeleteWindow(w); |
56 return; |
54 return; |
57 } else { |
55 } |
58 if (e.click.widget == 1) { |
56 |
59 StartWindowDrag(w); |
57 if (e.click.widget == 1) /* 'Title bar' */ |
60 } |
58 StartWindowDrag(w); |
61 } |
59 } |
62 } |
60 |
63 |
61 if (w->desc_flags & WDF_RESIZABLE && wi->type == WWT_RESIZEBOX) |
64 if (w->desc_flags & WDF_RESIZABLE && wi->type == WWT_RESIZEBOX) { |
|
65 StartWindowSizing(w); |
62 StartWindowSizing(w); |
66 } |
|
67 |
63 |
68 if (w->desc_flags & WDF_STICKY_BUTTON && wi->type == WWT_STICKYBOX) { |
64 if (w->desc_flags & WDF_STICKY_BUTTON && wi->type == WWT_STICKYBOX) { |
69 w->click_state ^= (1 << e.click.widget); |
65 TOGGLEBIT(w->click_state, e.click.widget); |
70 w->flags4 ^= WF_STICKY; |
66 w->flags4 ^= WF_STICKY; |
71 InvalidateWidget(w, e.click.widget); |
67 InvalidateWidget(w, e.click.widget); |
72 } |
68 } |
73 } else { |
69 } |
74 w->wndproc(w, &e); |
70 |
75 } |
71 w->wndproc(w, &e); |
76 } |
72 } |
77 |
73 |
78 void DispatchRightClickEvent(Window *w, int x, int y) { |
74 void DispatchRightClickEvent(Window *w, int x, int y) { |
79 WindowEvent e; |
75 WindowEvent e; |
80 |
76 |
769 } |
765 } |
770 |
766 |
771 if (_left_button_down) { |
767 if (_left_button_down) { |
772 e.event = WE_POPUPMENU_OVER; |
768 e.event = WE_POPUPMENU_OVER; |
773 e.popupmenu.pt = _cursor.pos; |
769 e.popupmenu.pt = _cursor.pos; |
774 w->wndproc(w, &e); |
|
775 } else { |
770 } else { |
776 _popup_menu_active = false; |
771 _popup_menu_active = false; |
777 e.event = WE_POPUPMENU_SELECT; |
772 e.event = WE_POPUPMENU_SELECT; |
778 e.popupmenu.pt = _cursor.pos; |
773 e.popupmenu.pt = _cursor.pos; |
779 w->wndproc(w, &e); |
774 } |
780 } |
775 |
|
776 w->wndproc(w, &e); |
781 |
777 |
782 return false; |
778 return false; |
783 } |
779 } |
784 |
780 |
785 bool HandleMouseOver() |
781 bool HandleMouseOver() |