Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

W32DLib::Common Class Reference

The Common class. More...

#include <w32dlib/common.h>

List of all members.

Static Public Member Functions

static void Initialise ()
 Initialises any Windows APIs required by W32DLib.
static void MessageTitle (const char *title)
 Sets the default titles for message boxes.
static void Message (HWND parent, const char *title, const char *msg)
 Displays a message box.
static void Message (HWND parent, const char *title, const std::string &msg)
 Displays a message box.
static void Error (HWND parent, const char *title, const char *msg)
 Displays an error message box.
static void Error (HWND parent, const char *title, const std::string &msg)
 Displays an error message box.
static bool Query (HWND parent, const char *title, const char *msg)
 Displays a Yes/No message box.
static bool Query (HWND parent, const char *title, const std::string &msg)
 Displays a Yes/No message box.
static bool OpenFile (HWND parent, const char *title, std::string &path, const char *filter)
 Requests a file to open.
static bool SaveFile (HWND parent, const char *title, std::string &path, const char *filter)
 Requests a file to save.
static bool SelectDir (HWND parent, const char *title, std::string &path)
 Selects a directory.
static std::string GetOSError ()
 Returns the last error as a readable string.
static HINSTANCE GetInstance ()
 Get an HINSTANCE.
static HWND GetAppWindow ()
 Get an application's top-level window.


Detailed Description

The Common class.

This class provides common dialogs and useful routines.


Member Function Documentation

static void W32DLib::Common::Error HWND  parent,
const char *  title,
const std::string &  msg
[static]
 

Displays an error message box.

Parameters:
parent Parent window (NULL for none)
title The title to display. NULL for default ("Error") or to use the default supplied to MessageTitle().
msg The error message to display.

static void W32DLib::Common::Error HWND  parent,
const char *  title,
const char *  msg
[static]
 

Displays an error message box.

Parameters:
parent Parent window (NULL for none)
title The title to display. NULL for default ("Error") or to use the default supplied to MessageTitle().
msg The error message to display.

static HWND W32DLib::Common::GetAppWindow  )  [static]
 

Get an application's top-level window.

This finds the top-level window for the application. This is mainly a helper for when you're in a DLL, cannot access the applications window handle any other way and wish to display a modal Dialog.

Returns:
The window handle, or zero for error or the window couldn't be found.

static HINSTANCE W32DLib::Common::GetInstance  )  [static]
 

Get an HINSTANCE.

This should (though it hasn't been proved in all cases) get the apropriate HINSTANCE for the application or DLL the library has be linked into.

Returns:
The HINSTANCE

static std::string W32DLib::Common::GetOSError  )  [static]
 

Returns the last error as a readable string.

Returns:
The error message

static void W32DLib::Common::Initialise  )  [static]
 

Initialises any Windows APIs required by W32DLib.

static void W32DLib::Common::Message HWND  parent,
const char *  title,
const std::string &  msg
[static]
 

Displays a message box.

Parameters:
parent Parent window (NULL for none)
title The title to display. NULL for default ("Message") or to use the default supplied to MessageTitle().
msg The message to display.

static void W32DLib::Common::Message HWND  parent,
const char *  title,
const char *  msg
[static]
 

Displays a message box.

Parameters:
parent Parent window (NULL for none)
title The title to display. NULL for default ("Message") or to use the default supplied to MessageTitle().
msg The message to display.

static void W32DLib::Common::MessageTitle const char *  title  )  [static]
 

Sets the default titles for message boxes.

All MessageBox type calls provide a default title if non is provided. Using this you can set the default title to an application specific one.

Parameters:
title The default title. This pointer must remain valid throughout the life of the application.

static bool W32DLib::Common::OpenFile HWND  parent,
const char *  title,
std::string &  path,
const char *  filter
[static]
 

Requests a file to open.

Parameters:
parent The parent window.
title Title for the selector.
path The current filename. This will hold the selected name on return if a file is selected.
filter The file selector filter.
Returns:
True if a file was selected and path updated.

static bool W32DLib::Common::Query HWND  parent,
const char *  title,
const std::string &  msg
[static]
 

Displays a Yes/No message box.

Parameters:
parent Parent window (NULL for none)
title The title to display. NULL for default ("Question") or to use the default supplied to MessageTitle().
msg The message to display.
Returns:
True if the user selects Yes.

static bool W32DLib::Common::Query HWND  parent,
const char *  title,
const char *  msg
[static]
 

Displays a Yes/No message box.

Parameters:
parent Parent window (NULL for none)
title The title to display. NULL for default ("Question") or to use the default supplied to MessageTitle().
msg The message to display.
Returns:
True if the user selects Yes.

static bool W32DLib::Common::SaveFile HWND  parent,
const char *  title,
std::string &  path,
const char *  filter
[static]
 

Requests a file to save.

Parameters:
parent The parent window.
title Title for the selector.
path The current filename. This will hold the selected name on return if a file is selected.
filter The file selector filter.
Returns:
True if a file was selected and path updated.

static bool W32DLib::Common::SelectDir HWND  parent,
const char *  title,
std::string &  path
[static]
 

Selects a directory.

Parameters:
parent The parent window.
title Title for the selector.
path The current path. This will hold the selected path on return if a directory is selected.
Returns:
True if a directory was selected and path updated.


The documentation for this class was generated from the following file:
Generated on Fri May 6 01:22:33 2005 for W32DLib by  doxygen 1.4.1