Namespace: kodi::gui::dialogs::YesNo
Yes / No dialog
The Yes / No dialog can be used to inform the user about questions and get the answer.
In order to achieve a line break is a \n directly in the text or in the "./resources/language/resource.language.??_??/strings.po" to call with std::string kodi::general::GetLocalizedString(...);.
It has the header #include <kodi/gui/dialogs/YesNo.h> be included to enjoy it.
◆ ShowAndGetInput() [1/3]
bool ATTRIBUTE_HIDDEN kodi::gui::dialogs::YesNo::ShowAndGetInput |
( |
const std::string & |
heading, |
|
|
const std::string & |
text, |
|
|
bool & |
canceled, |
|
|
const std::string & |
noLabel = "" , |
|
|
const std::string & |
yesLabel = "" |
|
) |
| |
|
inline |
Use dialog to get numeric new password with one text string shown everywhere and cancel return field.
- Parameters
-
[in] | heading | Dialog heading |
[in] | text | Multi-line text |
[out] | canceled | Return value about cancel button |
[in] | noLabel | [opt] label to put on the no button |
[in] | yesLabel | [opt] label to put on the yes button |
- Returns
- Returns True if 'Yes' was pressed, else False
- Note
- It is preferred to only use this as it is actually a multi-line text.
Example:
#include <kodi/gui/dialogs/YesNo.h>
bool canceled = false;
"Yes / No test call",
"You has opened Yes / No dialog for test\n\nIs this OK for you?",
canceled,
"Not really",
"Ohhh yes");
fprintf(stderr, "You has called Yes/No, returned '%s' and was %s\n",
ret ? "yes" : "no",
canceled ? "canceled" : "not canceled");
bool ATTRIBUTE_HIDDEN ShowAndGetInput(std::string &text, const std::string &heading, bool allowEmptyResult, bool hiddenInput=false, unsigned int autoCloseMs=0)
Show keyboard with initial value text and replace with result string.
Definition: Keyboard.h:74
◆ ShowAndGetInput() [2/3]
bool ATTRIBUTE_HIDDEN kodi::gui::dialogs::YesNo::ShowAndGetInput |
( |
const std::string & |
heading, |
|
|
const std::string & |
line0, |
|
|
const std::string & |
line1, |
|
|
const std::string & |
line2, |
|
|
const std::string & |
noLabel = "" , |
|
|
const std::string & |
yesLabel = "" |
|
) |
| |
|
inline |
Use dialog to get numeric new password with separated line strings.
- Parameters
-
[in] | heading | Dialog heading |
[in] | line0 | Line #0 text |
[in] | line1 | Line #1 text |
[in] | line2 | Line #2 text |
[in] | noLabel | [opt] label to put on the no button |
[in] | yesLabel | [opt] label to put on the yes button |
- Returns
- Returns True if 'Yes' was pressed, else False
Example:
#include <kodi/gui/dialogs/YesNo.h>
"Yes / No test call",
"You has opened Yes / No dialog for test",
"",
"Is this OK for you?",
"Not really",
"Ohhh yes");
fprintf(stderr, "You has called Yes/No, returned '%s'\n",
ret ? "yes" : "no");
◆ ShowAndGetInput() [3/3]
bool ATTRIBUTE_HIDDEN kodi::gui::dialogs::YesNo::ShowAndGetInput |
( |
const std::string & |
heading, |
|
|
const std::string & |
line0, |
|
|
const std::string & |
line1, |
|
|
const std::string & |
line2, |
|
|
bool & |
canceled, |
|
|
const std::string & |
noLabel = "" , |
|
|
const std::string & |
yesLabel = "" |
|
) |
| |
|
inline |
Use dialog to get numeric new password with separated line strings and cancel return field.
- Parameters
-
[in] | heading | Dialog heading |
[in] | line0 | Line #0 text |
[in] | line1 | Line #1 text |
[in] | line2 | Line #2 text |
[out] | canceled | Return value about cancel button |
[in] | noLabel | [opt] label to put on the no button |
[in] | yesLabel | [opt] label to put on the yes button |
- Returns
- Returns True if 'Yes' was pressed, else False
Example:
#include <kodi/gui/dialogs/YesNo.h>
bool canceled = false;
"Yes / No test call",
"You has opened Yes / No dialog for test",
"",
"Is this OK for you?",
canceled,
"Not really",
"Ohhh yes");
fprintf(stderr, "You has called Yes/No, returned '%s' and was %s\n",
ret ? "yes" : "no",
canceled ? "canceled" : "not canceled");