- Main Page
- Packages
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# smjg.libs.sdwf.windowbase.WindowBase Class Reference

The smjg.libs.sdwf.windowbase.WindowBase class is the abstract base class from which the Window, Dialog and Control classes are derived. More...

Inheritance diagram for smjg.libs.sdwf.windowbase.WindowBase:

List of all members.

## Properties
typedef text | title
| This alias is provided for clarity, since the caption text of a window or dialog is the text in the title bar.
string | toString ()
| Returns a string representation of this WindowBase.
final uint | toHash ()
| Returns a hash value of this WindowBase.
Application | application ()
| The Application object representing the application instance to which this window object belongs.
WindowBase | parent ()
| The parent of this window object.
HWND | handle ()
| The Windows handle of the interface element represented by this WindowBase object.
DCState | dcState ()
bool | enabled ()
| Whether the control is enabled, i.e.
bool | enabled (bool e)
| Whether the control is enabled, i.e.
int | textLength ()
| The length, in characters, of the caption text.
char[] | text ()
| The caption text of the window, dialog or control.
string | text (string t)
| The caption text of the window, dialog or control.
bool | visible ()
| Whether the window is currently visible.
bool | visible (bool v)
| Whether the window is currently visible.
Rect | sizeAndPosition ()
| A rectangle representing the size and position of this interface element.
Rect | sizeAndPosition (Rect pos)
| A rectangle representing the size and position of this interface element.
Rect | sizeAndPositionScreen ()
| A rectangle representing the size and position of this interface element, in screen coordinates.
Rect | sizeAndPositionScreen (Rect pos)
| A rectangle representing the size and position of this interface element, in screen coordinates.
Rect | clientArea ()
| A rectangle representing the size of the window's client area.
HACCEL | accelerators ()
| Windows handle of the window's accelerator table.
HACCEL | accelerators (HACCEL h)
| Windows handle of the window's accelerator table.
HACCEL | accelerators (LPCTSTR i)
HACCEL | accelerators (uint id)
| Sets the window's accelerator table.
HACCEL | accelerators (string name)
| Sets the window's accelerator table.
WS | style ()
| The window style.
WS | style (WS s)
| The window style.
WS_EX | exStyle ()
| The window extended style.
WS_EX | exStyle (WS_EX s)
| The window extended style.
MenuBar | menu ()
| The menu bar attached to this window object.
MenuBar | menu (MenuBar m)
| The menu bar attached to this window object.
void | menu (int id)
| The menu bar attached to this window object.
void | menu (string name)
| The menu bar attached to this window object.
## Callback Methods
bool | confirmClose ()
| Determines whether it is OK to close the window or dialog.
void | onActivate (ActivationEvent event)
| Carries out operations when the window is made active.
void | onDeactivate (ActivationEvent event)
| Carries out operations when the window is made inactive.
void | setup ()
| Carries out setup operations on the window or dialog.
void | cleanup ()
| Carries out cleanup operations on the window or dialog.
## Public Types
typedef int(* | MessageHandler )(uint message, uint wParam, int lParam, WindowBase receivedVia, out bool swallow)
| The form of a message handler or listener method.
## Public Member Functions
abstract void | create ()
| Creates the Windows interface element represented by this WindowBase object.
int | show ()
| Creates and displays the Windows interface element represented by this WindowBase object.
void | focus ()
| Sets the keyboard focus on this interface element.
void | close (int exitCode=ID.CLOSE)
| Calls confirmClose, and if it returns `true`, closes the window object.
ID | messageBox (string text, string boxTitle, MB style)
| Displays a standard Windows message box, with this window or dialog as its parent.
void | enableMenuItem (uint id, MF state)
| Enables or disables the specified menu item in this window's menu bar.
void | checkMenuItem (uint id, MF state)
| Checks or unchecks the specified menu item in this window's menu bar.
int | sendMessage (uint message, uint wParam=0, int lParam=0)
| Sends a window message to this window object.
int | postMessage (uint message, uint wParam=0, int lParam=0)
| Posts a window message for this window object to the message queue.
void | toClientCoords (inout int x, inout int y)
| Transforms the given coordinates relative to the screen into coordinates relative to this window object's client area.
void | toClientCoords (inout Point p)
| Transforms the given coordinates relative to the screen into coordinates relative to this window object's client area.
void | toClientCoords (Point[] p)
| Transforms the given coordinates relative to the screen into coordinates relative to this window object's client area.
void | toClientCoords (inout Rect r)
| Transforms the given coordinates relative to the screen into coordinates relative to this window object's client area.
void | toClientCoords (Rect[] r)
| Transforms the given coordinates relative to the screen into coordinates relative to this window object's client area.
void | toScreenCoords (inout int x, inout int y)
| Transforms the given coordinates relative to this window object's client area into coordinates relative to the screen.
void | toScreenCoords (inout Point p)
| Transforms the given coordinates relative to this window object's client area into coordinates relative to the screen.
void | toScreenCoords (Point[] p)
| Transforms the given coordinates relative to this window object's client area into coordinates relative to the screen.
void | toScreenCoords (inout Rect r)
| Transforms the given coordinates relative to this window object's client area into coordinates relative to the screen.
void | toScreenCoords (Rect[] r)
| Transforms the given coordinates relative to this window object's client area into coordinates relative to the screen.
void | addListener (MessageHandler listener, int priority=0)
| Adds a listener function to this window object.
void | removeListener (MessageHandler listener)
| Removes a listener from this window object.
void | repaint (bool blank)
| Signals that the window needs to be repainted.
void | repaint (bool blank, Rect area)
| Signals that a portion of the window needs to be repainted.
Operators
final int | opEquals (Object o)
| Determines whether this WindowBase is equal to another object.
final int | opEquals (WindowBase a)
| Determines whether this WindowBase is equal to another WindowBase.
## Protected Member Functions
| this (Application a, HWND hwnd)
| this (WindowBase p, HWND hwnd)
| this (Application a)
| this (WindowBase p)
final void | evDestroy (uint msg)
int | processMessage (uint message, uint wParam, int lParam, WindowBase receivedVia)
final int | intermediateProcessMessage (uint message, uint wParam, int lParam, WindowBase receivedVia, out bool swallow)
final int | windowBasePredef (uint message, uint wParam, int lParam, WindowBase receivedVia, out bool swallow)
int | defaultProcessMessage (uint message, uint wParam, int lParam)
void | predefCommandHandler (uint notify, uint id)
void | defaultCommandHandler (uint notify, uint id)
int | predefNotifyHandler (uint notify, uint id, void *info)
int | defaultNotifyHandler (uint notify, uint id, void *info)
abstract void | initListeners ()
bool | _despatchDialogMessage (MSG *msg)
## Static Protected Member Functions
static synchronized WindowBase | findWindow (HWND windowHandle)
static int | WindowProc (HWND windowHandle, uint message, WPARAM wParam, LPARAM lParam)
static bool | _translateAccel (MSG *msg)
static bool | _translateDialogMessage (WindowBase active, MSG *msg)
## Protected Attributes
string | _text
HWND | _handle
bool | _initialised = false
int(* | handler )(uint message, uint wParam, int lParam)[uint]
| Associates each Windows message (WM_xxxx constant) with a handler method.
MessageHandler[uint] | messageHandler
| Associates each Windows message (WM_xxxx constant) with a handler method.
void(* | commandHandler )(uint notify, uint id)[uint]
| Associates each menu command, or the notification messages from each control within a dialog, with a handler method.
int(* | notifyHandler )(uint notify, uint id, void *info)[uint]
| Associates each control within a dialog with a handler method.
void(* | menuCommandHandler )(bool byAccel, uint id)[uint]
| Associates each menu or accelerator with a handler method.
uint | windowStyle
WS_EX | _exStyle
## Static Protected Attributes
static WindowBase | newWindow
## Classes
struct | Listener

