Planeshift
|
pawsStringPromptWindow is a window that lets the user enter a string More...
#include <pawsstringpromptwindow.h>
Public Member Functions | |
bool | OnButtonReleased (int mouseButton, int keyModifier, pawsWidget *widget) |
Called when a button is released inside the window Only relevant if widget is okButton or cancelButton. | |
virtual bool | OnChange (pawsWidget *widget) |
Called when a child widget changes If the widget is the inputWidget and the max length is being tracked, then the max length is updated. | |
virtual bool | OnKeyDown (utf32_char keyCode, utf32_char keyChar, int modifiers) |
Called when a key is pressed If the enter key is pressed, the window is accepted and the action is called. | |
pawsStringPromptWindow () | |
Basic constructor. | |
pawsStringPromptWindow (const pawsStringPromptWindow &origin) | |
Static Public Member Functions | |
static pawsStringPromptWindow * | Create (const csString &label, const csString &string, bool multiline, int width, int height, iOnStringEnteredAction *action, const char *name, int param=0, bool modal=false, int maxlen=0) |
Entry point to pawsStringPromptWindow Call to create a window. | |
Protected Member Functions | |
void | CloseWindow (const csString &text) |
Executes action and destroys window. | |
void | CloseWindow () |
Executes action with text entered by user as parameter and destroys window. | |
void | Initialize (const csString &label, const csString &string, bool multiline, int width, int height, iOnStringEnteredAction *action, const char *name, int param=0, int maxlen=0) |
Initializes the window and sets up all of the appropriate widgets. | |
Protected Attributes | |
iOnStringEnteredAction * | action |
The action to call when this window is successfully destroyed. | |
bool | multiLine |
Whether the prompt is multi-line or single. | |
csString | name |
The name of the window; is sent to the action when OK is pressed. | |
int | param |
The optional parameter for the window; is sent to the action when OK is pressed. |
pawsStringPromptWindow is a window that lets the user enter a string
Definition at line 55 of file pawsstringpromptwindow.h.
pawsStringPromptWindow::pawsStringPromptWindow | ( | ) |
Basic constructor.
pawsStringPromptWindow::pawsStringPromptWindow | ( | const pawsStringPromptWindow & | origin | ) |
void pawsStringPromptWindow::CloseWindow | ( | const csString & | text | ) | [protected] |
Executes action and destroys window.
Sends text, the prestored param and this widget's name to the action.
text | The text to send to the action |
void pawsStringPromptWindow::CloseWindow | ( | ) | [protected] |
Executes action with text entered by user as parameter and destroys window.
static pawsStringPromptWindow* pawsStringPromptWindow::Create | ( | const csString & | label, |
const csString & | string, | ||
bool | multiline, | ||
int | width, | ||
int | height, | ||
iOnStringEnteredAction * | action, | ||
const char * | name, | ||
int | param = 0 , |
||
bool | modal = false , |
||
int | maxlen = 0 |
||
) | [static] |
Entry point to pawsStringPromptWindow Call to create a window.
label | Copied to Initialize |
string | Copied to Initialize |
multiline | Copied to Initialize |
width | Copied to Initialize |
height | Copied to Initialize |
action | Copied to Initialize |
name | Copied to Initialize |
param | Copied to Initialize |
modal | Whether the widget should be modal |
maxlen | Copied to Initialize |
void pawsStringPromptWindow::Initialize | ( | const csString & | label, |
const csString & | string, | ||
bool | multiline, | ||
int | width, | ||
int | height, | ||
iOnStringEnteredAction * | action, | ||
const char * | name, | ||
int | param = 0 , |
||
int | maxlen = 0 |
||
) | [protected] |
Initializes the window and sets up all of the appropriate widgets.
label | Label to use as a title |
string | Default string in the string prompt |
multiline | Whether the input supports multi-line |
width | Width of the window to show |
height | Height of the window to show |
action | The action to call when the prompt window is closed successfully |
name | The name of the string that is being prompted - passed to the action |
param | An optional parameter (not visible to user) - passed to the action |
maxlen | The maximum length of the string that is accepted |
bool pawsStringPromptWindow::OnButtonReleased | ( | int | mouseButton, |
int | keyModifier, | ||
pawsWidget * | widget | ||
) | [virtual] |
Called when a button is released inside the window Only relevant if widget is okButton or cancelButton.
mouseButton | The mouse button that was released |
keyModifier | Any modifiers that were present at release time |
widget | The widget which had focus when the button was released |
Reimplemented from pawsWidget.
virtual bool pawsStringPromptWindow::OnChange | ( | pawsWidget * | widget | ) | [virtual] |
Called when a child widget changes If the widget is the inputWidget and the max length is being tracked, then the max length is updated.
widget | The widget that changes |
Reimplemented from pawsWidget.
virtual bool pawsStringPromptWindow::OnKeyDown | ( | utf32_char | keyCode, |
utf32_char | keyChar, | ||
int | modifiers | ||
) | [virtual] |
Called when a key is pressed If the enter key is pressed, the window is accepted and the action is called.
keyCode | Key code for the key pressed |
keyChar | Char code for the key pressed |
modifiers | Any modifiers that were present at press time |
Reimplemented from pawsWidget.
iOnStringEnteredAction* pawsStringPromptWindow::action [protected] |
The action to call when this window is successfully destroyed.
Definition at line 145 of file pawsstringpromptwindow.h.
bool pawsStringPromptWindow::multiLine [protected] |
Whether the prompt is multi-line or single.
Definition at line 141 of file pawsstringpromptwindow.h.
csString pawsStringPromptWindow::name [protected] |
The name of the window; is sent to the action when OK is pressed.
Reimplemented from pawsWidget.
Definition at line 149 of file pawsstringpromptwindow.h.
int pawsStringPromptWindow::param [protected] |
The optional parameter for the window; is sent to the action when OK is pressed.
Definition at line 153 of file pawsstringpromptwindow.h.