#pragma interface "log.h"
#endif
+#include "wx/intl.h"
+
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// (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; }
// 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
// ----------------
// 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
};
// ----------------------------------------------------------------------------