Planeshift
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

pawsStringPromptWindow Class Reference

pawsStringPromptWindow is a window that lets the user enter a string More...

#include <pawsstringpromptwindow.h>

List of all members.

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 pawsStringPromptWindowCreate (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

iOnStringEnteredActionaction
 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.

Detailed Description

pawsStringPromptWindow is a window that lets the user enter a string

Definition at line 55 of file pawsstringpromptwindow.h.


Constructor & Destructor Documentation

pawsStringPromptWindow::pawsStringPromptWindow ( )

Basic constructor.

pawsStringPromptWindow::pawsStringPromptWindow ( const pawsStringPromptWindow origin)

Member Function Documentation

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.

Parameters:
textThe 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.

Parameters:
labelCopied to Initialize
stringCopied to Initialize
multilineCopied to Initialize
widthCopied to Initialize
heightCopied to Initialize
actionCopied to Initialize
nameCopied to Initialize
paramCopied to Initialize
modalWhether the widget should be modal
maxlenCopied to Initialize
Returns:
The widget that is created
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.

Parameters:
labelLabel to use as a title
stringDefault string in the string prompt
multilineWhether the input supports multi-line
widthWidth of the window to show
heightHeight of the window to show
actionThe action to call when the prompt window is closed successfully
nameThe name of the string that is being prompted - passed to the action
paramAn optional parameter (not visible to user) - passed to the action
maxlenThe 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.

Parameters:
mouseButtonThe mouse button that was released
keyModifierAny modifiers that were present at release time
widgetThe widget which had focus when the button was released
Returns:
True if widget == okButton or cancelButton, false otherwise

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.

Parameters:
widgetThe widget that changes
Returns:
False

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.

Parameters:
keyCodeKey code for the key pressed
keyCharChar code for the key pressed
modifiersAny modifiers that were present at press time
Returns:
True if key is Enter, False otherwise

Reimplemented from pawsWidget.


Member Data Documentation

The action to call when this window is successfully destroyed.

Definition at line 145 of file pawsstringpromptwindow.h.

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.

The optional parameter for the window; is sent to the action when OK is pressed.

Definition at line 153 of file pawsstringpromptwindow.h.


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