(svn r16740) -Codechange: Self-sizing widgets in intro screen, town directory, and found town windows.

This commit is contained in:
alberth
2009-07-04 15:35:36 +00:00
parent 2385aeae3c
commit d65c6cae54
6 changed files with 173 additions and 34 deletions

View File

@@ -165,7 +165,7 @@ class NWidgetBase : public ZeroedMemoryAllocator {
public:
NWidgetBase(WidgetType tp);
virtual int SetupSmallestSize() = 0;
virtual int SetupSmallestSize(Window *w) = 0;
virtual void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl) = 0;
virtual void StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl) = 0;
@@ -284,7 +284,6 @@ public:
inline void SetDisabled(bool disabled);
inline bool IsDisabled();
int SetupSmallestSize();
void StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl);
/* virtual */ void FillNestedArray(NWidgetCore **array, uint length);
@@ -355,7 +354,7 @@ class NWidgetStacked : public NWidgetContainer {
public:
NWidgetStacked(WidgetType tp);
int SetupSmallestSize();
int SetupSmallestSize(Window *w);
void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl);
void StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl);
@@ -395,7 +394,7 @@ class NWidgetHorizontal : public NWidgetPIPContainer {
public:
NWidgetHorizontal(NWidContainerFlags flags = NC_NONE);
int SetupSmallestSize();
int SetupSmallestSize(Window *w);
void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl);
void StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl);
@@ -418,7 +417,7 @@ class NWidgetVertical : public NWidgetPIPContainer {
public:
NWidgetVertical(NWidContainerFlags flags = NC_NONE);
int SetupSmallestSize();
int SetupSmallestSize(Window *w);
void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl);
void StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl);
@@ -431,7 +430,7 @@ class NWidgetSpacer : public NWidgetResizeBase {
public:
NWidgetSpacer(int length, int height);
int SetupSmallestSize();
int SetupSmallestSize(Window *w);
void StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl);
/* virtual */ void FillNestedArray(NWidgetCore **array, uint length);
@@ -451,7 +450,7 @@ public:
void Add(NWidgetBase *nwid);
void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
int SetupSmallestSize();
int SetupSmallestSize(Window *w);
void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl);
void StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl);
@@ -472,6 +471,7 @@ class NWidgetLeaf : public NWidgetCore {
public:
NWidgetLeaf(WidgetType tp, Colours colour, int index, uint16 data, StringID tip);
/* virtual */ int SetupSmallestSize(Window *w);
/* virtual */ void Draw(const Window *w);
/* virtual */ void Invalidate(const Window *w) const;
/* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y);