Jump to content

KrCommonTextOutput

From EDM2

Description

#include "krcto.hpp"

This class contains a ostream object. All output that goes to this object is displayed in an IMultiLineEdit window.

You can use this class to redirect output from cout etc. to the screen.

Derivation

KrCommonTextOutput inherits from IMultiLineEdit.

Constructors

You can construct and destruct objects of this class.

Overload 1   
public: 
KrCommonTextOutput (unsigned long id, IWindow* parent, IWindow* owner,
                    const IRectangle& initial = IRectangle (),
                    const Style& style = defaultStyle () | readOnly);

The constructor works exactly like the corresponding constructor of IMultiLineEdit.

Public Functions

Constructors

KrCommonTextOutput

You can construct and destruct objects of this class.

Overload 1

public: 
KrCommonTextOutput (unsigned long id, IWindow* parent, IWindow* owner,
                    const IRectangle& initial = IRectangle (),
                    const Style& style = defaultStyle () | readOnly);

The constructor works exactly like the corresponding constructor of IMultiLineEdit.

Associated stream

stream

Use this function to access the ostream associated to the KrCommonTextOutput object.

public: 
ostream & stream (); 

Usually, you will assign it to some other stream like cout using the operator =.

Note: The ostream has and needs the property ios::unitbuf. Unfortunately, this is not copied by the operator =. Hence, you must take care of this yourself by calling ios::setf (ios::unitbuf).

Do not use this function before the object is properly initialized, i.e. before IApplication::current().run() has been called.