(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,

WWT_IMGBTN must contain an image for drawing. Renamed WWT_PANEL_2 to WWT_IMGBTN_2
 because that is what it is. Added WWT_PUSHBTN that is either just a pushable button,
 or a textbutton, which text's drawn dynamically independent of widget.
This commit is contained in:
Darkvater
2006-10-24 14:15:17 +00:00
parent 13df23c586
commit c7c65ce6d5
28 changed files with 337 additions and 330 deletions

View File

@@ -102,15 +102,15 @@ static void DispatchLeftClickEvent(Window *w, int x, int y)
/* don't allow any interaction if the button has been disabled */
if (IsWidgetDisabled(wi)) return;
if (wi->type & 0xE0) {
if (wi->type & WWB_MASK) {
/* special widget handling for buttons*/
switch (wi->type) {
case WWT_IMGBTN | WWB_PUSHBUTTON: /* WWT_PUSHIMGBTN */
case WWT_TEXTBTN | WWB_PUSHBUTTON: /* WWT_PUSHTXTBTN */
HandleButtonClick(w, e.we.click.widget);
break;
case WWT_NODISTXTBTN:
break;
case WWT_PANEL | WWB_PUSHBUTTON: /* WWT_PUSHBTN */
case WWT_IMGBTN | WWB_PUSHBUTTON: /* WWT_PUSHIMGBTN */
case WWT_TEXTBTN | WWB_PUSHBUTTON: /* WWT_PUSHTXTBTN */
HandleButtonClick(w, e.we.click.widget);
break;
case WWT_NODISTXTBTN: break;
}
} else if (wi->type == WWT_SCROLLBAR || wi->type == WWT_SCROLL2BAR || wi->type == WWT_HSCROLLBAR) {
ScrollbarClickHandler(w, wi, e.we.click.pt.x, e.we.click.pt.y);