|
@@ -40,38 +40,37 @@ typedef void WindowProc(Window *w, Windo
|
|
|
the default height/width of the window itself. You can change this
|
|
|
AFTER window-creation, with:
|
|
|
w->resize.width or w->resize.height.
|
|
|
That was all.. good luck, and enjoy :) -- TrueLight */
|
|
|
|
|
|
typedef enum ResizeFlags {
|
|
|
RESIZE_NONE = 0,
|
|
|
RESIZE_NONE = 0, ///< no resize required
|
|
|
|
|
|
RESIZE_LEFT = 1,
|
|
|
RESIZE_RIGHT = 2,
|
|
|
RESIZE_TOP = 4,
|
|
|
RESIZE_BOTTOM = 8,
|
|
|
RESIZE_LEFT = 1, ///< left resize flag
|
|
|
RESIZE_RIGHT = 2, ///< rigth resize flag
|
|
|
RESIZE_TOP = 4, ///< top resize flag
|
|
|
RESIZE_BOTTOM = 8, ///< bottom resize flag
|
|
|
|
|
|
RESIZE_LR = RESIZE_LEFT | RESIZE_RIGHT,
|
|
|
RESIZE_RB = RESIZE_RIGHT | RESIZE_BOTTOM,
|
|
|
RESIZE_TB = RESIZE_TOP | RESIZE_BOTTOM,
|
|
|
RESIZE_LRB = RESIZE_LEFT | RESIZE_RIGHT | RESIZE_BOTTOM,
|
|
|
RESIZE_LRTB = RESIZE_LEFT | RESIZE_RIGHT | RESIZE_TOP | RESIZE_BOTTOM,
|
|
|
RESIZE_RTB = RESIZE_RIGHT | RESIZE_TOP | RESIZE_BOTTOM,
|
|
|
RESIZE_LR = RESIZE_LEFT | RESIZE_RIGHT, ///< combination of left and right resize flags
|
|
|
RESIZE_RB = RESIZE_RIGHT | RESIZE_BOTTOM, ///< combination of right and bottom resize flags
|
|
|
RESIZE_TB = RESIZE_TOP | RESIZE_BOTTOM, ///< combination of top and bottom resize flags
|
|
|
RESIZE_LRB = RESIZE_LEFT | RESIZE_RIGHT | RESIZE_BOTTOM, ///< combination of left, right and bottom resize flags
|
|
|
RESIZE_LRTB = RESIZE_LEFT | RESIZE_RIGHT | RESIZE_TOP | RESIZE_BOTTOM, ///< combination of all resize flags
|
|
|
RESIZE_RTB = RESIZE_RIGHT | RESIZE_TOP | RESIZE_BOTTOM, ///< combination of right, top and bottom resize flag
|
|
|
|
|
|
/* The following flags are used by the system to specify what is disabled, hidden, or clicked
|
|
|
* They are used in the same place as the above RESIZE_x flags, Widget visual_flags.
|
|
|
* These states are used in exceptions. If nothing is specified, they will indicate
|
|
|
* Enabled, visible or unclicked widgets*/
|
|
|
WIDG_DISABLED = 4, ///< widget is greyed out, not available
|
|
|
WIDG_HIDDEN = 5, ///< widget is made invisible
|
|
|
WIDG_LOWERED = 6, ///< widget is paint lowered, a pressed button in fact
|
|
|
} ResizeFlag;
|
|
|
|
|
|
/* used to indicate the end of widgets' list for vararg functions */
|
|
|
enum {
|
|
|
WIDGET_LIST_END = -1,
|
|
|
WIDGET_LIST_END = -1, ///< indicate the end of widgets' list for vararg functions
|
|
|
};
|
|
|
|
|
|
typedef struct Widget {
|
|
|
byte type; ///< Widget type, see WindowWidgetTypes
|
|
|
byte display_flags; ///< Resize direction, alignment, etc. during resizing, see ResizeFlags
|
|
|
byte color; ///< Widget colour, see docs/ottd-colourtext-palette.png
|
|
@@ -234,13 +233,12 @@ typedef struct Scrollbar {
|
|
|
uint16 count, cap, pos;
|
|
|
} Scrollbar;
|
|
|
|
|
|
typedef struct ResizeInfo {
|
|
|
uint width; ///< Minimum width and height
|
|
|
uint height;
|
|
|
|
|
|
uint step_width; ///< In how big steps the width and height go
|
|
|
uint step_height;
|
|
|
} ResizeInfo;
|
|
|
|
|
|
typedef struct WindowMessage {
|
|
|
int msg;
|
|
@@ -428,13 +426,13 @@ typedef struct {
|
|
|
int height;
|
|
|
uint16 counter;
|
|
|
} scroller_d;
|
|
|
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(scroller_d));
|
|
|
|
|
|
typedef enum SortListFlags {
|
|
|
VL_NONE = 0x00,
|
|
|
VL_NONE = 0x00, ///< no sort
|
|
|
VL_DESC = 0x01, ///< sort descending or ascending
|
|
|
VL_RESORT = 0x02, ///< instruct the code to resort the list in the next loop
|
|
|
VL_REBUILD = 0x04, ///< create sort-listing to use for qsort and friends
|
|
|
VL_END = 0x08
|
|
|
} SortListFlags;
|
|
|
|