#pragma interface "log.h"
#endif
-#include "wx/intl.h"
-
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// you override DoLog() you might not need it at all
virtual void DoLogString(const char *szString);
+ // helpers
+ // put the time stamp in the current format into the string
+ wxString TimeStamp() const;
+
private:
// static variables
// ----------------
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();
// window operations
// show/hide the log window
void Show(bool bShow = TRUE);
- // get the frame pointer (you shouldn't close it!)
+ // retrieve the pointer to the frame
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; }
+
+ // base class virtuals
+ // we don't need it ourselves, but we pass it to the previous logger
+ virtual void Flush();
+
+ // overridables
+ // called immediately after the log frame creation allowing for
+ // any extra initializations
+ virtual void OnFrameCreate(wxFrame *frame);
+ // called right before the log frame is going to be deleted
+ virtual void OnFrameDelete(wxFrame *frame);
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
};
// ----------------------------------------------------------------------------