![]() ![]() ![]() ![]() wxstreamtotextredirectorthis class can be used to (temporarily) redirect all output sent to a c++ ostream object to a wxtextctrl instead. nb: some compilers and/or build configurations don't support multiply inheriting wxtextctrl from std::streambuf in which case this class is not compiled in. you also must have wxuse_std_iostream option on (i.e. set to 1) in your setup.h to be able to use it. under unix, specify --enable-std_iostreams switch when running configure for this.
example of usage:
no base class include files <wx/textctrl.h> see also members
wxstreamtotextredirector::wxstreamtotextredirector
wxstreamtotextredirector::wxstreamtotextredirectorwxstreamtotextredirector(wxtextctrl *text, ostream *ostr = null) the constructor starts redirecting output sent to ostr or cout for the default parameter value to the text control text. parameters text
ostr
wxstreamtotextredirector::~wxstreamtotextredirector~wxstreamtotextredirector() when a wxstreamtotextredirector object is destroyed, the redirection is ended and any output sent to the c++ ostream which had been specified at the time of the object construction will go to its original destination.
|