|
@@ -282,41 +282,46 @@ struct ResizeInfo {
|
|
|
* @see SendWindowMessageW()
|
|
|
*/
|
|
|
struct WindowMessage {
|
|
|
int msg;
|
|
|
int wparam;
|
|
|
int lparam;
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* Data structure for an opened window
|
|
|
*/
|
|
|
struct Window : ZeroedMemoryAllocator {
|
|
|
private:
|
|
|
WindowProc *wndproc; ///< Event handler function for the window. Do not use directly, call HandleWindowEvent() instead.
|
|
|
|
|
|
public:
|
|
|
Window(WindowProc *proc) : wndproc(proc) {}
|
|
|
|
|
|
uint16 flags4; ///< Window flags, @see WindowFlags
|
|
|
WindowClass window_class; ///< Window class
|
|
|
WindowNumber window_number; ///< Window number within the window class
|
|
|
|
|
|
int left; ///< x position of left edge of the window
|
|
|
int top; ///< y position of top edge of the window
|
|
|
int width; ///< width of the window (number of pixels to the right in x direction)
|
|
|
int height; ///< Height of the window (number of pixels down in y direction)
|
|
|
|
|
|
Scrollbar hscroll; ///< Horizontal scroll bar
|
|
|
Scrollbar vscroll; ///< First vertical scroll bar
|
|
|
Scrollbar vscroll2; ///< Second vertical scroll bar
|
|
|
ResizeInfo resize; ///< Resize information
|
|
|
|
|
|
byte caption_color; ///< Background color of the window caption, contains PlayerID
|
|
|
|
|
|
WindowProc *wndproc; ///< Event handler function for the window
|
|
|
ViewPort *viewport; ///< Pointer to viewport, if present
|
|
|
const Widget *original_widget; ///< Original widget layout, copied from WindowDesc
|
|
|
Widget *widget; ///< Widgets of the window
|
|
|
uint widget_count; ///< Number of widgets of the window
|
|
|
uint32 desc_flags; ///< Window/widgets default flags setting, @see WindowDefaultFlag
|
|
|
|
|
|
WindowMessage message; ///< Buffer for storing received messages (for communication between different window events)
|
|
|
Window *parent; ///< Parent window
|
|
|
byte custom[WINDOW_CUSTOM_SIZE]; ///< Additional data depending on window type
|
|
|
|
|
|
void HandleButtonClick(byte widget);
|
|
|
|
|
@@ -330,24 +335,26 @@ struct Window : ZeroedMemoryAllocator {
|
|
|
bool IsWidgetHidden(byte widget_index) const;
|
|
|
void SetWidgetLoweredState(byte widget_index, bool lowered_stat);
|
|
|
void ToggleWidgetLoweredState(byte widget_index);
|
|
|
void LowerWidget(byte widget_index);
|
|
|
void RaiseWidget(byte widget_index);
|
|
|
bool IsWidgetLowered(byte widget_index) const;
|
|
|
|
|
|
void RaiseButtons();
|
|
|
void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets, ...);
|
|
|
void CDECL SetWidgetsHiddenState(bool hidden_stat, int widgets, ...);
|
|
|
void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets, ...);
|
|
|
void InvalidateWidget(byte widget_index) const;
|
|
|
|
|
|
virtual void HandleWindowEvent(WindowEvent *e);
|
|
|
};
|
|
|
|
|
|
struct menu_d {
|
|
|
byte item_count; ///< follow_vehicle
|
|
|
byte sel_index; ///< scrollpos_x
|
|
|
byte main_button; ///< scrollpos_y
|
|
|
byte action_id;
|
|
|
StringID string_id; ///< unk30
|
|
|
uint16 checked_items; ///< unk32
|
|
|
byte disabled_items;
|
|
|
};
|
|
|
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(menu_d));
|