CamErrorDialog Class Reference

The underlying function for [Tool-Module]Inform[Warning-Error]. More...

List of all members.

Public Member Functions

 CamErrorDialog (ResourceID TitleID)
wxButton * AddErrorButton (wxSizer *pButtonSizer, const TCHAR *pText, INT32 id)
void ButtonClicked (wxCommandEvent &event)

Public Attributes

INT32 m_nHelpContext


Detailed Description

The underlying function for [Tool-Module]Inform[Warning-Error].

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com> (then Andy)
Date:
15/6/93
Parameters:
Error - either ERRORTYPE_NORMAL, [INPUTS] ERRORTYPE_ERROR, ERRORTYPE_WARNING or ERRORTYPE_SERIOUS ModID - Module ID to obtain messages (0=Kernel). ErrorMsg - The Error Message to display. 0 means use static Error Butt1-4 - The Text for the buttons. Up to 4 buttons can be specified If Butt1 is 0, it means use '_R(IDS_OK)', i.e. "OK". OK - which button (1-4) should be the OK (default) button. Cancel - button should be the 'Cancel' button (and hence responds to Esc).
Returns:
The number of the button used to close the dialog.
See also:
InformWarning; InformGeneral; ToolInformWarning; ToolInformError; ModuleInformWarning; ModuleInformError

Definition at line 370 of file errors.cpp.


Constructor & Destructor Documentation

CamErrorDialog::CamErrorDialog ResourceID  TitleID  )  [inline]
 

Definition at line 373 of file errors.cpp.

00373                                        :  wxDialog( NULL, -1, CamResource::GetText(TitleID),
00374                                             wxDefaultPosition, wxDefaultSize,
00375                                             wxDEFAULT_DIALOG_STYLE | wxSTAY_ON_TOP )
00376     {
00377         m_nHelpContext = Error::GetErrorNumber();
00378         if (! m_nHelpContext) m_nHelpContext = GetNextMsgHelpContext();
00379     }


Member Function Documentation

wxButton* CamErrorDialog::AddErrorButton wxSizer *  pButtonSizer,
const TCHAR pText,
INT32  id
[inline]
 

Definition at line 381 of file errors.cpp.

00382     {
00383         wxButton* pButton = new wxButton( this, id, pText, wxDefaultPosition, wxDefaultSize, 0 );
00384         if (!pButton)
00385             return NULL;
00386         pButtonSizer->Add(pButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00387         return pButton;
00388     }

void CamErrorDialog::ButtonClicked wxCommandEvent &  event  )  [inline]
 

Definition at line 390 of file errors.cpp.

00391     {
00392         ResourceID id = event.GetId();
00393         if (id == _R(IDS_HELP)) // Help always has a fixed ID.
00394         {
00395 #if !defined(EXCLUDE_FROM_RALPH)
00396             // It is, so run the help topic associated with the message ID.
00397             HelpUser(m_nHelpContext);
00398 #endif
00399         }
00400         else if (id == _R(IDS_ERRORBOX_DEBUGREPORT))
00401         {
00402 #ifdef HAVE_DEBUGREPORT
00403             wxCamDebugReport report;
00404             wxDebugReportPreviewStd preview;
00405         
00406             report.AddAll();
00407         
00408             if ( preview.Show(report) )
00409                 report.Process();
00410 #else
00411             // This string is not translatable in case translation errors. Note it should never
00412             // appear as the button to call this is disabled where the build does not support
00413             // debug reports.
00414             ::wxMessageBox(_T("Your build was not compiled to support debug reports"));
00415 #endif
00416         }
00417         else
00418         {
00419             EndModal(id);
00420         }
00421     }


Member Data Documentation

INT32 CamErrorDialog::m_nHelpContext
 

Definition at line 423 of file errors.cpp.


The documentation for this class was generated from the following file:
Generated on Sat Nov 10 03:51:49 2007 for Camelot by  doxygen 1.4.4