src/window_gui.h
author Tero Marttila <terom@fixme.fi>
Fri, 18 Jul 2008 22:41:08 +0300
changeset 11177 6d9a43c48924
parent 10772 24d449dd2907
permissions -rw-r--r--
set the GRFConfig's next ptr to NULL
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2159
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2159
diff changeset
     2
8602
9e75e594a068 (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: 8598
diff changeset
     3
/** @file window_gui.h Functions, definitions and such used only by the GUI. */
6443
b8f06d8eb7be (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: 6350
diff changeset
     4
8602
9e75e594a068 (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: 8598
diff changeset
     5
#ifndef WINDOW_GUI_H
9e75e594a068 (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: 8598
diff changeset
     6
#define WINDOW_GUI_H
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
8718
1f536d980531 (svn r11785) -Codechange: remove some unneeded includes.
rubidium
parents: 8710
diff changeset
     8
#include "core/bitmath_func.hpp"
10445
2dd7d9d0a957 (svn r12987) -Codechange: split viewport and tile selection.
rubidium
parents: 10435
diff changeset
     9
#include "core/geometry_type.hpp"
8635
3bbb6f87fced (svn r11701) -Codechange: removal unnecessary inclusions of map.h (and split map.h).
rubidium
parents: 8609
diff changeset
    10
#include "vehicle_type.h"
8720
4e60c30e2006 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 8719
diff changeset
    11
#include "viewport_type.h"
8750
fdd6054e7bae (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents: 8720
diff changeset
    12
#include "player_type.h"
8760
ce0891c412ce (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8750
diff changeset
    13
#include "strings_type.h"
10164
3ff9e65f3d49 (svn r12695) -Codechange: only allocate window structs when needed. Based on a patch by Alberth.
rubidium
parents: 10162
diff changeset
    14
#include "core/alloc_type.hpp"
10445
2dd7d9d0a957 (svn r12987) -Codechange: split viewport and tile selection.
rubidium
parents: 10435
diff changeset
    15
#include "window_type.h"
2dd7d9d0a957 (svn r12987) -Codechange: split viewport and tile selection.
rubidium
parents: 10435
diff changeset
    16
#include "tile_type.h"
4299
b86602eaaff1 (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
    17
8564
f4a063368ba9 (svn r11629) -Fix [FS#1527]: many viewports could crash the scenario editor.
rubidium
parents: 8532
diff changeset
    18
/**
f4a063368ba9 (svn r11629) -Fix [FS#1527]: many viewports could crash the scenario editor.
rubidium
parents: 8532
diff changeset
    19
 * The maximum number of windows that can be opened.
f4a063368ba9 (svn r11629) -Fix [FS#1527]: many viewports could crash the scenario editor.
rubidium
parents: 8532
diff changeset
    20
 */
f4a063368ba9 (svn r11629) -Fix [FS#1527]: many viewports could crash the scenario editor.
rubidium
parents: 8532
diff changeset
    21
static const int MAX_NUMBER_OF_WINDOWS = 25;
f4a063368ba9 (svn r11629) -Fix [FS#1527]: many viewports could crash the scenario editor.
rubidium
parents: 8532
diff changeset
    22
867
581154a08a78 (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:
581154a08a78 (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
581154a08a78 (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
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    26
     to resize itself.
581154a08a78 (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.
581154a08a78 (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
581154a08a78 (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
581154a08a78 (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
581154a08a78 (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,
581154a08a78 (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.
581154a08a78 (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
581154a08a78 (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
581154a08a78 (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
581154a08a78 (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
581154a08a78 (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?
581154a08a78 (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
581154a08a78 (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
581154a08a78 (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
581154a08a78 (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:
581154a08a78 (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;
581154a08a78 (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.
581154a08a78 (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
581154a08a78 (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
10229
fba3f9fa44d7 (svn r12761) -Codechange: lots of minor whitespace coding style fixes around operators.
rubidium
parents: 10217
diff changeset
    46
    AFTER window - creation, with:
867
581154a08a78 (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.
581154a08a78 (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 */
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    49
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    50
enum ResizeFlag {
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6443
diff changeset
    51
	RESIZE_NONE   = 0,  ///< no resize required
867
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    52
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6443
diff changeset
    53
	RESIZE_LEFT   = 1,  ///< left resize flag
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6443
diff changeset
    54
	RESIZE_RIGHT  = 2,  ///< rigth resize flag
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6443
diff changeset
    55
	RESIZE_TOP    = 4,  ///< top resize flag
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6443
diff changeset
    56
	RESIZE_BOTTOM = 8,  ///< bottom resize flag
867
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    57
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6443
diff changeset
    58
	RESIZE_LR     = RESIZE_LEFT  | RESIZE_RIGHT,   ///<  combination of left and right resize flags
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6443
diff changeset
    59
	RESIZE_RB     = RESIZE_RIGHT | RESIZE_BOTTOM,  ///<  combination of right and bottom resize flags
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6443
diff changeset
    60
	RESIZE_TB     = RESIZE_TOP   | RESIZE_BOTTOM,  ///<  combination of top and bottom resize flags
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6443
diff changeset
    61
	RESIZE_LRB    = RESIZE_LEFT  | RESIZE_RIGHT  | RESIZE_BOTTOM, ///< combination of left, right and bottom resize flags
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6443
diff changeset
    62
	RESIZE_LRTB   = RESIZE_LEFT  | RESIZE_RIGHT  | RESIZE_TOP | RESIZE_BOTTOM,  ///<  combination of all resize flags
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6443
diff changeset
    63
	RESIZE_RTB    = RESIZE_RIGHT | RESIZE_TOP    | RESIZE_BOTTOM, ///<  combination of right, top and bottom resize flag
4749
9490e643f23f (svn r6661) Feature: Windows are not restricted to 32 widget items anymore.
belugas
parents: 4739
diff changeset
    64
9490e643f23f (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
9490e643f23f (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.
9490e643f23f (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
9490e643f23f (svn r6661) Feature: Windows are not restricted to 32 widget items anymore.
belugas
parents: 4739
diff changeset
    68
	 * Enabled, visible or unclicked widgets*/
6443
b8f06d8eb7be (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: 6350
diff changeset
    69
	WIDG_DISABLED = 4,  ///< widget is greyed out, not available
b8f06d8eb7be (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: 6350
diff changeset
    70
	WIDG_HIDDEN   = 5,  ///< widget is made invisible
b8f06d8eb7be (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: 6350
diff changeset
    71
	WIDG_LOWERED  = 6,  ///< widget is paint lowered, a pressed button in fact
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    72
};
867
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    73
4755
4a3564952554 (svn r6669) -Add: vararg functions to set hidden/disabled/lowered state of multiple widgets in one call
glx
parents: 4749
diff changeset
    74
enum {
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6443
diff changeset
    75
	WIDGET_LIST_END = -1, ///< indicate the end of widgets' list for vararg functions
4755
4a3564952554 (svn r6669) -Add: vararg functions to set hidden/disabled/lowered state of multiple widgets in one call
glx
parents: 4749
diff changeset
    76
};
4a3564952554 (svn r6669) -Add: vararg functions to set hidden/disabled/lowered state of multiple widgets in one call
glx
parents: 4749
diff changeset
    77
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
    78
/**
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
    79
 * Window widget data structure
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
    80
 */
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    81
struct Widget {
6443
b8f06d8eb7be (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: 6350
diff changeset
    82
	byte type;                        ///< Widget type, see WindowWidgetTypes
b8f06d8eb7be (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: 6350
diff changeset
    83
	byte display_flags;               ///< Resize direction, alignment, etc. during resizing, see ResizeFlags
4547
9786a24c4102 (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
6224
5eec2dfd13af (svn r8662) -Fix r8661: don't try to put negative values in unsigned vars
bjarni
parents: 6195
diff changeset
    85
	int16 left, right, top, bottom;   ///< The position offsets inside the window
4547
9786a24c4102 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
Darkvater
parents: 4542
diff changeset
    86
	uint16 data;                      ///< The String/Image or special code (list-matrixes) of a widget
9786a24c4102 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
Darkvater
parents: 4542
diff changeset
    87
	StringID tooltips;                ///< Tooltips that are shown when rightclicking on a widget
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    88
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    89
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
    90
/**
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
    91
 * Flags to describe the look of the frame
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
    92
 */
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    93
enum FrameFlags {
8504
a258f7640c56 (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 8492
diff changeset
    94
	FR_NONE         =  0,
a258f7640c56 (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 8492
diff changeset
    95
	FR_TRANSPARENT  =  1 << 0,  ///< Makes the background transparent if set
a258f7640c56 (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 8492
diff changeset
    96
	FR_BORDERONLY   =  1 << 4,  ///< Draw border only, no background
a258f7640c56 (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 8492
diff changeset
    97
	FR_LOWERED      =  1 << 5,  ///< If set the frame is lowered and the background color brighter (ie. buttons when pressed)
a258f7640c56 (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 8492
diff changeset
    98
	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)
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    99
};
4437
d06bb548e48d (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
   100
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   101
DECLARE_ENUM_AS_BIT_SET(FrameFlags);
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   102
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   103
/* wiget.cpp */
4437
d06bb548e48d (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
   104
void DrawFrameRect(int left, int top, int right, int bottom, int color, FrameFlags flags);
1938
21bd6ef5f85e (svn r2444) - CodeChange: Add an enum for demagicifying the values of the 'flags' parameter of DrawFrameRect(). (_Abraxa_)
hackykid
parents: 1648
diff changeset
   105
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   106
/**
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   107
 * High level window description
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   108
 */
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   109
struct WindowDesc {
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   110
	int16 left;             ///< Prefered x position of left edge of the window, @see WindowDefaultPosition()
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   111
	int16 top;              ///< Prefered y position of the top of the window, @see WindowDefaultPosition()
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   112
	int16 minimum_width;    ///< Minimal width of the window
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   113
	int16 minimum_height;   ///< Minimal height of the window
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   114
	int16 default_width;    ///< Prefered initial width of the window
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   115
	int16 default_height;   ///< Prefered initial height of the window
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   116
	WindowClass cls;        ///< Class of the window, @see WindowClass
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   117
	WindowClass parent_cls; ///< Class of the parent window, @see WindowClass
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   118
	uint32 flags;           ///< Flags, @see WindowDefaultFlags
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   119
	const Widget *widgets;  ///< List of widgets with their position and size for the window
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   120
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   121
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   122
/**
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   123
 * Window default widget/window handling flags
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   124
 */
5664
dbbf4f842a00 (svn r7616) -Cleanup:
Darkvater
parents: 5268
diff changeset
   125
enum WindowDefaultFlag {
8504
a258f7640c56 (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 8492
diff changeset
   126
	WDF_STD_TOOLTIPS    =   1 << 0, ///< use standard routine when displaying tooltips
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   127
	WDF_DEF_WIDGET      =   1 << 1, ///< Default widget control for some widgets in the on click event, @see DispatchLeftClickEvent()
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   128
	WDF_STD_BTN         =   1 << 2, ///< Default handling for close and titlebar widgets (widget no 0 and 1)
8515
d0401d967e99 (svn r11579) -Revert(r11578): some cases of key propagation are not handled correctly.
belugas
parents: 8514
diff changeset
   129
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   130
	WDF_UNCLICK_BUTTONS =   1 << 4, ///< Unclick buttons when the window event times out
8504
a258f7640c56 (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 8492
diff changeset
   131
	WDF_STICKY_BUTTON   =   1 << 5, ///< Set window to sticky mode; they are not closed unless closed with 'X' (widget 2)
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   132
	WDF_RESIZABLE       =   1 << 6, ///< Window can be resized
8504
a258f7640c56 (svn r11568) -Codechange: Use bit shifts instead of values for flags. It helps readability a little bit.
belugas
parents: 8492
diff changeset
   133
	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
   134
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   135
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   136
/**
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   137
 * Special values for 'left' and 'top' to cause a specific placement
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   138
 */
5664
dbbf4f842a00 (svn r7616) -Cleanup:
Darkvater
parents: 5268
diff changeset
   139
enum WindowDefaultPosition {
5072
df5bde83a4bc (svn r7130) -Codechange: Handle the positioning of windows through the desc->left/top settings with
Darkvater
parents: 5071
diff changeset
   140
	WDP_AUTO      = -1, ///< Find a place automatically
df5bde83a4bc (svn r7130) -Codechange: Handle the positioning of windows through the desc->left/top settings with
Darkvater
parents: 5071
diff changeset
   141
	WDP_CENTER    = -2, ///< Center the window (left/right or top/bottom)
df5bde83a4bc (svn r7130) -Codechange: Handle the positioning of windows through the desc->left/top settings with
Darkvater
parents: 5071
diff changeset
   142
	WDP_ALIGN_TBR = -3, ///< Align the right side of the window with the right side of the main toolbar
df5bde83a4bc (svn r7130) -Codechange: Handle the positioning of windows through the desc->left/top settings with
Darkvater
parents: 5071
diff changeset
   143
	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
   144
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   145
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   146
/**
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   147
 * Scrollbar data structure
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   148
 */
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   149
struct Scrollbar {
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   150
	uint16 count;  ///< Number of elements in the list
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   151
	uint16 cap;    ///< Number of visible elements of the scroll bar
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   152
	uint16 pos;
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   153
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   154
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   155
/**
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   156
 * Data structure for resizing a window
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   157
 */
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   158
struct ResizeInfo {
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   159
	uint width;       ///< Minimum allowed width of the window
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   160
	uint height;      ///< Minimum allowed height of the window
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   161
	uint step_width;  ///< Step-size of width resize changes
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   162
	uint step_height; ///< Step-size of height resize changes
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   163
};
867
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   164
10595
7957c71b0dfe (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 10594
diff changeset
   165
enum SortButtonState {
7957c71b0dfe (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 10594
diff changeset
   166
	SBS_OFF,
7957c71b0dfe (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 10594
diff changeset
   167
	SBS_DOWN,
7957c71b0dfe (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 10594
diff changeset
   168
	SBS_UP,
7957c71b0dfe (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 10594
diff changeset
   169
};
7957c71b0dfe (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 10594
diff changeset
   170
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   171
/**
10504
7c80c8aaa1df (svn r13047) -Codechange: remove vp_d
glx
parents: 10502
diff changeset
   172
 * Data structure for a window viewport
7c80c8aaa1df (svn r13047) -Codechange: remove vp_d
glx
parents: 10502
diff changeset
   173
 */
7c80c8aaa1df (svn r13047) -Codechange: remove vp_d
glx
parents: 10502
diff changeset
   174
struct ViewportData : ViewPort {
7c80c8aaa1df (svn r13047) -Codechange: remove vp_d
glx
parents: 10502
diff changeset
   175
	VehicleID follow_vehicle;
7c80c8aaa1df (svn r13047) -Codechange: remove vp_d
glx
parents: 10502
diff changeset
   176
	int32 scrollpos_x;
7c80c8aaa1df (svn r13047) -Codechange: remove vp_d
glx
parents: 10502
diff changeset
   177
	int32 scrollpos_y;
7c80c8aaa1df (svn r13047) -Codechange: remove vp_d
glx
parents: 10502
diff changeset
   178
	int32 dest_scrollpos_x;
7c80c8aaa1df (svn r13047) -Codechange: remove vp_d
glx
parents: 10502
diff changeset
   179
	int32 dest_scrollpos_y;
7c80c8aaa1df (svn r13047) -Codechange: remove vp_d
glx
parents: 10502
diff changeset
   180
};
7c80c8aaa1df (svn r13047) -Codechange: remove vp_d
glx
parents: 10502
diff changeset
   181
10589
2998e6072c03 (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: 10586
diff changeset
   182
/**
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   183
 * Data structure for an opened window
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   184
 */
10164
3ff9e65f3d49 (svn r12695) -Codechange: only allocate window structs when needed. Based on a patch by Alberth.
rubidium
parents: 10162
diff changeset
   185
struct Window : ZeroedMemoryAllocator {
10607
1ab30cead125 (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: 10597
diff changeset
   186
	enum EventState {
1ab30cead125 (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: 10597
diff changeset
   187
		ES_HANDLED,
1ab30cead125 (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: 10597
diff changeset
   188
		ES_NOT_HANDLED,
1ab30cead125 (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: 10597
diff changeset
   189
	};
1ab30cead125 (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: 10597
diff changeset
   190
10461
48556aee54da (svn r13004) -Codechange: replace AllocateWindow and AllocateWindowDesc with a Window constructor.
rubidium
parents: 10445
diff changeset
   191
protected:
10498
f198d0a1aab7 (svn r13041) -Fix: calling a virtual function on a not fully constructed object is bound to cause errors.
rubidium
parents: 10488
diff changeset
   192
	void Initialize(int x, int y, int min_width, int min_height,
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   193
			WindowClass cls, const Widget *widget, int window_number);
10498
f198d0a1aab7 (svn r13041) -Fix: calling a virtual function on a not fully constructed object is bound to cause errors.
rubidium
parents: 10488
diff changeset
   194
	void FindWindowPlacementAndResize(int def_width, int def_height);
f198d0a1aab7 (svn r13041) -Fix: calling a virtual function on a not fully constructed object is bound to cause errors.
rubidium
parents: 10488
diff changeset
   195
	void FindWindowPlacementAndResize(const WindowDesc *desc);
10461
48556aee54da (svn r13004) -Codechange: replace AllocateWindow and AllocateWindowDesc with a Window constructor.
rubidium
parents: 10445
diff changeset
   196
10399
79a272c88359 (svn r12941) -Codechange: don't access wndproc directly. Patch by Alberth.
rubidium
parents: 10258
diff changeset
   197
public:
10625
3c1f6a26db71 (svn r13169) -Codechange: remove a (now) unneeded parameter of one of the Window constructors.
rubidium
parents: 10616
diff changeset
   198
	Window(int x, int y, int width, int height, WindowClass cls, const Widget *widget);
10525
da5bc725cda4 (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: 10508
diff changeset
   199
	Window(const WindowDesc *desc, WindowNumber number = 0);
10461
48556aee54da (svn r13004) -Codechange: replace AllocateWindow and AllocateWindowDesc with a Window constructor.
rubidium
parents: 10445
diff changeset
   200
10433
cca9f7948fe5 (svn r12975) -Codechange: replace DeleteWindow(w) with delete w.
rubidium
parents: 10399
diff changeset
   201
	virtual ~Window();
10399
79a272c88359 (svn r12941) -Codechange: don't access wndproc directly. Patch by Alberth.
rubidium
parents: 10258
diff changeset
   202
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   203
	uint16 flags4;              ///< Window flags, @see WindowFlags
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   204
	WindowClass window_class;   ///< Window class
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   205
	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
   206
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   207
	int left;   ///< x position of left edge of the window
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   208
	int top;    ///< y position of top edge of the window
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   209
	int width;  ///< width of the window (number of pixels to the right in x direction)
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   210
	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
   211
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   212
	Scrollbar hscroll;  ///< Horizontal scroll bar
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   213
	Scrollbar vscroll;  ///< First vertical scroll bar
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   214
	Scrollbar vscroll2; ///< Second vertical scroll bar
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   215
	ResizeInfo resize;  ///< Resize information
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   216
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   217
	byte caption_color; ///< Background color of the window caption, contains PlayerID
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   218
10504
7c80c8aaa1df (svn r13047) -Codechange: remove vp_d
glx
parents: 10502
diff changeset
   219
	ViewportData *viewport;      ///< Pointer to viewport data, if present
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   220
	Widget *widget;        ///< Widgets of the window
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   221
	uint widget_count;     ///< Number of widgets of the window
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   222
	uint32 desc_flags;     ///< Window/widgets default flags setting, @see WindowDefaultFlag
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   223
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   224
	Window *parent;        ///< Parent window
8489
1e2a5fdb152f (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: 8428
diff changeset
   225
8531
e87a51f162e2 (svn r11595) -Codechange: add a new member to Window struct, based on its function counterpart HandleButtonClick.
belugas
parents: 8528
diff changeset
   226
	void HandleButtonClick(byte widget);
e87a51f162e2 (svn r11595) -Codechange: add a new member to Window struct, based on its function counterpart HandleButtonClick.
belugas
parents: 8528
diff changeset
   227
8489
1e2a5fdb152f (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: 8428
diff changeset
   228
	void SetWidgetDisabledState(byte widget_index, bool disab_stat);
1e2a5fdb152f (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: 8428
diff changeset
   229
	void DisableWidget(byte widget_index);
1e2a5fdb152f (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: 8428
diff changeset
   230
	void EnableWidget(byte widget_index);
8491
804b3117cc36 (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 8489
diff changeset
   231
	bool IsWidgetDisabled(byte widget_index) const;
8489
1e2a5fdb152f (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: 8428
diff changeset
   232
	void SetWidgetHiddenState(byte widget_index, bool hidden_stat);
1e2a5fdb152f (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: 8428
diff changeset
   233
	void HideWidget(byte widget_index);
1e2a5fdb152f (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: 8428
diff changeset
   234
	void ShowWidget(byte widget_index);
8491
804b3117cc36 (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 8489
diff changeset
   235
	bool IsWidgetHidden(byte widget_index) const;
8489
1e2a5fdb152f (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: 8428
diff changeset
   236
	void SetWidgetLoweredState(byte widget_index, bool lowered_stat);
8492
d61f7a733d19 (svn r11554) -Codechange: be more consistent with the naming of the widget functions.
rubidium
parents: 8491
diff changeset
   237
	void ToggleWidgetLoweredState(byte widget_index);
8489
1e2a5fdb152f (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: 8428
diff changeset
   238
	void LowerWidget(byte widget_index);
1e2a5fdb152f (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: 8428
diff changeset
   239
	void RaiseWidget(byte widget_index);
8491
804b3117cc36 (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 8489
diff changeset
   240
	bool IsWidgetLowered(byte widget_index) const;
8489
1e2a5fdb152f (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: 8428
diff changeset
   241
1e2a5fdb152f (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: 8428
diff changeset
   242
	void RaiseButtons();
1e2a5fdb152f (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: 8428
diff changeset
   243
	void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets, ...);
1e2a5fdb152f (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: 8428
diff changeset
   244
	void CDECL SetWidgetsHiddenState(bool hidden_stat, int widgets, ...);
1e2a5fdb152f (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: 8428
diff changeset
   245
	void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets, ...);
8522
a1c44311e09e (svn r11586) -Fix: make another widget 'accessor' function const when it should be const.
glx
parents: 8515
diff changeset
   246
	void InvalidateWidget(byte widget_index) const;
10399
79a272c88359 (svn r12941) -Codechange: don't access wndproc directly. Patch by Alberth.
rubidium
parents: 10258
diff changeset
   247
10595
7957c71b0dfe (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 10594
diff changeset
   248
	void DrawWidgets() const;
7957c71b0dfe (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 10594
diff changeset
   249
	void DrawViewport() const;
7957c71b0dfe (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 10594
diff changeset
   250
	void DrawSortButtonState(int widget, SortButtonState state) const;
7957c71b0dfe (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 10594
diff changeset
   251
10433
cca9f7948fe5 (svn r12975) -Codechange: replace DeleteWindow(w) with delete w.
rubidium
parents: 10399
diff changeset
   252
	void SetDirty() const;
cca9f7948fe5 (svn r12975) -Codechange: replace DeleteWindow(w) with delete w.
rubidium
parents: 10399
diff changeset
   253
10486
247d43dfa6f1 (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: 10485
diff changeset
   254
	/*** Event handling ***/
247d43dfa6f1 (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: 10485
diff changeset
   255
247d43dfa6f1 (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: 10485
diff changeset
   256
	/**
247d43dfa6f1 (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: 10485
diff changeset
   257
	 * This window is currently being repainted.
247d43dfa6f1 (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: 10485
diff changeset
   258
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   259
	virtual void OnPaint() {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   260
247d43dfa6f1 (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: 10485
diff changeset
   261
247d43dfa6f1 (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: 10485
diff changeset
   262
	/**
247d43dfa6f1 (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: 10485
diff changeset
   263
	 * A key has been pressed.
247d43dfa6f1 (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: 10485
diff changeset
   264
	 * @param key     the Unicode value of the key.
247d43dfa6f1 (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: 10485
diff changeset
   265
	 * @param keycode the untranslated key code including shift state.
10607
1ab30cead125 (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: 10597
diff changeset
   266
	 * @return ES_HANDLED if the key press has been handled and no other
10486
247d43dfa6f1 (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: 10485
diff changeset
   267
	 *         window should receive the event.
247d43dfa6f1 (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: 10485
diff changeset
   268
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   269
	virtual EventState OnKeyPress(uint16 key, uint16 keycode) { return ES_NOT_HANDLED; }
10486
247d43dfa6f1 (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: 10485
diff changeset
   270
247d43dfa6f1 (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: 10485
diff changeset
   271
	/**
247d43dfa6f1 (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: 10485
diff changeset
   272
	 * The state of the control key has changed
10607
1ab30cead125 (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: 10597
diff changeset
   273
	 * @return ES_HANDLED if the change has been handled and no other
10486
247d43dfa6f1 (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: 10485
diff changeset
   274
	 *         window should receive the event.
247d43dfa6f1 (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: 10485
diff changeset
   275
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   276
	virtual EventState OnCTRLStateChange() { return ES_NOT_HANDLED; }
10486
247d43dfa6f1 (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: 10485
diff changeset
   277
247d43dfa6f1 (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: 10485
diff changeset
   278
247d43dfa6f1 (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: 10485
diff changeset
   279
	/**
247d43dfa6f1 (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: 10485
diff changeset
   280
	 * A click with the left mouse button has been made on the window.
247d43dfa6f1 (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: 10485
diff changeset
   281
	 * @param pt     the point inside the window that has been clicked.
247d43dfa6f1 (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: 10485
diff changeset
   282
	 * @param widget the clicked widget.
247d43dfa6f1 (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: 10485
diff changeset
   283
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   284
	virtual void OnClick(Point pt, int widget) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   285
247d43dfa6f1 (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: 10485
diff changeset
   286
	/**
247d43dfa6f1 (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: 10485
diff changeset
   287
	 * A double click with the left mouse button has been made on the window.
247d43dfa6f1 (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: 10485
diff changeset
   288
	 * @param pt     the point inside the window that has been clicked.
247d43dfa6f1 (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: 10485
diff changeset
   289
	 * @param widget the clicked widget.
247d43dfa6f1 (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: 10485
diff changeset
   290
	 */
10586
ddbc8067d186 (svn r13130) -Codechange: remove some of the (old) WindowEvent wrapper functions/enums/variables as they are not used anymore.
rubidium
parents: 10585
diff changeset
   291
	virtual void OnDoubleClick(Point pt, int widget) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   292
247d43dfa6f1 (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: 10485
diff changeset
   293
	/**
247d43dfa6f1 (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: 10485
diff changeset
   294
	 * A click with the right mouse button has been made on the window.
247d43dfa6f1 (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: 10485
diff changeset
   295
	 * @param pt     the point inside the window that has been clicked.
247d43dfa6f1 (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: 10485
diff changeset
   296
	 * @param widget the clicked widget.
247d43dfa6f1 (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: 10485
diff changeset
   297
	 */
10586
ddbc8067d186 (svn r13130) -Codechange: remove some of the (old) WindowEvent wrapper functions/enums/variables as they are not used anymore.
rubidium
parents: 10585
diff changeset
   298
	virtual void OnRightClick(Point pt, int widget) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   299
247d43dfa6f1 (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: 10485
diff changeset
   300
	/**
247d43dfa6f1 (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: 10485
diff changeset
   301
	 * A dragged 'object' has been released.
247d43dfa6f1 (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: 10485
diff changeset
   302
	 * @param pt     the point inside the window where the release took place.
247d43dfa6f1 (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: 10485
diff changeset
   303
	 * @param widget the widget where the release took place.
247d43dfa6f1 (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: 10485
diff changeset
   304
	 */
10586
ddbc8067d186 (svn r13130) -Codechange: remove some of the (old) WindowEvent wrapper functions/enums/variables as they are not used anymore.
rubidium
parents: 10585
diff changeset
   305
	virtual void OnDragDrop(Point pt, int widget) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   306
247d43dfa6f1 (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: 10485
diff changeset
   307
	/**
247d43dfa6f1 (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: 10485
diff changeset
   308
	 * Handle the request for (viewport) scrolling.
247d43dfa6f1 (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: 10485
diff changeset
   309
	 * @param delta the amount the viewport must be scrolled.
247d43dfa6f1 (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: 10485
diff changeset
   310
	 */
10586
ddbc8067d186 (svn r13130) -Codechange: remove some of the (old) WindowEvent wrapper functions/enums/variables as they are not used anymore.
rubidium
parents: 10585
diff changeset
   311
	virtual void OnScroll(Point delta) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   312
247d43dfa6f1 (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: 10485
diff changeset
   313
	/**
247d43dfa6f1 (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: 10485
diff changeset
   314
	 * The mouse is currently moving over the window or has just moved outside
247d43dfa6f1 (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: 10485
diff changeset
   315
	 * of the window. In the latter case pt is (-1, -1).
247d43dfa6f1 (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: 10485
diff changeset
   316
	 * @param pt     the point inside the window that the mouse hovers over.
247d43dfa6f1 (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: 10485
diff changeset
   317
	 * @param widget the widget the mouse hovers over.
247d43dfa6f1 (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: 10485
diff changeset
   318
	 */
10586
ddbc8067d186 (svn r13130) -Codechange: remove some of the (old) WindowEvent wrapper functions/enums/variables as they are not used anymore.
rubidium
parents: 10585
diff changeset
   319
	virtual void OnMouseOver(Point pt, int widget) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   320
247d43dfa6f1 (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: 10485
diff changeset
   321
	/**
247d43dfa6f1 (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: 10485
diff changeset
   322
	 * The mouse wheel has been turned.
247d43dfa6f1 (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: 10485
diff changeset
   323
	 * @param wheel the amount of movement of the mouse wheel.
247d43dfa6f1 (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: 10485
diff changeset
   324
	 */
10586
ddbc8067d186 (svn r13130) -Codechange: remove some of the (old) WindowEvent wrapper functions/enums/variables as they are not used anymore.
rubidium
parents: 10585
diff changeset
   325
	virtual void OnMouseWheel(int wheel) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   326
247d43dfa6f1 (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: 10485
diff changeset
   327
247d43dfa6f1 (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: 10485
diff changeset
   328
	/**
247d43dfa6f1 (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: 10485
diff changeset
   329
	 * Called for every mouse loop run, which is at least once per (game) tick.
247d43dfa6f1 (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: 10485
diff changeset
   330
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   331
	virtual void OnMouseLoop() {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   332
247d43dfa6f1 (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: 10485
diff changeset
   333
	/**
247d43dfa6f1 (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: 10485
diff changeset
   334
	 * Called once per (game) tick.
247d43dfa6f1 (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: 10485
diff changeset
   335
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   336
	virtual void OnTick() {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   337
247d43dfa6f1 (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: 10485
diff changeset
   338
	/**
247d43dfa6f1 (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: 10485
diff changeset
   339
	 * Called once every 100 (game) ticks.
247d43dfa6f1 (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: 10485
diff changeset
   340
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   341
	virtual void OnHundredthTick() {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   342
247d43dfa6f1 (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: 10485
diff changeset
   343
	/**
247d43dfa6f1 (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: 10485
diff changeset
   344
	 * Called when this window's timeout has been reached.
247d43dfa6f1 (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: 10485
diff changeset
   345
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   346
	virtual void OnTimeout() {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   347
247d43dfa6f1 (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: 10485
diff changeset
   348
247d43dfa6f1 (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: 10485
diff changeset
   349
	/**
247d43dfa6f1 (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: 10485
diff changeset
   350
	 * Called when the window got resized.
247d43dfa6f1 (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: 10485
diff changeset
   351
	 * @param new_size the new size of the window.
247d43dfa6f1 (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: 10485
diff changeset
   352
	 * @param delta    the amount of which the window size changed.
247d43dfa6f1 (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: 10485
diff changeset
   353
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   354
	virtual void OnResize(Point new_size, Point delta) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   355
247d43dfa6f1 (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: 10485
diff changeset
   356
	/**
247d43dfa6f1 (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: 10485
diff changeset
   357
	 * A dropdown option associated to this window has been selected.
247d43dfa6f1 (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: 10485
diff changeset
   358
	 * @param widget the widget (button) that the dropdown is associated with.
247d43dfa6f1 (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: 10485
diff changeset
   359
	 * @param index  the element in the dropdown that is selected.
247d43dfa6f1 (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: 10485
diff changeset
   360
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   361
	virtual void OnDropdownSelect(int widget, int index) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   362
247d43dfa6f1 (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: 10485
diff changeset
   363
	/**
247d43dfa6f1 (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: 10485
diff changeset
   364
	 * The query window opened from this window has closed.
247d43dfa6f1 (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: 10485
diff changeset
   365
	 * @param str the new value of the string or NULL if the window
247d43dfa6f1 (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: 10485
diff changeset
   366
	 *            was cancelled.
247d43dfa6f1 (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: 10485
diff changeset
   367
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   368
	virtual void OnQueryTextFinished(char *str) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   369
247d43dfa6f1 (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: 10485
diff changeset
   370
	/**
247d43dfa6f1 (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: 10485
diff changeset
   371
	 * Some data on this window has become invalid.
247d43dfa6f1 (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: 10485
diff changeset
   372
	 * @param data information about the changed data.
247d43dfa6f1 (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: 10485
diff changeset
   373
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   374
	virtual void OnInvalidateData(int data = 0) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   375
247d43dfa6f1 (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: 10485
diff changeset
   376
247d43dfa6f1 (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: 10485
diff changeset
   377
	/**
247d43dfa6f1 (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: 10485
diff changeset
   378
	 * The user clicked some place on the map when a tile highlight mode
247d43dfa6f1 (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: 10485
diff changeset
   379
	 * has been set.
247d43dfa6f1 (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: 10485
diff changeset
   380
	 * @param pt   the exact point on the map that has been clicked.
247d43dfa6f1 (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: 10485
diff changeset
   381
	 * @param tile the tile on the map that has been clicked.
247d43dfa6f1 (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: 10485
diff changeset
   382
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   383
	virtual void OnPlaceObject(Point pt, TileIndex tile) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   384
247d43dfa6f1 (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: 10485
diff changeset
   385
	/**
247d43dfa6f1 (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: 10485
diff changeset
   386
	 * The user cancelled a tile highlight mode that has been set.
247d43dfa6f1 (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: 10485
diff changeset
   387
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   388
	virtual void OnPlaceObjectAbort() {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   389
247d43dfa6f1 (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: 10485
diff changeset
   390
247d43dfa6f1 (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: 10485
diff changeset
   391
	/**
247d43dfa6f1 (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: 10485
diff changeset
   392
	 * The user is dragging over the map when the tile highlight mode
247d43dfa6f1 (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: 10485
diff changeset
   393
	 * has been set.
247d43dfa6f1 (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: 10485
diff changeset
   394
	 * @param select_method the method of selection (allowed directions)
247d43dfa6f1 (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: 10485
diff changeset
   395
	 * @param select_proc   what will be created when the drag is over.
247d43dfa6f1 (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: 10485
diff changeset
   396
	 * @param pt            the exact point on the map where the mouse is.
247d43dfa6f1 (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: 10485
diff changeset
   397
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   398
	virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   399
247d43dfa6f1 (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: 10485
diff changeset
   400
	/**
247d43dfa6f1 (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: 10485
diff changeset
   401
	 * The user has dragged over the map when the tile highlight mode
247d43dfa6f1 (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: 10485
diff changeset
   402
	 * has been set.
247d43dfa6f1 (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: 10485
diff changeset
   403
	 * @param select_method the method of selection (allowed directions)
247d43dfa6f1 (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: 10485
diff changeset
   404
	 * @param select_proc   what should be created.
247d43dfa6f1 (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: 10485
diff changeset
   405
	 * @param pt            the exact point on the map where the mouse was released.
247d43dfa6f1 (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: 10485
diff changeset
   406
	 * @param start_tile    the begin tile of the drag.
247d43dfa6f1 (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: 10485
diff changeset
   407
	 * @param end_tile      the end tile of the drag.
247d43dfa6f1 (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: 10485
diff changeset
   408
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   409
	virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   410
247d43dfa6f1 (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: 10485
diff changeset
   411
	/**
247d43dfa6f1 (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: 10485
diff changeset
   412
	 * The user moves over the map when a tile highlight mode has been set
247d43dfa6f1 (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: 10485
diff changeset
   413
	 * when the special mouse mode has been set to 'PRESIZE' mode. An
247d43dfa6f1 (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: 10485
diff changeset
   414
	 * example of this is the tile highlight for dock building.
247d43dfa6f1 (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: 10485
diff changeset
   415
	 * @param pt   the exact point on the map where the mouse is.
247d43dfa6f1 (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: 10485
diff changeset
   416
	 * @param tile the tile on the map where the mouse is.
247d43dfa6f1 (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: 10485
diff changeset
   417
	 */
10641
13148f508e6d (svn r13185) -Codechange: remove everything related to the WindowProc callbacks.
rubidium
parents: 10625
diff changeset
   418
	virtual void OnPlacePresize(Point pt, TileIndex tile) {}
10486
247d43dfa6f1 (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: 10485
diff changeset
   419
247d43dfa6f1 (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: 10485
diff changeset
   420
	/*** End of the event handling ***/
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   421
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   422
10589
2998e6072c03 (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: 10586
diff changeset
   423
/**
2998e6072c03 (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: 10586
diff changeset
   424
 * Data structure for a window opened from a toolbar
2998e6072c03 (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: 10586
diff changeset
   425
 */
2998e6072c03 (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: 10586
diff changeset
   426
class PickerWindowBase : public Window {
2998e6072c03 (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: 10586
diff changeset
   427
2998e6072c03 (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: 10586
diff changeset
   428
public:
10686
8e02259158f3 (svn r13230) -Fix [FS#2030](r13171): When closing toolbars, also close their PickerWindows.
frosch
parents: 10641
diff changeset
   429
	PickerWindowBase(const WindowDesc *desc, Window *parent) : Window(desc)
8e02259158f3 (svn r13230) -Fix [FS#2030](r13171): When closing toolbars, also close their PickerWindows.
frosch
parents: 10641
diff changeset
   430
	{
8e02259158f3 (svn r13230) -Fix [FS#2030](r13171): When closing toolbars, also close their PickerWindows.
frosch
parents: 10641
diff changeset
   431
		this->parent = parent;
8e02259158f3 (svn r13230) -Fix [FS#2030](r13171): When closing toolbars, also close their PickerWindows.
frosch
parents: 10641
diff changeset
   432
	};
10589
2998e6072c03 (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: 10586
diff changeset
   433
2998e6072c03 (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: 10586
diff changeset
   434
	virtual ~PickerWindowBase();
2998e6072c03 (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: 10586
diff changeset
   435
};
2998e6072c03 (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: 10586
diff changeset
   436
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   437
/****************** THESE ARE NOT WIDGET TYPES!!!!! *******************/
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   438
enum WindowWidgetBehaviours {
4344
5d0e40cd67b9 (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
   439
	WWB_PUSHBUTTON  = 1 << 5,
4938
074f734a91ca (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4884
diff changeset
   440
074f734a91ca (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4884
diff changeset
   441
	WWB_MASK        = 0xE0,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   442
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   443
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   444
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   445
/**
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   446
 * Window widget types
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   447
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   448
enum WindowWidgetTypes {
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   449
	WWT_EMPTY,      ///< Empty widget, place holder to reserve space in widget array
4938
074f734a91ca (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4884
diff changeset
   450
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   451
	WWT_PANEL,      ///< Simple depressed panel
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   452
	WWT_INSET,      ///< Pressed (inset) panel, most commonly used as combo box _text_ area
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   453
	WWT_IMGBTN,     ///< Button with image
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   454
	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
   455
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   456
	WWT_TEXTBTN,    ///< Button with text
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   457
	WWT_TEXTBTN_2,  ///< Button with diff text when clicked
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   458
	WWT_LABEL,      ///< Centered label
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   459
	WWT_TEXT,       ///< Pure simple text
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   460
	WWT_MATRIX,     ///< List of items underneath each other
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   461
	WWT_SCROLLBAR,  ///< Vertical scrollbar
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   462
	WWT_FRAME,      ///< Frame
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   463
	WWT_CAPTION,    ///< Window caption (window title between closebox and stickybox)
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   464
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   465
	WWT_HSCROLLBAR, ///< Horizontal scrollbar
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   466
	WWT_STICKYBOX,  ///< Sticky box (normally at top-right of a window)
6443
b8f06d8eb7be (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: 6350
diff changeset
   467
	WWT_SCROLL2BAR, ///< 2nd vertical scrollbar
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   468
	WWT_RESIZEBOX,  ///< Resize box (normally at bottom-right of a window)
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   469
	WWT_CLOSEBOX,   ///< Close box (at top-left of a window)
8831
c13fdbe2783a (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: 8780
diff changeset
   470
	WWT_DROPDOWN,   ///< Raised drop down list (regular)
c13fdbe2783a (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: 8780
diff changeset
   471
	WWT_DROPDOWNIN, ///< Inset drop down list (used on game options only)
9233
4daa9bb8dbf7 (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: 9082
diff changeset
   472
	WWT_EDITBOX,    ///< a textbox for typing (don't forget to call ShowOnScreenKeyboard() when clicked)
6443
b8f06d8eb7be (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: 6350
diff changeset
   473
	WWT_LAST,       ///< Last Item. use WIDGETS_END to fill up padding!!
4939
ede0f6777b3c (svn r6926) -Codechange: Rename WWT_4 to WWT_TEXTBTN_2 and WWT_6 to WWT_INSET (credits to peter1138
Darkvater
parents: 4938
diff changeset
   474
ede0f6777b3c (svn r6926) -Codechange: Rename WWT_4 to WWT_TEXTBTN_2 and WWT_6 to WWT_INSET (credits to peter1138
Darkvater
parents: 4938
diff changeset
   475
	WWT_MASK = 0x1F,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   476
4938
074f734a91ca (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents: 4884
diff changeset
   477
	WWT_PUSHBTN     = WWT_PANEL   | WWB_PUSHBUTTON,
4434
4175805666a5 (svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc.
rubidium
parents: 4345
diff changeset
   478
	WWT_PUSHTXTBTN  = WWT_TEXTBTN | WWB_PUSHBUTTON,
4175805666a5 (svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc.
rubidium
parents: 4345
diff changeset
   479
	WWT_PUSHIMGBTN  = WWT_IMGBTN  | WWB_PUSHBUTTON,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   480
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   481
867
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   482
#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
   483
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   484
/**
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   485
 * Window flags
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   486
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   487
enum WindowFlags {
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   488
	WF_TIMEOUT_SHL       = 0,       ///< Window timeout counter shift
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   489
	WF_TIMEOUT_MASK      = 7,       ///< Window timeout counter bit mask (3 bits), @see WF_TIMEOUT_SHL
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   490
	WF_DRAGGING          = 1 <<  3, ///< Window is being dragged
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   491
	WF_SCROLL_UP         = 1 <<  4, ///< Upper scroll button has been pressed, @see ScrollbarClickHandler()
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   492
	WF_SCROLL_DOWN       = 1 <<  5, ///< Lower scroll button has been pressed, @see ScrollbarClickHandler()
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   493
	WF_SCROLL_MIDDLE     = 1 <<  6, ///< Scrollbar scrolling, @see ScrollbarClickHandler()
4344
5d0e40cd67b9 (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
   494
	WF_HSCROLL           = 1 <<  7,
5d0e40cd67b9 (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
   495
	WF_SIZING            = 1 <<  8,
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   496
	WF_STICKY            = 1 <<  9, ///< Window is made sticky by user
867
581154a08a78 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   497
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 9267
diff changeset
   498
	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
   499
4344
5d0e40cd67b9 (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
   500
	WF_WHITE_BORDER_ONE  = 1 << 11,
5667
248a3234d2e2 (svn r7619) -Feature (Internal): Add support for modal children. It's a window-child that
Darkvater
parents: 5666
diff changeset
   501
	WF_WHITE_BORDER_MASK = 1 << 12 | WF_WHITE_BORDER_ONE,
4344
5d0e40cd67b9 (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
   502
	WF_SCROLL2           = 1 << 13,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   503
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   504
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   505
Window *BringWindowToFrontById(WindowClass cls, WindowNumber number);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   506
Window *FindWindowFromPt(int x, int y);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   507
10462
416b62f5ee6f (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 10461
diff changeset
   508
/**
416b62f5ee6f (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 10461
diff changeset
   509
 * Open a new window.
416b62f5ee6f (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 10461
diff changeset
   510
 * @param *desc The pointer to the WindowDesc to be created
416b62f5ee6f (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 10461
diff changeset
   511
 * @param window_number the window number of the new window
416b62f5ee6f (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 10461
diff changeset
   512
 * @param data arbitrary data that is send with the WE_CREATE message
416b62f5ee6f (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 10461
diff changeset
   513
 * @return see Window pointer of the newly created window
416b62f5ee6f (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 10461
diff changeset
   514
 */
416b62f5ee6f (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 10461
diff changeset
   515
template <typename Wcls>
10525
da5bc725cda4 (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: 10508
diff changeset
   516
Wcls *AllocateWindowDescFront(const WindowDesc *desc, int window_number)
10462
416b62f5ee6f (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 10461
diff changeset
   517
{
416b62f5ee6f (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 10461
diff changeset
   518
	if (BringWindowToFrontById(desc->cls, window_number)) return NULL;
10525
da5bc725cda4 (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: 10508
diff changeset
   519
	return new Wcls(desc, window_number);
10462
416b62f5ee6f (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window.
rubidium
parents: 10461
diff changeset
   520
}
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   521
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   522
void RelocateAllWindows(int neww, int newh);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   523
6443
b8f06d8eb7be (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: 6350
diff changeset
   524
/* misc_gui.cpp */
7502
71f5d2c6a605 (svn r10262) -Fix (r10258): some places that needed to be changed to uint64 were hidden/forgotten, which caused memory corruptions and that in caused all kinds of assertions to trigger.
rubidium
parents: 7226
diff changeset
   525
void GuiShowTooltipsWithArgs(StringID str, uint paramcount, const uint64 params[]);
4834
ddcf440d0ffd (svn r6758) -Feature: Add a measurement tool that will show dimensions and height
Darkvater
parents: 4800
diff changeset
   526
static inline void GuiShowTooltips(StringID str)
ddcf440d0ffd (svn r6758) -Feature: Add a measurement tool that will show dimensions and height
Darkvater
parents: 4800
diff changeset
   527
{
ddcf440d0ffd (svn r6758) -Feature: Add a measurement tool that will show dimensions and height
Darkvater
parents: 4800
diff changeset
   528
	GuiShowTooltipsWithArgs(str, 0, NULL);
ddcf440d0ffd (svn r6758) -Feature: Add a measurement tool that will show dimensions and height
Darkvater
parents: 4800
diff changeset
   529
}
4719
413b21513ef7 (svn r6631) -Codechange: Use accessors for click_state.
belugas
parents: 4712
diff changeset
   530
6443
b8f06d8eb7be (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: 6350
diff changeset
   531
/* widget.cpp */
2436
177cb6a8339f (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2216
diff changeset
   532
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
   533
6443
b8f06d8eb7be (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: 6350
diff changeset
   534
/* window.cpp */
5124
d30772d0e9e1 (svn r7205) -Fix [FS#350, SF#1560913]: Window allocation and deletion messed with the actual window
Darkvater
parents: 5123
diff changeset
   535
extern Window *_z_windows[];
d30772d0e9e1 (svn r7205) -Fix [FS#350, SF#1560913]: Window allocation and deletion messed with the actual window
Darkvater
parents: 5123
diff changeset
   536
extern Window **_last_z_window;
d30772d0e9e1 (svn r7205) -Fix [FS#350, SF#1560913]: Window allocation and deletion messed with the actual window
Darkvater
parents: 5123
diff changeset
   537
#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
   538
10772
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   539
/**
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   540
 * In certain windows you navigate with the arrow keys. Do not scroll the
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   541
 * gameview when here. Bitencoded variable that only allows scrolling if all
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   542
 * elements are zero
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   543
 */
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   544
enum {
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   545
	SCROLL_CON  = 0,
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   546
	SCROLL_EDIT = 1,
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   547
	SCROLL_SAVE = 2,
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   548
	SCROLL_CHAT = 4,
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   549
};
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   550
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   551
/** Disable scrolling of the main viewport when an input-window is active. */
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   552
extern byte _no_scroll;
24d449dd2907 (svn r13322) -Codechange: _no_scroll belongs more with the window code.
rubidium
parents: 10768
diff changeset
   553
8764
65746a5248ec (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8760
diff changeset
   554
extern Point _cursorpos_drag_start;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   555
8764
65746a5248ec (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8760
diff changeset
   556
extern int _scrollbar_start_pos;
65746a5248ec (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8760
diff changeset
   557
extern int _scrollbar_size;
65746a5248ec (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8760
diff changeset
   558
extern byte _scroller_click_timeout;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   559
8764
65746a5248ec (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8760
diff changeset
   560
extern bool _scrolling_scrollbar;
65746a5248ec (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8760
diff changeset
   561
extern bool _scrolling_viewport;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   562
8764
65746a5248ec (svn r11832) -Codechange: get rid of (quite) some VARDEFs.
rubidium
parents: 8760
diff changeset
   563
extern byte _special_mouse_mode;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   564
enum SpecialMouseMode {
4344
5d0e40cd67b9 (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_NONE     = 0,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   566
	WSM_DRAGDROP = 1,
4344
5d0e40cd67b9 (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
   567
	WSM_SIZING   = 2,
5d0e40cd67b9 (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
   568
	WSM_PRESIZE  = 3,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   569
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   570
10258
2aa4a5f35186 (svn r12790) -Codechange: code style fixes. Patch by Alberth.
rubidium
parents: 10229
diff changeset
   571
Window *GetCallbackWnd();
2aa4a5f35186 (svn r12790) -Codechange: code style fixes. Patch by Alberth.
rubidium
parents: 10229
diff changeset
   572
Window **FindWindowZPosition(const Window *w);
2aa4a5f35186 (svn r12790) -Codechange: code style fixes. Patch by Alberth.
rubidium
parents: 10229
diff changeset
   573
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   574
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
   575
6073
d8dae377c879 (svn r8384) -Codechange: [GUI] instead of writing a resize button function for each window, a global ResizeButtons() is added
bjarni
parents: 6032
diff changeset
   576
void ResizeButtons(Window *w, byte left, byte right);
d8dae377c879 (svn r8384) -Codechange: [GUI] instead of writing a resize button function for each window, a global ResizeButtons() is added
bjarni
parents: 6032
diff changeset
   577
8914
6ebaa4b4eb2b (svn r11988) -Codechange: Add a generic way of changing a widget's size and adjust the widgets around it to suit.
peter1138
parents: 8845
diff changeset
   578
void ResizeWindowForWidget(Window *w, int widget, int delta_x, int delta_y);
6ebaa4b4eb2b (svn r11988) -Codechange: Add a generic way of changing a widget's size and adjust the widgets around it to suit.
peter1138
parents: 8845
diff changeset
   579
10768
bbb4e4b152bf (svn r13318) -Codechange: move some functions from gui.h/misc_gui.cpp to window_gui.h/window.cpp because they belong there.
rubidium
parents: 10686
diff changeset
   580
void SetVScrollCount(Window *w, int num);
bbb4e4b152bf (svn r13318) -Codechange: move some functions from gui.h/misc_gui.cpp to window_gui.h/window.cpp because they belong there.
rubidium
parents: 10686
diff changeset
   581
void SetVScroll2Count(Window *w, int num);
bbb4e4b152bf (svn r13318) -Codechange: move some functions from gui.h/misc_gui.cpp to window_gui.h/window.cpp because they belong there.
rubidium
parents: 10686
diff changeset
   582
void SetHScrollCount(Window *w, int num);
bbb4e4b152bf (svn r13318) -Codechange: move some functions from gui.h/misc_gui.cpp to window_gui.h/window.cpp because they belong there.
rubidium
parents: 10686
diff changeset
   583
8489
1e2a5fdb152f (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: 8428
diff changeset
   584
1e2a5fdb152f (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: 8428
diff changeset
   585
/**
1e2a5fdb152f (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: 8428
diff changeset
   586
 * Sets the enabled/disabled status of a widget.
1e2a5fdb152f (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: 8428
diff changeset
   587
 * By default, widgets are enabled.
1e2a5fdb152f (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: 8428
diff changeset
   588
 * On certain conditions, they have to be disabled.
1e2a5fdb152f (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: 8428
diff changeset
   589
 * @param widget_index : index of this widget in the window
1e2a5fdb152f (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: 8428
diff changeset
   590
 * @param disab_stat : status to use ie: disabled = true, enabled = false
1e2a5fdb152f (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: 8428
diff changeset
   591
 */
1e2a5fdb152f (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: 8428
diff changeset
   592
inline void Window::SetWidgetDisabledState(byte widget_index, bool disab_stat)
1e2a5fdb152f (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: 8428
diff changeset
   593
{
1e2a5fdb152f (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: 8428
diff changeset
   594
	assert(widget_index < this->widget_count);
1e2a5fdb152f (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: 8428
diff changeset
   595
	SB(this->widget[widget_index].display_flags, WIDG_DISABLED, 1, !!disab_stat);
1e2a5fdb152f (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: 8428
diff changeset
   596
}
1e2a5fdb152f (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: 8428
diff changeset
   597
1e2a5fdb152f (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: 8428
diff changeset
   598
/**
1e2a5fdb152f (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: 8428
diff changeset
   599
 * Sets a widget to disabled.
1e2a5fdb152f (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: 8428
diff changeset
   600
 * @param widget_index : index of this widget in the window
1e2a5fdb152f (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: 8428
diff changeset
   601
 */
1e2a5fdb152f (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: 8428
diff changeset
   602
inline void Window::DisableWidget(byte widget_index)
1e2a5fdb152f (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: 8428
diff changeset
   603
{
1e2a5fdb152f (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: 8428
diff changeset
   604
	SetWidgetDisabledState(widget_index, true);
1e2a5fdb152f (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: 8428
diff changeset
   605
}
1e2a5fdb152f (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: 8428
diff changeset
   606
1e2a5fdb152f (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: 8428
diff changeset
   607
/**
1e2a5fdb152f (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: 8428
diff changeset
   608
 * Sets a widget to Enabled.
1e2a5fdb152f (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: 8428
diff changeset
   609
 * @param widget_index : index of this widget in the window
1e2a5fdb152f (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: 8428
diff changeset
   610
 */
8491
804b3117cc36 (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 8489
diff changeset
   611
inline void Window::EnableWidget(byte widget_index)
804b3117cc36 (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 8489
diff changeset
   612
{
804b3117cc36 (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 8489
diff changeset
   613
	SetWidgetDisabledState(widget_index, false);
804b3117cc36 (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 8489
diff changeset
   614
}
8489
1e2a5fdb152f (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: 8428
diff changeset
   615
1e2a5fdb152f (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: 8428
diff changeset
   616
/**
1e2a5fdb152f (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: 8428
diff changeset
   617
 * Gets the enabled/disabled status of a widget.
1e2a5fdb152f (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: 8428
diff changeset
   618
 * @param widget_index : index of this widget in the window
1e2a5fdb152f (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: 8428
diff changeset
   619
 * @return status of the widget ie: disabled = true, enabled = false
1e2a5fdb152f (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: 8428
diff changeset
   620
 */
8491
804b3117cc36 (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 8489
diff changeset
   621
inline bool Window::IsWidgetDisabled(byte widget_index) const
8489
1e2a5fdb152f (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: 8428
diff changeset
   622
{
1e2a5fdb152f (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: 8428
diff changeset
   623
	assert(widget_index < this->widget_count);
1e2a5fdb152f (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: 8428
diff changeset
   624
	return HasBit(this->widget[widget_index].display_flags, WIDG_DISABLED);
1e2a5fdb152f (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: 8428
diff changeset
   625
}
1e2a5fdb152f (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: 8428
diff changeset
   626
1e2a5fdb152f (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: 8428
diff changeset
   627
/**
1e2a5fdb152f (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: 8428
diff changeset
   628
 * Sets the hidden/shown status of a widget.
1e2a5fdb152f (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: 8428
diff changeset
   629
 * By default, widgets are visible.
1e2a5fdb152f (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: 8428
diff changeset
   630
 * On certain conditions, they have to be hidden.
1e2a5fdb152f (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: 8428
diff changeset
   631
 * @param widget_index index of this widget in the window
1e2a5fdb152f (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: 8428
diff changeset
   632
 * @param hidden_stat status to use ie. hidden = true, visible = false
1e2a5fdb152f (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: 8428
diff changeset
   633
 */
1e2a5fdb152f (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: 8428
diff changeset
   634
inline void Window::SetWidgetHiddenState(byte widget_index, bool hidden_stat)
1e2a5fdb152f (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: 8428
diff changeset
   635
{
1e2a5fdb152f (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: 8428
diff changeset
   636
	assert(widget_index < this->widget_count);
1e2a5fdb152f (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: 8428
diff changeset
   637
	SB(this->widget[widget_index].display_flags, WIDG_HIDDEN, 1, !!hidden_stat);
1e2a5fdb152f (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: 8428
diff changeset
   638
}
1e2a5fdb152f (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: 8428
diff changeset
   639
1e2a5fdb152f (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: 8428
diff changeset
   640
/**
1e2a5fdb152f (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: 8428
diff changeset
   641
 * Sets a widget hidden.
1e2a5fdb152f (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: 8428
diff changeset
   642
 * @param widget_index : index of this widget in the window
1e2a5fdb152f (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: 8428
diff changeset
   643
 */
1e2a5fdb152f (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: 8428
diff changeset
   644
inline void Window::HideWidget(byte widget_index)
1e2a5fdb152f (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: 8428
diff changeset
   645
{
1e2a5fdb152f (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: 8428
diff changeset
   646
	SetWidgetHiddenState(widget_index, true);
1e2a5fdb152f (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: 8428
diff changeset
   647
}
1e2a5fdb152f (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: 8428
diff changeset
   648
1e2a5fdb152f (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: 8428
diff changeset
   649
/**
1e2a5fdb152f (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: 8428
diff changeset
   650
 * Sets a widget visible.
1e2a5fdb152f (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: 8428
diff changeset
   651
 * @param widget_index : index of this widget in the window
1e2a5fdb152f (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: 8428
diff changeset
   652
 */
1e2a5fdb152f (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: 8428
diff changeset
   653
inline void Window::ShowWidget(byte widget_index)
1e2a5fdb152f (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: 8428
diff changeset
   654
{
1e2a5fdb152f (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: 8428
diff changeset
   655
	SetWidgetHiddenState(widget_index, false);
1e2a5fdb152f (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: 8428
diff changeset
   656
}
1e2a5fdb152f (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: 8428
diff changeset
   657
1e2a5fdb152f (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: 8428
diff changeset
   658
/**
1e2a5fdb152f (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: 8428
diff changeset
   659
 * Gets the visibility of a widget.
1e2a5fdb152f (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: 8428
diff changeset
   660
 * @param widget_index : index of this widget in the window
1e2a5fdb152f (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: 8428
diff changeset
   661
 * @return status of the widget ie: hidden = true, visible = false
1e2a5fdb152f (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: 8428
diff changeset
   662
 */
8491
804b3117cc36 (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 8489
diff changeset
   663
inline bool Window::IsWidgetHidden(byte widget_index) const
8489
1e2a5fdb152f (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: 8428
diff changeset
   664
{
1e2a5fdb152f (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: 8428
diff changeset
   665
	assert(widget_index < this->widget_count);
1e2a5fdb152f (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: 8428
diff changeset
   666
	return HasBit(this->widget[widget_index].display_flags, WIDG_HIDDEN);
1e2a5fdb152f (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: 8428
diff changeset
   667
}
1e2a5fdb152f (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: 8428
diff changeset
   668
1e2a5fdb152f (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: 8428
diff changeset
   669
/**
1e2a5fdb152f (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: 8428
diff changeset
   670
 * Sets the lowered/raised status of a widget.
1e2a5fdb152f (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: 8428
diff changeset
   671
 * @param widget_index : index of this widget in the window
1e2a5fdb152f (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: 8428
diff changeset
   672
 * @param lowered_stat : status to use ie: lowered = true, raised = false
1e2a5fdb152f (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: 8428
diff changeset
   673
 */
1e2a5fdb152f (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: 8428
diff changeset
   674
inline void Window::SetWidgetLoweredState(byte widget_index, bool lowered_stat)
1e2a5fdb152f (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: 8428
diff changeset
   675
{
1e2a5fdb152f (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: 8428
diff changeset
   676
	assert(widget_index < this->widget_count);
1e2a5fdb152f (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: 8428
diff changeset
   677
	SB(this->widget[widget_index].display_flags, WIDG_LOWERED, 1, !!lowered_stat);
1e2a5fdb152f (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: 8428
diff changeset
   678
}
1e2a5fdb152f (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: 8428
diff changeset
   679
1e2a5fdb152f (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: 8428
diff changeset
   680
/**
1e2a5fdb152f (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: 8428
diff changeset
   681
 * Invert the lowered/raised  status of a widget.
1e2a5fdb152f (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: 8428
diff changeset
   682
 * @param widget_index : index of this widget in the window
1e2a5fdb152f (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: 8428
diff changeset
   683
 */
8492
d61f7a733d19 (svn r11554) -Codechange: be more consistent with the naming of the widget functions.
rubidium
parents: 8491
diff changeset
   684
inline void Window::ToggleWidgetLoweredState(byte widget_index)
8489
1e2a5fdb152f (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: 8428
diff changeset
   685
{
1e2a5fdb152f (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: 8428
diff changeset
   686
	assert(widget_index < this->widget_count);
1e2a5fdb152f (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: 8428
diff changeset
   687
	ToggleBit(this->widget[widget_index].display_flags, WIDG_LOWERED);
1e2a5fdb152f (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: 8428
diff changeset
   688
}
1e2a5fdb152f (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: 8428
diff changeset
   689
1e2a5fdb152f (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: 8428
diff changeset
   690
/**
1e2a5fdb152f (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: 8428
diff changeset
   691
 * Marks a widget as lowered.
1e2a5fdb152f (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: 8428
diff changeset
   692
 * @param widget_index : index of this widget in the window
1e2a5fdb152f (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: 8428
diff changeset
   693
 */
1e2a5fdb152f (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: 8428
diff changeset
   694
inline void Window::LowerWidget(byte widget_index)
1e2a5fdb152f (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: 8428
diff changeset
   695
{
1e2a5fdb152f (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: 8428
diff changeset
   696
	SetWidgetLoweredState(widget_index, true);
1e2a5fdb152f (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: 8428
diff changeset
   697
}
1e2a5fdb152f (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: 8428
diff changeset
   698
1e2a5fdb152f (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: 8428
diff changeset
   699
/**
1e2a5fdb152f (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: 8428
diff changeset
   700
 * Marks a widget as raised.
1e2a5fdb152f (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: 8428
diff changeset
   701
 * @param widget_index : index of this widget in the window
1e2a5fdb152f (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: 8428
diff changeset
   702
 */
1e2a5fdb152f (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: 8428
diff changeset
   703
inline void Window::RaiseWidget(byte widget_index)
1e2a5fdb152f (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: 8428
diff changeset
   704
{
1e2a5fdb152f (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: 8428
diff changeset
   705
	SetWidgetLoweredState(widget_index, false);
1e2a5fdb152f (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: 8428
diff changeset
   706
}
1e2a5fdb152f (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: 8428
diff changeset
   707
1e2a5fdb152f (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: 8428
diff changeset
   708
/**
1e2a5fdb152f (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: 8428
diff changeset
   709
 * Gets the lowered state of a widget.
1e2a5fdb152f (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: 8428
diff changeset
   710
 * @param widget_index : index of this widget in the window
1e2a5fdb152f (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: 8428
diff changeset
   711
 * @return status of the widget ie: lowered = true, raised= false
1e2a5fdb152f (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: 8428
diff changeset
   712
 */
8491
804b3117cc36 (svn r11553) -Fix: make a few widget 'accessor' function const when they should be const.
rubidium
parents: 8489
diff changeset
   713
inline bool Window::IsWidgetLowered(byte widget_index) const
8489
1e2a5fdb152f (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: 8428
diff changeset
   714
{
1e2a5fdb152f (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: 8428
diff changeset
   715
	assert(widget_index < this->widget_count);
1e2a5fdb152f (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: 8428
diff changeset
   716
	return HasBit(this->widget[widget_index].display_flags, WIDG_LOWERED);
1e2a5fdb152f (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: 8428
diff changeset
   717
}
1e2a5fdb152f (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: 8428
diff changeset
   718
8602
9e75e594a068 (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: 8598
diff changeset
   719
#endif /* WINDOW_GUI_H */