## Detailed Description

The smjg.libs.sdwf.windowbase.WindowBase class is the abstract base class from which the Window, Dialog and Control classes are derived.

## Member Typedef Documentation

typedef int(* smjg.libs.sdwf.windowbase.WindowBase.MessageHandler)(uint message, uint wParam, int lParam, WindowBase receivedVia, out bool swallow)

The form of a message handler or listener method.

Parameters:

  | message | the WM_xxxx constant identifying the message. This is passed in so that similar handlings of different messages can be done by a single method and distinguished at call time.
  | wParam | the first of the two message-dependent parameters, as specified in the Windows API for the given message.
  | lParam | the second of the two message-dependent parameters.
  | receivedVia | the window object that actually received the message. This will usually be equal to `this`, but may be different if a FrameWindow is being used.
  | swallow | if the method sets this to `true`, the message will stop here. Otherwise, it will be passed down the message handling chain to listeners and/or default handling.

Returns:
  a value dependent on the message being handled, as specified in the Windows API for the given message.

typedef text smjg.libs.sdwf.windowbase.WindowBase.title

This alias is provided for clarity, since the caption text of a window or dialog is the text in the title bar.

## Constructor & Destructor Documentation

smjg.libs.sdwf.windowbase.WindowBase.this | ( | Application | a,
|  | HWND | hwnd |
| ) |  |  | `[protected]`

