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

- Class List
- Class Hierarchy
- Class Members

# smjg.libs.sdwf.dialog.Dialog Class Reference

The smjg.libs.sdwf.dialog.Dialog class defines basic behaviour of a dialog box. More...

Inheritance diagram for smjg.libs.sdwf.dialog.Dialog:

List of all members.

## Public Member Functions
| this (uint id, WindowBase parent, bool modal)
| Constructs a Dialog object to interface the given dialog resource.
| this (string name, WindowBase parent, bool modal)
| Constructs a Dialog object to interface the given dialog resource.
| this (uint id, Application app)
| Constructs a Dialog object to interface the given dialog resource and to be used as a top-level application window.
| this (string name, Application app)
| Constructs a Dialog object to interface the given dialog resource and to be used as a top-level application window.
| this (Application a, HWND h)
| Constructs a Dialog object to interface a pre-existing dialog.
| this (WindowBase w, HWND h)
| Constructs a Dialog object to interface a pre-existing dialog.
override void | create ()
| Creates the Windows interface element represented by this Dialog object.
override int | show ()
| Creates and displays the dialog box represented by this Dialog object.
## Protected Member Functions
final override int | processMessage (uint message, uint wParam, int lParam, WindowBase receivedVia)
int | dialogPredef (uint message, uint wParam, int lParam, WindowBase receivedVia, out bool swallow)
void | initListeners ()
override int | predefNotifyHandler (uint notify, uint id, void *info)
override void | close (int exitCode=0)
| Calls confirmClose, and if it returns true, closes the dialog.
Callback Methods
bool | setInitialFocus ()
| Called when the dialog is created, immediately after setup, in order to set a control to receive the initial focus.

## Detailed Description

The smjg.libs.sdwf.dialog.Dialog class defines basic behaviour of a dialog box.

The programmer would define a subclass of Dialog to interface a particular dialog box in the application.

Bug:
  Keyboard navigation doesn't work in a dialog with WS.CHILD style.

## Constructor & Destructor Documentation

smjg.libs.sdwf.dialog.Dialog.this | ( | uint | id,
|  | WindowBase | parent,
|  | bool | modal |
| ) |  |  |

Constructs a Dialog object to interface the given dialog resource.

Parameters:

  | id | numeric ID of the dialog resource.
  | parent | the parent dialog or window object.
  | modal | whether it will be a modal dialog (one that prevents interaction with its parent for the time it is displayed), as opposed to a modeless dialog (the user will be able to switch freely between the dialog box and its parent).

Status:
  done

smjg.libs.sdwf.dialog.Dialog.this | ( | string | name,
|  | WindowBase | parent,
|  | bool | modal |
| ) |  |  |

Constructs a Dialog object to interface the given dialog resource.

Parameters:

  | name | name of the dialog resource.
  | parent | the parent dialog or window object.
  | modal | whether it will be a modal dialog (one that prevents interaction with its parent for the time it is displayed), as opposed to a modeless dialog (the user will be able to switch freely between the dialog box and its parent).

Status:
  test

smjg.libs.sdwf.dialog.Dialog.this | ( | uint | id,
|  | Application | app |
| ) |  |  |

Constructs a Dialog object to interface the given dialog resource and to be used as a top-level application window.

Parameters:

  | id | numeric ID of the dialog resource.
  | app | the application to which this dialog will belong.

Since:
  0.3

Status:
  done

smjg.libs.sdwf.dialog.Dialog.this | ( | string | name,
|  | Application | app |
| ) |  |  |

Constructs a Dialog object to interface the given dialog resource and to be used as a top-level application window.

Parameters:

  | name | name of the dialog resource.
  | app | the application to which this dialog will belong.

Since:
  0.3

Status:
  test

smjg.libs.sdwf.dialog.Dialog.this | ( | Application | a,
|  | HWND | h |
| ) |  |  |

Constructs a Dialog object to interface a pre-existing dialog.

This can be used to perform operations on a dialog outside of SDWF's control. SDWF currently does not subclass interface elements, and so message handling will not work.

Parameters:

  | 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.dialog.Dialog.this | ( | WindowBase | w,
|  | HWND | h |
| ) |  |  |

Constructs a Dialog object to interface a pre-existing dialog.

This can be used to perform operations on a dialog outside of SDWF's control. SDWF currently does not subclass interface elements, and so message handling will not work.

Parameters:

  | w | the parent window object.
  | h | the Windows handle of the window.

## Member Function Documentation

override void smjg.libs.sdwf.dialog.Dialog.create | ( |  | ) | `[virtual]`

Creates the Windows interface element represented by this Dialog object.

Precondition:
  It is illegal to call this method more than once on any Dialog, or on a modal dialog.

Since:
  0.3

Status:
  done

Implements smjg.libs.sdwf.windowbase.WindowBase.

override int smjg.libs.sdwf.dialog.Dialog.show | ( |  | ) |

Creates and displays the dialog box represented by this Dialog object.

Returns:
  For a modal dialog, this method blocks until the dialog is closed, and returns its exit code. For a modeless dialog, it immediately returns zero.

Status:
  test further

Reimplemented from smjg.libs.sdwf.windowbase.WindowBase.

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

int smjg.libs.sdwf.dialog.Dialog.dialogPredef | ( | uint | message,
|  | uint | wParam,
|  | int | lParam,
|  | WindowBase | receivedVia,
|  | out bool | swallow |
| ) |  |  | `[protected]`

void smjg.libs.sdwf.dialog.Dialog.initListeners | ( |  | ) | `[protected, virtual]`

Implements smjg.libs.sdwf.windowbase.WindowBase.

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

Reimplemented from smjg.libs.sdwf.windowbase.WindowBase.

bool smjg.libs.sdwf.dialog.Dialog.setInitialFocus | ( |  | ) | `[protected]`

Called when the dialog is created, immediately after setup, in order to set a control to receive the initial focus.

Return values:

  | true | to indicate that no focus has been set, to tell Windows to automatically set the focus. This is the default Dialog implementation.
  | false | to indicate that the method has been overridden to set the focus on a specific control.

override void smjg.libs.sdwf.dialog.Dialog.close | ( | int | exitCode = `0` | ) | `[protected]`

Calls confirmClose, and if it returns true, closes the dialog.

Parameters:

  | exitCode | the dialog exit code, which will be returned from show if the dialog is modal. For a modeless dialog, this parameter is ignored.

Status:
  test further

Reimplemented from smjg.libs.sdwf.windowbase.WindowBase.

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

- dialog.d