- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Exponent::GUI::Basics::CDialog Class Reference

List of all members.

## Detailed Description

Defines several dialog boxes.

Date:
  28/08/2004

Author:
  Paul Chana

Version:
  1.0.0 Initial version

Note:
  All contents of this source code are copyright 2005 Exp Digital Uk.
  This source file is covered by the licence conditions of the Infinity API. You should have recieved a copy
  with the source code. If you didnt, please refer to http://www.expdigital.co.uk
  All content is the Intellectual property of Exp Digital Uk.
  Certain sections of this code may come from other sources. They are credited where applicable.
  If you have comments, suggestions or bug reports please visit http://support.expdigital.co.uk

Id
  CDialog.hpp,v 1.5 2007/02/11 02:16:22 paul Exp

Definition at line 30 of file CDialog.hpp.

## Static Public Member Functions

- static void audioPrompt ()
- static void notifyUser (const CString &message, const CString &title, const bool isSerious=false)
- static bool openFileDialog (const CSystemString &path, CSystemString &filename, const CString &title, const CString &filterDescription, const CString &filterExtension)
- static bool openFolderDialog (CSystemString &filename, const CString &title)
- static bool openSaveDialog (const CSystemString &startingPath, CSystemString &filename, const CString &title, const CString &filterDescription, const CString &filterExtension)
- static bool promptUser (const CString &message, const CString &title)

## Static Protected Member Functions

- static void createDialogFilter (char *filterString, const CSystemString &filterDescription, const CSystemString &filterExtension)

## Static Protected Attributes

- static const unsigned long CDIALOG_ASTERISK_OPTION
- static const unsigned long CDIALOG_EXCLAMATION_OPTION
- static const unsigned long CDIALOG_HAND_OPTION
- static const unsigned long CDIALOG_MAX_FILTER_STRING
- static const unsigned long CDIALOG_OK_OPTION
- static const unsigned long CDIALOG_QUESTION_OPTION
- static const unsigned long CDIALOG_SIMPLE_OPTION

## Member Function Documentation

static void Exponent::GUI::Basics::CDialog::audioPrompt | ( |  | ) | `[static]`

Audible prompt - sounds a ping!

static void Exponent::GUI::Basics::CDialog::createDialogFilter | ( | char * | filterString,
|  | const CSystemString & | filterDescription,
|  | const CSystemString & | filterExtension |
| ) |  |  | `[static, protected]`

Create the filter for a dialog box

Parameters:

  | filterString | The string that on return stores the filter, including all files
  | filterDescription | A description of the file filter
  | filterExtension | An extension to filter by, maybe *.*

static void Exponent::GUI::Basics::CDialog::notifyUser | ( | const CString & | message,
|  | const CString & | title,
|  | const bool | isSerious = `false` |
| ) |  |  | `[static]`

Put up a message for the user

Parameters:

  | message | The message to print
  | title | The dialog box title
  | isSerious | If true, puts up an eclamation icon

static bool Exponent::GUI::Basics::CDialog::openFileDialog | ( | const CSystemString & | path,
|  | CSystemString & | filename,
|  | const CString & | title,
|  | const CString & | filterDescription,
|  | const CString & | filterExtension |
| ) |  |  | `[static]`

Open load file dialog

Parameters:

  | path | The place to start ie the default location you recommend that they load from
  | filename | On return is filled with the filename they chose. On input can be a suggested filename, or can be blank string if you dont care
  | title | The title to display
  | filterDescription | A description of the file filter, on mac this is placed in the "message" location, would normally be something like "Text files (*.txt)
  | filterExtension | An extension to filter by, doesnt need the *. at the beggining, so to filter by text filesw you pass "txt"
       // Here is an example of how to use the save dialog prompt:
       CSystemString path        = CApplication::getApplicationInstallPath(); // This is the starting path for the save dialog - this is the place you want to recommend that your users save to
       CSystemString filename    = "Some sensible default name";              // Notice that you dont need to apply the extension
       CString title           = "Save a text file from my application";      // This is a descriptive title for the save window
       CString filterDescription = "Text files (*.txt)";                      // This is a description of some sort of the file type you are saving
       CString filterExtension   = "txt";                                     // The extension to search for, without the "." at the beggining

       // Now we try and open the dialog
       if (CDialog::openFileDialog(path, filename, title, filterDescription, filterExtension))
       {
             cout << "The user selected a file path to load from and the path was " << filename.getString() << endl;
       }
       else
       {
             cout << "The user hit cancel" << endl;
       }

