xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Go to the documentation of this file.
1 #pragma once
5 #include "trace_form_base.h"
6 #include "icontrol_trace.h"
9 namespace xtd {
11  namespace forms {
26  public:
28  trace_form() : trace_form_base("Trace") {
29  xtd::diagnostics::trace::listeners().push_back(listener_);
30 #if defined(TRACE)
31  visible(true);
32 #endif
33  }
40  const xtd::diagnostics::trace_listener& trace_listener() const {return *listener_;}
45  void write(const xtd::ustring& trace) override {
46 #if defined(TRACE)
48 #endif
49  }
50  void write_line(const xtd::ustring& trace) override {
51 #if defined(TRACE)
53 #endif
54  }
56  void flush() override {}
58  private:
59  std::shared_ptr<xtd::diagnostics::trace_listener> listener_ = xtd::forms::control_trace_listener::create(*this);
60  };
61  }
62 }
virtual void write(const xtd::ustring &trace)
Writes trace string to the multiline text.
Definition: trace_form_base.h:106
Provides the abstract base class for the listeners who monitor trace and debug output.
Definition: trace_listener.h:33
virtual void write_line(const xtd::ustring &trace)
Writes trace string to the multiline text followed by a line terminator.
Definition: trace_form_base.h:113
Contains xtd::forms::trace_form_base dialog.
static listener_collection & listeners()
Gets the collection of listeners that is monitoring the trace output.
void write(const xtd::ustring &trace) override
Write debug or trace message on this instance control.
Definition: trace_form.h:45
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Initializes a new instance of the trace_form class.
Definition: trace_form.h:28
Represents a base form for debug_form and trace_form forms. This class cannot be instantiated.
Definition: trace_form_base.h:20
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
Contains xtd::forms::icontrol_trace interface.
Allow a control to be called by control_trace_listener for writing debug or trace message...
Definition: icontrol_trace.h:18
Represents a form that displays trace form. This class cannot be inherited.
Definition: trace_form.h:25
virtual bool visible() const
Gets a value indicating whether the control and all its child controls are displayed.
void write_line(const xtd::ustring &trace) override
Write debug or trace message on this instance control followed by line terminator.
Definition: trace_form.h:50
static std::shared_ptr< xtd::diagnostics::trace_listener > create(xtd::forms::icontrol_trace &control_trace)
Create new control_trace_listener.
Definition: control_trace_listener.h:38
xtd::diagnostics::trace_listener & trace_listener()
Gets underlying trace listener.
Definition: trace_form.h:43
const xtd::diagnostics::trace_listener & trace_listener() const
Gets underlying trace listener.
Definition: trace_form.h:40
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
void flush() override
Flushes the output buffer and causes buffered data to write to the control.
Definition: trace_form.h:56