KrCommonTextOutput: Difference between revisions
m Martini moved page OS2 API:KrCommonTextOutput to OS2 API:Kronis:KrCommonTextOutput |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Description== | |||
'''#include "krcto.hpp"''' | |||
This class contains an 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: | |||
public: | |||
KrCommonTextOutput (unsigned long id, IWindow* parent, IWindow* owner, | KrCommonTextOutput (unsigned long id, IWindow* parent, IWindow* owner, | ||
const IRectangle& initial = IRectangle (), | const IRectangle& initial = IRectangle (), | ||
const Style& style = defaultStyle () | readOnly); | 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: | |||
'''Overload 1''' | |||
public: | |||
KrCommonTextOutput (unsigned long id, IWindow* parent, IWindow* owner, | KrCommonTextOutput (unsigned long id, IWindow* parent, IWindow* owner, | ||
const IRectangle& initial = IRectangle (), | const IRectangle& initial = IRectangle (), | ||
const Style& style = defaultStyle () | readOnly); | const Style& style = defaultStyle () | readOnly); | ||
The constructor works exactly like the corresponding constructor of IMultiLineEdit. | |||
===Associated stream=== | |||
====stream==== | |||
===Associated stream=== | Use this function to access the ostream associated to the KrCommonTextOutput object. | ||
====stream==== | public: | ||
Use this function to access the ostream associated to the KrCommonTextOutput object. | ostream &stream (); | ||
Usually, you will assign it to some other stream like cout using the operator =. | |||
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. | |||
[[Category: | [[Category:Kronis Classes]] |
Latest revision as of 21:37, 7 October 2022
Description
#include "krcto.hpp"
This class contains an 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.