xtd 0.2.0
trace_form_base.h
Go to the documentation of this file.
1 #pragma once
5 #include "form.h"
6 #include "text_box.h"
7 #include <xtd/drawing/font_family>
8 #include <xtd/date_time>
9 
11 namespace xtd {
13  namespace forms {
23  struct data;
24 
25  public:
27 
30 
33  virtual const xtd::ustring& header_separator() const noexcept;
38 
39  const xtd::ustring& name() const noexcept override;
40 
43  virtual bool show_date() const noexcept;
47  virtual trace_form_base& show_date(bool value);
48 
51  virtual bool show_time() const noexcept;
55  virtual trace_form_base& show_time(bool value);
57 
58  protected:
60 
64  explicit trace_form_base(const xtd::ustring& text);
66 
68 
70  void on_back_color_changed(const xtd::event_args& e) override;
71  void on_fore_color_changed(const xtd::event_args& e) override;
72 
75  virtual void write(const xtd::ustring& trace);
76 
79  virtual void write_line(const xtd::ustring& trace);
80 
83  virtual void write_header();
84 
88  virtual bool need_header() const;
93  virtual trace_form_base& need_header(bool value);
95 
96  private:
97  using form::name;
98 
99  void update_format();
100 
101  std::shared_ptr<data> data_;
102  };
103  }
104 }
virtual void write(const xtd::ustring &trace)
Writes trace string to the multiline text.
virtual bool show_time() const noexcept
Gets a value indicate if time is showing before trace text.
virtual void write_line(const xtd::ustring &trace)
Writes trace string to the multiline text followed by a line terminator.
virtual const xtd::ustring & header_separator() const noexcept
Gets the string used to separate date and/or time from trace text.
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
trace_form_base(const xtd::ustring &text)
Initializes a new instance of the trace_form_base class with specified caption text.
Contains xtd::forms::text_box control.
const xtd::ustring & name() const noexcept override
Gets the name of the control.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents a base form for debug_form and trace_form forms. This class cannot be instantiated.
Definition: trace_form_base.h:22
virtual const xtd::ustring & name() const noexcept
Gets the name of the control.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
virtual bool show_date() const noexcept
Gets a value indicate if date is showing before trace text.
void on_fore_color_changed(const xtd::event_args &e) override
Raises the xtd::forms::control::fore_color_changed event.
void on_back_color_changed(const xtd::event_args &e) override
Raises the xtd::forms::control::back_color_changed event.
virtual void write_header()
Writes header, if needed. Writes date and/or time and header_separator.
Represents a window or dialog box that makes up an application&#39;s user interface.
Definition: form.h:52
Contains xtd::forms::form container.
virtual dock_style dock() const noexcept
Gets which control borders are docked to its parent control and determines how a control is resized w...
virtual const xtd::ustring & text() const noexcept
Gets the text associated with this control.
Defines the base class for controls, which are components with visual representation.
Definition: control.h:78
dock_style
Specifies the position and manner in which a control is docked.
Definition: dock_style.h:21
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
virtual bool need_header() const
Gets a value indicate if header need written.