diff options
author | belugas <belugas@openttd.org> | 2006-10-06 01:33:27 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2006-10-06 01:33:27 +0000 |
commit | 67b88e7ed931a66f73d347ddaed840aee92eb72c (patch) | |
tree | 430f2b9127a57a13c4df1dae3ed1a35f0bf2c76c /window.c | |
parent | 9d24f3df0a7bddaa951eae6bd92be96dd6f13efc (diff) | |
download | openttd-67b88e7ed931a66f73d347ddaed840aee92eb72c.tar.xz |
(svn r6661) Feature: Windows are not restricted to 32 widget items anymore.
The functions required to do so are to be found in window.h.
Rather then use the old deprecated disabled_state, hidden_state and click_state uint32 variables,
we now need to use accessors like SetWindowWidgetDisabledState, SetWindowWidgetHiddenState or SetWindowWidgetLoweredState.
This is the final commit for the merge of XTDwidget branch.
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -57,7 +57,7 @@ static void DispatchLeftClickEvent(Window *w, int x, int y) wi = &w->widget[e.we.click.widget]; /* don't allow any interaction if the button has been disabled */ - if (HASBIT(w->disabled_state, e.we.click.widget)) return; + if (IsWidgetDisabled(wi)) return; if (wi->type & 0xE0) { /* special widget handling for buttons*/ @@ -1068,22 +1068,25 @@ static bool HandleWindowDragging(void) bool resize_width = false; while (wi->type != WWT_LAST) { - if (wi->resize_flag != RESIZE_NONE) { + /* Isolate the resizing flags */ + byte rsizeflag = GB(wi->display_flags, 0, 4); + + if (rsizeflag != RESIZE_NONE) { /* Resize this widget */ - if (wi->resize_flag & RESIZE_LEFT) { + if (rsizeflag & RESIZE_LEFT) { wi->left += x; resize_width = true; } - if (wi->resize_flag & RESIZE_RIGHT) { + if (rsizeflag & RESIZE_RIGHT) { wi->right += x; resize_width = true; } - if (wi->resize_flag & RESIZE_TOP) { + if (rsizeflag & RESIZE_TOP) { wi->top += y; resize_height = true; } - if (wi->resize_flag & RESIZE_BOTTOM) { + if (rsizeflag & RESIZE_BOTTOM) { wi->bottom += y; resize_height = true; } @@ -1538,7 +1541,7 @@ void InvalidateWidget(const Window *w, byte widget_index) const Widget *wi = &w->widget[widget_index]; /* Don't redraw the window if the widget is invisible or of no-type */ - if (wi->type == WWT_EMPTY || HASBIT(w->hidden_state, widget_index)) return; + if (wi->type == WWT_EMPTY || IsWidgetHidden(wi)) return; SetDirtyBlocks(w->left + wi->left, w->top + wi->top, w->left + wi->right + 1, w->top + wi->bottom + 1); } |