Reimplemented in smjg.libs.sdwf.dialog.Dialog, and smjg.libs.sdwf.window.Window.

smjg.libs.sdwf.windowbase.WindowBase.this | ( | WindowBase | p,
|  | HWND | hwnd |
| ) |  |  | `[protected]`

smjg.libs.sdwf.windowbase.WindowBase.this | ( | Application | a | ) | `[protected]`

smjg.libs.sdwf.windowbase.WindowBase.this | ( | WindowBase | p | ) | `[protected]`

## Member Function Documentation

static synchronized WindowBase smjg.libs.sdwf.windowbase.WindowBase.findWindow | ( | HWND | windowHandle | ) | `[static, protected]`

static int smjg.libs.sdwf.windowbase.WindowBase.WindowProc | ( | HWND | windowHandle,
|  | uint | message,
|  | WPARAM | wParam,
|  | LPARAM | lParam |
| ) |  |  | `[static, protected]`

static bool smjg.libs.sdwf.windowbase.WindowBase._translateAccel | ( | MSG * | msg | ) | `[static, protected]`

static bool smjg.libs.sdwf.windowbase.WindowBase._translateDialogMessage | ( | WindowBase | active,
|  | MSG * | msg |
| ) |  |  | `[static, protected]`

abstract void smjg.libs.sdwf.windowbase.WindowBase.create | ( |  | ) | `[pure virtual]`

Creates the Windows interface element represented by this WindowBase object.

Precondition:
  It is illegal to call this method more than once on any WindowBase.

Since:
  0.3

Implemented in smjg.libs.sdwf.commoncontrol.TreeView, smjg.libs.sdwf.control.Control, smjg.libs.sdwf.dialog.Dialog, smjg.libs.sdwf.statusbar.StatusBar, and smjg.libs.sdwf.window.Window.

int smjg.libs.sdwf.windowbase.WindowBase.show | ( |  | ) |

Creates and displays the Windows interface element represented by this WindowBase object.

Returns:
  zero, except in the case of a modal Dialog.

Status:
  done

Reimplemented in smjg.libs.sdwf.dialog.Dialog.

void smjg.libs.sdwf.windowbase.WindowBase.focus | ( |  | ) |

Sets the keyboard focus on this interface element.

Status:
  done

void smjg.libs.sdwf.windowbase.WindowBase.close | ( | int | exitCode = `ID.CLOSE` | ) |

Calls confirmClose, and if it returns `true`, closes the window object.

Parameters:

  | exitCode | used only for a modal Dialog. The WindowBase implementation ignores this parameter.

Status:
  test further

Reimplemented in smjg.libs.sdwf.dialog.Dialog.

ID smjg.libs.sdwf.windowbase.WindowBase.messageBox | ( | string | text,
|  | string | boxTitle,
|  | MB | style |
| ) |  |  |

Displays a standard Windows message box, with this window or dialog as its parent.

Parameters:

  | text | the text to display in the message box.
  | boxTitle | the text to display in the title bar.
  | style | a bitwise combination of constants denoting the buttons, icon and other options.

Returns:
  a value indicating which button the user pressed.

Status:
  done

void smjg.libs.sdwf.windowbase.WindowBase.enableMenuItem | ( | uint | id,
|  | MF | state |
| ) |  |  |

Enables or disables the specified menu item in this window's menu bar.

Parameters:

  | id | numeric ID of the menu item, or zero-based position on menu bar if MF.BYPOSITION is specifed. The latter currently allows only for enabling/disabling of top-level menus.
  | state | new enabled/disabled state.

Since:
  0.3

Status:
  done

void smjg.libs.sdwf.windowbase.WindowBase.checkMenuItem | ( | uint | id,
|  | MF | state |
| ) |  |  |

Checks or unchecks the specified menu item in this window's menu bar.

Parameters:

  | id | numeric ID of the menu item.
  | state | new check state.

Since:
  0.3

Status:
  done

int smjg.libs.sdwf.windowbase.WindowBase.sendMessage | ( | uint | message,
|  | uint | wParam = `0`,
|  | int | lParam = `0` |
| ) |  |  |

Sends a window message to this window object.

Parameters:

  | message | the WM_xxxx constant identifying the message.
  | wParam | the first of the two message-dependent parameters, as specified in the Windows API for the chosen message.
  | lParam | the second of the two message-dependent parameters.