static bool Exponent::GUI::Basics::CDialog::openFolderDialog | ( | CSystemString & | filename,
|  | const CString & | title |
| ) |  |  | `[static]`

Open a choose folder dialog

Parameters:

  | filename | On return is filled with the filename they chose
  | title | the window title

Return values:

  | bool | True if filename is filled properly, false if they clicked cancel

static bool Exponent::GUI::Basics::CDialog::openSaveDialog | ( | const CSystemString & | startingPath,
|  | CSystemString & | filename,
|  | const CString & | title,
|  | const CString & | filterDescription,
|  | const CString & | filterExtension |
| ) |  |  | `[static]`

Open save dialog

Parameters:

  | startingPath | The place to start
  | filename | On return is filled with the filename they chose, on input this can be a default file name
  | title | The title of the window
  | filterDescription | A description of the file filter, on mac this is placed in the "message" location, would normally be something like "Text files (*.txt)
  | filterExtension | An extension to filter by, doesnt need the *. at the beggining, so to filter by text filesw you pass "txt"
       // Here is an example of how to use the save dialog prompt:
       CSystemString path        = CApplication::getApplicationInstallPath(); // This is the starting path for the save dialog - this is the place you want to recommend that your users save to
       CSystemString filename    = "Some sensible default name";              // Notice that you dont need to apply the extension
       CString title           = "Save a text file from my application";      // This is a descriptive title for the save window
       CString filterDescription = "Text files (*.txt)";                      // This is a description of some sort of the file type you are saving
       CString filterExtension   = "txt";                                     // The extension to search for, without the "." at the beggining

       // Now we try and open the dialog
       if (CDialog::openSaveDialog(path, filename, title, filterDescription, filterExtension))
       {
             cout << "The user selected a file path to save to and the path was " << filename.getString() << endl;
       }
       else
       {
             cout << "The user hit cancel" << endl;
       }

static bool Exponent::GUI::Basics::CDialog::promptUser | ( | const CString & | message,
|  | const CString & | title |
| ) |  |  | `[static]`

Get Response from user

Parameters:

  | message | The message to print
  | title | The dialog box title

Return values:

  | true | if they clicked ok, false if they clicked cancel

## Member Data Documentation

const unsigned long Exponent::GUI::Basics::CDialog::CDIALOG_ASTERISK_OPTION`[static, protected]`

Asterisk option

Definition at line 130 of file CDialog.hpp.

const unsigned long Exponent::GUI::Basics::CDialog::CDIALOG_EXCLAMATION_OPTION`[static, protected]`

Exclamation option

Definition at line 131 of file CDialog.hpp.

const unsigned long Exponent::GUI::Basics::CDialog::CDIALOG_HAND_OPTION`[static, protected]`

Hand option

Definition at line 132 of file CDialog.hpp.

const unsigned long Exponent::GUI::Basics::CDialog::CDIALOG_MAX_FILTER_STRING`[static, protected]`

Max length of the filter

Definition at line 135 of file CDialog.hpp.

const unsigned long Exponent::GUI::Basics::CDialog::CDIALOG_OK_OPTION`[static, protected]`

OK option

Definition at line 129 of file CDialog.hpp.

const unsigned long Exponent::GUI::Basics::CDialog::CDIALOG_QUESTION_OPTION`[static, protected]`

Question option

Definition at line 133 of file CDialog.hpp.

const unsigned long Exponent::GUI::Basics::CDialog::CDIALOG_SIMPLE_OPTION`[static, protected]`

Simple option

Definition at line 134 of file CDialog.hpp.