xtd 0.2.0
enable_debug.cpp

demonstrates the use of xtd::enable_debugs::enable_debug container.

Windows

macOS

Gnome

#define DEBUG // Force debug mode even if example is builded in release.
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/debug_form>
#include <xtd/forms/enable_debug>
#include <xtd/forms/form>
#include <xtd/forms/text_box>
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Enable debug example");
name("form1");
button1.auto_repeat(true);
button1.auto_size(true);
button1.location({10, 10});
button1.parent(*this);
button1.text("click-me");
button1.name("button1");
text_box1.location({10, 50});
text_box1.parent(*this);
text_box1.text("Text box");
text_box1.name("text_box1");
}
private:
text_box text_box1;
};
auto main() -> int {
auto df = debug_form {};
application::run(form1 {});
}
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
Represents a form that displays debug form. This class cannot be inherited.
Definition debug_form.hpp:36
static const enable_debug mouse_events
Represent mouse events debug.
Definition enable_debug.hpp:53
static xtd::diagnostics::trace_switch & trace_switch() noexcept
Gets a trace switch to configure debug traces.
static const enable_debug key_events
Represent key events debug.
Definition enable_debug.hpp:51
static void set(const enable_debug &flags, bool on)
Sets enable_debug flags status.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
Represents a standard Windows text box.
Definition text_box.hpp:31
@ verbose
Output all debugging and tracing messages.
Definition trace_level.hpp:34
@ button1
The first button on the message box is the default button.
Definition message_dialog_default_button.hpp:24
@ text
The xtd::forms::status_bar_panel displays text in the standard font.
Definition status_bar_panel_style.hpp:25
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:217