#include <YLogView.h>
Public Member Functions | |
virtual | ~YLogView () |
virtual const char * | widgetClass () const |
std::string | label () const |
virtual void | setLabel (const std::string &label) |
int | visibleLines () const |
void | setVisibleLines (int newVisibleLines) |
int | maxLines () const |
void | setMaxLines (int newMaxLines) |
std::string | logText () const |
void | setLogText (const std::string &text) |
std::string | lastLine () const |
void | appendLines (const std::string &text) |
void | clearText () |
int | lines () const |
virtual bool | setProperty (const std::string &propertyName, const YPropertyValue &val) |
virtual YPropertyValue | getProperty (const std::string &propertyName) |
virtual const YPropertySet & | propertySet () |
virtual std::string | shortcutString () const |
virtual void | setShortcutString (const std::string &str) |
![]() | |
virtual | ~YWidget () |
virtual std::string | debugLabel () const |
std::string | helpText () const |
void | setHelpText (const std::string &helpText) |
bool | hasChildren () const |
YWidget * | firstChild () const |
YWidget * | lastChild () const |
YWidgetListIterator | childrenBegin () const |
YWidgetListIterator | childrenEnd () const |
YWidgetListConstIterator | childrenConstBegin () const |
YWidgetListConstIterator | childrenConstEnd () const |
YWidgetListIterator | begin () |
YWidgetListIterator | end () |
int | childrenCount () const |
bool | contains (YWidget *child) const |
virtual void | addChild (YWidget *child) |
virtual void | removeChild (YWidget *child) |
void | deleteChildren () |
YWidget * | parent () const |
bool | hasParent () const |
void | setParent (YWidget *newParent) |
YDialog * | findDialog () |
YWidget * | findWidget (YWidgetID *id, bool doThrow=true) const |
virtual int | preferredWidth ()=0 |
virtual int | preferredHeight ()=0 |
virtual int | preferredSize (YUIDimension dim) |
virtual void | setSize (int newWidth, int newHeight)=0 |
bool | isValid () const |
bool | beingDestroyed () const |
void * | widgetRep () const |
void | setWidgetRep (void *toolkitWidgetRep) |
bool | hasId () const |
YWidgetID * | id () const |
void | setId (YWidgetID *newId_disown) |
virtual void | setEnabled (bool enabled=true) |
void | setDisabled () |
virtual bool | isEnabled () const |
virtual bool | stretchable (YUIDimension dim) const |
void | setStretchable (YUIDimension dim, bool newStretch) |
void | setDefaultStretchable (YUIDimension dim, bool newStretch) |
virtual int | weight (YUIDimension dim) |
bool | hasWeight (YUIDimension dim) |
void | setWeight (YUIDimension dim, int weight) |
void | setNotify (bool notify=true) |
bool | notify () const |
void | setNotifyContextMenu (bool notifyContextMenu=true) |
bool | notifyContextMenu () const |
bool | sendKeyEvents () const |
void | setSendKeyEvents (bool doSend) |
bool | autoShortcut () const |
void | setAutoShortcut (bool _newAutoShortcut) |
int | functionKey () const |
bool | hasFunctionKey () const |
virtual void | setFunctionKey (int fkey_no) |
virtual bool | setKeyboardFocus () |
virtual const char * | userInputProperty () |
void | dumpWidgetTree (int indentationLevel=0) |
void | dumpDialogWidgetTree () |
void | setChildrenEnabled (bool enabled) |
virtual void | saveUserInput (YMacroRecorder *macroRecorder) |
void * | operator new (size_t size) |
void | operator delete (void *ptr) noexcept |
virtual void | startMultipleChanges () |
virtual void | doneMultipleChanges () |
Protected Member Functions | |
YLogView (YWidget *parent, const std::string &label, int visibleLines, int maxLines) | |
virtual void | displayLogText (const std::string &text)=0 |
![]() | |
YWidget (YWidget *parent) | |
YWidgetChildrenManager * | childrenManager () const |
void | setChildrenManager (YWidgetChildrenManager *manager) |
void | setBeingDestroyed () |
void | dumpWidget (YWidget *w, int indentationLevel) |
LogView: A scrollable (output-only) text to display a growing log, very much like the "tail -f" shell command.
|
protected |
Constructor.
'label' is the caption above the log. 'visibleLines' indicates how many lines should be visible by default (unless changed by other layout constraints), 'maxLines' specifies how many lines (always the last ones) to keep in the log. 0 for 'maxLines' means "keep all lines".
|
virtual |
Destructor.
void YLogView::appendLines | ( | const std::string & | text | ) |
Append one or more lines to the log text and trigger a display update.
void YLogView::clearText | ( | ) |
Clear the log text and trigger a display update.
|
protectedpure virtual |
Display the part of the log text that should be displayed. 'text' contains the last 'visibleLines()' lines. This is called whenever the log text changes. Note that the text might also be empty, in which case the displayed log text should be cleared.
Derived classes are required to implement this.
|
virtual |
string YLogView::label | ( | ) | const |
Return the label (the caption above the log text).
string YLogView::lastLine | ( | ) | const |
Return the last log line.
int YLogView::lines | ( | ) | const |
Return the current number of lines.
string YLogView::logText | ( | ) | const |
Return the entire log text as one large string of concatenated lines delimited with newlines.
int YLogView::maxLines | ( | ) | const |
Return the maximum number of lines to store. The last maxLines() lines of the log text will be kept.
|
virtual |
|
virtual |
Set the label (the caption above the log text).
Derived classes are free to reimplement this, but they should call this base class method at the end of the overloaded function.
void YLogView::setLogText | ( | const std::string & | text | ) |
Set (replace) the entire log text and trigger a display update.
void YLogView::setMaxLines | ( | int | newMaxLines | ) |
Set the maximum number of lines to store. "0" means "keep all lines" (beware of memory overflow!).
If the new value is lower than the old value, any (now) excess lines before the last 'newMaxLines' lines of the log text is cut off and a display update is triggered.
This method is intentionally not virtual since a display update is triggered when appropriate.
|
virtual |
|
inlinevirtual |
void YLogView::setVisibleLines | ( | int | newVisibleLines | ) |
Set the number of visible lines. Changing this has only effect upon the next geometry call, so applications calling this function might want to trigger a re-layout afterwards.
This method is intentionally not virtual: visibleLines() should be queried in the preferredHeight() implementation.
|
inlinevirtual |
int YLogView::visibleLines | ( | ) | const |
Return the number of visible lines.
|
inlinevirtual |
Returns a descriptive name of this widget class for logging, debugging etc.
Reimplemented from YWidget.