1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxLog and related classes documentation
4 %% Author: Vadim Zeitlin
6 %% Created: some time ago
8 %% Copyright: (c) 1997-2001 Vadim Zeitlin
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxLog
}}\label{wxlog
}
14 wxLog class defines the interface for the
{\it log targets
} used by wxWindows
15 logging functions as explained in the
\helpref{wxLog overview
}{wxlogoverview
}.
16 The only situations when you need to directly use this class is when you want
17 to derive your own log target because the existing ones don't satisfy your
18 needs. Another case is if you wish to customize the behaviour of the standard
19 logging classes (all of which respect the wxLog settings): for example, set
20 which trace messages are logged and which are not or change (or even remove
21 completely) the timestamp on the messages.
23 Otherwise, it is completely hidden behind the
{\it wxLogXXX()
} functions and
24 you may not even know about its existence.
26 See
\helpref{log overview
}{wxlogoverview
} for the descriptions of wxWindows
29 \wxheading{Derived from
}
33 \wxheading{Include files
}
37 \latexignore{\rtfignore{\wxheading{Function groups
}}}
39 \membersection{Static functions
}
41 The functions in this section work with and manipulate the active log target.
42 The
\helpref{OnLog()
}{wxlogonlog
} is called by the
{\it wxLogXXX()
} functions
43 and invokes the
\helpref{DoLog()
}{wxlogdolog
} of the active log target if any.
44 Get/Set methods are used to install/query the current active target and,
45 finally,
\helpref{DontCreateOnDemand()
}{wxlogdontcreateondemand
} disables the
46 automatic creation of a standard log target if none actually exists. It is
47 only useful when the application is terminating and shouldn't be used in other
48 situations because it may easily lead to a loss of messages.
50 \helpref{OnLog
}{wxlogonlog
}\\
51 \helpref{GetActiveTarget
}{wxloggetactivetarget
}\\
52 \helpref{SetActiveTarget
}{wxlogsetactivetarget
}\\
53 \helpref{DontCreateOnDemand
}{wxlogdontcreateondemand
}\\
54 \helpref{Suspend
}{wxlogsuspend
}\\
55 \helpref{Resume
}{wxlogresume
}
57 \membersection{Logging functions
}
59 There are two functions which must be implemented by any derived class to
60 actually process the log messages:
\helpref{DoLog
}{wxlogdolog
} and
61 \helpref{DoLogString
}{wxlogdologstring
}. The second function receives a string
62 which just has to be output in some way and the easiest way to write a new log
63 target is to override just this function in the derived class. If more control
64 over the output format is needed, then the first function must be overridden
65 which allows to construct custom messages depending on the log level or even
66 do completely different things depending on the message severity (for example,
67 throw away all messages except warnings and errors, show warnings on the
68 screen and forward the error messages to the user's (or programmer's) cell
69 phone - maybe depending on whether the timestamp tells us if it is day or
70 night in the current time zone).
72 There also functions to support message buffering. Why are they needed?
73 Some of wxLog implementations, most notably the standard wxLogGui class,
74 buffer the messages (for example, to avoid showing the user a zillion of modal
75 message boxes one after another -- which would be really annoying).
76 \helpref{Flush()
}{wxlogflush
} shows them all and clears the buffer contents.
77 This function doesn't do anything if the buffer is already empty.
79 \helpref{Flush
}{wxlogflush
}\\
80 \helpref{FlushActive
}{wxlogflushactive
}
82 \membersection{Customization
}\label{wxlogcustomization
}
84 The functions below allow some limited customization of wxLog behaviour
85 without writing a new log target class (which, aside of being a matter of
86 several minutes, allows you to do anything you want).
88 The verbose messages are the trace messages which are not disabled in the
89 release mode and are generated by
\helpref{wxLogVerbose
}{wxlogverbose
}. They
90 are not normally shown to the user because they present little interest, but
91 may be activated, for example, in order to help the user find some program
94 As for the (real) trace messages, their handling depends on the settings of
95 the (application global)
{\it trace mask
}. There are two ways to specify it:
96 either by using
\helpref{SetTraceMask
}{wxlogsettracemask
} and
97 \helpref{GetTraceMask
}{wxloggettracemask
} and using
98 \helpref{wxLogTrace
}{wxlogtrace
} which takes an integer mask or by using
99 \helpref{AddTraceMask
}{wxlogaddtracemask
} for string trace masks.
101 The difference between bit-wise and string trace masks is that a message using
102 integer trace mask will only be logged if all bits of the mask are set in the
103 current mask while a message using string mask will be logged simply if the
104 mask had been added before to the list of allowed ones.
109 // wxTraceOleCalls is one of standard bit masks
110 wxLogTrace(wxTraceRefCount | wxTraceOleCalls, "Active object ref count:
%d", nRef);
112 will do something only if the current trace mask contains both
113 {\tt wxTraceRefCount
} and
{\tt wxTraceOle
}, but
116 // wxTRACE_OleCalls is one of standard string masks
117 wxLogTrace(wxTRACE_OleCalls, "IFoo::Bar() called");
120 will log the message if it was preceded by
123 wxLog::AddTraceMask(wxTRACE_OleCalls);
126 Using string masks is simpler and allows to easily add custom ones, so this is
127 the preferred way of working with trace messages. The integer trace mask is
128 kept for compatibility and for additional (but very rarely needed) flexibility
131 The standard trace masks are given in
\helpref{wxLogTrace
}{wxlogtrace
}
134 Finally, the
{\it wxLog::DoLog()
} function automatically prepends a time stamp
135 to all the messages. The format of the time stamp may be changed: it can be
136 any string with \% specifications fully described in the documentation of the
137 standard
{\it strftime()
} function. For example, the default format is
138 "
[\%d/\%b/\%y \%H:\%M:\%S
] " which gives something like "
[17/Sep/
98 22:
10:
16] "
139 (without quotes) for the current date. Setting an empty string as the time
140 format disables timestamping of the messages completely.
142 {\bf NB:
} Timestamping is disabled for Visual C++ users in debug builds by
143 default because otherwise it would be impossible to directly go to the line
144 from which the log message was generated by simply clicking in the debugger
145 window on the corresponding error message. If you wish to enable it, please use
146 \helpref{SetTimestamp
}{wxlogsettimestamp
} explicitly.
148 \helpref{AddTraceMask
}{wxlogaddtracemask
}\\
149 \helpref{RemoveTraceMask
}{wxlogremovetracemask
}\\
150 \helpref{ClearTraceMasks
}{wxlogcleartracemasks
}\\
151 \helpref{GetTraceMasks
}{wxloggettracemasks
}\\
152 \helpref{IsAllowedTraceMask
}{wxlogisallowedtracemask
}\\
153 \helpref{SetVerbose
}{wxlogsetverbose
}\\
154 \helpref{GetVerbose
}{wxloggetverbose
}\\
155 \helpref{SetTimestamp
}{wxlogsettimestamp
}\\
156 \helpref{GetTimestamp
}{wxloggettimestamp
}\\
157 \helpref{SetTraceMask
}{wxlogsettracemask
}\\
158 \helpref{GetTraceMask
}{wxloggettracemask
}
160 %%%%% MEMBERS HERE %%%%%
161 \helponly{\insertatlevel{2}{
167 \membersection{wxLog::AddTraceMask
}\label{wxlogaddtracemask
}
169 \func{static void
}{AddTraceMask
}{\param{const wxString\&
}{mask
}}
171 Add the
{\it mask
} to the list of allowed masks for
172 \helpref{wxLogTrace
}{wxlogtrace
}.
175 \helpref{RemoveTraceMask
}{wxlogremovetracemask
}
176 \helpref{GetTraceMasks
}{wxloggettracemasks
}
178 \membersection{wxLog::ClearTraceMasks
}\label{wxlogcleartracemasks
}
180 \func{static void
}{ClearTraceMasks
}{\void}
182 Removes all trace masks previously set with
183 \helpref{AddTraceMask
}{wxlogaddtracemask
}.
186 \helpref{RemoveTraceMask
}{wxlogremovetracemask
}
188 \membersection{wxLog::GetTraceMasks
}\label{wxloggettracemasks
}
190 \func{static const wxArrayString &
}{GetTraceMasks
}{\void}
192 Returns the currently allowed list of string trace masks.
195 \helpref{AddTraceMask
}{wxlogaddtracemask
}.
197 \membersection{wxLog::OnLog
}\label{wxlogonlog
}
199 \func{static void
}{OnLog
}{\param{wxLogLevel
}{ level
},
\param{const char *
}{ message
}}
201 Forwards the message at specified level to the
{\it DoLog()
} function of the
202 active log target if there is any, does nothing otherwise.
204 \membersection{wxLog::GetActiveTarget
}\label{wxloggetactivetarget
}
206 \func{static wxLog *
}{GetActiveTarget
}{\void}
208 Returns the pointer to the active log target (may be NULL).
210 \membersection{wxLog::SetActiveTarget
}\label{wxlogsetactivetarget
}
212 \func{static wxLog *
}{SetActiveTarget
}{\param{wxLog *
}{ logtarget
}}
214 Sets the specified log target as the active one. Returns the pointer to the
215 previous active log target (may be NULL).
217 \membersection{wxLog::Suspend
}\label{wxlogsuspend
}
219 \func{static void
}{Suspend
}{\void}
221 Suspends the logging until
\helpref{Resume
}{wxlogresume
} is called. Note that
222 the latter must be called the same number of times as the former to undo it,
223 i.e. if you call Suspend() twice you must call Resume() twice as well.
225 Note that suspending the logging means that the log sink won't be be flushed
226 periodically, it doesn't have any effect if the current log target does the
227 logging immediately without waiting for
\helpref{Flush
}{wxlogflush
} to be
228 called (the standard GUI log target only shows the log dialog when it is
229 flushed, so Suspend() works as expected with it).
231 \wxheading{See also:
}
233 \helpref{Resume
}{wxlogresume
},\\
234 \helpref{wxLogNull
}{wxlogoverview
}
236 \membersection{wxLog::Resume
}\label{wxlogresume
}
238 \func{static void
}{Resume
}{\void}
240 Resumes logging previously suspended by a call to
241 \helpref{Suspend
}{wxlogsuspend
}. All messages logged in the meanwhile will be
244 \membersection{wxLog::DoLog
}\label{wxlogdolog
}
246 \func{virtual void
}{DoLog
}{\param{wxLogLevel
}{level
},
\param{const wxChar
}{*msg
},
\param{time
\_t }{timestamp
}}
248 Called to process the message of the specified severity.
{\it msg
} is the text
249 of the message as specified in the call of
{\it wxLogXXX()
} function which
250 generated it and
{\it timestamp
} is the moment when the message was generated.
252 The base class version prepends the timestamp to the message, adds a prefix
253 corresponding to the log level and then calls
254 \helpref{DoLogString
}{wxlogdologstring
} with the resulting string.
256 \membersection{wxLog::DoLogString
}\label{wxlogdologstring
}
258 \func{virtual void
}{DoLogString
}{\param{const wxChar
}{*msg
},
\param{time
\_t }{timestamp
}}
260 Called to log the specified string. The timestamp is already included into the
261 string but still passed to this function.
263 A simple implementation may just send the string to
{\tt stdout
} or, better,
266 \membersection{wxLog::DontCreateOnDemand
}\label{wxlogdontcreateondemand
}
268 \func{static void
}{DontCreateOnDemand
}{\void}
270 Instructs wxLog to not create new log targets on the fly if there is none
271 currently. (Almost) for internal use only: it is supposed to be called by the
272 application shutdown code.
274 Note that this function also calls
275 \helpref{ClearTraceMasks
}{wxlogcleartracemasks
}.
277 \membersection{wxLog::Flush
}\label{wxlogflush
}
279 \func{virtual void
}{Flush
}{\void}
281 Shows all the messages currently in buffer and clears it. If the buffer
282 is already empty, nothing happens.
284 \membersection{wxLog::FlushActive
}\label{wxlogflushactive
}
286 \func{static void
}{FlushActive
}{\void}
288 Flushes the current log target if any, does nothing if there is none.
292 \helpref{Flush
}{wxlogflush
}
294 \membersection{wxLog::SetVerbose
}\label{wxlogsetverbose
}
296 \func{static void
}{SetVerbose
}{\param{bool
}{ verbose = TRUE
}}
298 Activates or deactivates verbose mode in which the verbose messages are
299 logged as the normal ones instead of being silently dropped.
301 \membersection{wxLog::GetVerbose
}\label{wxloggetverbose
}
303 \func{static bool
}{GetVerbose
}{\void}
305 Returns whether the verbose mode is currently active.
307 \membersection{wxLog::SetLogLevel
}\label{wxlogsetloglevel
}
309 \func{static void
}{SetLogLevel
}{\param{wxLogLevel
}{ logLevel
}}
311 Specifies that log messages with $level > logLevel$ should be ignored
312 and not sent to the active log target.
314 \membersection{wxLog::GetLogLevel
}\label{wxloggetloglevel
}
316 \func{static wxLogLevel
}{GetLogLevel
}{\void}
318 Returns the current log level limit.
320 \membersection{wxLog::SetTimestamp
}\label{wxlogsettimestamp
}
322 \func{void
}{SetTimestamp
}{\param{const char *
}{ format
}}
324 Sets the timestamp format prepended by the default log targets to all
325 messages. The string may contain any normal characters as well as \%
326 prefixed format specificators, see
{\it strftime()
} manual for details.
327 Passing a NULL value (not empty string) to this function disables message timestamping.
329 \membersection{wxLog::GetTimestamp
}\label{wxloggettimestamp
}
331 \constfunc{const char *
}{GetTimestamp
}{\void}
333 Returns the current timestamp format string.
335 \membersection{wxLog::SetTraceMask
}\label{wxlogsettracemask
}
337 \func{static void
}{SetTraceMask
}{\param{wxTraceMask
}{ mask
}}
339 Sets the trace mask, see
\helpref{Customization
}{wxlogcustomization
}
342 \membersection{wxLog::GetTraceMask
}\label{wxloggettracemask
}
344 Returns the current trace mask, see
\helpref{Customization
}{wxlogcustomization
} section
347 \membersection{wxLog::IsAllowedTraceMask
}\label{wxlogisallowedtracemask
}
349 \func{static bool
}{IsAllowedTraceMask
}{\param{const wxChar *
}{mask
}}
351 Returns TRUE if the
{\it mask
} is one of allowed masks for
352 \helpref{wxLogTrace
}{wxlogtrace
}.
354 See also:
\helpref{AddTraceMask
}{wxlogaddtracemask
},
355 \helpref{RemoveTraceMask
}{wxlogremovetracemask
}
357 \membersection{wxLog::RemoveTraceMask
}\label{wxlogremovetracemask
}
359 \func{static void
}{RemoveTraceMask
}{\param{const wxString\&
}{mask
}}
361 Remove the
{\it mask
} from the list of allowed masks for
362 \helpref{wxLogTrace
}{wxlogtrace
}.
364 See also:
\helpref{AddTraceMask
}{wxlogaddtracemask
}
366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% wxLogChain %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
368 \section{\class{wxLogChain
}}\label{wxlogchain
}
370 This simple class allows to chain log sinks, that is to install a new sink but
371 keep passing log messages to the old one instead of replacing it completely as
372 \helpref{SetActiveTarget
}{wxlogsetactivetarget
} does.
374 It is especially useful when you want to divert the logs somewhere (for
375 example to a file or a log window) but also keep showing the error messages
376 using the standard dialogs as
\helpref{wxLogGui
}{wxlogoverview
} does by default.
381 wxLogChain *logChain = new wxLogChain(new wxLogStderr);
383 // all the log messages are sent to stderr and also processed as usually
386 // don't delete logChain directly as this would leave a dangling
387 // pointer as active log target, use SetActiveTarget() instead
388 delete wxLog::SetActiveTarget(...something else or NULL...);
392 \wxheading{Derived from
}
394 \helpref{wxLog
}{wxlog
}
396 \wxheading{Include files
}
400 \latexignore{\rtfignore{\wxheading{Members
}}}
402 \membersection{wxLogChain::wxLogChain
}\label{wxlogchainwxlogchain
}
404 \func{}{wxLogChain
}{\param{wxLog *
}{logger
}}
406 Sets the specified
{\tt logger
} (which may be
{\tt NULL
}) as the default log
407 target but the log messages are also passed to the previous log target if any.
409 \membersection{wxLogChain::
\destruct{wxLogChain
}}
411 \func{}{\destruct{wxLogChain
}}{\void}
413 Destroys the previous log target.
415 \membersection{wxLogChain::GetOldLog
}\label{wxlogchaingetoldlog
}
417 \constfunc{wxLog *
}{GetOldLog
}{\void}
419 Returns the pointer to the previously active log target (which may be
{\tt
422 \membersection{wxLogChain::IsPassingMessages
}\label{wxlogchainispassingmessages
}
424 \constfunc{bool
}{IsPassingMessages
}{\void}
426 Returns
{\tt TRUE
} if the messages are passed to the previously active log
427 target (default) or
{\tt FALSE
} if
\helpref{PassMessages
}{wxlogchainpassmessages
}
430 \membersection{wxLogChain::PassMessages
}\label{wxlogchainpassmessages
}
432 \func{void
}{PassMessages
}{\param{bool
}{passMessages
}}
434 By default, the log messages are passed to the previously active log target.
435 Calling this function with
{\tt FALSE
} parameter disables this behaviour
436 (presumably temporarily, as you shouldn't use wxLogChain at all otherwise) and
437 it can be reenabled by calling it again with
{\it passMessages
} set to
{\tt
440 \membersection{wxLogChain::SetLog
}\label{wxlogchainsetlog
}
442 \func{void
}{SetLog
}{\param{wxLog *
}{logger
}}
444 Sets another log target to use (may be
{\tt NULL
}). The log target specified
445 in the
\helpref{constructor
}{wxlogchainwxlogchain
} or in a previous call to
446 this function is deleted.
448 This doesn't change the old log target value (the one the messages are
449 forwarded to) which still remains the same as was active when wxLogChain
452 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% wxLogGui %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
454 \section{\class{wxLogGui
}}\label{wxloggui
}
456 This is the default log target for the GUI wxWindows applications. It is passed
457 to
\helpref{wxLog::SetActiveTarget
}{wxlogsetactivetarget
} at the program
458 startup and is deleted by wxWindows during the program shut down.
460 \wxheading{Derived from
}
462 \helpref{wxLog
}{wxlog
}
464 \wxheading{Include files
}
468 \latexignore{\rtfignore{\wxheading{Members
}}}
470 \membersection{wxLogGui::wxLogGui
}
472 \func{}{wxLogGui
}{\void}
476 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% wxLogNull %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
478 \section{\class{wxLogNull
}}\label{wxlognull
}
480 This class allows to temporarily suspend logging. All calls to the log
481 functions during the life time of an object of this class are just ignored.
483 In particular, it can be used to suppress the log messages given by wxWindows
484 itself but it should be noted that it is rarely the best way to cope with this
485 problem as
{\bf all
} log messages are suppressed, even if they indicate a
486 completely different error than the one the programmer wanted to suppress.
488 For instance, the example of the overview:
494 // wxFile.Open() normally complains if file can't be opened, we don't want it
497 if ( !file.Open("bar") )
498 ... process error ourselves ...
499 } // ~wxLogNull called, old log sink restored
501 wxLogMessage("..."); // ok
505 would be better written as:
511 // don't try to open file if it doesn't exist, we are prepared to deal with
512 // this ourselves - but all other errors are not expected
513 if ( wxFile::Exists("bar") )
515 // gives an error message if the file couldn't be opened
525 \wxheading{Derived from
}
527 \helpref{wxLog
}{wxlog
}
529 \wxheading{Include files
}
533 \latexignore{\rtfignore{\wxheading{Members
}}}
535 \membersection{wxLogNull::wxLogNull
}
537 \func{}{wxLogNull
}{\void}
541 \membersection{wxLogNull::
\destruct{wxLogNull
}}
545 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% wxLogPassThrough %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
547 \section{\class{wxLogPassThrough
}}\label{wxlogpassthrough
}
549 A special version of
\helpref{wxLogChain
}{wxlogchain
} which uses itself as the
550 new log target. Maybe more clearly, it means that this is a log target which
551 forwards the log messages to the previously installed one in addition to
552 processing them itself.
554 Unlike
\helpref{wxLogChain
}{wxlogchain
} which is usually used directly as is,
555 this class must be derived from to implement
\helpref{DoLog
}{wxlogdolog
}
556 and/or
\helpref{DoLogString
}{wxlogdologstring
} methods.
558 \wxheading{Derived from
}
560 \helpref{wxLogChain
}{wxlogchain
}
562 \wxheading{Include files
}
566 \latexignore{\rtfignore{\wxheading{Members
}}}
568 \membersection{wxLogPassThrough::wxLogPassThrough
}\label{wxlogpassthroughctor
}
570 Default ctor installs this object as the current active log target.
572 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% wxLogStderr %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
574 \section{\class{wxLogStderr
}}\label{wxlogstderr
}
576 This class can be used to redirect the log messages to a C file stream (not to
577 be confused with C++ streams). It is the default log target for the non-GUI
578 wxWindows applications which send all the output to
{\tt stderr
}.
580 \wxheading{Derived from
}
582 \helpref{wxLog
}{wxlog
}
584 \wxheading{Include files
}
590 \helpref{wxLogStream
}{wxlogstream
}
592 \latexignore{\rtfignore{\wxheading{Members
}}}
594 \membersection{wxLogStderr::wxLogStderr
}
596 \func{}{wxLogStderr
}{\param{FILE
}{*fp = NULL
}}
598 Constructs a log target which sends all the log messages to the given
599 {\tt FILE
}. If it is
{\tt NULL
}, the messages are sent to
{\tt stderr
}.
601 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% wxLogStream %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
603 \section{\class{wxLogStream
}}\label{wxlogstream
}
605 This class can be used to redirect the log messages to a C++ stream.
607 Please note that this class is only available if wxWindows was compiled with
608 the standard iostream library support (
{\tt wxUSE
\_STD\_IOSTREAM} must be on).
610 \wxheading{Derived from
}
612 \helpref{wxLog
}{wxlog
}
614 \wxheading{Include files
}
620 \helpref{wxLogStderr
}{wxlogstderr
},\\
621 \helpref{wxStreamToTextRedirector
}{wxstreamtotextredirector
}
623 \latexignore{\rtfignore{\wxheading{Members
}}}
625 \membersection{wxLogStream::wxLogStream
}
627 \func{}{wxLogStream
}{\param{std::ostream
}{*ostr = NULL
}}
629 Constructs a log target which sends all the log messages to the given
630 output stream. If it is
{\tt NULL
}, the messages are sent to
{\tt cerr
}.
632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% wxLogTextCtrl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
634 \section{\class{wxLogTextCtrl
}}\label{wxlogtextctrl
}
636 Using these target all the log messages can be redirected to a text control.
637 The text control must have been created with
{\tt wxTE
\_MULTILINE} style by the
640 \wxheading{Derived from
}
642 \helpref{wxLog
}{wxlog
}
644 \wxheading{Include files
}
650 \helpref{wxLogTextCtrl
}{wxlogtextctrl
},\\
651 \helpref{wxStreamToTextRedirector
}{wxstreamtotextredirector
}
653 \latexignore{\rtfignore{\wxheading{Members
}}}
655 \membersection{wxLogTextCtrl::wxLogTextCtrl
}
657 \func{}{wxLogTextCtrl
}{\param{wxTextCtrl
}{*textctrl
}}
659 Constructs a log target which sends all the log messages to the given text
660 control. The
{\it textctrl
} parameter cannot be
{\tt NULL
}.
662 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% wxLogWindow %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
664 \section{\class{wxLogWindow
}}\label{wxlogwindow
}
666 This class represents a background log window: to be precise, it collects all
667 log messages in the log frame which it manages but also passes them on to the
668 log target which was active at the moment of its creation. This allows, for
669 example, to show all the log messages in a frame but still continue to process
670 them normally by showing the standard log dialog.
672 \wxheading{Derived from
}
674 \helpref{wxLogPassThrough
}{wxlogpassthrough
}
676 \wxheading{Include files
}
682 \helpref{wxLogTextCtrl
}{wxlogtextctrl
}
684 \latexignore{\rtfignore{\wxheading{Members
}}}
686 \membersection{wxLogWindow::wxLogWindow
}
688 \func{}{wxLogWindow
}{\param{wxFrame
}{*parent
},
\param{const wxChar
}{*title
},
\param{bool
}{show =
{\tt TRUE
}},
\param{bool
}{passToOld =
{\tt TRUE
}}}
690 Creates the log frame window and starts collecting the messages in it.
692 \wxheading{Parameters
}
694 \docparam{parent
}{The parent window for the log frame, may be
{\tt NULL
}}
696 \docparam{title
}{The title for the log frame
}
698 \docparam{show
}{{\tt TRUE
} to show the frame initially (default), otherwise
699 \helpref{wxLogWindow::Show
}{wxlogwindowshow
} must be called later.
}
701 \docparam{passToOld
}{{\tt TRUE
} to process the log messages normally in addition to
702 logging them in the log frame (default),
{\tt FALSE
} to only log them in the
705 \membersection{wxLogWindow::Show
}\label{wxlogwindowshow
}
707 \func{void
}{Show
}{\param{bool
}{show =
{\tt TRUE
}}}
709 Shows or hides the frame.
711 \membersection{wxLogWindow::GetFrame
}
713 \constfunc{wxFrame *
}{GetFrame
}{\void}
715 Returns the associated log frame window. This may be used to position or resize
716 it but use
\helpref{wxLogWindow::Show
}{wxlogwindowshow
} to show or hide it.
718 \membersection{wxLogWindow::OnFrameCreate
}
720 \func{virtual void
}{OnFrameCreate
}{\param{wxFrame
}{*frame
}}
722 Called immediately after the log frame creation allowing for
723 any extra initializations.
725 \membersection{wxLogWindow::OnFrameClose
}\label{wxlogwindowonframeclose
}
727 \func{virtual void
}{OnFrameClose
}{\param{wxFrame
}{*frame
}}
729 Called if the user closes the window interactively, will not be
730 called if it is destroyed for another reason (such as when program
733 Return
{\tt TRUE
} from here to allow the frame to close,
{\tt FALSE
} to
734 prevent this from happening.
738 \helpref{wxLogWindow::OnFrameDelete
}{wxlogwindowonframedelete
}
740 \membersection{wxLogWindow::OnFrameDelete
}\label{wxlogwindowonframedelete
}
742 \func{virtual void
}{OnFrameDelete
}{\param{wxFrame
}{*frame
}}
744 Called right before the log frame is going to be deleted: will
745 always be called unlike
\helpref{OnFrameClose()
}{wxlogwindowonframeclose
}.