src/window_gui.h
author rubidium
Tue, 16 Dec 2008 17:58:27 +0000
changeset 10426 4a77f7049b5e
parent 10238 5076964d81a1
permissions -rw-r--r--
(svn r14679) -Fix [FS#2431]: opening the OSK on the chatbox did disable map scrolling (with keyboard) until another window with editbox was opened and closed. Just "refcount" the open edit boxes instead of setting/clearing a bit when opening/closing a window.
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2159
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2159
diff changeset
     2
8106
e6790dd9e750 (svn r11667) -Codechange: split window.h into a header that defines some 'global' window related types, on that defined 'global' window functions and one that defines functions and types only used by *_gui.cpps.
rubidium
parents: 8102
diff changeset
     3
/** @file window_gui.h Functions, definitions and such used only by the GUI. */
6117
6507b2a7e71d (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6024
diff changeset
     4
8106
e6790dd9e750 (svn r11667) -Codechange: split window.h into a header that defines some 'global' window related types, on that defined 'global' window functions and one that defines functions and types only used by *_gui.cpps.
rubidium
parents: 8102
diff changeset
     5
#ifndef WINDOW_GUI_H
e6790dd9e750 (svn r11667) -Codechange: split window.h into a header that defines some 'global' window related types, on that defined 'global' window functions and one that defines functions and types only used by *_gui.cpps.
rubidium
parents: 8102
diff changeset
     6
#define WINDOW_GUI_H
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
8222
ce0457729295 (svn r11785) -Codechange: remove some unneeded includes.
rubidium
parents: 8214
diff changeset
     8
#include "core/bitmath_func.hpp"
9127
14f21c5954ee (svn r12987) -Codechange: split viewport and tile selection.
rubidium
parents: 9117
diff changeset
     9
#include "core/geometry_type.hpp"
8139
4e91c448c409 (svn r11701) -Codechange: removal unnecessary inclusions of map.h (and split map.h).
rubidium
parents: 8113
diff changeset
    10
#include "vehicle_type.h"
8224
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 8223
diff changeset
    11
#include "viewport_type.h"
10208
72c00af5c95d (svn r14422) -Codechange: also reflect the changes of r14421 in the filenames.
rubidium
parents: 10207
diff changeset
    12
#include "company_type.h"
8264
b1e85998c7d3 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8254
diff changeset
    13
#include "strings_type.h"
8925
e0d37ce1eba8 (svn r12695) -Codechange: only allocate window structs when needed. Based on a patch by Alberth.
rubidium
parents: 8923
diff changeset
    14
#include "core/alloc_type.hpp"
9127
14f21c5954ee (svn r12987) -Codechange: split viewport and tile selection.
rubidium
parents: 9117
diff changeset
    15
#include "window_type.h"
14f21c5954ee (svn r12987) -Codechange: split viewport and tile selection.
rubidium
parents: 9117
diff changeset
    16
#include "tile_type.h"
4299
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
    17
8068
41569ce2d1d9 (svn r11629) -Fix [FS#1527]: many viewports could crash the scenario editor.
rubidium
parents: 8036
diff changeset
    18
/**
41569ce2d1d9 (svn r11629) -Fix [FS#1527]: many viewports could crash the scenario editor.
rubidium
parents: 8036
diff changeset
    19
 * The maximum number of windows that can be opened.
41569ce2d1d9 (svn r11629) -Fix [FS#1527]: many viewports could crash the scenario editor.
rubidium
parents: 8036
diff changeset
    20
 */
41569ce2d1d9 (svn r11629) -Fix [FS#1527]: many viewports could crash the scenario editor.
rubidium
parents: 8036
diff changeset
    21
static const int MAX_NUMBER_OF_WINDOWS = 25;
41569ce2d1d9 (svn r11629) -Fix [FS#1527]: many viewports could crash the scenario editor.
rubidium
parents: 8036
diff changeset
    22
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    23
/* How the resize system works:
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    24
    First, you need to add a WWT_RESIZEBOX to the widgets, and you need
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    25
     to add the flag WDF_RESIZABLE to the window. Now the window is ready
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    26
     to resize itself.
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    27
    As you may have noticed, all widgets have a RESIZE_XXX in their line.
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    28
     This lines controls how the widgets behave on resize. RESIZE_NONE means
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    29
     it doesn't do anything. Any other option let's one of the borders
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    30
     move with the changed width/height. So if a widget has
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    31
     RESIZE_RIGHT, and the window is made 5 pixels wider by the user,
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    32
     the right of the window will also be made 5 pixels wider.
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    33
    Now, what if you want to clamp a widget to the bottom? Give it the flag
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    34
     RESIZE_TB. This is RESIZE_TOP + RESIZE_BOTTOM. Now if the window gets
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    35
     5 pixels bigger, both the top and bottom gets 5 bigger, so the whole
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    36
     widgets moves downwards without resizing, and appears to be clamped
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    37
     to the bottom. Nice aint it?
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    38
   You should know one more thing about this system. Most windows can't
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    39
    handle an increase of 1 pixel. So there is a step function, which
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    40
    let the windowsize only be changed by X pixels. You configure this
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    41
    after making the window, like this:
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    42
      w->resize.step_height = 10;
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    43
    Now the window will only change in height in steps of 10.
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    44
   You can also give a minimum width and height. The default value is
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    45
    the default height/width of the window itself. You can change this
8969
6d1c74e0e2cd (svn r12761) -Codechange: lots of minor whitespace coding style fixes around operators.
rubidium
parents: 8957
diff changeset
    46
    AFTER window - creation, with:
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    47
     w->resize.width or w->resize.height.
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    48
   That was all.. good luck, and enjoy :) -- TrueLight */
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    49
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    50
enum ResizeFlag {
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6117
diff changeset
    51
	RESIZE_NONE   = 0,  ///< no resize required
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    52
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6117
diff changeset
    53
	RESIZE_LEFT   = 1,  ///< left resize flag
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6117
diff changeset
    54
	RESIZE_RIGHT  = 2,  ///< rigth resize flag
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6117
diff changeset
    55
	RESIZE_TOP    = 4,  ///< top resize flag
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6117
diff changeset
    56
	RESIZE_BOTTOM = 8,  ///< bottom resize flag
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    57
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6117
diff changeset
    58
	RESIZE_LR     = RESIZE_LEFT  | RESIZE_RIGHT,   ///<  combination of left and right resize flags
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6117
diff changeset
    59
	RESIZE_RB     = RESIZE_RIGHT | RESIZE_BOTTOM,  ///<  combination of right and bottom resize flags
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6117
diff changeset
    60
	RESIZE_TB     = RESIZE_TOP   | RESIZE_BOTTOM,  ///<  combination of top and bottom resize flags
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6117
diff changeset
    61
	RESIZE_LRB    = RESIZE_LEFT  | RESIZE_RIGHT  | RESIZE_BOTTOM, ///< combination of left, right and bottom resize flags
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6117
diff changeset
    62
	RESIZE_LRTB   = RESIZE_LEFT  | RESIZE_RIGHT  | RESIZE_TOP | RESIZE_BOTTOM,  ///<  combination of all resize flags
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6117
diff changeset
    63
	RESIZE_RTB    = RESIZE_RIGHT | RESIZE_TOP    | RESIZE_BOTTOM, ///<  combination of right, top and bottom resize flag
4749
65a49cfc922d (svn r6661) Feature: Windows are not restricted to 32 widget items anymore.
belugas
parents: 4739
diff changeset
    64
65a49cfc922d (svn r6661) Feature: Windows are not restricted to 32 widget items anymore.
belugas
parents: 4739
diff changeset
    65
	/* The following flags are used by the system to specify what is disabled, hidden, or clicked
65a49cfc922d (svn r6661) Feature: Windows are not restricted to 32 widget items anymore.
belugas
parents: 4739
diff changeset
    66
	 * They are used in the same place as the above RESIZE_x flags, Widget visual_flags.
65a49cfc922d (svn r6661) Feature: Windows are not restricted to 32 widget items anymore.
belugas
parents: 4739
diff changeset
    67
	 * These states are used in exceptions. If nothing is specified, they will indicate
65a49cfc922d (svn r6661) Feature: Windows are not restricted to 32 widget items anymore.
belugas
parents: 4739
diff changeset
    68
	 * Enabled, visible or unclicked widgets*/
6117
6507b2a7e71d (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6024
diff changeset
    69
	WIDG_DISABLED = 4,  ///< widget is greyed out, not available
6507b2a7e71d (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6024
diff changeset
    70
	WIDG_HIDDEN   = 5,  ///< widget is made invisible
6507b2a7e71d (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6024
diff changeset
    71
	WIDG_LOWERED  = 6,  ///< widget is paint lowered, a pressed button in fact
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    72
};
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    73
4755
9ebcb0db6c06 (svn r6669) -Add: vararg functions to set hidden/disabled/lowered state of multiple widgets in one call
glx
parents: 4749
diff changeset
    74
enum {
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6117
diff changeset
    75
	WIDGET_LIST_END = -1, ///< indicate the end of widgets' list for vararg functions
4755
9ebcb0db6c06 (svn r6669) -Add: vararg functions to set hidden/disabled/lowered state of multiple widgets in one call
glx
parents: 4749
diff changeset
    76
};
9ebcb0db6c06 (svn r6669) -Add: vararg functions to set hidden/disabled/lowered state of multiple widgets in one call
glx
parents: 4749
diff changeset
    77
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
    78
/**
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
    79
 * Window widget data structure
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
    80
 */
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    81
struct Widget {
6117
6507b2a7e71d (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6024
diff changeset
    82
	byte type;                        ///< Widget type, see WindowWidgetTypes
9773
fd7309d22bc6 (svn r13910) -Document: string drawing related functions and types (Alberth)
rubidium
parents: 9660
diff changeset
    83
	byte display_flags;               ///< Resize direction, alignment, etc. during resizing. @see ResizeFlags
4547
d37c2d172ad4 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
Darkvater
parents: 4542
diff changeset
    84
	byte color;                       ///< Widget colour, see docs/ottd-colourtext-palette.png
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
    85
	int16 left;                       ///< The left edge of the widget
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
    86
	int16 right;                      ///< The right edge of the widget
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
    87
	int16 top;                        ///< The top edge of the widget
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
    88
	int16 bottom;                     ///< The bottom edge of the widget
4547
d37c2d172ad4 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
Darkvater
parents: 4542
diff changeset
    89
	uint16 data;                      ///< The String/Image or special code (list-matrixes) of a widget
d37c2d172ad4 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
Darkvater
parents: 4542
diff changeset
    90
	StringID tooltips;                ///< Tooltips that are shown when rightclicking on a widget
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    91
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    92
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
    93
/**
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
    94
 * Flags to describe the look of the frame
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
    95
 */
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    96
enum FrameFlags {
8008
4cc180fe96ab (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 7996
diff changeset
    97
	FR_NONE         =  0,
4cc180fe96ab (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 7996
diff changeset
    98
	FR_TRANSPARENT  =  1 << 0,  ///< Makes the background transparent if set
4cc180fe96ab (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 7996
diff changeset
    99
	FR_BORDERONLY   =  1 << 4,  ///< Draw border only, no background
4cc180fe96ab (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 7996
diff changeset
   100
	FR_LOWERED      =  1 << 5,  ///< If set the frame is lowered and the background color brighter (ie. buttons when pressed)
4cc180fe96ab (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 7996
diff changeset
   101
	FR_DARKENED     =  1 << 6,  ///< If set the background is darker, allows for lowered frames with normal background color when used with FR_LOWERED (ie. dropdown boxes)
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
   102
};
4437
49e79e135539 (svn r6209) Move DrawFrameRect() out of gfx.[ch], because it uses data (_color_list) which the renderer shouldn't have know about
tron
parents: 4434
diff changeset
   103
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
   104
DECLARE_ENUM_AS_BIT_SET(FrameFlags);
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
   105
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   106
/* wiget.cpp */
4437
49e79e135539 (svn r6209) Move DrawFrameRect() out of gfx.[ch], because it uses data (_color_list) which the renderer shouldn't have know about
tron
parents: 4434
diff changeset
   107
void DrawFrameRect(int left, int top, int right, int bottom, int color, FrameFlags flags);
1938
70baf462aff1 (svn r2444) - CodeChange: Add an enum for demagicifying the values of the 'flags' parameter of DrawFrameRect(). (_Abraxa_)
hackykid
parents: 1648
diff changeset
   108
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   109
/**
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   110
 * High level window description
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   111
 */
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
   112
struct WindowDesc {
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   113
	int16 left;             ///< Prefered x position of left edge of the window, @see WindowDefaultPosition()
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   114
	int16 top;              ///< Prefered y position of the top of the window, @see WindowDefaultPosition()
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   115
	int16 minimum_width;    ///< Minimal width of the window
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   116
	int16 minimum_height;   ///< Minimal height of the window
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   117
	int16 default_width;    ///< Prefered initial width of the window
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   118
	int16 default_height;   ///< Prefered initial height of the window
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   119
	WindowClass cls;        ///< Class of the window, @see WindowClass
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   120
	WindowClass parent_cls; ///< Class of the parent window, @see WindowClass
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   121
	uint32 flags;           ///< Flags, @see WindowDefaultFlags
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   122
	const Widget *widgets;  ///< List of widgets with their position and size for the window
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
   123
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   124
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   125
/**
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   126
 * Window default widget/window handling flags
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   127
 */
5413
21f75917d589 (svn r7616) -Cleanup:
Darkvater
parents: 5268
diff changeset
   128
enum WindowDefaultFlag {
8008
4cc180fe96ab (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 7996
diff changeset
   129
	WDF_STD_TOOLTIPS    =   1 << 0, ///< use standard routine when displaying tooltips
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   130
	WDF_DEF_WIDGET      =   1 << 1, ///< Default widget control for some widgets in the on click event, @see DispatchLeftClickEvent()
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   131
	WDF_STD_BTN         =   1 << 2, ///< Default handling for close and titlebar widgets (widget no 0 and 1)
8019
fc0e94dee165 (svn r11579) -Revert(r11578): some cases of key propagation are not handled correctly.
belugas
parents: 8018
diff changeset
   132
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   133
	WDF_UNCLICK_BUTTONS =   1 << 4, ///< Unclick buttons when the window event times out
8008
4cc180fe96ab (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 7996
diff changeset
   134
	WDF_STICKY_BUTTON   =   1 << 5, ///< Set window to sticky mode; they are not closed unless closed with 'X' (widget 2)
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   135
	WDF_RESIZABLE       =   1 << 6, ///< Window can be resized
8008
4cc180fe96ab (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 7996
diff changeset
   136
	WDF_MODAL           =   1 << 7, ///< The window is a modal child of some other window, meaning the parent is 'inactive'
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   137
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   138
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   139
/**
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   140
 * Special values for 'left' and 'top' to cause a specific placement
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   141
 */
5413
21f75917d589 (svn r7616) -Cleanup:
Darkvater
parents: 5268
diff changeset
   142
enum WindowDefaultPosition {
5072
69195f96a23a (svn r7130) -Codechange: Handle the positioning of windows through the desc->left/top settings with
Darkvater
parents: 5071
diff changeset
   143
	WDP_AUTO      = -1, ///< Find a place automatically
69195f96a23a (svn r7130) -Codechange: Handle the positioning of windows through the desc->left/top settings with
Darkvater
parents: 5071
diff changeset
   144
	WDP_CENTER    = -2, ///< Center the window (left/right or top/bottom)
69195f96a23a (svn r7130) -Codechange: Handle the positioning of windows through the desc->left/top settings with
Darkvater
parents: 5071
diff changeset
   145
	WDP_ALIGN_TBR = -3, ///< Align the right side of the window with the right side of the main toolbar
69195f96a23a (svn r7130) -Codechange: Handle the positioning of windows through the desc->left/top settings with
Darkvater
parents: 5071
diff changeset
   146
	WDP_ALIGN_TBL = -4, ///< Align the left side of the window with the left side of the main toolbar
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   147
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   148
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   149
/**
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   150
 * Scrollbar data structure
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   151
 */
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
   152
struct Scrollbar {
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   153
	uint16 count;  ///< Number of elements in the list
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   154
	uint16 cap;    ///< Number of visible elements of the scroll bar
9773
fd7309d22bc6 (svn r13910) -Document: string drawing related functions and types (Alberth)
rubidium
parents: 9660
diff changeset
   155
	uint16 pos;    ///< Index of first visible item of the list
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
   156
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   157
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   158
/**
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   159
 * Data structure for resizing a window
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   160
 */
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
   161
struct ResizeInfo {
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   162
	uint width;       ///< Minimum allowed width of the window
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   163
	uint height;      ///< Minimum allowed height of the window
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   164
	uint step_width;  ///< Step-size of width resize changes
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   165
	uint step_height; ///< Step-size of height resize changes
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
   166
};
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   167
9273
35e0224ea8f1 (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 9272
diff changeset
   168
enum SortButtonState {
35e0224ea8f1 (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 9272
diff changeset
   169
	SBS_OFF,
35e0224ea8f1 (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 9272
diff changeset
   170
	SBS_DOWN,
35e0224ea8f1 (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 9272
diff changeset
   171
	SBS_UP,
35e0224ea8f1 (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 9272
diff changeset
   172
};
35e0224ea8f1 (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 9272
diff changeset
   173
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   174
/**
9184
6c18790d3929 (svn r13047) -Codechange: remove vp_d
glx
parents: 9182
diff changeset
   175
 * Data structure for a window viewport
6c18790d3929 (svn r13047) -Codechange: remove vp_d
glx
parents: 9182
diff changeset
   176
 */
6c18790d3929 (svn r13047) -Codechange: remove vp_d
glx
parents: 9182
diff changeset
   177
struct ViewportData : ViewPort {
6c18790d3929 (svn r13047) -Codechange: remove vp_d
glx
parents: 9182
diff changeset
   178
	VehicleID follow_vehicle;
6c18790d3929 (svn r13047) -Codechange: remove vp_d
glx
parents: 9182
diff changeset
   179
	int32 scrollpos_x;
6c18790d3929 (svn r13047) -Codechange: remove vp_d
glx
parents: 9182
diff changeset
   180
	int32 scrollpos_y;
6c18790d3929 (svn r13047) -Codechange: remove vp_d
glx
parents: 9182
diff changeset
   181
	int32 dest_scrollpos_x;
6c18790d3929 (svn r13047) -Codechange: remove vp_d
glx
parents: 9182
diff changeset
   182
	int32 dest_scrollpos_y;
6c18790d3929 (svn r13047) -Codechange: remove vp_d
glx
parents: 9182
diff changeset
   183
};
6c18790d3929 (svn r13047) -Codechange: remove vp_d
glx
parents: 9182
diff changeset
   184
9267
22095cc802dd (svn r13133) -Codechange: Add a base class (descending from Window) for all new windows that are going to require a ResetObjectToPlace to be performed on closing.
belugas
parents: 9264
diff changeset
   185
/**
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   186
 * Data structure for an opened window
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   187
 */
8925
e0d37ce1eba8 (svn r12695) -Codechange: only allocate window structs when needed. Based on a patch by Alberth.
rubidium
parents: 8923
diff changeset
   188
struct Window : ZeroedMemoryAllocator {
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   189
	/** State whether an event is handled or not */
9285
235e5e2d7f55 (svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium
parents: 9275
diff changeset
   190
	enum EventState {
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   191
		ES_HANDLED,     ///< The passed event is handled
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   192
		ES_NOT_HANDLED, ///< The passed event is not handled
9285
235e5e2d7f55 (svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium
parents: 9275
diff changeset
   193
	};
235e5e2d7f55 (svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium
parents: 9275
diff changeset
   194
9142
858a058aa730 (svn r13004) -Codechange: replace AllocateWindow and AllocateWindowDesc with a Window constructor.
rubidium
parents: 9127
diff changeset
   195
protected:
9178
3235f895bf12 (svn r13041) -Fix: calling a virtual function on a not fully constructed object is bound to cause errors.
rubidium
parents: 9168
diff changeset
   196
	void Initialize(int x, int y, int min_width, int min_height,
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   197
			WindowClass cls, const Widget *widget, int window_number);
9178
3235f895bf12 (svn r13041) -Fix: calling a virtual function on a not fully constructed object is bound to cause errors.
rubidium
parents: 9168
diff changeset
   198
	void FindWindowPlacementAndResize(int def_width, int def_height);
3235f895bf12 (svn r13041) -Fix: calling a virtual function on a not fully constructed object is bound to cause errors.
rubidium
parents: 9168
diff changeset
   199
	void FindWindowPlacementAndResize(const WindowDesc *desc);
9142
858a058aa730 (svn r13004) -Codechange: replace AllocateWindow and AllocateWindowDesc with a Window constructor.
rubidium
parents: 9127
diff changeset
   200
9082
8a28686aeff2 (svn r12941) -Codechange: don't access wndproc directly. Patch by Alberth.
rubidium
parents: 8995
diff changeset
   201
public:
9301
3b20dfb6c4e8 (svn r13169) -Codechange: remove a (now) unneeded parameter of one of the Window constructors.
rubidium
parents: 9293
diff changeset
   202
	Window(int x, int y, int width, int height, WindowClass cls, const Widget *widget);
9203
082fbf0500c4 (svn r13069) -Codechange: it is no longer needed to pass a void *data pointer with the WE_CREATE message because nothing uses it anymore.
rubidium
parents: 9188
diff changeset
   203
	Window(const WindowDesc *desc, WindowNumber number = 0);
9142
858a058aa730 (svn r13004) -Codechange: replace AllocateWindow and AllocateWindowDesc with a Window constructor.
rubidium
parents: 9127
diff changeset
   204
9115
47ae980bace3 (svn r12975) -Codechange: replace DeleteWindow(w) with delete w.
rubidium
parents: 9082
diff changeset
   205
	virtual ~Window();
9082
8a28686aeff2 (svn r12941) -Codechange: don't access wndproc directly. Patch by Alberth.
rubidium
parents: 8995
diff changeset
   206
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   207
	uint16 flags4;              ///< Window flags, @see WindowFlags
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   208
	WindowClass window_class;   ///< Window class
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   209
	WindowNumber window_number; ///< Window number within the window class
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   210
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   211
	int left;   ///< x position of left edge of the window
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   212
	int top;    ///< y position of top edge of the window
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   213
	int width;  ///< width of the window (number of pixels to the right in x direction)
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   214
	int height; ///< Height of the window (number of pixels down in y direction)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   215
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   216
	Scrollbar hscroll;  ///< Horizontal scroll bar
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   217
	Scrollbar vscroll;  ///< First vertical scroll bar
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   218
	Scrollbar vscroll2; ///< Second vertical scroll bar
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   219
	ResizeInfo resize;  ///< Resize information
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   220
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 10184
diff changeset
   221
	byte caption_color; ///< Background color of the window caption, contains CompanyID
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   222
9184
6c18790d3929 (svn r13047) -Codechange: remove vp_d
glx
parents: 9182
diff changeset
   223
	ViewportData *viewport;      ///< Pointer to viewport data, if present
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   224
	Widget *widget;        ///< Widgets of the window
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   225
	uint widget_count;     ///< Number of widgets of the window
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   226
	uint32 desc_flags;     ///< Window/widgets default flags setting, @see WindowDefaultFlag
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   227
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   228
	Window *parent;        ///< Parent window
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   229
8035
8c76ea0d84ab (svn r11595) -Codechange: add a new member to Window struct, based on its function counterpart HandleButtonClick.
belugas
parents: 8032
diff changeset
   230
	void HandleButtonClick(byte widget);
8c76ea0d84ab (svn r11595) -Codechange: add a new member to Window struct, based on its function counterpart HandleButtonClick.
belugas
parents: 8032
diff changeset
   231
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   232
	void SetWidgetDisabledState(byte widget_index, bool disab_stat);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   233
	void DisableWidget(byte widget_index);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   234
	void EnableWidget(byte widget_index);
7995
36f4cc1839fb (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 7993
diff changeset
   235
	bool IsWidgetDisabled(byte widget_index) const;
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   236
	void SetWidgetHiddenState(byte widget_index, bool hidden_stat);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   237
	void HideWidget(byte widget_index);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   238
	void ShowWidget(byte widget_index);
7995
36f4cc1839fb (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 7993
diff changeset
   239
	bool IsWidgetHidden(byte widget_index) const;
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   240
	void SetWidgetLoweredState(byte widget_index, bool lowered_stat);
7996
809895d51e05 (svn r11554) -Codechange: be more consistent with the naming of the widget functions.
rubidium
parents: 7995
diff changeset
   241
	void ToggleWidgetLoweredState(byte widget_index);
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   242
	void LowerWidget(byte widget_index);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   243
	void RaiseWidget(byte widget_index);
7995
36f4cc1839fb (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 7993
diff changeset
   244
	bool IsWidgetLowered(byte widget_index) const;
9660
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   245
	void AlignWidgetRight(byte widget_index_a, byte widget_index_b);
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   246
	int  GetWidgetWidth(byte widget_index) const;
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   247
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   248
	void RaiseButtons();
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   249
	void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets, ...);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   250
	void CDECL SetWidgetsHiddenState(bool hidden_stat, int widgets, ...);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   251
	void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets, ...);
8026
a188ea8201ce (svn r11586) -Fix: make another widget 'accessor' function const when it should be const.
glx
parents: 8019
diff changeset
   252
	void InvalidateWidget(byte widget_index) const;
9082
8a28686aeff2 (svn r12941) -Codechange: don't access wndproc directly. Patch by Alberth.
rubidium
parents: 8995
diff changeset
   253
9273
35e0224ea8f1 (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 9272
diff changeset
   254
	void DrawWidgets() const;
35e0224ea8f1 (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 9272
diff changeset
   255
	void DrawViewport() const;
35e0224ea8f1 (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 9272
diff changeset
   256
	void DrawSortButtonState(int widget, SortButtonState state) const;
35e0224ea8f1 (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 9272
diff changeset
   257
10184
bf4e3ff4cf16 (svn r14395) -Fix [FS#2285]: crashes and GUI desyncs when order is deleted/modified while the timetable window is open
smatz
parents: 10181
diff changeset
   258
	void DeleteChildWindows() const;
bf4e3ff4cf16 (svn r14395) -Fix [FS#2285]: crashes and GUI desyncs when order is deleted/modified while the timetable window is open
smatz
parents: 10181
diff changeset
   259
9115
47ae980bace3 (svn r12975) -Codechange: replace DeleteWindow(w) with delete w.
rubidium
parents: 9082
diff changeset
   260
	void SetDirty() const;
47ae980bace3 (svn r12975) -Codechange: replace DeleteWindow(w) with delete w.
rubidium
parents: 9082
diff changeset
   261
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   262
	/*** Event handling ***/
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   263
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   264
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   265
	 * This window is currently being repainted.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   266
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   267
	virtual void OnPaint() {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   268
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   269
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   270
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   271
	 * A key has been pressed.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   272
	 * @param key     the Unicode value of the key.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   273
	 * @param keycode the untranslated key code including shift state.
9285
235e5e2d7f55 (svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium
parents: 9275
diff changeset
   274
	 * @return ES_HANDLED if the key press has been handled and no other
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   275
	 *         window should receive the event.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   276
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   277
	virtual EventState OnKeyPress(uint16 key, uint16 keycode) { return ES_NOT_HANDLED; }
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   278
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   279
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   280
	 * The state of the control key has changed
9285
235e5e2d7f55 (svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium
parents: 9275
diff changeset
   281
	 * @return ES_HANDLED if the change has been handled and no other
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   282
	 *         window should receive the event.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   283
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   284
	virtual EventState OnCTRLStateChange() { return ES_NOT_HANDLED; }
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   285
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   286
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   287
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   288
	 * A click with the left mouse button has been made on the window.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   289
	 * @param pt     the point inside the window that has been clicked.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   290
	 * @param widget the clicked widget.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   291
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   292
	virtual void OnClick(Point pt, int widget) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   293
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   294
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   295
	 * A double click with the left mouse button has been made on the window.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   296
	 * @param pt     the point inside the window that has been clicked.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   297
	 * @param widget the clicked widget.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   298
	 */
9264
9380b4a14c92 (svn r13130) -Codechange: remove some of the (old) WindowEvent wrapper functions/enums/variables as they are not used anymore.
rubidium
parents: 9263
diff changeset
   299
	virtual void OnDoubleClick(Point pt, int widget) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   300
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   301
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   302
	 * A click with the right mouse button has been made on the window.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   303
	 * @param pt     the point inside the window that has been clicked.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   304
	 * @param widget the clicked widget.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   305
	 */
9264
9380b4a14c92 (svn r13130) -Codechange: remove some of the (old) WindowEvent wrapper functions/enums/variables as they are not used anymore.
rubidium
parents: 9263
diff changeset
   306
	virtual void OnRightClick(Point pt, int widget) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   307
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   308
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   309
	 * A dragged 'object' has been released.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   310
	 * @param pt     the point inside the window where the release took place.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   311
	 * @param widget the widget where the release took place.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   312
	 */
9264
9380b4a14c92 (svn r13130) -Codechange: remove some of the (old) WindowEvent wrapper functions/enums/variables as they are not used anymore.
rubidium
parents: 9263
diff changeset
   313
	virtual void OnDragDrop(Point pt, int widget) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   314
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   315
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   316
	 * Handle the request for (viewport) scrolling.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   317
	 * @param delta the amount the viewport must be scrolled.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   318
	 */
9264
9380b4a14c92 (svn r13130) -Codechange: remove some of the (old) WindowEvent wrapper functions/enums/variables as they are not used anymore.
rubidium
parents: 9263
diff changeset
   319
	virtual void OnScroll(Point delta) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   320
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   321
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   322
	 * The mouse is currently moving over the window or has just moved outside
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   323
	 * of the window. In the latter case pt is (-1, -1).
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   324
	 * @param pt     the point inside the window that the mouse hovers over.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   325
	 * @param widget the widget the mouse hovers over.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   326
	 */
9264
9380b4a14c92 (svn r13130) -Codechange: remove some of the (old) WindowEvent wrapper functions/enums/variables as they are not used anymore.
rubidium
parents: 9263
diff changeset
   327
	virtual void OnMouseOver(Point pt, int widget) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   328
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   329
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   330
	 * The mouse wheel has been turned.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   331
	 * @param wheel the amount of movement of the mouse wheel.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   332
	 */
9264
9380b4a14c92 (svn r13130) -Codechange: remove some of the (old) WindowEvent wrapper functions/enums/variables as they are not used anymore.
rubidium
parents: 9263
diff changeset
   333
	virtual void OnMouseWheel(int wheel) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   334
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   335
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   336
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   337
	 * Called for every mouse loop run, which is at least once per (game) tick.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   338
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   339
	virtual void OnMouseLoop() {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   340
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   341
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   342
	 * Called once per (game) tick.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   343
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   344
	virtual void OnTick() {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   345
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   346
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   347
	 * Called once every 100 (game) ticks.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   348
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   349
	virtual void OnHundredthTick() {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   350
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   351
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   352
	 * Called when this window's timeout has been reached.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   353
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   354
	virtual void OnTimeout() {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   355
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   356
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   357
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   358
	 * Called when the window got resized.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   359
	 * @param new_size the new size of the window.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   360
	 * @param delta    the amount of which the window size changed.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   361
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   362
	virtual void OnResize(Point new_size, Point delta) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   363
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   364
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   365
	 * A dropdown option associated to this window has been selected.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   366
	 * @param widget the widget (button) that the dropdown is associated with.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   367
	 * @param index  the element in the dropdown that is selected.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   368
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   369
	virtual void OnDropdownSelect(int widget, int index) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   370
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   371
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   372
	 * The query window opened from this window has closed.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   373
	 * @param str the new value of the string or NULL if the window
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   374
	 *            was cancelled.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   375
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   376
	virtual void OnQueryTextFinished(char *str) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   377
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   378
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   379
	 * Some data on this window has become invalid.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   380
	 * @param data information about the changed data.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   381
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   382
	virtual void OnInvalidateData(int data = 0) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   383
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   384
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   385
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   386
	 * The user clicked some place on the map when a tile highlight mode
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   387
	 * has been set.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   388
	 * @param pt   the exact point on the map that has been clicked.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   389
	 * @param tile the tile on the map that has been clicked.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   390
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   391
	virtual void OnPlaceObject(Point pt, TileIndex tile) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   392
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   393
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   394
	 * The user cancelled a tile highlight mode that has been set.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   395
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   396
	virtual void OnPlaceObjectAbort() {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   397
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   398
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   399
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   400
	 * The user is dragging over the map when the tile highlight mode
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   401
	 * has been set.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   402
	 * @param select_method the method of selection (allowed directions)
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   403
	 * @param select_proc   what will be created when the drag is over.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   404
	 * @param pt            the exact point on the map where the mouse is.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   405
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   406
	virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   407
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   408
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   409
	 * The user has dragged over the map when the tile highlight mode
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   410
	 * has been set.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   411
	 * @param select_method the method of selection (allowed directions)
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   412
	 * @param select_proc   what should be created.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   413
	 * @param pt            the exact point on the map where the mouse was released.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   414
	 * @param start_tile    the begin tile of the drag.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   415
	 * @param end_tile      the end tile of the drag.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   416
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   417
	virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   418
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   419
	/**
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   420
	 * The user moves over the map when a tile highlight mode has been set
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   421
	 * when the special mouse mode has been set to 'PRESIZE' mode. An
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   422
	 * example of this is the tile highlight for dock building.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   423
	 * @param pt   the exact point on the map where the mouse is.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   424
	 * @param tile the tile on the map where the mouse is.
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   425
	 */
9317
f14eb8815829 (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 9301
diff changeset
   426
	virtual void OnPlacePresize(Point pt, TileIndex tile) {}
9166
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   427
dce886fc5eeb (svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
rubidium
parents: 9165
diff changeset
   428
	/*** End of the event handling ***/
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   429
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   430
9267
22095cc802dd (svn r13133) -Codechange: Add a base class (descending from Window) for all new windows that are going to require a ResetObjectToPlace to be performed on closing.
belugas
parents: 9264
diff changeset
   431
/**
22095cc802dd (svn r13133) -Codechange: Add a base class (descending from Window) for all new windows that are going to require a ResetObjectToPlace to be performed on closing.
belugas
parents: 9264
diff changeset
   432
 * Data structure for a window opened from a toolbar
22095cc802dd (svn r13133) -Codechange: Add a base class (descending from Window) for all new windows that are going to require a ResetObjectToPlace to be performed on closing.
belugas
parents: 9264
diff changeset
   433
 */
22095cc802dd (svn r13133) -Codechange: Add a base class (descending from Window) for all new windows that are going to require a ResetObjectToPlace to be performed on closing.
belugas
parents: 9264
diff changeset
   434
class PickerWindowBase : public Window {
22095cc802dd (svn r13133) -Codechange: Add a base class (descending from Window) for all new windows that are going to require a ResetObjectToPlace to be performed on closing.
belugas
parents: 9264
diff changeset
   435
22095cc802dd (svn r13133) -Codechange: Add a base class (descending from Window) for all new windows that are going to require a ResetObjectToPlace to be performed on closing.
belugas
parents: 9264
diff changeset
   436
public:
9338
3d6f9ddd431d (svn r13230) -Fix [FS#2030](r13171): When closing toolbars, also close their PickerWindows.
frosch
parents: 9317
diff changeset
   437
	PickerWindowBase(const WindowDesc *desc, Window *parent) : Window(desc)
3d6f9ddd431d (svn r13230) -Fix [FS#2030](r13171): When closing toolbars, also close their PickerWindows.
frosch
parents: 9317
diff changeset
   438
	{
3d6f9ddd431d (svn r13230) -Fix [FS#2030](r13171): When closing toolbars, also close their PickerWindows.
frosch
parents: 9317
diff changeset
   439
		this->parent = parent;
3d6f9ddd431d (svn r13230) -Fix [FS#2030](r13171): When closing toolbars, also close their PickerWindows.
frosch
parents: 9317
diff changeset
   440
	};
9267
22095cc802dd (svn r13133) -Codechange: Add a base class (descending from Window) for all new windows that are going to require a ResetObjectToPlace to be performed on closing.
belugas
parents: 9264
diff changeset
   441
22095cc802dd (svn r13133) -Codechange: Add a base class (descending from Window) for all new windows that are going to require a ResetObjectToPlace to be performed on closing.
belugas
parents: 9264
diff changeset
   442
	virtual ~PickerWindowBase();
22095cc802dd (svn r13133) -Codechange: Add a base class (descending from Window) for all new windows that are going to require a ResetObjectToPlace to be performed on closing.
belugas
parents: 9264
diff changeset
   443
};
22095cc802dd (svn r13133) -Codechange: Add a base class (descending from Window) for all new windows that are going to require a ResetObjectToPlace to be performed on closing.
belugas
parents: 9264
diff changeset
   444
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   445
/****************** THESE ARE NOT WIDGET TYPES!!!!! *******************/
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   446
enum WindowWidgetBehaviours {
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   447
	WWB_PUSHBUTTON  = 1 << 5,
4938
0447845fd1b3 (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4884
diff changeset
   448
0447845fd1b3 (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4884
diff changeset
   449
	WWB_MASK        = 0xE0,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   450
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   451
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   452
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   453
/**
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   454
 * Window widget types
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   455
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   456
enum WindowWidgetTypes {
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   457
	WWT_EMPTY,      ///< Empty widget, place holder to reserve space in widget array
4938
0447845fd1b3 (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4884
diff changeset
   458
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   459
	WWT_PANEL,      ///< Simple depressed panel
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   460
	WWT_INSET,      ///< Pressed (inset) panel, most commonly used as combo box _text_ area
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   461
	WWT_IMGBTN,     ///< Button with image
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   462
	WWT_IMGBTN_2,   ///< Button with diff image when clicked
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   463
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   464
	WWT_TEXTBTN,    ///< Button with text
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   465
	WWT_TEXTBTN_2,  ///< Button with diff text when clicked
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   466
	WWT_LABEL,      ///< Centered label
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   467
	WWT_TEXT,       ///< Pure simple text
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   468
	WWT_MATRIX,     ///< List of items underneath each other
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   469
	WWT_SCROLLBAR,  ///< Vertical scrollbar
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   470
	WWT_FRAME,      ///< Frame
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   471
	WWT_CAPTION,    ///< Window caption (window title between closebox and stickybox)
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   472
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   473
	WWT_HSCROLLBAR, ///< Horizontal scrollbar
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   474
	WWT_STICKYBOX,  ///< Sticky box (normally at top-right of a window)
6117
6507b2a7e71d (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6024
diff changeset
   475
	WWT_SCROLL2BAR, ///< 2nd vertical scrollbar
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   476
	WWT_RESIZEBOX,  ///< Resize box (normally at bottom-right of a window)
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   477
	WWT_CLOSEBOX,   ///< Close box (at top-left of a window)
8335
09a2e049b3a8 (svn r11901) -Add: add two widgets for dropdowns, one raised and one inset, to eventually replace use of two widgets for each dropdown control.
peter1138
parents: 8284
diff changeset
   478
	WWT_DROPDOWN,   ///< Raised drop down list (regular)
09a2e049b3a8 (svn r11901) -Add: add two widgets for dropdowns, one raised and one inset, to eventually replace use of two widgets for each dropdown control.
peter1138
parents: 8284
diff changeset
   479
	WWT_DROPDOWNIN, ///< Inset drop down list (used on game options only)
8737
4405e2e80db6 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents: 8586
diff changeset
   480
	WWT_EDITBOX,    ///< a textbox for typing (don't forget to call ShowOnScreenKeyboard() when clicked)
6117
6507b2a7e71d (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6024
diff changeset
   481
	WWT_LAST,       ///< Last Item. use WIDGETS_END to fill up padding!!
4939
bef7c24a6027 (svn r6926) -Codechange: Rename WWT_4 to WWT_TEXTBTN_2 and WWT_6 to WWT_INSET (credits to peter1138
Darkvater
parents: 4938
diff changeset
   482
bef7c24a6027 (svn r6926) -Codechange: Rename WWT_4 to WWT_TEXTBTN_2 and WWT_6 to WWT_INSET (credits to peter1138
Darkvater
parents: 4938
diff changeset
   483
	WWT_MASK = 0x1F,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   484
4938
0447845fd1b3 (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4884
diff changeset
   485
	WWT_PUSHBTN     = WWT_PANEL   | WWB_PUSHBUTTON,
4434
a08cb4b5c179 (svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc.
rubidium
parents: 4345
diff changeset
   486
	WWT_PUSHTXTBTN  = WWT_TEXTBTN | WWB_PUSHBUTTON,
a08cb4b5c179 (svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc.
rubidium
parents: 4345
diff changeset
   487
	WWT_PUSHIMGBTN  = WWT_IMGBTN  | WWB_PUSHBUTTON,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   488
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   489
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   490
/** Marker for the "end of widgets" in a Window(Desc) widget table. */
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   491
#define WIDGETS_END WWT_LAST,   RESIZE_NONE,     0,     0,     0,     0,     0, 0, STR_NULL
176
84990c4b9212 (svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents: 164
diff changeset
   492
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   493
/**
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   494
 * Window flags
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   495
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   496
enum WindowFlags {
10181
3c3e31214f4c (svn r14392) -Fix [FS#1404]: some widgets saw a single click as multiple clicks.
rubidium
parents: 10180
diff changeset
   497
	WF_TIMEOUT_TRIGGER   = 1,       ///< When the timeout should start triggering
3c3e31214f4c (svn r14392) -Fix [FS#1404]: some widgets saw a single click as multiple clicks.
rubidium
parents: 10180
diff changeset
   498
	WF_TIMEOUT_BEGIN     = 7,       ///< The initial value for the timeout
10180
a99cf854c6d0 (svn r14390) -Codechange: replace magic constants with symbolic constants.
rubidium
parents: 9834
diff changeset
   499
	WF_TIMEOUT_MASK      = 7,       ///< Window timeout counter bit mask (3 bits)
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   500
	WF_DRAGGING          = 1 <<  3, ///< Window is being dragged
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   501
	WF_SCROLL_UP         = 1 <<  4, ///< Upper scroll button has been pressed, @see ScrollbarClickHandler()
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   502
	WF_SCROLL_DOWN       = 1 <<  5, ///< Lower scroll button has been pressed, @see ScrollbarClickHandler()
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   503
	WF_SCROLL_MIDDLE     = 1 <<  6, ///< Scrollbar scrolling, @see ScrollbarClickHandler()
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   504
	WF_HSCROLL           = 1 <<  7,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   505
	WF_SIZING            = 1 <<  8,
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   506
	WF_STICKY            = 1 <<  9, ///< Window is made sticky by user
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   507
8857
7593af4962e6 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8771
diff changeset
   508
	WF_DISABLE_VP_SCROLL = 1 << 10, ///< Window does not do autoscroll, @see HandleAutoscroll()
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   509
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   510
	WF_WHITE_BORDER_ONE  = 1 << 11,
5416
b9a3326da943 (svn r7619) -Feature (Internal): Add support for modal children. It's a window-child that
Darkvater
parents: 5415
diff changeset
   511
	WF_WHITE_BORDER_MASK = 1 << 12 | WF_WHITE_BORDER_ONE,
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   512
	WF_SCROLL2           = 1 << 13,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   513
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   514
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   515
Window *BringWindowToFrontById(WindowClass cls, WindowNumber number);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   516
Window *FindWindowFromPt(int x, int y);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   517
9143
029e126e3439 (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 9142
diff changeset
   518
/**
029e126e3439 (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 9142
diff changeset
   519
 * Open a new window.
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   520
 * @param desc The pointer to the WindowDesc to be created
9143
029e126e3439 (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 9142
diff changeset
   521
 * @param window_number the window number of the new window
029e126e3439 (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 9142
diff changeset
   522
 * @return see Window pointer of the newly created window
029e126e3439 (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 9142
diff changeset
   523
 */
029e126e3439 (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 9142
diff changeset
   524
template <typename Wcls>
9203
082fbf0500c4 (svn r13069) -Codechange: it is no longer needed to pass a void *data pointer with the WE_CREATE message because nothing uses it anymore.
rubidium
parents: 9188
diff changeset
   525
Wcls *AllocateWindowDescFront(const WindowDesc *desc, int window_number)
9143
029e126e3439 (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 9142
diff changeset
   526
{
029e126e3439 (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 9142
diff changeset
   527
	if (BringWindowToFrontById(desc->cls, window_number)) return NULL;
9203
082fbf0500c4 (svn r13069) -Codechange: it is no longer needed to pass a void *data pointer with the WE_CREATE message because nothing uses it anymore.
rubidium
parents: 9188
diff changeset
   528
	return new Wcls(desc, window_number);
9143
029e126e3439 (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 9142
diff changeset
   529
}
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   530
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   531
void RelocateAllWindows(int neww, int newh);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   532
6117
6507b2a7e71d (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6024
diff changeset
   533
/* misc_gui.cpp */
9781
31e0e461d7bf (svn r13922) -Codechange: Move measurement-tooltip related stuff out of the general tooltip window.
frosch
parents: 9773
diff changeset
   534
void GuiShowTooltips(StringID str, uint paramcount = 0, const uint64 params[] = NULL, bool use_left_mouse_button = false);
4719
fc6e14219f72 (svn r6631) -Codechange: Use accessors for click_state.
belugas
parents: 4712
diff changeset
   535
6117
6507b2a7e71d (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6024
diff changeset
   536
/* widget.cpp */
2436
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2216
diff changeset
   537
int GetWidgetFromPos(const Window *w, int x, int y);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   538
6117
6507b2a7e71d (svn r8853) -Cleanup: doxygen changes. Correct forgotten c files to cpp files with the @file tag as well as a few general comments style
belugas
parents: 6024
diff changeset
   539
/* window.cpp */
5124
2ca62776430e (svn r7205) -Fix [FS#350, SF#1560913]: Window allocation and deletion messed with the actual window
Darkvater
parents: 5123
diff changeset
   540
extern Window *_z_windows[];
2ca62776430e (svn r7205) -Fix [FS#350, SF#1560913]: Window allocation and deletion messed with the actual window
Darkvater
parents: 5123
diff changeset
   541
extern Window **_last_z_window;
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   542
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   543
/** Iterate over all windows */
5124
2ca62776430e (svn r7205) -Fix [FS#350, SF#1560913]: Window allocation and deletion messed with the actual window
Darkvater
parents: 5123
diff changeset
   544
#define FOR_ALL_WINDOWS(wz) for (wz = _z_windows; wz != _last_z_window; wz++)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   545
9411
f54d5b3b3bf8 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 9407
diff changeset
   546
/**
10426
4a77f7049b5e (svn r14679) -Fix [FS#2431]: opening the OSK on the chatbox did disable map scrolling (with keyboard) until another window with editbox was opened and closed. Just "refcount" the open edit boxes instead of setting/clearing a bit when opening/closing a window.
rubidium
parents: 10238
diff changeset
   547
 * Disable scrolling of the main viewport when an input-window is active.
4a77f7049b5e (svn r14679) -Fix [FS#2431]: opening the OSK on the chatbox did disable map scrolling (with keyboard) until another window with editbox was opened and closed. Just "refcount" the open edit boxes instead of setting/clearing a bit when opening/closing a window.
rubidium
parents: 10238
diff changeset
   548
 * This contains the count of windows with a textbox in them.
9411
f54d5b3b3bf8 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 9407
diff changeset
   549
 */
f54d5b3b3bf8 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 9407
diff changeset
   550
extern byte _no_scroll;
f54d5b3b3bf8 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 9407
diff changeset
   551
8268
5027ad5e70a0 (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8264
diff changeset
   552
extern Point _cursorpos_drag_start;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   553
8268
5027ad5e70a0 (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8264
diff changeset
   554
extern int _scrollbar_start_pos;
5027ad5e70a0 (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8264
diff changeset
   555
extern int _scrollbar_size;
5027ad5e70a0 (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8264
diff changeset
   556
extern byte _scroller_click_timeout;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   557
8268
5027ad5e70a0 (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8264
diff changeset
   558
extern bool _scrolling_scrollbar;
5027ad5e70a0 (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8264
diff changeset
   559
extern bool _scrolling_viewport;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   560
8268
5027ad5e70a0 (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8264
diff changeset
   561
extern byte _special_mouse_mode;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   562
enum SpecialMouseMode {
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   563
	WSM_NONE     = 0,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   564
	WSM_DRAGDROP = 1,
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   565
	WSM_SIZING   = 2,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   566
	WSM_PRESIZE  = 3,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   567
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   568
8995
f6b859375e10 (svn r12790) -Codechange: code style fixes. Patch by Alberth.
rubidium
parents: 8969
diff changeset
   569
Window *GetCallbackWnd();
f6b859375e10 (svn r12790) -Codechange: code style fixes. Patch by Alberth.
rubidium
parents: 8969
diff changeset
   570
Window **FindWindowZPosition(const Window *w);
f6b859375e10 (svn r12790) -Codechange: code style fixes. Patch by Alberth.
rubidium
parents: 8969
diff changeset
   571
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   572
void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   573
5822
f71317de4ab6 (svn r8384) -Codechange: [GUI] instead of writing a resize button function for each window, a global ResizeButtons() is added
bjarni
parents: 5781
diff changeset
   574
void ResizeButtons(Window *w, byte left, byte right);
f71317de4ab6 (svn r8384) -Codechange: [GUI] instead of writing a resize button function for each window, a global ResizeButtons() is added
bjarni
parents: 5781
diff changeset
   575
9834
7474149531c1 (svn r13977) -Codechange: Let ResizeWindowForWidget() handle hidden (zero height or zero width) widgets.
peter1138
parents: 9781
diff changeset
   576
void ResizeWindowForWidget(Window *w, uint widget, int delta_x, int delta_y);
8418
afae92fe35f1 (svn r11988) -Codechange: Add a generic way of changing a widget's size and adjust the widgets around it to suit.
peter1138
parents: 8349
diff changeset
   577
9407
079a6bf07bae (svn r13318) -Codechange: move some functions from gui.h/misc_gui.cpp to window_gui.h/window.cpp because they belong there.
rubidium
parents: 9338
diff changeset
   578
void SetVScrollCount(Window *w, int num);
079a6bf07bae (svn r13318) -Codechange: move some functions from gui.h/misc_gui.cpp to window_gui.h/window.cpp because they belong there.
rubidium
parents: 9338
diff changeset
   579
void SetVScroll2Count(Window *w, int num);
079a6bf07bae (svn r13318) -Codechange: move some functions from gui.h/misc_gui.cpp to window_gui.h/window.cpp because they belong there.
rubidium
parents: 9338
diff changeset
   580
void SetHScrollCount(Window *w, int num);
079a6bf07bae (svn r13318) -Codechange: move some functions from gui.h/misc_gui.cpp to window_gui.h/window.cpp because they belong there.
rubidium
parents: 9338
diff changeset
   581
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   582
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   583
/**
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   584
 * Sets the enabled/disabled status of a widget.
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   585
 * By default, widgets are enabled.
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   586
 * On certain conditions, they have to be disabled.
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   587
 * @param widget_index index of this widget in the window
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   588
 * @param disab_stat status to use ie: disabled = true, enabled = false
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   589
 */
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   590
inline void Window::SetWidgetDisabledState(byte widget_index, bool disab_stat)
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   591
{
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   592
	assert(widget_index < this->widget_count);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   593
	SB(this->widget[widget_index].display_flags, WIDG_DISABLED, 1, !!disab_stat);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   594
}
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   595
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   596
/**
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   597
 * Sets a widget to disabled.
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   598
 * @param widget_index index of this widget in the window
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   599
 */
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   600
inline void Window::DisableWidget(byte widget_index)
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   601
{
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   602
	SetWidgetDisabledState(widget_index, true);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   603
}
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   604
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   605
/**
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   606
 * Sets a widget to Enabled.
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   607
 * @param widget_index index of this widget in the window
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   608
 */
7995
36f4cc1839fb (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 7993
diff changeset
   609
inline void Window::EnableWidget(byte widget_index)
36f4cc1839fb (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 7993
diff changeset
   610
{
36f4cc1839fb (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 7993
diff changeset
   611
	SetWidgetDisabledState(widget_index, false);
36f4cc1839fb (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 7993
diff changeset
   612
}
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   613
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   614
/**
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   615
 * Gets the enabled/disabled status of a widget.
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   616
 * @param widget_index index of this widget in the window
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   617
 * @return status of the widget ie: disabled = true, enabled = false
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   618
 */
7995
36f4cc1839fb (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 7993
diff changeset
   619
inline bool Window::IsWidgetDisabled(byte widget_index) const
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   620
{
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   621
	assert(widget_index < this->widget_count);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   622
	return HasBit(this->widget[widget_index].display_flags, WIDG_DISABLED);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   623
}
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   624
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   625
/**
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   626
 * Sets the hidden/shown status of a widget.
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   627
 * By default, widgets are visible.
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   628
 * On certain conditions, they have to be hidden.
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   629
 * @param widget_index index of this widget in the window
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   630
 * @param hidden_stat status to use ie. hidden = true, visible = false
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   631
 */
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   632
inline void Window::SetWidgetHiddenState(byte widget_index, bool hidden_stat)
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   633
{
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   634
	assert(widget_index < this->widget_count);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   635
	SB(this->widget[widget_index].display_flags, WIDG_HIDDEN, 1, !!hidden_stat);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   636
}
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   637
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   638
/**
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   639
 * Sets a widget hidden.
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   640
 * @param widget_index index of this widget in the window
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   641
 */
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   642
inline void Window::HideWidget(byte widget_index)
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   643
{
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   644
	SetWidgetHiddenState(widget_index, true);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   645
}
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   646
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   647
/**
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   648
 * Sets a widget visible.
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   649
 * @param widget_index index of this widget in the window
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   650
 */
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   651
inline void Window::ShowWidget(byte widget_index)
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   652
{
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   653
	SetWidgetHiddenState(widget_index, false);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   654
}
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   655
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   656
/**
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   657
 * Gets the visibility of a widget.
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   658
 * @param widget_index index of this widget in the window
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   659
 * @return status of the widget ie: hidden = true, visible = false
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   660
 */
7995
36f4cc1839fb (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 7993
diff changeset
   661
inline bool Window::IsWidgetHidden(byte widget_index) const
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   662
{
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   663
	assert(widget_index < this->widget_count);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   664
	return HasBit(this->widget[widget_index].display_flags, WIDG_HIDDEN);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   665
}
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   666
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   667
/**
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   668
 * Sets the lowered/raised status of a widget.
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   669
 * @param widget_index index of this widget in the window
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   670
 * @param lowered_stat status to use ie: lowered = true, raised = false
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   671
 */
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   672
inline void Window::SetWidgetLoweredState(byte widget_index, bool lowered_stat)
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   673
{
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   674
	assert(widget_index < this->widget_count);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   675
	SB(this->widget[widget_index].display_flags, WIDG_LOWERED, 1, !!lowered_stat);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   676
}
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   677
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   678
/**
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   679
 * Invert the lowered/raised  status of a widget.
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   680
 * @param widget_index index of this widget in the window
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   681
 */
7996
809895d51e05 (svn r11554) -Codechange: be more consistent with the naming of the widget functions.
rubidium
parents: 7995
diff changeset
   682
inline void Window::ToggleWidgetLoweredState(byte widget_index)
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   683
{
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   684
	assert(widget_index < this->widget_count);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   685
	ToggleBit(this->widget[widget_index].display_flags, WIDG_LOWERED);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   686
}
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   687
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   688
/**
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   689
 * Marks a widget as lowered.
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   690
 * @param widget_index index of this widget in the window
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   691
 */
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   692
inline void Window::LowerWidget(byte widget_index)
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   693
{
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   694
	SetWidgetLoweredState(widget_index, true);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   695
}
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   696
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   697
/**
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   698
 * Marks a widget as raised.
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   699
 * @param widget_index index of this widget in the window
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   700
 */
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   701
inline void Window::RaiseWidget(byte widget_index)
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   702
{
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   703
	SetWidgetLoweredState(widget_index, false);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   704
}
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   705
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   706
/**
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   707
 * Gets the lowered state of a widget.
10238
5076964d81a1 (svn r14466) -Doc: remove some obsolete parameters, fix a few parameter names in comments and add a little more doxygen documentation.
rubidium
parents: 10208
diff changeset
   708
 * @param widget_index index of this widget in the window
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   709
 * @return status of the widget ie: lowered = true, raised= false
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   710
 */
7995
36f4cc1839fb (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 7993
diff changeset
   711
inline bool Window::IsWidgetLowered(byte widget_index) const
7993
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   712
{
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   713
	assert(widget_index < this->widget_count);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   714
	return HasBit(this->widget[widget_index].display_flags, WIDG_LOWERED);
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   715
}
8776e72bf3da (svn r11551) -Codechange: Introduction of widget control members on struct Window. These "new" members have the exact same functionalities as their pure functions "genitors"
belugas
parents: 7932
diff changeset
   716
9660
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   717
/**
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   718
 * Align widgets a and b next to each other.
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   719
 * @param widget_index_a  the left widget
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   720
 * @param widget_index_b  the right widget (fixed)
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   721
 */
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   722
inline void Window::AlignWidgetRight(byte widget_index_a, byte widget_index_b)
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   723
{
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   724
	assert(widget_index_a < this->widget_count);
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   725
	assert(widget_index_b < this->widget_count);
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   726
	int w = this->widget[widget_index_a].right - this->widget[widget_index_a].left;
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   727
	this->widget[widget_index_a].right = this->widget[widget_index_b].left - 1;
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   728
	this->widget[widget_index_a].left  = this->widget[widget_index_a].right - w;
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   729
}
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   730
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   731
/**
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   732
 * Get the width of a widget.
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   733
 * @param widget_index  the widget
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   734
 * @return width of the widget
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   735
 */
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   736
inline int Window::GetWidgetWidth(byte widget_index) const
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   737
{
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   738
	assert(widget_index < this->widget_count);
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   739
	return this->widget[widget_index].right - this->widget[widget_index].left + 1;
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   740
}
2bc15fc4dcf6 (svn r13732) -Feature: add a few extra columns with information to the server list. Patch by Pegasus.
rubidium
parents: 9411
diff changeset
   741
8106
e6790dd9e750 (svn r11667) -Codechange: split window.h into a header that defines some 'global' window related types, on that defined 'global' window functions and one that defines functions and types only used by *_gui.cpps.
rubidium
parents: 8102
diff changeset
   742
#endif /* WINDOW_GUI_H */