Returns:
  a value dependent on the message being handled, as specified in the Windows API for the chosen message.

Since:
  0.4

Status:
  done

int smjg.libs.sdwf.windowbase.WindowBase.postMessage | ( | uint | message,
|  | uint | wParam = `0`,
|  | int | lParam = `0` |
| ) |  |  |

Posts a window message for this window object to the message queue.

Parameters:

  | message | the WM_xxxx constant identifying the message.
  | wParam | the first of the two message-dependent parameters, as specified in the Windows API for the chosen message.
  | lParam | the second of the two message-dependent parameters.

Returns:
  a value dependent on the message being handled, as specified in the Windows API for the chosen message.

Since:
  0.51

Status:
  test

void smjg.libs.sdwf.windowbase.WindowBase.toClientCoords | ( | inout int | x,
|  | inout int | y |
| ) |  |  |

Transforms the given coordinates relative to the screen into coordinates relative to this window object's client area.

Parameters:

  | x | the screen x-coordinate, which will be replaced by the client x-coordinate.
  | y | the screen y-coordinate, which will be replaced by the client y-coordinate.

Since:
  0.4

Status:
  done

void smjg.libs.sdwf.windowbase.WindowBase.toClientCoords | ( | inout Point | p | ) |

Transforms the given coordinates relative to the screen into coordinates relative to this window object's client area.

Parameters:

  | p | point in screen coordinates, which will be replaced by client coordinates.

Since:
  0.4

Status:
  test

void smjg.libs.sdwf.windowbase.WindowBase.toClientCoords | ( | Point[] | p | ) |

Transforms the given coordinates relative to the screen into coordinates relative to this window object's client area.

Parameters:

  | p | array of points in screen coordinates, which will be replaced by client coordinates.

Since:
  0.4

Status:
  test

void smjg.libs.sdwf.windowbase.WindowBase.toClientCoords | ( | inout Rect | r | ) |

Transforms the given coordinates relative to the screen into coordinates relative to this window object's client area.

Parameters:

  | r | rectangle in screen coordinates, which will be replaced by client coordinates.

Since:
  0.4

Status:
  test

void smjg.libs.sdwf.windowbase.WindowBase.toClientCoords | ( | Rect[] | r | ) |

Transforms the given coordinates relative to the screen into coordinates relative to this window object's client area.

Parameters:

  | r | array of rectangles in screen coordinates, which will be replaced by client coordinates.

Since:
  0.4

Status:
  test

void smjg.libs.sdwf.windowbase.WindowBase.toScreenCoords | ( | inout int | x,
|  | inout int | y |
| ) |  |  |

Transforms the given coordinates relative to this window object's client area into coordinates relative to the screen.

Parameters:

  | x | the client x-coordinate, which will be replaced by the screen x-coordinate.
  | y | the client y-coordinate, which will be replaced by the screen y-coordinate.

Since:
  0.4

Status:
  done

void smjg.libs.sdwf.windowbase.WindowBase.toScreenCoords | ( | inout Point | p | ) |

Transforms the given coordinates relative to this window object's client area into coordinates relative to the screen.

Parameters:

  | p | point in client coordinates, which will be replaced by screen coordinates.

Since:
  0.4

Status:
  test

void smjg.libs.sdwf.windowbase.WindowBase.toScreenCoords | ( | Point[] | p | ) |

Transforms the given coordinates relative to this window object's client area into coordinates relative to the screen.

Parameters:

  | p | array of points in client coordinates, which will be replaced by screen coordinates.

Since:
  0.4

Status:
  test

void smjg.libs.sdwf.windowbase.WindowBase.toScreenCoords | ( | inout Rect | r | ) |

Transforms the given coordinates relative to this window object's client area into coordinates relative to the screen.

Parameters:

  | r | rectangle in client coordinates, which will be replaced by screen coordinates.

Since:
  0.4

Status:
  test

void smjg.libs.sdwf.windowbase.WindowBase.toScreenCoords | ( | Rect[] | r | ) |

Transforms the given coordinates relative to this window object's client area into coordinates relative to the screen.

Parameters:

  | r | array of rectangles in client coordinates, which will be replaced by screen coordinates.

Since:
  0.4

Status:
  test

void smjg.libs.sdwf.windowbase.WindowBase.addListener | ( | MessageHandler | listener,
|  | int | priority = `0` |
| ) |  |  |

Adds a listener function to this window object.

Unilke Java AWT and various other GUI systems, the programmer does not usually need to create listeners, since most programmer-defined handling is done through WindowBase.handler and other similar associative arrays. Rather, listeners are mostly used internally, although a few are provided for the programmer to attach to a window.

