101 WWB_PUSHBUTTON = 1 << 7,
133 virtual void FillNestedArray(
NWidgetBase **array, uint length) = 0;
138 virtual bool IsHighlighted()
const {
return false; }
139 virtual TextColour GetHighlightColour()
const {
return TC_INVALID; }
140 virtual void SetHighlighted(
TextColour highlight_colour) {}
149 inline void SetPadding(uint8 top, uint8 right, uint8 bottom, uint8 left)
241 void SetFill(uint fill_x, uint fill_y);
288 void SetIndex(
int index);
291 inline void SetLowered(
bool lowered);
292 inline bool IsLowered()
const;
293 inline void SetDisabled(
bool disabled);
294 inline bool IsDisabled()
const;
296 void FillNestedArray(
NWidgetBase **array, uint length);
298 bool IsHighlighted()
const;
300 void SetHighlighted(
TextColour highlight_colour);
318 this->highlight_colour = highlight_colour;
330 return this->highlight_colour;
374 void FillNestedArray(
NWidgetBase **array, uint length);
377 inline bool IsEmpty() {
return head == NULL; }
409 void SetIndex(
int index);
413 void FillNestedArray(
NWidgetBase **array, uint length);
418 void SetDisplayedPlane(
int plane);
438 void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
497 void SetIndex(
int index);
498 void SetColour(Colours colour);
499 void SetClicked(
int clicked);
500 void SetCount(
int count);
505 void FillNestedArray(
NWidgetBase **array, uint length);
521 void GetScrollOffsets(
int &start_x,
int &start_y,
int &base_offs_x,
int &base_offs_y);
534 void FillNestedArray(
NWidgetBase **array, uint length);
551 void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
556 void FillNestedArray(
NWidgetBase **array, uint length);
582 void InitializeViewport(
Window *w, uint32 follow_flags,
ZoomLevel zoom);
583 void UpdateViewportCoordinates(
Window *w);
605 Scrollbar(
bool is_vertical) : is_vertical(is_vertical), stepsize(1)
643 return IsInsideBS(item, this->GetPosition(), this->GetCapacity());
652 return this->is_vertical;
661 assert(stepsize > 0);
662 this->stepsize = stepsize;
677 if (num < 0) num = 0;
678 if (num < this->pos) this->pos = num;
688 assert(capacity > 0);
691 this->cap = capacity;
692 if (this->cap + this->pos > this->count) this->pos =
max(0, this->count - this->cap);
695 void SetCapacityFromWidget(
Window *w,
int widget,
int padding = 0);
703 assert(position >= 0);
704 assert(this->count <= this->cap ? (position == 0) : (position + this->cap <= this->count));
705 this->pos = position;
716 if (difference == 0)
return;
718 case SS_SMALL: difference *= this->stepsize;
break;
719 case SS_BIG: difference *= this->cap;
break;
722 this->SetPosition(
Clamp(this->pos + difference, 0,
max(this->count - this->cap, 0)));
733 if (position < this->GetPosition()) {
735 this->SetPosition(position);
736 }
else if (position >= this->GetPosition() + this->GetCapacity()) {
738 this->SetPosition(position - this->GetCapacity() + 1);
742 int GetScrolledRowFromWidget(
int clickpos,
const Window *
const w,
int widget,
int padding = 0,
int line_height = -1)
const;
757 static void InvalidateDimensionCache();
759 static Dimension GetHorizontalDimension();
777 bool ButtonHit(
const Point &pt);
779 static void InvalidateDimensionCache();
800 if (base >= max_space || step == 0)
return base;
801 if (step == 1)
return max_space;
802 uint increment = max_space - base;
803 increment -= increment % step;
804 return base + increment;
877 uint8 top, right, bottom,
left;
1053 part.u.
padding.bottom = bottom;
1066 return SetPadding(padding, padding, padding, padding);
1081 part.u.
pip.pre = pre;
1082 part.u.
pip.inter = inter;
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Types related to windows.
#define SETBITS(x, y)
Sets several bits in a variable.
static bool IsInsideBS(const T x, const uint base, const uint size)
Checks if a value is between a window started at some base point.
Functions related to bit mathematics.
#define CLRBITS(x, y)
Clears several bits in a variable.
Helper types related to the allocation of memory.
static T max(const T a, const T b)
Returns the maximum of two values.
Data structure for an opened window.
TextColour
Colour of the strings, see _string_colourmap in table/string_colours.h or docs/ottd-colourtext-palett...
#define MAX_UVALUE(type)
The largest value that can be entered in a variable.
Base class that provides memory initialization on dynamically created objects.
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.
ZoomLevel
All zoom levels we know.
uint8 spacing
Extra spacing around lines.
Widget part for storing minimal text line data.
FontSize
Available font sizes.
Index of the normal font in the font tables.
Coordinates of a point in 2D.
Types related to strings.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
uint8 lines
Number of text lines.
FontSize size
Font size of text lines.
Dimensions (a width and height) of a rectangle in 2D.
Types related to the graphics and/or input devices.