X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/275bf4c13ab7f4b041b0d5c78cfdece709800d14..83626bfa72bd7f0147392818846242a846d12063:/include/wx/log.h?ds=sidebyside diff --git a/include/wx/log.h b/include/wx/log.h index db850ff128..c4550d25fd 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -16,6 +16,8 @@ #pragma interface "log.h" #endif +#include "wx/intl.h" + // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -68,7 +70,7 @@ public: // (FILE and iostream logs don't need it, but wxGuiLog does to avoid // showing 17 modal dialogs one after another) virtual void Flush(); - // call to Flush() may be optimized: call it only if this function + // call to Flush() may be optimized: call it only if this function // returns true (although Flush() also returns immediately if there // is no messages, this functions is more efficient because inline) bool HasPendingMessages() const { return m_bHasMessages; } @@ -119,7 +121,7 @@ protected: // default DoLogString does nothing but is not pure virtual because if // you override DoLog() you might not need it at all virtual void DoLogString(const char *szString); - + private: // static variables // ---------------- @@ -197,25 +199,40 @@ protected: // close it, clear the log contents or save it to the file. // ---------------------------------------------------------------------------- class wxLogFrame; +class wxFrame; class WXDLLEXPORT wxLogWindow : public wxLog { public: - wxLogWindow(const char *szTitle, bool bShow = TRUE); + wxLogWindow(const char *szTitle, // the title of the frame + bool bShow = TRUE, // show window immediately? + bool bPassToOld = TRUE); // pass log messages to the old target? ~wxLogWindow(); - - // show/hide the log window + + // window operations + // show/hide the log window void Show(bool bShow = TRUE); + // get the frame pointer (you shouldn't close it!) + wxFrame *GetFrame() const; // accessors + // the previous log target (may be NULL) wxLog *GetOldLog() const { return m_pOldLog; } + // are we passing the messages to the previous log target? + bool IsPassingMessages() const { return m_bPassMessages; } + + // we can pass the messages to the previous log target (we're in this mode by + // default: we collect all messages in the window, but also let the default + // processing take place) + void PassMessages(bool bDoPass) { m_bPassMessages = bDoPass; } protected: virtual void DoLog(wxLogLevel level, const char *szString); virtual void DoLogString(const char *szString); - + private: - wxLog *m_pOldLog; // previous log target - wxLogFrame *m_pLogFrame; // the log frame + bool m_bPassMessages; // pass messages to m_pOldLog? + wxLog *m_pOldLog; // previous log target + wxLogFrame *m_pLogFrame; // the log frame }; // ----------------------------------------------------------------------------