xtd 0.2.0
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< type_t, equatable_t >

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 // 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:
button button1;
text_box text_box1;
};
auto main() -> int {
auto df = debug_form {};
application::run(form1 {});
}
xtd::diagnostics::trace_level level() const noexcept
Gets the trace level that determines the messages the switch allows.
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.
@ button1
The first button on the message box is the default button.
@ text
The xtd::forms::status_bar_panel displays text in the standard font.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.hpp:12

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 xtd::diagnostics::trace_switchtrace_switch () noexcept
 Gets a trace switch to configure debug traces.
 

Public Static Methods

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

Public Methods

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

Additional Inherited Members

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

Member Function Documentation

◆ trace_switch()

static xtd::diagnostics::trace_switch & xtd::forms::enable_debug::trace_switch ( )
staticnoexcept

Gets a trace switch to configure debug traces.

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

◆ equals() [1/2]

bool xtd::forms::enable_debug::equals ( const xtd::object obj) const
overridevirtualnoexcept

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]

bool xtd::forms::enable_debug::equals ( const enable_debug other) const
overridenoexcept

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()

xtd::size xtd::forms::enable_debug::get_hash_code ( ) const
overridevirtualnoexcept

Serves as a hash function for a particular type.

Returns
A hash code for the current object.

Reimplemented from xtd::object.

◆ get()

static bool xtd::forms::enable_debug::get ( const enable_debug flags)
static

Gets enable_debug flags status.

Returns
true if enable_debug flags is on; otherwise false.

◆ set()

static void xtd::forms::enable_debug::set ( const enable_debug flags,
bool  on 
)
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: