xtd 1.0.0
Loading...
Searching...
No Matches
xtd::forms::assert_dialog Class Referencefinal
Inheritance diagram for xtd::forms::assert_dialog:
xtd::forms::component xtd::object

Definition

Represents a common dialog box that displays assert dialog.

Header
#include <xtd/forms/assert_dialog>
Namespace
xtd::forms
Library
xtd.forms
Appearance
Windows macOS Gnome
Light
Dark
Examples
The following code example demonstrates the use of assert_dialog dialog.
#include <xtd/xtd>
class form1 : public form {
public:
form1() {
text("Assert dialog example");
controls().add(button1);
button1.location({10, 10});
button1.auto_size(true);
button1.text("assert...");
button1.click += delegate_ {
auto dialog = assert_dialog {};
dialog.message("Index must be > 0");
switch(dialog.show_sheet_dialog(self_)) {
default: break;
}
};
}
private:
};
auto main() -> int {
application::run(form1 {});
}
static auto debug_break() -> void
Signals a breakpoint to an attached debugger.
static auto exit() -> void
Informs all message pumps that they must terminate, and then closes all application windows after the...
Represents a common dialog box that displays assert dialog.
Definition assert_dialog.hpp:35
auto message() const noexcept -> xtd::string
Gets the dialog message text.
virtual auto text() const noexcept -> const xtd::string &
Gets the text associated with this control.
virtual auto controls() noexcept -> control_collection &
Gets the collection of controls contained within the control.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
#define self_
The self_ expression is a reference value expression whose value is the reference of the implicit obj...
Definition self.hpp:20
#define delegate_
The declaration of a delegate type is similar to a method signature. It has a return value and any nu...
Definition delegate.hpp:1018
xtd::forms::style_sheets::control button
The buttton data allows you to specify the box of a button control.
Definition button.hpp:25
@ retry
The dialog box return value is Retry (usually sent from a button labeled Retry).
Definition dialog_result.hpp:53
@ abort
The dialog box return value is Abort (usually sent from a button labeled Abort).
Definition dialog_result.hpp:51
@ button1
The first button on the message box is the default button.
Definition message_dialog_default_button.hpp:24

Public Events

event< assert_dialog, dialog_closed_event_handlerdialog_closed
 Occurs when the user close an assert dialog box with dialog close button or other dialog buttons.

Public Constructors

 assert_dialog ()
 Initializes a new instance of the assert_dialog class.

Public Properties

auto dialog_result () const noexcept -> xtd::forms::dialog_result
 Gets async dialog_result result after dialog box is closing.
auto dialog_appearance () const noexcept -> xtd::forms::dialog_appearance
 Gets the dialog appearance.
auto dialog_appearance (xtd::forms::dialog_appearance value) -> assert_dialog &
 Sets the dialog appearance.
auto message () const noexcept -> xtd::string
 Gets the dialog message text.
auto message (const xtd::string &value) -> assert_dialog &
 Sets the dialog message text.

Public Methods

auto reset () noexcept -> void
 Resets all properties to empty string.
auto show_dialog (const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> xtd::forms::dialog_result
 Runs assert dialog box.
auto show_dialog (const iwin32_window &owner, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> xtd::forms::dialog_result
 Runs assert dialog box.
auto show_sheet (const iwin32_window &owner, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> void
 Runs assert dialog box.
auto show_sheet_dialog (const iwin32_window &owner, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) -> xtd::forms::dialog_result
 Runs assert dialog box.

Public Deprecated Properties

auto stack_frame () const noexcept -> xtd::diagnostics::stack_frame
 Gets stack frame.
auto stack_frame (const xtd::diagnostics::stack_frame &value) -> assert_dialog &
 Sets stack frame.

Protected Methods

auto on_dialog_closed (const dialog_closed_event_args &e) -> void
 Raises the close event.

Additional Inherited Members

 object ()=default
 Create a new instance of the ultimate base class object.
virtual auto equals (const object &obj) const noexcept -> bool
 Determines whether the specified object is equal to the current object.
virtual auto get_hash_code () const noexcept -> xtd::usize
 Serves as a hash function for a particular type.
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.
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.
 component ()
 Initialises a new instance of the component class.
virtual auto can_raise_events () const noexcept -> bool
 Gets a value indicating whether the component can raise an event.
auto design_mode () const noexcept -> bool
 Gets a value that indicates whether the component is currently in design mode.

Constructor & Destructor Documentation

◆ assert_dialog()

xtd::forms::assert_dialog::assert_dialog ( )

Initializes a new instance of the assert_dialog class.

Member Function Documentation

◆ dialog_result()

auto xtd::forms::assert_dialog::dialog_result ( ) const -> xtd::forms::dialog_result
nodiscardnoexcept

Gets async dialog_result result after dialog box is closing.

Returns
ok if the user clicks OK in the dialog box; otherwise, cancel.

◆ dialog_appearance() [1/2]

auto xtd::forms::assert_dialog::dialog_appearance ( ) const -> xtd::forms::dialog_appearance
nodiscardnoexcept

Gets the dialog appearance.

Returns
One of the xtd::forms::dialog_appearance values. The default value is xtd::forms::dialog_appearance::standard.

◆ dialog_appearance() [2/2]

auto xtd::forms::assert_dialog::dialog_appearance ( xtd::forms::dialog_appearance value) -> assert_dialog &

Sets the dialog appearance.

Parameters
valueOne of the xtd::forms::dialog_appearance values. The default value is xtd::forms::dialog_appearance::standard.
Returns
Current assert_dialog instance.

◆ message() [1/2]

auto xtd::forms::assert_dialog::message ( ) const -> xtd::string
nodiscardnoexcept

Gets the dialog message text.

Returns
The current dialog message text.

◆ message() [2/2]

auto xtd::forms::assert_dialog::message ( const xtd::string & value) -> assert_dialog &

Sets the dialog message text.

Parameters
valueThe new dialog message text.
Returns
Current input_dialog instance.

◆ reset()

auto xtd::forms::assert_dialog::reset ( ) -> void
noexcept

Resets all properties to empty string.

◆ show_dialog() [1/2]

auto xtd::forms::assert_dialog::show_dialog ( const xtd::diagnostics::stack_frame & stack_frame = xtd::diagnostics::stack_frame::current()) -> xtd::forms::dialog_result

Runs assert dialog box.

◆ show_dialog() [2/2]

auto xtd::forms::assert_dialog::show_dialog ( const iwin32_window & owner,
const xtd::diagnostics::stack_frame & stack_frame = xtd::diagnostics::stack_frame::current() ) -> xtd::forms::dialog_result

Runs assert dialog box.

◆ show_sheet()

auto xtd::forms::assert_dialog::show_sheet ( const iwin32_window & owner,
const xtd::diagnostics::stack_frame & stack_frame = xtd::diagnostics::stack_frame::current() ) -> void

Runs assert dialog box.

Remarks
The result will done in async. Check result_dialog property after dialog box closed to obtain the result.

◆ show_sheet_dialog()

auto xtd::forms::assert_dialog::show_sheet_dialog ( const iwin32_window & owner,
const xtd::diagnostics::stack_frame & stack_frame = xtd::diagnostics::stack_frame::current() ) -> xtd::forms::dialog_result

Runs assert dialog box.

◆ stack_frame() [1/2]

auto xtd::forms::assert_dialog::stack_frame ( ) const -> xtd::diagnostics::stack_frame
nodiscardnoexcept

Gets stack frame.

Returns
The stack frame.
Deprecated
Will be removed in version 1.2.0.

◆ stack_frame() [2/2]

auto xtd::forms::assert_dialog::stack_frame ( const xtd::diagnostics::stack_frame & value) -> assert_dialog &
nodiscard

Sets stack frame.

Parameters
valueThe stack frame.
Returns
Current assert_dialog instance.
Deprecated
Use "Use xtd::forms::assert_dialog::show_dialog ([owner,] stack_frame) or xtd::forms::assert_dialog::show_sheet (owner, stack_frame) - Will be removed in version 1.2.0.

◆ on_dialog_closed()

auto xtd::forms::assert_dialog::on_dialog_closed ( const dialog_closed_event_args & e) -> void
protected

Raises the close event.

Parameters
eAn assert_dialog_closed_event_args that provides the event data.
Remarks
This method is invoked when the assert dialog box is closed.

Member Data Documentation

◆ dialog_closed

event<assert_dialog, dialog_closed_event_handler> xtd::forms::assert_dialog::dialog_closed

Occurs when the user close an assert dialog box with dialog close button or other dialog buttons.

Remarks
For more information about handling events, see Handling and Raising Events.

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