OpenTTD Source
12.0-beta2
|
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();
165 Rect GetCurrentRect()
const
168 r.left = this->
pos_x;
256 void AdjustPaddingForZoom()
override;
315 void SetIndex(
int index);
321 inline void SetLowered(
bool lowered);
322 inline bool IsLowered()
const;
323 inline void SetDisabled(
bool disabled);
324 inline bool IsDisabled()
const;
326 void FillNestedArray(
NWidgetBase **array, uint length)
override;
328 bool IsHighlighted()
const override;
329 TextColour GetHighlightColour()
const override;
330 void SetHighlighted(
TextColour highlight_colour)
override;
405 void AdjustPaddingForZoom()
override;
442 void SetIndex(
int index);
444 void AdjustPaddingForZoom()
override;
472 void AdjustPaddingForZoom()
override;
473 void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
475 void Draw(
const Window *w)
override;
536 void SetIndex(
int index);
537 void SetColour(Colours
colour);
560 void GetScrollOffsets(
int &start_x,
int &start_y,
int &base_offs_x,
int &base_offs_y);
590 void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
592 void AdjustPaddingForZoom()
override;
717 if (num < 0) num = 0;
718 if (num < this->
pos) this->pos = num;
728 assert(capacity > 0);
731 this->cap = capacity;
732 if (this->cap + this->pos > this->count) this->pos = std::max(0, this->count - this->cap);
744 assert(position >= 0);
745 assert(this->count <= this->
cap ? (position == 0) : (position + this->cap <= this->
count));
746 uint16 old_pos = this->
pos;
747 this->pos = position;
748 return this->pos != old_pos;
760 if (difference == 0)
return false;
763 case SS_BIG: difference *= this->
cap;
break;
766 return this->
SetPosition(
Clamp(this->pos + difference, 0, std::max(this->count - this->cap, 0)));
802 static void InvalidateDimensionCache();
804 static Dimension GetHorizontalDimension();
845 if (base >= max_space || step == 0)
return base;
846 if (step == 1)
return max_space;
847 uint increment = max_space - base;
848 increment -= increment % step;
849 return base + increment;
922 uint8 top, right, bottom,
left;
1081 part.u.
xy.x = fill_x;
1082 part.u.
xy.y = fill_y;
1146 part.u.
padding.bottom = bottom;
1159 return SetPadding(padding, padding, padding, padding);
1174 part.u.
pip.pre = pre;
1175 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.
@ 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.