window.c
changeset 4719 fc6e14219f72
parent 4634 07699ac2bf37
child 4739 e626ef1b522e
equal deleted inserted replaced
4718:7ea19105eeac 4719:fc6e14219f72
    15 #include "genworld.h"
    15 #include "genworld.h"
    16 
    16 
    17 // delta between mouse cursor and upper left corner of dragged window
    17 // delta between mouse cursor and upper left corner of dragged window
    18 static Point _drag_delta;
    18 static Point _drag_delta;
    19 
    19 
       
    20 void RaiseWindowButtons(Window *w)
       
    21 {
       
    22 	const Widget *wi = w->widget;
       
    23 	uint i = 0;
       
    24 
       
    25 	for (i = 0; wi->type != WWT_LAST; i++, wi++) {
       
    26 		if (IsWindowWidgetLowered(w, i)) {
       
    27 			RaiseWindowWidget(w, i);
       
    28 			InvalidateWidget(w, i);
       
    29 		}
       
    30 	}
       
    31 }
       
    32 
    20 void HandleButtonClick(Window *w, byte widget)
    33 void HandleButtonClick(Window *w, byte widget)
    21 {
    34 {
    22 	w->click_state |= (1 << widget);
    35 	LowerWindowWidget(w, widget);
    23 	w->flags4 |= 5 << WF_TIMEOUT_SHL;
    36 	w->flags4 |= 5 << WF_TIMEOUT_SHL;
    24 	InvalidateWidget(w, widget);
    37 	InvalidateWidget(w, widget);
    25 }
    38 }
    26 
    39 
    27 
    40 
   752 	for (w = _last_window; w != _windows;) {
   765 	for (w = _last_window; w != _windows;) {
   753 		--w;
   766 		--w;
   754 
   767 
   755 		if (w->flags4&WF_TIMEOUT_MASK && !(--w->flags4&WF_TIMEOUT_MASK)) {
   768 		if (w->flags4&WF_TIMEOUT_MASK && !(--w->flags4&WF_TIMEOUT_MASK)) {
   756 			CallWindowEventNP(w, WE_TIMEOUT);
   769 			CallWindowEventNP(w, WE_TIMEOUT);
   757 			if (w->desc_flags & WDF_UNCLICK_BUTTONS) UnclickWindowButtons(w);
   770 			if (w->desc_flags & WDF_UNCLICK_BUTTONS) RaiseWindowButtons(w);
   758 		}
   771 		}
   759 	}
   772 	}
   760 }
   773 }
   761 
   774 
   762 Window *GetCallbackWnd(void)
   775 Window *GetCallbackWnd(void)