src/widget/widget.h
branchcpp_gui
changeset 6294 6c74bf9cc5a4
parent 6290 8078f7a3c8a0
child 6295 a88d8c2cff6e
equal deleted inserted replaced
6293:59b7305f9a8b 6294:6c74bf9cc5a4
    73 	byte            m_color;            ///< Widget color, see docs/ottd-colourtext-palette.png
    73 	byte            m_color;            ///< Widget color, see docs/ottd-colourtext-palette.png
    74 	bool            m_is_closing : 1;   ///< Widget was logically destroyed
    74 	bool            m_is_closing : 1;   ///< Widget was logically destroyed
    75 	bool            m_dont_clip : 1;    ///< should not be clipped by parent (container)
    75 	bool            m_dont_clip : 1;    ///< should not be clipped by parent (container)
    76 	StringID        m_tooltips;         ///< Tooltips that are shown when right clicking on a widget
    76 	StringID        m_tooltips;         ///< Tooltips that are shown when right clicking on a widget
    77 	Anchors         m_anchors;          ///< Resize/move when container resizes?
    77 	Anchors         m_anchors;          ///< Resize/move when container resizes?
       
    78 	Point16         m_min_size;         ///< Minimum size
       
    79 	Point16         m_max_size;         ///< Maximum size
       
    80 	Point16         m_size_step;        ///< When resizing, what step is the best
    78 	Handlers        m_handlers;         ///< dynamically registered event handlers
    81 	Handlers        m_handlers;         ///< dynamically registered event handlers
    79 
    82 
    80 	Widget()
    83 	Widget()
    81 		: m_container(NULL), m_id(0), m_rect(), m_data(0), m_feature_flags(FF_NONE), m_color(0)
    84 		: m_container(NULL), m_id(0), m_rect(), m_data(0), m_feature_flags(FF_NONE), m_color(0)
    82 		, m_is_closing(false), m_tooltips(0), m_anchors(PIN_NONE)
    85 		, m_is_closing(false), m_tooltips(0), m_anchors(PIN_NONE)
       
    86 		, m_max_size(Point16::max()), m_size_step(1, 1)
    83 	{}
    87 	{}
    84 
    88 
    85 	Widget(CompositeWidget *container, WidgetId id, FeatureFlags feature_flags, byte color, const Rect16 &rect, StringID tooltips)
    89 	Widget(CompositeWidget *container, WidgetId id, FeatureFlags feature_flags, byte color, const Rect16 &rect, StringID tooltips)
    86 		: m_container(container)
    90 		: m_container(container)
    87 		, m_id(id)
    91 		, m_id(id)
    91 		, m_color(color)
    95 		, m_color(color)
    92 		, m_is_closing(false)
    96 		, m_is_closing(false)
    93 		, m_dont_clip(false)
    97 		, m_dont_clip(false)
    94 		, m_tooltips(tooltips)
    98 		, m_tooltips(tooltips)
    95 		, m_anchors(PIN_NONE)
    99 		, m_anchors(PIN_NONE)
       
   100 		, m_max_size(Point16::max())
       
   101 		, m_size_step(1, 1)
    96 	{}
   102 	{}
    97 
   103 
    98 	int16 Left() const;
   104 	int16 Left() const;
    99 	int16 Top() const;
   105 	int16 Top() const;
   100 	int16 Right() const;
   106 	int16 Right() const;