+
+ /**
+ Presents the accumulated log messages, if any, to the user.
+
+ This method is called during the idle time and should show any messages
+ accumulated in wxLogGui#m_aMessages field to the user.
+ */
+ virtual void Flush();
+
+protected:
+ /**
+ Returns the appropriate title for the dialog.
+
+ The title is constructed from wxApp::GetAppDisplayName() and the
+ severity string (e.g. "error" or "warning") appropriate for the current
+ wxLogGui#m_bErrors and wxLogGui#m_bWarnings values.
+ */
+ wxString GetTitle() const;
+
+ /**
+ Returns wxICON_ERROR, wxICON_WARNING or wxICON_INFORMATION depending on
+ the current maximal severity.
+
+ This value is suitable to be used in the style parameter of
+ wxMessageBox() function.
+ */
+ int GetSeverityIcon() const;
+
+ /**
+ Forgets all the currently stored messages.
+
+ If you override Flush() (and don't call the base class version), you
+ must call this method to avoid messages being logged over and over
+ again.
+ */
+ void Clear();
+
+
+ /**
+ All currently accumulated messages.
+
+ This array may be empty if no messages were logged.
+
+ @see m_aSeverity, m_aTimes
+ */
+ wxArrayString m_aMessages;
+
+ /**
+ The severities of each logged message.
+
+ This array is synchronized with wxLogGui#m_aMessages, i.e. the n-th
+ element of this array corresponds to the severity of the n-th message.
+ The possible severity values are @c wxLOG_XXX constants, e.g.
+ wxLOG_Error, wxLOG_Warning, wxLOG_Message etc.
+ */
+ wxArrayInt m_aSeverity;
+
+ /**
+ The time stamps of each logged message.
+
+ The elements of this array are time_t values corresponding to the time
+ when the message was logged.
+ */
+ wxArrayLong m_aTimes;
+
+ /**
+ True if there any error messages.
+ */
+ bool m_bErrors;
+
+ /**
+ True if there any warning messages.
+
+ If both wxLogGui#m_bErrors and this member are false, there are only
+ informational messages to be shown.
+ */
+ bool m_bWarnings;
+
+ /**
+ True if there any messages to be shown to the user.
+
+ This variable is used instead of simply checking whether
+ wxLogGui#m_aMessages array is empty to allow blocking further calls to
+ Flush() while a log dialog is already being shown, even if the messages
+ array hasn't been emptied yet.
+ */
+ bool m_bHasMessages;
+
+private:
+ /**
+ Method called by Flush() to show a single log message.
+
+ This function can be overridden to show the message in a different way.
+ By default a simple wxMessageBox() call is used.
+
+ @param message
+ The message to show (it can contain multiple lines).
+ @param title
+ The suggested title for the dialog showing the message, see
+ GetTitle().
+ @param style
+ One of @c wxICON_XXX constants, see GetSeverityIcon().
+ */
+ virtual void DoShowSingleLogMessage(const wxString& message,
+ const wxString& title,
+ int style);
+
+ /**
+ Method called by Flush() to show multiple log messages.
+
+ This function can be overridden to show the messages in a different way.
+ By default a special log dialog showing the most recent message and
+ allowing the user to expand it to view the previously logged ones is
+ used.
+
+ @param messages
+ Array of messages to show; it contains more than one element.
+ @param severities
+ Array of message severities containing @c wxLOG_XXX values.
+ @param times
+ Array of time_t values indicating when each message was logged.
+ @param title
+ The suggested title for the dialog showing the message, see
+ GetTitle().
+ @param style
+ One of @c wxICON_XXX constants, see GetSeverityIcon().
+ */
+ virtual void DoShowMultipleLogMessages(const wxArrayString& messages,
+ const wxArrayInt& severities,
+ const wxArrayLong& times,
+ const wxString& title,
+ int style);