(svn r6631) -Codechange: Use accessors for click_state.

Another step toward merging XTDwidget.
The only two files not converted (window.h and widget.c) will be done at the very last commit)
This commit is contained in:
belugas
2006-10-03 20:16:20 +00:00
parent bdaab39e64
commit 17eb65050b
23 changed files with 313 additions and 185 deletions

View File

@@ -17,9 +17,22 @@
// delta between mouse cursor and upper left corner of dragged window
static Point _drag_delta;
void RaiseWindowButtons(Window *w)
{
const Widget *wi = w->widget;
uint i = 0;
for (i = 0; wi->type != WWT_LAST; i++, wi++) {
if (IsWindowWidgetLowered(w, i)) {
RaiseWindowWidget(w, i);
InvalidateWidget(w, i);
}
}
}
void HandleButtonClick(Window *w, byte widget)
{
w->click_state |= (1 << widget);
LowerWindowWidget(w, widget);
w->flags4 |= 5 << WF_TIMEOUT_SHL;
InvalidateWidget(w, widget);
}
@@ -754,7 +767,7 @@ static void DecreaseWindowCounters(void)
if (w->flags4&WF_TIMEOUT_MASK && !(--w->flags4&WF_TIMEOUT_MASK)) {
CallWindowEventNP(w, WE_TIMEOUT);
if (w->desc_flags & WDF_UNCLICK_BUTTONS) UnclickWindowButtons(w);
if (w->desc_flags & WDF_UNCLICK_BUTTONS) RaiseWindowButtons(w);
}
}
}