xtd 1.0.0
Loading...
Searching...
No Matches
xtd::forms::enable_debug Class Reference
Inheritance diagram for xtd::forms::enable_debug:
xtd::object xtd::iequatable< enable_debug > xtd::interface xtd::extensions::equality_operators< enable_debug, iequatable< enable_debug > >

Definition

Represent enable debug class.

Header
#include <xtd/forms/enable_debug>
Namespace
xtd::forms
Library
xtd.forms
Remarks
You can activate or deactivate one, some or all debug trace categories.
Examples
The following code example demonstrates the use of enable_debug class.
#define DEBUG 1 // Force debug mode even if example is builded in release.
#include <xtd/xtd>
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:
button button1;
text_box text_box1;
};
auto main() -> int {
auto df = debug_form {};
enable_debug::trace_switch().level(xtd::diagnostics::trace_level::verbose);
enable_debug::set(enable_debug::key_events | enable_debug::mouse_events, true);
application::run(form1 {});
}
virtual auto text() const noexcept -> const xtd::string &
Gets the text associated with this control.
virtual auto name() const noexcept -> const xtd::string &
Gets the name of the control.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
@ 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

Public Fields

static const enable_debug none
 Represent none debug.
static const enable_debug creation
 Represent creation debug.
static const enable_debug events
 Represent events debug.
static const enable_debug key_events
 Represent key events debug.
static const enable_debug mouse_events
 Represent mouse events debug.
static const enable_debug layout
 Represent layout debug.
static const enable_debug workaround
 Represent workaround debug.
static const enable_debug style
 Represent style debug.
static const enable_debug all
 Represent all debug.

Public Static Properties

static auto trace_switch () noexcept -> xtd::diagnostics::trace_switch &
 Gets a trace switch to configure debug traces.

Public Static Methods

static auto get (const enable_debug &flags) -> bool
 Gets enable_debug flags status.
static auto set (const enable_debug &flags, bool on) -> void
 Sets enable_debug flags status.

Public Methods

auto equals (const xtd::object &obj) const noexcept -> bool override
 Determines whether the specified object is equal to the current object.
auto equals (const enable_debug &other) const noexcept -> bool override
 Determines whether the specified object is equal to the current object.
auto get_hash_code () const noexcept -> xtd::usize override
 Serves as a hash function for a particular type.

Additional Inherited Members

 object ()=default
 Create a new instance of the ultimate base class object.
virtual auto get_type () const noexcept -> type_object
 Gets the type of the current instance.
template<typename object_t>
auto memberwise_clone () const -> xtd::unique_ptr_object< object_t >
 Creates a shallow copy of the current object.
virtual auto to_string () const -> xtd::string
 Returns a xtd::string that represents the current object.
virtual auto equals (const enable_debug &) const noexcept -> bool=0
 Indicates whether the current object is equal to another object of the same type.
template<typename object_a_t, typename object_b_t>
static auto equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are considered equal.
template<typename object_a_t, typename object_b_t>
static auto reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are the same instance.

Member Function Documentation

◆ trace_switch()

auto xtd::forms::enable_debug::trace_switch ( ) -> xtd::diagnostics::trace_switch &
staticnodiscardnoexcept

Gets a trace switch to configure debug traces.

Returns
a xtd::diagnostics::trace_switch to configure debug traces.

◆ equals() [1/2]

auto xtd::forms::enable_debug::equals ( const xtd::object & obj) const -> bool
nodiscardoverridevirtualnoexcept

Determines whether the specified object is equal to the current object.

Parameters
objThe object to compare with the current object.
Returns
true if the specified object is equal to the current object. otherwise, false.

Reimplemented from xtd::object.

◆ equals() [2/2]

auto xtd::forms::enable_debug::equals ( const enable_debug & other) const -> bool
nodiscardoverridenoexcept

Determines whether the specified object is equal to the current object.

Parameters
otherThe object to compare with the current object.
Returns
true if the specified object is equal to the current object. otherwise, false.

◆ get_hash_code()

auto xtd::forms::enable_debug::get_hash_code ( ) const -> xtd::usize
nodiscardoverridevirtualnoexcept

Serves as a hash function for a particular type.

Returns
A hash code for the current object.

Reimplemented from xtd::object.

◆ get()

auto xtd::forms::enable_debug::get ( const enable_debug & flags) -> bool
staticnodiscard

Gets enable_debug flags status.

Returns
true if enable_debug flags is on; otherwise false.

◆ set()

auto xtd::forms::enable_debug::set ( const enable_debug & flags,
bool on ) -> void
static

Sets enable_debug flags status.

Parameters
ontrue if enable_debug flags is on; otherwise false.

Member Data Documentation

◆ none

const enable_debug xtd::forms::enable_debug::none
static

Represent none debug.

◆ creation

const enable_debug xtd::forms::enable_debug::creation
static

Represent creation debug.

◆ events

const enable_debug xtd::forms::enable_debug::events
static

Represent events debug.

◆ key_events

const enable_debug xtd::forms::enable_debug::key_events
static

Represent key events debug.

◆ mouse_events

const enable_debug xtd::forms::enable_debug::mouse_events
static

Represent mouse events debug.

◆ layout

const enable_debug xtd::forms::enable_debug::layout
static

Represent layout debug.

◆ workaround

const enable_debug xtd::forms::enable_debug::workaround
static

Represent workaround debug.

◆ style

const enable_debug xtd::forms::enable_debug::style
static

Represent style debug.

◆ all

const enable_debug xtd::forms::enable_debug::all
static

Represent all debug.


The documentation for this class was generated from the following file: