xtd 0.2.0
trace_form.cpp

demonstrates the use of xtd::trace_forms::trace_form container.

Windows

macOS

Gnome

#define TRACE
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/forms/trace_form>
using namespace xtd::diagnostics;
using namespace xtd::drawing;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Trace form example");
button1.auto_repeat(true);
button1.auto_size(true);
button1.location({10, 10});
button1.parent(*this);
button1.text("Write line...");
button1.click += [&] {
static auto counter = 0;
trace::write_line("Write line {}...", ++counter);
};
}
private:
};
auto main() -> int {
auto tf = trace_form {};
tf.fore_color(color::white);
application::run(form1 {});
}
static void write_line()
Writes a line terminator to the trace listeners in the listeners collection.
Definition trace.hpp:343
static const xtd::drawing::color white
Gets a system-defined color that has an ARGB value of 0xFFFFFFFF. This field is constant.
Definition color.hpp:470
static const xtd::drawing::color navy
Gets a system-defined color that has an ARGB value of 0xFF000080. This field is constant.
Definition color.hpp:344
static void run()
Begins running a standard application message loop on the current thread, without a form.
Represents a Windows button control.
Definition button.hpp:49
virtual drawing::color back_color() const noexcept
Gets the background color for the control.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
Represents a form that displays trace form. This class cannot be inherited.
Definition trace_form.hpp:36
@ button1
The first button on the message box is the default button.
Definition message_dialog_default_button.hpp:24
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.hpp:10
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:217
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:16