Go to the documentation of this file.
101 WWB_PUSHBUTTON = 1 << 7,
130 virtual void AdjustPaddingForZoom();
139 virtual bool IsHighlighted()
const {
return false; }
140 virtual TextColour GetHighlightColour()
const {
return TC_INVALID; }
141 virtual void SetHighlighted(
TextColour highlight_colour) {}
150 inline void SetPadding(uint8 top, uint8 right, uint8 bottom, uint8 left)
156 this->AdjustPaddingForZoom();
166 this->AdjustPaddingForZoom();
175 Rect GetCurrentRect()
const
178 r.left = this->
pos_x;
259 void AdjustPaddingForZoom()
override;
318 void SetIndex(
int index);
324 inline void SetLowered(
bool lowered);
325 inline bool IsLowered()
const;
326 inline void SetDisabled(
bool disabled);
327 inline bool IsDisabled()
const;
329 void FillNestedArray(
NWidgetBase **array, uint length)
override;
331 bool IsHighlighted()
const override;
332 TextColour GetHighlightColour()
const override;
333 void SetHighlighted(
TextColour highlight_colour)
override;
408 void AdjustPaddingForZoom()
override;
445 void SetIndex(
int index);
447 void AdjustPaddingForZoom()
override;
477 void AdjustPaddingForZoom()
override;
478 void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
480 void Draw(
const Window *w)
override;
541 void SetIndex(
int index);
542 void SetColour(Colours
colour);
565 void GetScrollOffsets(
int &start_x,
int &start_y,
int &base_offs_x,
int &base_offs_y);
595 void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
597 void AdjustPaddingForZoom()
override;
722 if (num < 0) num = 0;
723 if (num < this->
pos) this->pos = num;
733 assert(capacity > 0);
736 this->cap = capacity;
737 if (this->cap + this->pos > this->count) this->pos = std::max(0, this->count - this->cap);
749 uint16 old_pos = this->
pos;
750 this->pos =
Clamp(position, 0, std::max(this->count - this->cap, 0));
751 return this->pos != old_pos;
763 if (difference == 0)
return false;
766 case SS_BIG: difference *= this->
cap;
break;
805 static void InvalidateDimensionCache();
807 static Dimension GetHorizontalDimension();
848 if (base >= max_space || step == 0)
return base;
849 if (step == 1)
return max_space;
850 uint increment = max_space - base;
851 increment -= increment % step;
852 return base + increment;
1083 part.u.
xy.x = fill_x;
1084 part.u.
xy.y = fill_y;
1148 part.u.
padding.bottom = bottom;
1164 part.u.
padding.left = padding.left;
1165 part.u.
padding.top = padding.top;
1166 part.u.
padding.right = padding.right;
1167 part.u.
padding.bottom = padding.bottom;
1179 return SetPadding(padding, padding, padding, padding);
1194 part.u.
pip.pre = pre;
1195 part.u.
pip.inter = inter;
uint8 lines
Number of text lines.
Dimensions (a width and height) of a rectangle in 2D.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
TextColour
Colour of the strings, see _string_colourmap in table/string_colours.h or docs/ottd-colourtext-palett...
ZoomLevel
All zoom levels we know.
StringAlignment
How to align the to-be drawn text.
#define SETBITS(x, y)
Sets several bits in a variable.
Padding dimensions to apply to each side of a Rect.
@ FS_NORMAL
Index of the normal font in the font tables.
static bool IsInsideBS(const T x, const size_t base, const size_t size)
Checks if a value is between a window started at some base point.
Base class that provides memory initialization on dynamically created objects.
Widget part for storing minimal text line data.
Coordinates of a point in 2D.
uint8 spacing
Extra spacing around lines.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
static T Clamp(const T a, const T min, const T max)
Clamp a value between an interval.
TextColour colour
TextColour for DrawString.
EventState
State of handling an event.
#define MAX_UVALUE(type)
The largest value that can be entered in a variable.
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Widget part for storing text colour.
FontSize
Available font sizes.
Data structure for an opened window.
Specification of a rectangle with absolute coordinates of all edges.
FontSize size
Font size of text lines.
#define CLRBITS(x, y)
Clears several bits in a variable.