From d303ef94b3e4bd19ab21ba49a70dd626e763f275 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Tue, 24 Oct 2006 14:15:17 +0000 Subject: (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. --- window.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'window.c') diff --git a/window.c b/window.c index 363808188..df4fbf868 100644 --- a/window.c +++ b/window.c @@ -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); -- cgit v1.2.3-70-g09d2