xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
input_box.h
Go to the documentation of this file.
1 #pragma once
5 #include "input_dialog.h"
6 #include "input_box_style.h"
7 #include <xtd/static.h>
8 
10 namespace xtd {
12  namespace forms {
22  class input_box final static_ {
23  public:
29  static xtd::forms::dialog_result show(xtd::ustring& value, const xtd::forms::iwin32_window& owner) {return show_input_box(value, &owner);}
36  static xtd::forms::dialog_result show(xtd::ustring& value, const xtd::forms::iwin32_window& owner, const xtd::ustring& text) {return show_input_box(value, &owner, text);}
44  static xtd::forms::dialog_result show(xtd::ustring& value, const xtd::forms::iwin32_window& owner, const xtd::ustring& text, const xtd::ustring& caption) {return show_input_box(value, &owner, text, caption);}
53  static xtd::forms::dialog_result show(xtd::ustring& value, const xtd::forms::iwin32_window& owner, const xtd::ustring& text, const xtd::ustring& caption, xtd::forms::input_box_style style) {return show_input_box(value, &owner, text, caption, style);}
63  static xtd::forms::dialog_result show(xtd::ustring& value, const xtd::forms::iwin32_window& owner, const xtd::ustring& text, const xtd::ustring& caption, xtd::forms::input_box_style style, xtd::forms::character_casing casing) {return show_input_box(value, &owner, text, caption, style, casing);}
74  static xtd::forms::dialog_result show(xtd::ustring& value, const xtd::forms::iwin32_window& owner, const xtd::ustring& text, const xtd::ustring& caption, xtd::forms::input_box_style style, xtd::forms::character_casing casing, bool word_wrap) {return show_input_box(value, &owner, text, caption, style, casing, word_wrap);}
75 
81  static xtd::forms::dialog_result show(xtd::ustring& value) {return show_input_box(value);}
88  static xtd::forms::dialog_result show(xtd::ustring& value, const xtd::ustring& text) {return show_input_box(value, nullptr, text);}
96  static xtd::forms::dialog_result show(xtd::ustring& value, const xtd::ustring& text, const xtd::ustring& caption) {return show_input_box(value, nullptr, text, caption);}
105  static xtd::forms::dialog_result show(xtd::ustring& value, const xtd::ustring& text, const xtd::ustring& caption, xtd::forms::input_box_style style) {return show_input_box(value, nullptr, text, caption, style);}
115  static xtd::forms::dialog_result show(xtd::ustring& value, const xtd::ustring& text, const xtd::ustring& caption, xtd::forms::input_box_style style, xtd::forms::character_casing casing) {return show_input_box(value, nullptr, text, caption, style, casing);}
126  static xtd::forms::dialog_result show(xtd::ustring& value, const xtd::ustring& text, const xtd::ustring& caption, xtd::forms::input_box_style style, xtd::forms::character_casing casing, bool word_wrap) {return show_input_box(value, nullptr, text, caption, style, casing, word_wrap);}
127 
128  private:
129  static xtd::forms::dialog_result show_input_box(xtd::ustring& value, const xtd::forms::iwin32_window* owner = nullptr, const xtd::ustring& text = "", const xtd::ustring& caption = "", xtd::forms::input_box_style style = xtd::forms::input_box_style::normal, xtd::forms::character_casing casing = xtd::forms::character_casing::normal, bool word_wrap = true) {
131  dialog.value(value);
132  dialog.message(text);
133  dialog.text(caption);
134  dialog.character_casing(casing);
137  dialog.word_wrap(word_wrap);
138  xtd::forms::dialog_result result = owner ? dialog.show_sheet_dialog(*owner) : dialog.show_dialog();
139  if (result == xtd::forms::dialog_result::ok) value = dialog.value();
140  return result;
141  }
142  };
143  }
144 }
xtd::forms::dialog_result show_dialog()
Runs a common dialog box with a default owner.
Definition: common_dialog.h:60
xtd::forms::dialog_result show_sheet_dialog(const iwin32_window &owner)
Runs a common dialog box with the specified owner.
Definition: common_dialog.h:91
Represents a common dialog box that displays input box.
Definition: input_box.h:22
static xtd::forms::dialog_result show(xtd::ustring &value)
Displays an input box. The input box displays a text value.
Definition: input_box.h:81
static xtd::forms::dialog_result show(xtd::ustring &value, const xtd::ustring &text, const xtd::ustring &caption, xtd::forms::input_box_style style)
Displays an input box. The input box displays a input text value with specified invite message text,...
Definition: input_box.h:105
static xtd::forms::dialog_result show(xtd::ustring &value, const xtd::forms::iwin32_window &owner, const xtd::ustring &text, const xtd::ustring &caption, xtd::forms::input_box_style style, xtd::forms::character_casing casing)
Displays an input box in front of the specified window. The input box displays a input text value wit...
Definition: input_box.h:63
static xtd::forms::dialog_result show(xtd::ustring &value, const xtd::forms::iwin32_window &owner, const xtd::ustring &text, const xtd::ustring &caption, xtd::forms::input_box_style style)
Displays an input box in front of the specified window. The input box displays a input text value wit...
Definition: input_box.h:53
static xtd::forms::dialog_result show(xtd::ustring &value, const xtd::ustring &text, const xtd::ustring &caption)
Displays an input box. The input box displays a input text value with specified invite message text a...
Definition: input_box.h:96
static xtd::forms::dialog_result show(xtd::ustring &value, const xtd::ustring &text)
Displays an input box. The input box displays a input text value with specified invite message text.
Definition: input_box.h:88
static xtd::forms::dialog_result show(xtd::ustring &value, const xtd::forms::iwin32_window &owner, const xtd::ustring &text, const xtd::ustring &caption)
Displays an input box in front of the specified window. The input box displays a input text value wit...
Definition: input_box.h:44
static xtd::forms::dialog_result show(xtd::ustring &value, const xtd::ustring &text, const xtd::ustring &caption, xtd::forms::input_box_style style, xtd::forms::character_casing casing)
Displays an input box. The input box displays a input text value with specified invite message text,...
Definition: input_box.h:115
static xtd::forms::dialog_result show(xtd::ustring &value, const xtd::forms::iwin32_window &owner, const xtd::ustring &text)
Displays an input box in front of the specified window. The input box displays a input text value wit...
Definition: input_box.h:36
static xtd::forms::dialog_result show(xtd::ustring &value, const xtd::forms::iwin32_window &owner, const xtd::ustring &text, const xtd::ustring &caption, xtd::forms::input_box_style style, xtd::forms::character_casing casing, bool word_wrap)
Displays an input box in front of the specified window. The input box displays a input text value wit...
Definition: input_box.h:74
static xtd::forms::dialog_result show(xtd::ustring &value, const xtd::forms::iwin32_window &owner)
Displays an input box in front of the specified window. The input box displays a text value.
Definition: input_box.h:29
static xtd::forms::dialog_result show(xtd::ustring &value, const xtd::ustring &text, const xtd::ustring &caption, xtd::forms::input_box_style style, xtd::forms::character_casing casing, bool word_wrap)
Displays an input box. The input box displays a input text value with specified invite message text,...
Definition: input_box.h:126
Represents a common dialog box that displays input dialog.
Definition: input_dialog.h:30
bool multiline() const
Gets multiline status.
Definition: input_dialog.h:68
xtd::ustring value() const
Gets the value.
Definition: input_dialog.h:118
xtd::forms::character_casing character_casing() const
Gets the character casing.
Definition: input_dialog.h:37
bool word_wrap() const
Gets word wrap status.
Definition: input_dialog.h:136
xtd::ustring text() const
Gets the dialog caption text.
Definition: input_dialog.h:93
bool use_system_password_char() const
Gets use system password char status.
Definition: input_dialog.h:106
xtd::ustring message() const
Gets the text message.
Definition: input_dialog.h:81
Provides an interface to expose Win32 HWND handles.
Definition: iwin32_window.h:19
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition: static.h:38
input_box_style
Specifies constants defining which input_box style is used.
Definition: input_box_style.h:18
dialog_result
Specifies identifiers to indicate the return value of a dialog box.
Definition: dialog_result.h:39
character_casing
Specifies the case of characters in a text_box control.
Definition: character_casing.h:18
@ password
Single line text box with password characters.
@ multiline
Multiline text box.
@ normal
Single line text box.
@ ok
The dialog box return value is OK (usually sent from a button labeled OK).
@ normal
The case of characters is left unchanged.
Contains xtd::forms::input_box_style enum class.
Contains xtd::forms::input_dialog dialog.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::static_object class.