xtd.forms - Reference Guide  0.1.0
Modern c++17 library containing classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows, Apple macOS and Linux like Ubuntu operating system.
xtd::forms::input_dialog Class Reference

Represents a common dialog box that displays input box. More...

#include <input_dialog.h>

Inheritance diagram for xtd::forms::input_dialog:
xtd::forms::common_dialog xtd::forms::component

Public Member Functions

 input_dialog ()=default
 Initializes a new instance of the input_dialog class. More...
 
xtd::forms::character_casing character_casing () const
 
input_dialogcharacter_casing (xtd::forms::character_casing value)
 
xtd::forms::dialog_style dialog_style () const
 
input_dialogdialog_style (xtd::forms::dialog_style dialog_style)
 
input_dialogmessage (const std::string &value)
 Sets the text message. More...
 
std::string messsage () const
 Gets the text message. More...
 
bool multiline () const
 
input_dialogmultiline (bool multiline)
 
void reset () override
 Resets all properties to empty string. More...
 
std::string text () const
 Gets the dialog caption text. More...
 
input_dialogtext (const std::string &value)
 Sets the dialog caption text. More...
 
bool use_system_password_char () const
 
void use_system_password_char (bool use_system_password_char)
 
std::string value () const
 Gets the value. More...
 
input_dialogvalue (const std::string &value)
 Sets thevalue. More...
 
- Public Member Functions inherited from xtd::forms::common_dialog
 common_dialog ()=default
 Initializes a new instance of the common_dialog class. More...
 
xtd::forms::dialog_result dialog_result () const
 
xtd::forms::dialog_result show_dialog ()
 Runs a common dialog box with a default owner. More...
 
xtd::forms::dialog_result show_dialog (const iwin32_window &owner)
 Runs a common dialog box with the specified owner. More...
 
void show_sheet (const iwin32_window &owner)
 Runs a common dialog box with the specified owner. More...
 
xtd::forms::dialog_result show_sheet_dialog (const iwin32_window &owner)
 Runs a common dialog box with the specified owner. More...
 
std::any tag () const
 Gets an object that contains data about the control. More...
 
common_dialogtag (const std::any &tag)
 Sets an object that contains data about the control. More...
 

Protected Member Functions

bool run_dialog (intptr_t owner) override
 When overridden in a derived class, specifies a common dialog box. More...
 
void run_sheet (intptr_t owner) override
 When overridden in a derived class, specifies a common dialog box. More...
 
- Protected Member Functions inherited from xtd::forms::common_dialog
virtual void on_common_dialog_closed (const common_dialog_closed_event_args &e)
 Raises the close event. More...
 
virtual void on_help_request (help_event_args &e)
 Raises the help_request event. More...
 
- Protected Member Functions inherited from xtd::forms::component
virtual bool can_raise_events () const
 Gets a value indicating whether the component can raise an event. More...
 
bool design_mode () const
 Gets a value that indicates whether the component is currently in design mode. More...
 

Protected Attributes

xtd::forms::character_casing character_casing_ = xtd::forms::character_casing::normal
 
xtd::forms::dialog_style dialog_style_ = xtd::forms::dialog_style::standard
 
std::string message_
 
bool multiline_ = false
 
std::string text_
 
bool use_system_password_char_ = false
 
std::string value_
 

Additional Inherited Members

- Public Attributes inherited from xtd::forms::common_dialog
event< common_dialog, common_dialog_closed_event_handler< component & > > common_dialog_closed
 
event< common_dialog, help_event_handler< component & > > help_request
 Occurs when the user clicks the Help button on a common dialog box. More...
 

Detailed Description

Represents a common dialog box that displays input box.

Example
The following code example demonstrate the use of input_dialog dialog.
#include <xtd/xtd.forms>
using namespace xtd;
using namespace xtd::forms;
namespace examples {
class form1 : public form {
public:
form1() {
text("Input box example");
controls().push_back_range({button1, label1});
button1.location({10, 10});
button1.text("Text...");
button1.click += [&] {
input_dialog.text("Caption text");
input_dialog.message("Message text");
input_dialog.value(label1.text());
if (input_dialog.show_sheet_dialog(*this) == dialog_result::ok)
label1.text(input_dialog.value());
};
label1.location({10, 50});
label1.auto_size(true);
label1.text("Default value");
}
private:
label label1;
};
}
int main() {
application::run(examples::form1());
}

Constructor & Destructor Documentation

§ input_dialog()

xtd::forms::input_dialog::input_dialog ( )
default

Initializes a new instance of the input_dialog class.

Member Function Documentation

§ message()

input_dialog& xtd::forms::input_dialog::message ( const std::string &  value)
inline

Sets the text message.

Parameters
valueThe text message.
Returns
Current input_dialog instance.

§ messsage()

std::string xtd::forms::input_dialog::messsage ( ) const
inline

Gets the text message.

Returns
The text message.

§ reset()

void xtd::forms::input_dialog::reset ( )
overridevirtual

Resets all properties to empty string.

Implements xtd::forms::common_dialog.

§ run_dialog()

bool xtd::forms::input_dialog::run_dialog ( intptr_t  hwnd_owner)
overrideprotectedvirtual

When overridden in a derived class, specifies a common dialog box.

Parameters
hwnd_ownerA value that represents the window handle of the owner window for the common dialog box.
Returns
true if the dialog box was successfully run; otherwise, false.

Implements xtd::forms::common_dialog.

§ run_sheet()

void xtd::forms::input_dialog::run_sheet ( intptr_t  hwnd_owner)
overrideprotectedvirtual

When overridden in a derived class, specifies a common dialog box.

Parameters
hwnd_ownerA value that represents the window handle of the owner window for the common dialog box.
Returns
true if the dialog box was successfully run; otherwise, false.

Implements xtd::forms::common_dialog.

§ text() [1/2]

std::string xtd::forms::input_dialog::text ( ) const
inline

Gets the dialog caption text.

Returns
The current dialog caption text.

§ text() [2/2]

input_dialog& xtd::forms::input_dialog::text ( const std::string &  value)
inline

Sets the dialog caption text.

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

§ value() [1/2]

std::string xtd::forms::input_dialog::value ( ) const
inline

Gets the value.

Returns
The value.

§ value() [2/2]

input_dialog& xtd::forms::input_dialog::value ( const std::string &  value)
inline

Sets thevalue.

Parameters
valueThe value.
Returns
Current input_dialog instance.

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