xtd 0.2.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::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

template<typename object_a_t , typename 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.
 
bool equals (const enable_debug &value) const noexcept override
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename 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<typename object_a_t , typename 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<typename object_a_t , typename 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.

◆ 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.

◆ equals() [1/2]

virtual bool xtd::object::equals ( const object obj) const
virtualnoexcept

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.
Examples
The following code example compares the current instance with another object.
#include <xtd/console>
using namespace xtd;
auto main() -> int {
auto object1 = new_ptr<object>();
auto object2 = new_ptr<object>();
auto object3 = object2;
console::write_line(object1->equals(*object3));
console::write_line(*object1 == *object3);
object3 = object1;
console::write_line(object1->equals(*object3));
console::write_line(*object1 == *object3);
}
// This code produces the following output :
//
// false
// false
// true
// true
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10

Reimplemented from xtd::object.

◆ equals() [2/2]

template<typename object_a_t , typename object_b_t >
static bool xtd::object::equals ( const object_a_t &  object_a,
const object_b_t &  object_b 
)
inlinestaticnoexcept

Determines whether the specified object instances are considered equal.

Parameters
object_aThe first object to compare.
object_bThe second object to compare.
Returns
true if object_a is the same instance as object_b or if both are null references or if object_a(object_b) returns true. otherwise, false.
Examples
The following code example compares different objects.
#include <xtd/console>
using namespace xtd;
auto main() -> int {
string s1 = "Tom";
string s2 = "Carol";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "Tom";
s2 = "Tom";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "";
s2 = "Tom";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "Carol";
s2 = "";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "";
s2 = "";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
}
// This code produces the following output :
//
// object::equals("Tom", "Carol") => false
// object::equals("Tom", "Tom") => true
// object::equals("", "Tom") => false
// object::equals("Carol", "") => false
// object::equals("", "") => true
virtual bool equals(const object &obj) const noexcept
Determines whether the specified object is equal to the current object.

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: