Public Types | |
typedef bool(* | MouseHandler )(uint message, MK modKeys, int x, int y) |
The form of a method that receives and processes mouse messages translated into coordinate form. | |
typedef bool(* | KeyHandler )(uint message, uint keyCode, ushort repeatCount, ubyte scanCode, bool isExtendedKey, bool altKeyDown, bool wasDown, bool released) |
The form of a method that receives and processes all keyboard messages. | |
typedef bool(* | CharKeyHandler )(uint message, char ch, ushort repeatCount, ubyte scanCode, bool isExtendedKey, bool altKeyDown, bool wasDown, bool released) |
The form of a method that receives and processes the keyboard messages that carry character codes. | |
typedef bool(* | VirtualKeyHandler )(uint message, VK key, ushort repeatCount, ubyte scanCode, bool isExtendedKey, bool altKeyDown, bool wasDown, bool released) |
The form of a method that receives and processes the keyboard messages that carry virtual key codes. | |
Public Member Functions | |
this (string windowTitle, WindowBase p) | |
Constructs a new window as a child of another window. | |
this (string windowTitle, Application a) | |
Constructs a new top-level application window. | |
this (Application a, HWND h) | |
Constructs a Window object to interface a pre-existing window. | |
this (WindowBase w, HWND h) | |
Constructs a Window object to interface a pre-existing window. | |
override void | create () |
Creates the Window object. | |
Properties | |
WindowClass | windowClass () |
The window class to which this window will belong. | |
WindowClass | windowClass (WindowClass c) |
The window class to which this window will belong. | |
MouseCursor | mouseCursor () |
The window's mouse cursor. | |
MouseCursor | mouseCursor (MouseCursor c) |
The window's mouse cursor. | |
Protected Member Functions | |
override void | predefCommandHandler (uint notify, uint id) |
final override int | processMessage (uint message, uint wParam, int lParam, WindowBase receivedVia) |
deprecated bool | selectMouseEventHandler (uint message, MK modKeys, int x, int y) |
Looks up a mouse message in Window.mouseEventHandler and calls the individual message handler. | |
deprecated bool | selectKeyEventHandler (uint message, uint keyCode, ushort repeatCount, ubyte scanCode, bool isExtendedKey, bool altKeyDown, bool wasDown, bool released) |
Looks up a keyboard message in Window.charKeyEventHandler or Window.virtualKeyEventHandler as applicable, and calls the individual message handler. | |
override void | initListeners () |
override bool | _despatchDialogMessage (MSG *msg) |
Listeners | |
int | selectMouseEventHandler (uint message, uint wParam, int lParam, WindowBase receivedVia, out bool swallow) |
Looks up a mouse message in Window.mouseEventHandler and calls the individual message handler. | |
int | setDynamicMouseCursor (uint message, uint wParam, int lParam, WindowBase receivedVia, out bool swallow) |
Responds to mouse movement by calling dynamicMouseCursor to set the mouse cursor. | |
int | selectKeyEventHandler (uint message, uint wParam, int lParam, WindowBase receivedVia, out bool swallow) |
Looks up a keyboard message in Window.charKeyEventHandler or Window.virtualKeyEventHandler as applicable, and calls the individual message handler. | |
int | oldIntermediateProcessMessage (uint message, uint wParam, int lParam, WindowBase receivedVia, out bool swallow) |
int | windowPredef (uint message, uint wParam, int lParam, WindowBase receivedVia, out bool swallow) |
Callback Methods | |
Rect | defaultSize () |
Called by show to get a Rect defining the default size and position of the window on the screen. | |
void | setWindowScale () |
Sets up a logical coordinate system. | |
void | paint (PaintDC dc, PAINTSTRUCT ps) |
Called in response to a WM_PAINT message, in order to repaint the contents of the window. | |
MouseCursor | dynamicMouseCursor (int x, int y) |
Called in response to a WM_SETCURSOR message, in order to display the correct mouse cursor. | |
Protected Attributes | |
WindowClass | wc |
MouseHandler | mouseHandler |
The method to which mouse messages will be delegated for processing. | |
MouseHandler[uint] | mouseEventHandler |
Associates each mouse message with an individual handler method. | |
KeyHandler | keyHandler |
The method to which keyboard messages will be delegated for processing. | |
CharKeyHandler[uint] | charKeyEventHandler |
Associates each keyboard message taking a character key code with an indvidual handler method. | |
VirtualKeyHandler[uint] | virtualKeyEventHandler |
Associates each keyboard message taking a virtual key code with an indvidual handler method. |
The programmer would define a subclass of Window to implement a window's functionality.
typedef bool(* smjg.libs.sdwf.window.Window.MouseHandler)(uint message, MK modKeys, int x, int y) |
The form of a method that receives and processes mouse messages translated into coordinate form.
message | the WM_xxxx constant identifying the mouse message. This is necessary to a method used for Window.mouseHandler, and can also be interrogated by methods in Window.mouseEventHandler so that similar handlings of different mouse events can be done by a single method. | |
modKeys | a combination of MK_xxxx constants as defined in the Windows API for mouse messages, specifying which modifier keys are down at the time of the event. | |
x | the x-coordinate at which the mouse event occurred. | |
y | the y-coordinate at which the mouse event occurred. The x and y values are given in device coordinates from the upper-left corner of the window client area. |
typedef bool(* smjg.libs.sdwf.window.Window.KeyHandler)(uint message, uint keyCode, ushort repeatCount, ubyte scanCode, bool isExtendedKey, bool altKeyDown, bool wasDown, bool released) |
The form of a method that receives and processes all keyboard messages.
message | the WM_xxxx constant identifying the keyboard message. | |
keyCode | the value of the keyboard message's wParam value, identifying the key that was pressed or released in a way dependent on the message that was received. | |
repeatCount | the number of times the keystroke is repeated because the user held down the key. This is normally 1; it will be greater only if Windows has coalesced key events. | |
scanCode | the OEM-dependent key scan code. | |
isExtendedKey | whether the key is an extended key. | |
altKeyDown | whether the ALT key was held down at the time of the event. | |
wasDown | whether the key was down immediately before the event occurred. | |
released | whether the key is released now that the event has occurred. |
typedef bool(* smjg.libs.sdwf.window.Window.CharKeyHandler)(uint message, char ch, ushort repeatCount, ubyte scanCode, bool isExtendedKey, bool altKeyDown, bool wasDown, bool released) |
The form of a method that receives and processes the keyboard messages that carry character codes.
Methods of this form apply to the messages WM_CHAR
, WM_SYSCHAR
, WM_DEADCHAR
and WM_SYSDEADCHAR
.
message | the WM_xxxx constant identifying the keyboard message. It can be interrogated by methods in Window.charKeyEventHandler so that similar handlings of different keyboard events can be done by a single method. | |
ch | the character value of the key that was pressed. | |
repeatCount | the number of times the keystroke is repeated because the user held down the key. This is normally 1; it will be greater only if Windows has coalesced key events. | |
scanCode | the OEM-dependent key scan code. | |
isExtendedKey | whether the key is an extended key. | |
altKeyDown | whether the ALT key was held down at the time of the event. | |
wasDown | whether the key was down immediately before the event occurred. | |
released | whether the key is released now that the event has occurred. |
typedef bool(* smjg.libs.sdwf.window.Window.VirtualKeyHandler)(uint message, VK key, ushort repeatCount, ubyte scanCode, bool isExtendedKey, bool altKeyDown, bool wasDown, bool released) |
The form of a method that receives and processes the keyboard messages that carry virtual key codes.
Methods of these form are used with the messages WM_KEYDOWN
, WM_SYSKEYDOWN
, WM_KEYUP
, WM_SYSKEYUP
. Although some of the parameter values are wholly or partly determined by the particular message received, they are all included for the sake of completeness and convenience.
message | the WM_xxxx constant identifying the keyboard message. It can be interrogated by methods in Window.virtualKeyEventHandler so that similar handlings of different keyboard events can be done by a single method. | |
virtualKey | identifies the key that was pressed or released. | |
repeatCount | the number of times the keystroke is repeated because the user held down the key. This is normally 1; it will be greater only if Windows has coalesced key events. | |
scanCode | the OEM-dependent key scan code. | |
isExtendedKey | whether the key is an extended key. | |
altKeyDown | whether the ALT key was held down at the time of the event. | |
wasDown | whether the key was down immediately before the event occurred. | |
released | whether the key is released now that the event has occurred. |
smjg.libs.sdwf.window.Window.this | ( | string | windowTitle, | |
WindowBase | p | |||
) |
Constructs a new window as a child of another window.
The Windows interface element itself is not yet created - this is done when Window.show is called.
Reimplemented in smjg.libs.sdwf.framewindow.FrameWindow, and smjg.libs.sdwf.mdi.MDIFrameWindow.
smjg.libs.sdwf.window.Window.this | ( | string | windowTitle, | |
Application | a | |||
) |
Constructs a new top-level application window.
The Windows interface element itself is not yet created - this is done when Window.show is called.
windowTitle | the title bar text of the window. | |
a | the application to which this window belongs. |
Reimplemented in smjg.libs.sdwf.framewindow.FrameWindow, and smjg.libs.sdwf.mdi.MDIFrameWindow.
smjg.libs.sdwf.window.Window.this | ( | Application | a, | |
HWND | h | |||
) |
Constructs a Window object to interface a pre-existing window.
This can be used to perform operations on a window outside of SDWF's control. SDWF currently does not subclass interface elements, and so message handling will not work.
a | the application to which the window object belongs. | |
h | the Windows handle of the window. |
Reimplemented from smjg.libs.sdwf.windowbase.WindowBase.
smjg.libs.sdwf.window.Window.this | ( | WindowBase | w, | |
HWND | h | |||
) |
override void smjg.libs.sdwf.window.Window.create | ( | ) | [virtual] |
Creates the Window object.
Implements smjg.libs.sdwf.windowbase.WindowBase.
WindowClass smjg.libs.sdwf.window.Window.windowClass | ( | ) |
The window class to which this window will belong.
Isn't it getting confusing? We've got the Window class in SDWF, and window classes in the Windows API. The latter is the one that this property is concerned with.
WindowClass smjg.libs.sdwf.window.Window.windowClass | ( | WindowClass | c | ) |
MouseCursor smjg.libs.sdwf.window.Window.mouseCursor | ( | ) |
The window's mouse cursor.
This is the cursor that will be displayed when the mouse is in the window, if it has not been overridden by Window.dynamicMouseCursor and the window class does not specify a mouse cursor.
MouseCursor smjg.libs.sdwf.window.Window.mouseCursor | ( | MouseCursor | c | ) |
The window's mouse cursor.
This is the cursor that will be displayed when the mouse is in the window, if it has not been overridden by Window.dynamicMouseCursor and the window class does not specify a mouse cursor.
override void smjg.libs.sdwf.window.Window.predefCommandHandler | ( | uint | notify, | |
uint | id | |||
) | [protected] |
Reimplemented from smjg.libs.sdwf.windowbase.WindowBase.
Reimplemented in smjg.libs.sdwf.mdi.MDIFrameWindow.
final override int smjg.libs.sdwf.window.Window.processMessage | ( | uint | message, | |
uint | wParam, | |||
int | lParam, | |||
WindowBase | receivedVia | |||
) | [protected] |
int smjg.libs.sdwf.window.Window.selectMouseEventHandler | ( | uint | message, | |
uint | wParam, | |||
int | lParam, | |||
WindowBase | receivedVia, | |||
out bool | swallow | |||
) | [protected] |
Looks up a mouse message in Window.mouseEventHandler and calls the individual message handler.
Normally an application would not call this method directly, but add it as a listener.
int smjg.libs.sdwf.window.Window.setDynamicMouseCursor | ( | uint | message, | |
uint | wParam, | |||
int | lParam, | |||
WindowBase | receivedVia, | |||
out bool | swallow | |||
) | [protected] |
Responds to mouse movement by calling dynamicMouseCursor to set the mouse cursor.
int smjg.libs.sdwf.window.Window.selectKeyEventHandler | ( | uint | message, | |
uint | wParam, | |||
int | lParam, | |||
WindowBase | receivedVia, | |||
out bool | swallow | |||
) | [protected] |
Looks up a keyboard message in Window.charKeyEventHandler or Window.virtualKeyEventHandler as applicable, and calls the individual message handler.
Normally an application would not call this method directly, but add it as a listener.
int smjg.libs.sdwf.window.Window.oldIntermediateProcessMessage | ( | uint | message, | |
uint | wParam, | |||
int | lParam, | |||
WindowBase | receivedVia, | |||
out bool | swallow | |||
) | [protected] |
int smjg.libs.sdwf.window.Window.windowPredef | ( | uint | message, | |
uint | wParam, | |||
int | lParam, | |||
WindowBase | receivedVia, | |||
out bool | swallow | |||
) | [protected] |
deprecated bool smjg.libs.sdwf.window.Window.selectMouseEventHandler | ( | uint | message, | |
MK | modKeys, | |||
int | x, | |||
int | y | |||
) | [protected] |
Looks up a mouse message in Window.mouseEventHandler and calls the individual message handler.
Normally an application would not call this method directly, but assign it to Window.mouseHandler.
deprecated bool smjg.libs.sdwf.window.Window.selectKeyEventHandler | ( | uint | message, | |
uint | keyCode, | |||
ushort | repeatCount, | |||
ubyte | scanCode, | |||
bool | isExtendedKey, | |||
bool | altKeyDown, | |||
bool | wasDown, | |||
bool | released | |||
) | [protected] |
Looks up a keyboard message in Window.charKeyEventHandler or Window.virtualKeyEventHandler as applicable, and calls the individual message handler.
Normally an application would not call this method directly, but assign it to Window.keyHandler.
Rect smjg.libs.sdwf.window.Window.defaultSize | ( | ) | [protected] |
Called by show to get a Rect defining the default size and position of the window on the screen.
void smjg.libs.sdwf.window.Window.setWindowScale | ( | ) | [protected] |
Sets up a logical coordinate system.
This method is called when the window is first displayed, and when the window is resized in order to update the logical coordinates to the new window size.
The Window implementation does nothing, so that ordinary device coordinates are used.
Reimplemented in smjg.libs.sdwf.framewindow.FrameWindow.
void smjg.libs.sdwf.window.Window.paint | ( | PaintDC | dc, | |
PAINTSTRUCT | ps | |||
) | [protected] |
MouseCursor smjg.libs.sdwf.window.Window.dynamicMouseCursor | ( | int | x, | |
int | y | |||
) | [protected] |
Called in response to a WM_SETCURSOR message, in order to display the correct mouse cursor.
This can be used to change the mouse cursor as the mouse moves within the window. For this to work, the window class cursor must be null, and the Window.setDynamicMouseCursor listener must be added to the window.
x | the x-coordinate of the mouse cursor. | |
y | the y-coordinate of the mouse cursor. The x and y values are given in device coordinates from the upper-left corner of the window client area. |
null
to use the default cursor.override void smjg.libs.sdwf.window.Window.initListeners | ( | ) | [protected, virtual] |
Implements smjg.libs.sdwf.windowbase.WindowBase.
Reimplemented in smjg.libs.sdwf.framewindow.FrameWindow, and smjg.libs.sdwf.mdi.MDIFrameWindow.
override bool smjg.libs.sdwf.window.Window._despatchDialogMessage | ( | MSG * | msg | ) | [protected] |
Reimplemented from smjg.libs.sdwf.windowbase.WindowBase.
WindowClass smjg.libs.sdwf.window.Window.wc [protected] |
The method to which mouse messages will be delegated for processing.
MouseHandler [uint] smjg.libs.sdwf.window.Window.mouseEventHandler [protected] |
Associates each mouse message with an individual handler method.
The Window.selectMouseEventHandler listener must be added to the window for this to work.
KeyHandler smjg.libs.sdwf.window.Window.keyHandler [protected] |
The method to which keyboard messages will be delegated for processing.
CharKeyHandler [uint] smjg.libs.sdwf.window.Window.charKeyEventHandler [protected] |
Associates each keyboard message taking a character key code with an indvidual handler method.
The Window.selectKeyEventHandler listener must be added to the window for this to work.
VirtualKeyHandler [uint] smjg.libs.sdwf.window.Window.virtualKeyEventHandler [protected] |
Associates each keyboard message taking a virtual key code with an indvidual handler method.
The Window.selectKeyEventHandler listener must be added to the window for this to work.