xtd 0.2.0
xtd::forms::use_wait_cursor Class Reference

Definition

Creates a use wait cursor class.

Header
#include <xtd/forms/use_wait_cursor>
Namespace
xtd::forms
Library
xtd.forms
Remarks
Displays a wai cursor as long as the object instance is not destroyed.
Examples
The following code example demonstrates the use of use_wait_cursor class.
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/forms/use_wait_cursor>
#include <xtd/threading/thread>
using namespace xtd;
using namespace xtd::forms;
using namespace xtd::threading;
class form1 : public form {
public:
form1() {
text("Use wait cursor example");
button1.auto_size(true);
button1.location({10, 10});
button1.parent(*this);
button1.text("Do something...");
button1.click += [] {
for (auto count = 0; count < 500; ++count) {
thread::sleep(10_ms); // Simulate work...
}
};
}
private:
};
auto main()->int {
}
Examples:
use_wait_cursor.cpp.

Constructors

 use_wait_cursor ()
 Initializes a new instance of use_wait_cursor class. More...
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type. More...
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance. More...
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const noexcept
 Creates a shallow copy of the current object. More...
 
virtual xtd::ustring to_string () const noexcept
 Returns a sxd::ustring that represents the current object. More...
 
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...
 

Constructor & Destructor Documentation

◆ use_wait_cursor()

xtd::forms::use_wait_cursor::use_wait_cursor ( )

Initializes a new instance of use_wait_cursor class.

Remarks
The xtd::forms::application::use_wait_cursor(true) is called in the constructor and xtd::forms::application::use_wait_cursor(false) is called in the destructor.

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