Listener processing happens after WindowBase.handler lookup, and currently happens only if the received message is not listed in WindowBase.handler. It generally happens before processing of menu command and control notifications and those predefined by SDWF.

Parameters:

  | listener | the listener function to attach.
  | priority | the priority of the listener. The higher this value, the earlier it will come in the listener processing sequence. Listeners with the same priority will be processed in the order that they were added. The default value of zero is suitable for most purposes; generally values in the range `-65536` to `65536` should be used to avoid conflicts with internal listeners.

Since:
  0.5

Status:
  done

void smjg.libs.sdwf.windowbase.WindowBase.removeListener | ( | MessageHandler | listener | ) |

Removes a listener from this window object.

Since:
  0.5

Status:
  test

void smjg.libs.sdwf.windowbase.WindowBase.repaint | ( | bool | blank | ) |

Signals that the window needs to be repainted.

Parameters:

  | blank | if true, the window will be cleared to its background before repainting.

Since:
  0.5 (previously in Window)

Status:
  done

void smjg.libs.sdwf.windowbase.WindowBase.repaint | ( | bool | blank,
|  | Rect | area |
| ) |  |  |

Signals that a portion of the window needs to be repainted.

Parameters:

  | blank | if true, the area will be cleared to its background before repainting.
  | area | the area of the window to be repainted, in device coordinates.

Since:
  0.5 (previously in Window)

Status:
  done

string smjg.libs.sdwf.windowbase.WindowBase.toString | ( |  | ) |

Returns a string representation of this WindowBase.

Returns:
  the window object's caption text.

Since:
  0.4

final uint smjg.libs.sdwf.windowbase.WindowBase.toHash | ( |  | ) |

Returns a hash value of this WindowBase.

Returns:
  the hash value, defined by window object's handle.

Since:
  0.4

Application smjg.libs.sdwf.windowbase.WindowBase.application | ( |  | ) |

The Application object representing the application instance to which this window object belongs.

Status:
  done

WindowBase smjg.libs.sdwf.windowbase.WindowBase.parent | ( |  | ) |

The parent of this window object.

Returns:
  the parent WindowBase object, or `null` if this is a top-level application window.

Status:
  done

HWND smjg.libs.sdwf.windowbase.WindowBase.handle | ( |  | ) |

The Windows handle of the interface element represented by this WindowBase object.

You would use this property if you need to call a Windows API function directly on the window, dialog or control.

Status:
  done

DCState smjg.libs.sdwf.windowbase.WindowBase.dcState | ( |  | ) |

bool smjg.libs.sdwf.windowbase.WindowBase.enabled | ( |  | ) |

Whether the control is enabled, i.e.

currently accepting user interaction, as opposed to being 'greyed out'.

Since:
  0.5 (previously in Control)

bool smjg.libs.sdwf.windowbase.WindowBase.enabled | ( | bool | e | ) |

Whether the control is enabled, i.e.

currently accepting user interaction, as opposed to being 'greyed out'.

Since:
  0.5 (previously in Control)

Status:
  test

int smjg.libs.sdwf.windowbase.WindowBase.textLength | ( |  | ) |

The length, in characters, of the caption text.

It is not necessary to interrogate this property in order to retrieve the text.

Status:
  test

char [] smjg.libs.sdwf.windowbase.WindowBase.text | ( |  | ) |

The caption text of the window, dialog or control.

Status:
  done

Reimplemented in smjg.libs.sdwf.control.EditBox, and smjg.libs.sdwf.statusbar.StatusBar.

string smjg.libs.sdwf.windowbase.WindowBase.text | ( | string | t | ) |

The caption text of the window, dialog or control.

Exceptions:

  | WindowBaseException | if the operation fails because the text is too long, or this WindowBase object is a list box or combo box that does not accept text.

Status:
  done

Reimplemented in smjg.libs.sdwf.control.EditBox, and smjg.libs.sdwf.statusbar.StatusBar.

bool smjg.libs.sdwf.windowbase.WindowBase.visible | ( |  | ) |

Whether the window is currently visible.

Since:
  0.3

Status:
  test

Reimplemented in smjg.libs.sdwf.framewindow.Bar.

bool smjg.libs.sdwf.windowbase.WindowBase.visible | ( | bool | v | ) |

Whether the window is currently visible.

Since:
  0.3

Status:
  test

Reimplemented in smjg.libs.sdwf.framewindow.Bar.

Rect smjg.libs.sdwf.windowbase.WindowBase.sizeAndPosition | ( |  | ) |

A rectangle representing the size and position of this interface element.

For top-level and pop-up windows, this is in screen coordinates. For child objects, the coordinates are relative to the parent's client area.

Since:
  0.4

Status:
  done

Rect smjg.libs.sdwf.windowbase.WindowBase.sizeAndPosition | ( | Rect | pos | ) |

A rectangle representing the size and position of this interface element.

For top-level and pop-up windows, this is in screen coordinates. For child objects, the coordinates are relative to the parent's client area.

Note:
  If the window is maximized or minimized, setting this property restores it to a normal state.

Since:
  0.4

Status:
  done

Rect smjg.libs.sdwf.windowbase.WindowBase.sizeAndPositionScreen | ( |  | ) |

A rectangle representing the size and position of this interface element, in screen coordinates.

Since:
  0.4

Status:
  done

Rect smjg.libs.sdwf.windowbase.WindowBase.sizeAndPositionScreen | ( | Rect | pos | ) |

A rectangle representing the size and position of this interface element, in screen coordinates.

Note:
  If the window is maximized or minimized, setting this property restores it to a normal state.

Since:
  0.4

Status:
  test

Rect smjg.libs.sdwf.windowbase.WindowBase.clientArea | ( |  | ) |

A rectangle representing the size of the window's client area.

It is the rectangle denoting the client area in device coordinates.

Returns:
  a rectangle of the client area's dimensions, with the left and top values set to zero.

Since:
  0.5 (previously in Window)

Status:
  done

HACCEL smjg.libs.sdwf.windowbase.WindowBase.accelerators | ( |  | ) |

Windows handle of the window's accelerator table.

Since:
  0.3

Status:
  done

HACCEL smjg.libs.sdwf.windowbase.WindowBase.accelerators | ( | HACCEL | h | ) |

Windows handle of the window's accelerator table.

Limitations:
  Because of a limitation of Windows, accelerators don't work in a modal Dialog.

Since:
  0.3

Status:
  done

HACCEL smjg.libs.sdwf.windowbase.WindowBase.accelerators | ( | LPCTSTR | i | ) |

HACCEL smjg.libs.sdwf.windowbase.WindowBase.accelerators | ( | uint | id | ) |

Sets the window's accelerator table.

Parameters:

  | id | numeric ID of the accelerator resource.

Limitations:
  Because of a limitation of Windows, accelerators don't work in a modal Dialog.

Since:
  0.3

Status:
  done

HACCEL smjg.libs.sdwf.windowbase.WindowBase.accelerators | ( | string | name | ) |

Sets the window's accelerator table.

Parameters:

  | name | name of the accelerator resource.

Limitations:
  Because of a limitation of Windows, accelerators don't work in a modal Dialog.

Since:
  0.3

Status:
  done

WS smjg.libs.sdwf.windowbase.WindowBase.style | ( |  | ) |

The window style.

Since:
  0.4

Status:
  done

WS smjg.libs.sdwf.windowbase.WindowBase.style | ( | WS | s | ) |

The window style.

Note:
  Setting this property on a Dialog before the interface element is created will have no effect.

Since:
  0.4

Status:
  done

WS_EX smjg.libs.sdwf.windowbase.WindowBase.exStyle | ( |  | ) |

The window extended style.

Since:
  0.4

Status:
  done

WS_EX smjg.libs.sdwf.windowbase.WindowBase.exStyle | ( | WS_EX | s | ) |

The window extended style.

Note:
  Setting this property on a Dialog before the interface element is created will have no effect.

Since:
  0.4

Status:
  done

MenuBar smjg.libs.sdwf.windowbase.WindowBase.menu | ( |  | ) |

The menu bar attached to this window object.

MenuBar smjg.libs.sdwf.windowbase.WindowBase.menu | ( | MenuBar | m | ) |

The menu bar attached to this window object.

void smjg.libs.sdwf.windowbase.WindowBase.menu | ( | int | id | ) |

The menu bar attached to this window object.

Parameters:

  | id | numeric ID of the menu resource.

void smjg.libs.sdwf.windowbase.WindowBase.menu | ( | string | name | ) |

The menu bar attached to this window object.

Parameters:

  | name | name of the menu resource.

Exceptions:

  | MenuException | if loading the menu failed.

final int smjg.libs.sdwf.windowbase.WindowBase.opEquals | ( | Object | o | ) |

Determines whether this WindowBase is equal to another object.

Since:
  0.4

final int smjg.libs.sdwf.windowbase.WindowBase.opEquals | ( | WindowBase | a | ) |

Determines whether this WindowBase is equal to another WindowBase.

Two WindowBase objects are equal iff they have the same handle, i.e. they interface the same interface element.

Since:
  0.4

final void smjg.libs.sdwf.windowbase.WindowBase.evDestroy | ( | uint | msg | ) | `[protected]`

int smjg.libs.sdwf.windowbase.WindowBase.processMessage | ( | uint | message,
|  | uint | wParam,
|  | int | lParam,
|  | WindowBase | receivedVia |
| ) |  |  | `[protected]`

final int smjg.libs.sdwf.windowbase.WindowBase.intermediateProcessMessage | ( | uint | message,
|  | uint | wParam,
|  | int | lParam,
|  | WindowBase | receivedVia,
|  | out bool | swallow |
| ) |  |  | `[protected]`

final int smjg.libs.sdwf.windowbase.WindowBase.windowBasePredef | ( | uint | message,
|  | uint | wParam,
|  | int | lParam,
|  | WindowBase | receivedVia,
|  | out bool | swallow |
| ) |  |  | `[protected]`

int smjg.libs.sdwf.windowbase.WindowBase.defaultProcessMessage | ( | uint | message,
|  | uint | wParam,
|  | int | lParam |
| ) |  |  | `[protected]`

Reimplemented in smjg.libs.sdwf.mdi.MDIFrameWindow.

void smjg.libs.sdwf.windowbase.WindowBase.predefCommandHandler | ( | uint | notify,
|  | uint | id |
| ) |  |  | `[protected]`

Reimplemented in smjg.libs.sdwf.mdi.MDIFrameWindow, and smjg.libs.sdwf.window.Window.

void smjg.libs.sdwf.windowbase.WindowBase.defaultCommandHandler | ( | uint | notify,
|  | uint | id |
| ) |  |  | `[protected]`

Reimplemented in smjg.libs.sdwf.framewindow.FrameWindow, and smjg.libs.sdwf.mdi.MDIFrameWindow.

int smjg.libs.sdwf.windowbase.WindowBase.predefNotifyHandler | ( | uint | notify,
|  | uint | id,
|  | void * | info |
| ) |  |  | `[protected]`

Reimplemented in smjg.libs.sdwf.dialog.Dialog.

int smjg.libs.sdwf.windowbase.WindowBase.defaultNotifyHandler | ( | uint | notify,
|  | uint | id,
|  | void * | info |
| ) |  |  | `[protected]`

abstract void smjg.libs.sdwf.windowbase.WindowBase.initListeners | ( |  | ) | `[protected, pure virtual]`

Implemented in smjg.libs.sdwf.control.Control, smjg.libs.sdwf.dialog.Dialog, smjg.libs.sdwf.framewindow.FrameWindow, smjg.libs.sdwf.mdi.MDIFrameWindow, and smjg.libs.sdwf.window.Window.

bool smjg.libs.sdwf.windowbase.WindowBase.confirmClose | ( |  | ) |

Determines whether it is OK to close the window or dialog.

Called when a request is made to close the window or dialog by any means. A subclass would override this, e.g. to prompt the user to save a modified data file before exiting.

WindowBase itself has no such checking, so it simply returns true.

Return values:

  | true | to proceed with closing.
  | false | to cancel closing.

Status:
  done

Reimplemented in smjg.libs.sdwf.framewindow.FrameWindow.

void smjg.libs.sdwf.windowbase.WindowBase.setup | ( |  | ) | `[protected]`

Carries out setup operations on the window or dialog.

A subclass would override this method to perform setup operations after the Windows interface element represented by this WindowBase object is created, and before the user can interact with it.

The WindowBase implementation does nothing.

Status:
  done

Reimplemented in smjg.libs.sdwf.framewindow.FrameWindow.

void smjg.libs.sdwf.windowbase.WindowBase.onActivate | ( | ActivationEvent | event | ) |

Carries out operations when the window is made active.

The WindowBase implementation does nothing.

Parameters:

  | event | information about the event of changing the active window.

Since:
  0.58

Status:
  test ActivationEvent

Reimplemented in smjg.libs.sdwf.framewindow.FrameWindow.

void smjg.libs.sdwf.windowbase.WindowBase.onDeactivate | ( | ActivationEvent | event | ) |

Carries out operations when the window is made inactive.

The WindowBase implementation does nothing.

Parameters:

  | event | information about the event of changing the active window.

Since:
  0.58

Status:
  test ActivationEvent

Reimplemented in smjg.libs.sdwf.framewindow.FrameWindow.

void smjg.libs.sdwf.windowbase.WindowBase.cleanup | ( |  | ) | `[protected]`

Carries out cleanup operations on the window or dialog.

A subclass would override this method to perform cleanup operations when the window is ready to be destroyed. It is always called before the window is destroyed or Windows is shut down, after the confirmClose method has been called and returned true.

The WindowBase implementation does nothing.

Status:
  done

bool smjg.libs.sdwf.windowbase.WindowBase._despatchDialogMessage | ( | MSG * | msg | ) | `[protected]`

Reimplemented in smjg.libs.sdwf.window.Window.

## Member Data Documentation

WindowBase smjg.libs.sdwf.windowbase.WindowBase.newWindow`[static, protected]`

string smjg.libs.sdwf.windowbase.WindowBase._text`[protected]`

HWND smjg.libs.sdwf.windowbase.WindowBase._handle`[protected]`

bool smjg.libs.sdwf.windowbase.WindowBase._initialised = false`[protected]`

int(* smjg.libs.sdwf.windowbase.WindowBase.handler)(uint message, uint wParam, int lParam)[uint]`[protected]`

Associates each Windows message (WM_xxxx constant) with a handler method.

It is not necessary to assign a handler to every message that a window or dialog may receive. If none is found, a default handler will take care of the message, or ignore it if the message has no default handling.

Parameters:

  | message | the WM_xxxx constant identifying the message. This is passed in so that similar handlings of different messages can be done by a single method and distinguished at call time.
  | wParam | the first of the two message-dependent parameters, as specified in the Windows API for the given message.
  | lParam | the second of the two message-dependent parameters.

Returns:
  a value dependent on the message being handled, as specified in the Windows API for the given message.

Deprecated:
  This form doesn't allow for passing the message down the chain. It is superseded by WindowBase.messageHandler.

MessageHandler [uint] smjg.libs.sdwf.windowbase.WindowBase.messageHandler`[protected]`

Associates each Windows message (WM_xxxx constant) with a handler method.

It is not necessary to assign a handler to every message that a window or dialog may receive. If none is found, a default handler will take care of the message, or ignore it if the message has no default handling.

Since:
  0.5

void(* smjg.libs.sdwf.windowbase.WindowBase.commandHandler)(uint notify, uint id)[uint]`[protected]`

Associates each menu command, or the notification messages from each control within a dialog, with a handler method.

Parameters:

  | notify | for dialog controls, the constant identifying the particular notification message that was sent.
  | id | the ID of the menu command or dialog control. This is passed in so that similar handlings of different commands or controls can be done by a single method and distinguished at call time.

Note:
  This works only for controls that communicate via the `WM_COMMAND` message. This includes all Windows 9x controls inherited from Windows 3.x. For controls such as 'common controls' that use `WM_NOTIFY`, see notifyHandler.

Deprecated:
  Superseded by WindowBase.menuCommandHandler and WindowBase.notifyHandler

int(* smjg.libs.sdwf.windowbase.WindowBase.notifyHandler)(uint notify, uint id, void *info)[uint]`[protected]`

Associates each control within a dialog with a handler method.

This member can be used to handle both `WM_COMMAND` and `WM_NOTIFY` messages.

Parameters:

  | notify | the constant identifying the particular notification message that was sent.
  | id | the ID of the control that sent the message. This is passed in so that similar handlings of different controls can be done by a single method and distinguished at call time.
  | info | pointer to a Windows API structure containing information about the notification. This is useful for getting information from notification-specific structures passed in by some notifications. For notifications using `WM_COMMAND` rather than `WM_NOTIFY`, this parameter is `null`.

Returns:
  a value as defined in the Windows API for the message being processed. For most notifications, including all that use `WM_COMMAND`, this value is zero.

Since:
  0.4

Status:
  done

void(* smjg.libs.sdwf.windowbase.WindowBase.menuCommandHandler)(bool byAccel, uint id)[uint]`[protected]`

Associates each menu or accelerator with a handler method.

Parameters:

  | byAccel | `true` if the command was activated by an accelerator; `false` if it was activated by a menu.
  | id | the ID of the activated command. This is passed in so that similar handlings of different commands can be done by a single method and distinguished at call time.

Since:
  0.4

Status:
  done

uint smjg.libs.sdwf.windowbase.WindowBase.windowStyle`[protected]`

The window style (combination of WS_xxxx constants). Any changes to this field will be relevant only if made before the window is created.

Deprecated:
  Retained for internal use. Applications should use the WindowBase.style property instead.

WS_EX smjg.libs.sdwf.windowbase.WindowBase._exStyle`[protected]`

The documentation for this class was generated from the following file:

- windowbase.d