|
OpenTTD Source
13.0-beta1
|
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;
474 void AdjustPaddingForZoom()
override;
475 void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
477 void Draw(
const Window *w)
override;
538 void SetIndex(
int index);
539 void SetColour(Colours
colour);
562 void GetScrollOffsets(
int &start_x,
int &start_y,
int &base_offs_x,
int &base_offs_y);
592 void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
594 void AdjustPaddingForZoom()
override;
719 if (num < 0) num = 0;
720 if (num < this->
pos) this->pos = num;
730 assert(capacity > 0);
733 this->cap = capacity;
734 if (this->cap + this->pos > this->count) this->pos = std::max(0, this->count - this->cap);
746 assert(position >= 0);
747 assert(this->count <= this->
cap ? (position == 0) : (position + this->cap <= this->
count));
748 uint16 old_pos = this->
pos;
749 this->pos = position;
750 return this->pos != old_pos;
762 if (difference == 0)
return false;
765 case SS_BIG: difference *= this->
cap;
break;
768 return this->
SetPosition(
Clamp(this->pos + difference, 0, std::max(this->count - this->cap, 0)));
804 static void InvalidateDimensionCache();
806 static Dimension GetHorizontalDimension();
847 if (base >= max_space || step == 0)
return base;
848 if (step == 1)
return max_space;
849 uint increment = max_space - base;
850 increment -= increment % step;
851 return base + increment;
924 uint8 top, right, bottom,
left;
1083 part.u.
xy.x = fill_x;
1084 part.u.
xy.y = fill_y;
1148 part.u.
padding.bottom = bottom;
1161 return SetPadding(padding, padding, padding, padding);
1176 part.u.
pip.pre = pre;
1177 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.