summaryrefslogtreecommitdiff
path: root/src/widget_type.h
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-09-19 13:08:37 +0000
committeralberth <alberth@openttd.org>2009-09-19 13:08:37 +0000
commit8d7498b82cdcfe8d647d7aae0adddc762fa8f3ce (patch)
treeda7c0212a7c63c6397fd4baa9ddb63f24ceb543a /src/widget_type.h
parent86395277d35a53a3bb0abe74f454e59735d9a4b0 (diff)
downloadopenttd-8d7498b82cdcfe8d647d7aae0adddc762fa8f3ce.tar.xz
(svn r17575) -Codechange: Adding a new combined button+dropdown widget.
Diffstat (limited to 'src/widget_type.h')
-rw-r--r--src/widget_type.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widget_type.h b/src/widget_type.h
index 8683f2003..27eeb2071 100644
--- a/src/widget_type.h
+++ b/src/widget_type.h
@@ -121,6 +121,7 @@ enum WidgetType {
NWID_SELECTION, ///< Stacked widgets, only one visible at a time (eg in a panel with tabs).
NWID_LAYERED, ///< Widgets layered on top of each other, all visible at the same time.
NWID_VIEWPORT, ///< Nested widget containing a viewport.
+ NWID_BUTTON_DRPDOWN, ///< Button with a drop-down.
/* Nested widget part types. */
WPT_RESIZE, ///< Widget part for specifying resizing.
@@ -278,17 +279,22 @@ public:
/** Nested widget flags that affect display and interaction withe 'real' widgets. */
enum NWidgetDisplay {
+ /* Generic. */
NDB_LOWERED = 0, ///< Widget is lowered (pressed down) bit.
NDB_DISABLED = 1, ///< Widget is disabled (greyed out) bit.
+ /* Viewport widget. */
NDB_NO_TRANSPARENCY = 2, ///< Viewport is never transparent.
NDB_SHADE_GREY = 3, ///< Shade viewport to grey-scale.
NDB_SHADE_DIMMED = 4, ///< Display dimmed colours in the viewport.
+ /* Button dropdown widget. */
+ NDB_DROPDOWN_ACTIVE = 5, ///< Dropdown menu of the button dropdown widget is active. @see #NWID_BUTTON_DRPDOWN
ND_LOWERED = 1 << NDB_LOWERED, ///< Bit value of the lowered flag.
ND_DISABLED = 1 << NDB_DISABLED, ///< Bit value of the disabled flag.
ND_NO_TRANSPARENCY = 1 << NDB_NO_TRANSPARENCY, ///< Bit value of the 'no transparency' flag.
ND_SHADE_GREY = 1 << NDB_SHADE_GREY, ///< Bit value of the 'shade to grey' flag.
ND_SHADE_DIMMED = 1 << NDB_SHADE_DIMMED, ///< Bit value of the 'dimmed colours' flag.
+ ND_DROPDOWN_ACTIVE = 1 << NDB_DROPDOWN_ACTIVE, ///< Bit value of the 'dropdown active' flag.
};
DECLARE_ENUM_AS_BIT_SET(NWidgetDisplay);
@@ -526,6 +532,8 @@ public:
/* virtual */ void Draw(const Window *w);
/* virtual */ Scrollbar *FindScrollbar(Window *w, bool allow_next = true);
+ bool ButtonHit(const Point &pt);
+
static void InvalidateDimensionCache();
private:
static Dimension stickybox_dimension; ///< Cached size of a stickybox widget.