99 WWB_PUSHBUTTON = 1 << 7,
136 virtual bool IsHighlighted()
const {
return false; }
137 virtual TextColour GetHighlightColour()
const {
return TC_INVALID; }
138 virtual void SetHighlighted(
TextColour highlight_colour) {}
147 inline void SetPadding(uint8 top, uint8 right, uint8 bottom, uint8 left)
239 void SetFill(uint fill_x, uint fill_y);
286 void SetIndex(
int index);
289 inline void SetLowered(
bool lowered);
290 inline bool IsLowered()
const;
291 inline void SetDisabled(
bool disabled);
292 inline bool IsDisabled()
const;
296 bool IsHighlighted()
const override;
297 TextColour GetHighlightColour()
const override;
298 void SetHighlighted(
TextColour highlight_colour)
override;
316 this->highlight_colour = highlight_colour;
328 return this->highlight_colour;
375 inline bool IsEmpty() {
return head ==
nullptr; }
407 void SetIndex(
int index);
416 void SetDisplayedPlane(
int plane);
436 void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
495 void SetIndex(
int index);
496 void SetColour(Colours colour);
497 void SetClicked(
int clicked);
498 void SetCount(
int count);
519 void GetScrollOffsets(
int &start_x,
int &start_y,
int &base_offs_x,
int &base_offs_y);
549 void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
580 void InitializeViewport(
Window *w, uint32 follow_flags,
ZoomLevel zoom);
581 void UpdateViewportCoordinates(
Window *w);
603 Scrollbar(
bool is_vertical) : is_vertical(is_vertical), stepsize(1)
641 return IsInsideBS(item, this->GetPosition(), this->GetCapacity());
650 return this->is_vertical;
659 assert(stepsize > 0);
660 this->stepsize = stepsize;
675 if (num < 0) num = 0;
676 if (num < this->pos) this->pos = num;
686 assert(capacity > 0);
689 this->cap = capacity;
690 if (this->cap + this->pos > this->count) this->pos =
max(0, this->count - this->cap);
693 void SetCapacityFromWidget(
Window *w,
int widget,
int padding = 0);
701 assert(position >= 0);
702 assert(this->count <= this->cap ? (position == 0) : (position + this->cap <= this->count));
703 this->pos = position;
714 if (difference == 0)
return;
716 case SS_SMALL: difference *= this->stepsize;
break;
717 case SS_BIG: difference *= this->cap;
break;
720 this->SetPosition(
Clamp(this->pos + difference, 0,
max(this->count - this->cap, 0)));
731 if (position < this->GetPosition()) {
733 this->SetPosition(position);
734 }
else if (position >= this->GetPosition() + this->GetCapacity()) {
736 this->SetPosition(position - this->GetCapacity() + 1);
740 int GetScrolledRowFromWidget(
int clickpos,
const Window *
const w,
int widget,
int padding = 0,
int line_height = -1)
const;
755 static void InvalidateDimensionCache();
757 static Dimension GetHorizontalDimension();
775 bool ButtonHit(
const Point &pt);
777 static void InvalidateDimensionCache();
798 if (base >= max_space || step == 0)
return base;
799 if (step == 1)
return max_space;
800 uint increment = max_space - base;
801 increment -= increment % step;
802 return base + increment;
875 uint8 top, right, bottom,
left;
1051 part.u.
padding.bottom = bottom;
1064 return SetPadding(padding, padding, padding, padding);
1079 part.u.
pip.pre = pre;
1080 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.
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.
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.
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.
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.
ZoomLevel
All zoom levels we know.
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.