|
|
#ifndef WINDOW_H
|
|
|
#define WINDOW_H
|
|
|
|
|
|
#include "vehicle_gui.h"
|
|
|
|
|
|
typedef union WindowEvent WindowEvent;
|
|
|
|
|
|
//typedef void WindowProc(Window *w, int event, int wparam, long lparam);
|
|
|
|
|
|
typedef void WindowProc(Window *w, WindowEvent *e);
|
|
|
|
|
|
/* How the resize system works:
|
|
|
First, you need to add a WWT_RESIZEBOX to the widgets, and you need
|
|
|
to add the flag WDF_RESIZABLE to the window. Now the window is ready
|
|
|
to resize itself.
|
|
|
As you may have noticed, all widgets have a RESIZE_XXX in their line.
|
|
|
This lines controls how the widgets behave on resize. RESIZE_NONE means
|
|
|
it doesn't do anything. Any other option let's one of the borders
|
|
|
move with the changed width/height. So if a widget has
|
|
|
RESIZE_RIGHT, and the window is made 5 pixels wider by the user,
|
|
|
the right of the window will also be made 5 pixels wider.
|
|
|
Now, what if you want to clamp a widget to the bottom? Give it the flag
|
|
|
RESIZE_TB. This is RESIZE_TOP + RESIZE_BOTTOM. Now if the window gets
|
|
|
5 pixels bigger, both the top and bottom gets 5 bigger, so the whole
|
|
|
widgets moves downwards without resizing, and appears to be clamped
|
|
|
to the bottom. Nice aint it?
|
|
|
You should know one more thing about this system. Most windows can't
|
|
|
handle an increase of 1 pixel. So there is a step function, which
|
|
|
let the windowsize only be changed by X pixels. You configure this
|