|
cxWidgets 1.0
|
Represents a single-line input box with a label. This class. More...
#include <cxInput.h>


Public Member Functions | |
| cxInput (cxWindow *pParentWindow=nullptr, int pRow=0, int pCol=0, int pWidth=DEFAULT_WIDTH, const std::string &pLabel="", eBorderStyle pBorderStyle=eBS_NOBORDER, eInputOptions pInputOption=eINPUT_EDITABLE, bool pExitOnFull=false, std::string *pExtVal=nullptr) | |
| Default constructor. | |
| cxInput (const cxInput &pThatInput) | |
| Copy constructor. | |
| cxInput (const cxInput &pThatInput, cxMultiLineInput *pParentMLInput) | |
| Copy constructor that will be used by cxMultiLineInput when. | |
| virtual | ~cxInput () |
| Destructor. | |
| virtual long | show (bool pBringToTop=false, bool pShowSubwindows=false) override |
| Shows the window, along with the user's input. | |
| virtual long | showModal (bool pShowSelf=true, bool pBringToTop=true, bool pShowSubwindows=false) override |
| Handles user input for the form. | |
| virtual std::string | getLabel () const |
| virtual void | setLabel (const std::string &pLabel) |
| virtual void | clearValue (bool pRefresh=false) |
| Clears the input value. | |
| virtual void | clear (bool pRefresh=false) override |
| Alias for clearValue() (this is here to overload the clear() | |
| virtual std::string | getValue (bool pRemoveLeadingSpaces=false, bool pRemoveTrailingSpaces=false) const |
| virtual bool | setValue (const std::string &pValue, bool pRefresh=false) |
| std::string * | getExtValue () const |
| void | setExtValue (std::string *pExtVal, bool pRefresh=false) |
| bool | getExitOnFull () const |
| void | setExitOnFull (bool pExitOnFull) |
| Sets whether the input should leave the input loop when it's. | |
| bool | getExitOnBackspaceAtFront () const |
| Returns whether the input will exit the input loop when the. | |
| void | setExitOnBackspaceAtFront (bool pExitOnBackspaceAtFront) |
| Sets whether the input should exit the input loop when the. | |
| bool | getExitOnMouseOutside () const override |
| Returns whether the input exits its input loop when a mouse. | |
| void | setExitOnMouseOutside (bool pExitOnMouseOutside) override |
| Sets whether the input should exit its input loop when a. | |
| bool | getExitOnArrowAtBoundary () const |
| Returns whether the input exits when the left arrow key is. | |
| void | setExitOnArrowAtBoundary (bool pExitOnArrowAtBoundary) |
| Sets whether the input should exit its input loop when the. | |
| bool | getMustFill () const |
| void | setMustFill (bool pMustFill) |
| bool | getMasked () const |
| void | toggleMasking (bool pMasking) |
| char | getMaskChar () const |
| void | setMaskChar (char pMaskChar) |
| int | getInputOption () const |
| Accessor for mInputOption; Returns an int representing the. | |
| void | setInputOption (eInputOptions pInputOption) |
| Sets the input editability (i.e., eINPUT_EDITABLE, eINPUT_READONLY) -. | |
| void | setValidator (const std::string &pVString) |
| const std::string & | getValidatorStr () const |
| int | getInputLen () const |
| void | setCursorX (int pCursorX) |
| virtual bool | move (int pNewRow, int pNewCol, bool pRefresh=true) override |
| virtual void | resize (int pNewHeight, int pNewWidth, bool pRefresh=true) override |
| Changes the input's width. The upper-left coordinate stays. | |
| void | setExitOnFKey (bool pExitOnFunctionKey) |
| virtual bool | textIsValid () const |
| virtual bool | textIsValid (const std::string &pText) const |
| void | setLabelColor (e_cxColors pColor) |
| Sets the label color. | |
| e_cxColors | getLabelColor () const |
| void | setValueColor (e_cxColors pColor) |
| Sets the color of the value typed into the input. | |
| e_cxColors | getValueColor () const |
| virtual void | setColor (e_WidgetItems pItem, e_cxColors pColor) override |
| Sets the color of one of the window items. | |
| void | toggleCursor (bool pShowCursor) |
| Enables/disables the display of the cursor. | |
| bool | setValidatorFunction (funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4) |
| bool | setValidatorFunction (funcPtr2 pFunction, void *p1, void *p2) |
| bool | setValidatorFunction (funcPtr0 pFunction) |
| void | clearValidatorFunction () |
| Un-sets the validator function. | |
| virtual bool | setOnKeyFunction (const std::shared_ptr< cxFunction > &pFunction) |
| Sets a function to be run whenever a key is pressed (referred. | |
| virtual bool | setOnKeyFunction (funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4) |
| Sets a function to be run whenever a key is pressed (referred. | |
| virtual bool | setOnKeyFunction (funcPtr2 pFunction, void *p1, void *p2) |
| Sets a function to be run whenever a key is pressed (referred. | |
| virtual bool | setOnKeyFunction (funcPtr0 pFunction) |
| Sets a function to be run whenever a key is pressed (referred. | |
| virtual void | toggleOnKeyFunction (bool pRunOnKeyFunction) |
| Sets whether the onKey function should be fired or not. | |
| virtual void | clearOnKeyFunction () |
| Un-sets the onKey function. | |
| virtual bool | onKeyFunctionEnabled () const |
| Returns whether or not the onKey function will be run. | |
| virtual bool | isFull () const |
| Returns whether the value in the input takes up the maximum possible space in the input. | |
| virtual int | maxValueLen () const |
| Returns the maximum length of the value that may be set. | |
| virtual bool | hasFocus () const override |
| Returns whether or not the input currently has focus. | |
| virtual void | setReadOnlyOnLeave (bool pReadOnlyOnLeave) |
| Sets whether the input should go read-only when setFocus() exits. | |
| bool | canBeEditable () const |
| Returns whether the input can be editable. | |
| void | setCanBeEditable (bool pCanBeEditable) |
| Sets whether the input can be set editable. | |
| virtual void | setBorderStyle (eBorderStyle pBorderStyle) override |
| Sets the border style. | |
| virtual void | refreshValue (bool pRefresh=true) |
| Refreshes just the value portion of the input. | |
| void | trapNonAssignedFKeys (bool pTrapNonAssignedFKeys) |
| Sets whether non-assigned function keys should. | |
| virtual void | enableInputLoop (bool pDoInputLoop) |
| Enables or disables the input loop. | |
| virtual bool | inputLoopEnabled () const |
| Returns whether the input loop is enabled. | |
| bool | isEditable () const |
| Returns whether or not the input is editable. An input is editable if it passes the 3 following criteria: | |
| virtual bool | getCursorLeftAlign () const |
| Returns whether the cursor will be left-aligned when the. | |
| virtual void | setCursorLeftAlign (bool pCursorLeftAlign) |
| Sets whether the cursor should be left-aligned when the. | |
| virtual void | setValidateOnReverse (bool pValidateOnReverse) |
| Sets whether or not to run the validator function. | |
| virtual bool | getValidateOnReverse () const |
| Returns whether or not the validator function will. | |
| virtual void | setLastKey (int pLastKey) override |
| Sets the last keypress. | |
| virtual bool | modalGetsKeypress () const override |
| Returns whether or not a call to showModal() will wait for a. | |
| virtual bool | runOnFocusFunction (std::string *pFunctionRetval=nullptr) override |
| Runs the onFocus function, if it's set. If the. | |
| virtual cxWindow * | getParent () const override |
| Returns a pointer to the parent window. If the cxInput. | |
| virtual void | addAttr (e_WidgetItems pItem, attr_t pAttr) override |
| Adds an ncurses attribute to use for one of the items in the. | |
| virtual void | setAttr (e_WidgetItems pItem, attr_t pAttr) override |
| Sets the ncurses attribute to use for one of the items in the. | |
| virtual void | removeAttr (e_WidgetItems pItem, attr_t pAttr) override |
| Removes an ncurses attribute from one of the item lists. | |
| virtual void | removeAttrs (e_WidgetItems pItem) override |
| Removes all attributes for a given window item. | |
| virtual void | getAttrs (e_WidgetItems pItem, std::set< attr_t > &pAttrs) const override |
| Returns the set of ncurses attributes for a given item. | |
| virtual std::string | runValidatorFunction () const |
| Runs the input's validator function and returns its return. | |
| virtual void | setTimeout (int pTimeout) |
| Sets the amount of time (in seconds) that the input should. | |
| int | getTimeout () const |
| Returns the amount of time that the. | |
| virtual std::string | cxTypeStr () const override |
| Returns the name of the cxWidgets class. This can be used to. | |
| void | setForceUpper (bool pForceUpper) |
| Toggles the option to force text to be upper-case. | |
| bool | getForceUpper () const |
| Returns the option for forcing text to upper-case. | |
| void | setMaxInputLength (int pLength) |
| Sets the maximum text length that can be accepted by the input. | |
| int | getMaxInputLength () const |
| Returns the currently-set maximum input length. | |
Public Member Functions inherited from cx::cxWindow | |
| cxWindow (cxWindow *pParentWindow=nullptr, int pRow=0, int pCol=0, int pHeight=DEFAULT_HEIGHT, int pWidth=DEFAULT_WIDTH, const std::string &pTitle="", const std::string &pMessage="", const std::string &pStatus="", eBorderStyle pBorderStyle=eBS_SINGLE_LINE, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false) | |
| Default constructor. | |
| cxWindow (cxWindow *pParentWindow, int pRow, int pCol, const std::string &pTitle, const std::string &pMessage, const std::string &pStatus, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false) | |
| Overloaded constructor. | |
| cxWindow (cxWindow *pParentWindow, const std::string &pTitle, const std::string &pMessage, const std::string &pStatus, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false) | |
| Overloaded constructor - Centers the window in the middle of the screen. | |
| cxWindow (cxWindow *pParentWindow, const std::string &pTitle, const std::string &pMessage, const std::string &pStatus, int pHeight, int pWidth, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false) | |
| Overloaded constructor - Centers the window in the middle of the screen. | |
| cxWindow (cxWindow *pParentWindow, const std::string &pMessage, const std::string &pStatus, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false) | |
| Overloaded constructor - Centers the window in the middle of the screen. | |
| cxWindow (cxWindow *pParentWindow, const std::string &pMessage, const std::string &pStatus, int pHeight, int pWidth, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false) | |
| Overloaded constructor - Centers the window in the middle of the screen. | |
| cxWindow (cxWindow *pParentWindow, const std::string &pMessage, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false) | |
| Overloaded constructor - Centers the window in the middle of the screen. | |
| cxWindow (cxWindow *pParentWindow, eHPosition pHPosition, const std::string &pTitle, const std::string &pMessage, const std::string &pStatus, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false) | |
| Overloaded constructor - Lets you specify the horizontal position. | |
| cxWindow (const cxWindow &pThatWindow) | |
| Copy constructor. | |
| virtual | ~cxWindow () |
| virtual void | centerHoriz (bool pRefresh=true) |
| Centers the window horizontally on the screen. | |
| virtual void | alignHoriz (eHPosition pPosition, bool pRefresh=true) |
| Aligns the window horizontally on the screen. | |
| virtual void | centerVert (bool pRefresh=true) |
| Centers the window vertically on the screen. | |
| virtual void | alignVert (eVPosition pPosition, bool pRefresh=true) |
| Aligns the window vertically on the screen. | |
| virtual void | center (bool pRefresh=true) |
| Centers the window on the screen. | |
| virtual std::string | getTitle () const |
| Accessor for title text - Returns the first string in the. | |
| virtual void | setTitle (const std::string &pTitle, bool pRefreshTitle=true) |
| Setter for the title text - This sets the first string in the. | |
| std::string | getStatus () const |
| Accessor for the status line text. | |
| virtual void | setStatus (const std::string &pStatus, bool pRefreshStatus=true) |
| Mutator for the status line text. | |
| std::string | getMessage () const |
| Returns the message that appears in the window, concatenating all message lines together. | |
| virtual void | setMessage (const std::string &pMessage) |
| Sets the text that appears within the window. | |
| virtual void | addMessageLineBelow (const std::string &pLine) |
| Adds a line to the message to be displayed in the window,. | |
| virtual void | addMessageLinesBelow (const std::vector< std::string > &pLines) |
| Adds lines to the message below the current message text. | |
| virtual void | addMessageLinesBelow (const std::list< std::string > &pLines) |
| Adds lines to the message below the current message text. | |
| virtual void | addMessageLinesBelow (const std::deque< std::string > &pLines) |
| Adds lines to the message below the current message text. | |
| virtual void | addMessageLineAbove (const std::string &pLine) |
| Adds a line to the message to be displayed in the window,. | |
| virtual void | addMessageLinesAbove (const std::vector< std::string > &pLines) |
| Adds lines to the message above the current message text. | |
| virtual void | addMessageLinesAbove (const std::list< std::string > &pLines) |
| Adds lines to the message above the current message text. | |
| virtual void | addMessageLinesAbove (const std::deque< std::string > &pLines) |
| Adds lines to the message above the current message text. | |
| virtual void | setMessageLines (const std::vector< std::string > &pLines) |
| Sets the message lines in the window. | |
| virtual void | setMessageLines (const std::list< std::string > &pLines) |
| Sets the message lines in the window. | |
| virtual void | setMessageLines (const std::deque< std::string > &pLines) |
| Sets the message lines in the window. | |
| virtual void | removeMessageLine (unsigned pIndex) |
| Removes a line from the text inside the window (by index). | |
| virtual void | setMessageLine (unsigned pIndex, const std::string &pLine) |
| Modifies one of the lines displayed in the window. | |
| void | setHorizTitleAlignment (eHPosition pHAlignment) |
| Sets the horizontal alignment of the title text. | |
| eHPosition | getHorizTitleAlignment () const |
| Accessor for the title text alignment. | |
| void | setHorizMessageAlignment (eHPosition pHAlignment) |
| Sets the horizontal alignment of the message text. | |
| eHPosition | getHorizMessageAlignment () const |
| Accessor for the horizontal message text alignment. | |
| void | setHorizStatusAlignment (eHPosition pHAlignment) |
| Sets the horizontal alignment of the status text. | |
| eHPosition | getHorizStatusAlignment () const |
| Accessor for the horizontal status text alignment. | |
| void | setVerticalMessageAlignment (eVPosition pVAlignment) |
| Sets the vertical alignment of the message text. | |
| eVPosition | getVerticalMessageAlignment () const |
| Accessor for the vertical message text alignment. | |
| void | setExtTitleWindow (cxWindow *pWindow, bool pRefreshTitle=true) |
| Sets an external cxWindow object to be used for the title, rather. | |
| cxWindow * | getExtTitleWindow () const |
| Accessor for the external title window pointer. | |
| void | setExtStatusWindow (cxWindow *pWindow, bool pRefreshStatus=true) |
| Sets an external cxWindow object to be used for status, rather. | |
| cxWindow * | getExtStatusWindow () const |
| Accessor for the external status window pointer. | |
| bool | isHidden () const |
| Returns whether or not the window is hidden. | |
| virtual long | setFocus (bool pShowSelf=true, bool pBringToTop=true, bool pShowSubwindows=true) |
| Alias for showModal() | |
| virtual void | setFocusColors () |
| Turns on the ncurses attribute A_REVERSE for the window to. | |
| virtual void | setFocusColors (attr_t pAttr) |
| Turns on the ncurses attribute pAttr for the window to. | |
| virtual void | unSetFocusColors () |
| Disables focus for this window and unhighlights the message. | |
| virtual void | unSetFocusColors (attr_t pAttr) |
| Disables focus for this window and un-highlights the message (using pAttr) | |
| virtual void | erase (bool pEraseSubwindows=true) |
| Erases the window. | |
| virtual void | bringToTop (bool pRefresh=true) |
| Brings the window to the top. | |
| virtual void | bringToBottom (bool pRefresh=false) |
| Puts the window on the bottom of all other windows. | |
| virtual bool | isOnTop () const |
| Returns whether the window is on top of all other windows. | |
| virtual bool | isOnBottom () const |
| Returns whether the window is on the bottom of all other windows. | |
| virtual bool | isAbove (const cxWindow &pThatWindow) const |
| Returns whether the window is above another window. | |
| virtual bool | isBelow (const cxWindow &pThatWindow) const |
| Returns whether a window is below another window. | |
| virtual void | hide (bool pHideSubwindows=true) |
| Hides the window. | |
| virtual void | unhide (bool pUnhideSubwindows=true) |
| Un-hides the window. | |
| void | touchWindow () |
| Marks the window's entire content as dirty so that the next. | |
| virtual void | drawBorder (int pRow, int pCol, int pHeight, int pWidth, bool pTop=true, bool pBottom=true, bool pLeft=true, bool pRight=true) |
| Draws the border (based on the border style) | |
| virtual void | drawBorder (int pHeight, int pWidth) |
| Draws a box in the window. | |
| virtual void | drawBorder () |
| Draws a box for the window border. | |
| virtual int | top () const |
| Returns the top row of the window. | |
| virtual int | centerRow () const |
| Returns the center row of the window. | |
| virtual int | bottom () const |
| Returns the bottom row of the window. | |
| virtual int | left () const |
| Returns the left column of the window. | |
| virtual int | centerCol () const |
| Returns the center column of the window. | |
| virtual int | right () const |
| Returns the right column of the window. | |
| virtual int | width (int pWidth) |
| Changes the width of the window. | |
| virtual int | width () const |
| Returns the width of the window. | |
| virtual int | height (int pHeight) |
| Changes the height of the window. | |
| virtual int | height () const |
| Returns the height of the window. | |
| virtual void | getRect (int &pTop, int &pLeft, int &pBottom, int &pRight) |
| Returns the coordinates of the rectangle defining the window. | |
| virtual bool | pointIsInWindow (int pY, int pX) const |
| Returns whether a screen location is in the window (including. | |
| virtual bool | pointIsInTitle (int pY, int pX) const |
| Returns whether a screen location is in the title of the window. | |
| virtual void | getSize (int &pHeight, int &pWidth) |
| Returns the height & width of the window. | |
| virtual bool | moveRelative (int pVerticalOffset, int pHorizOffset, bool pRefresh=true) |
| Changes the window's position via vertical & horizontal offsets. | |
| unsigned | numSubWindows () |
| Returns the number of subwindows in this window. | |
| void | setSubWinMessage (unsigned pIndex, const std::string &pMessage) |
| Sets the message of one of the subwindows (by index). | |
| void | setSubWinMessage (const std::string &pTitle, const std::string &pMessage) |
| Sets the message of one of the subwindows (by title). | |
| eBorderStyle | getBorderStyle () const |
| Returns the border style. | |
| bool | hasBorder () const |
| Does this window have a border? | |
| void | setParent (cxWindow *pNewParent) |
| Changes the pointer to the parent window; changes the parent window. | |
| virtual void | dump (std::string &pResult) |
| Returns a string containing all the characters. | |
| virtual void | showSubwindows (bool pBringToTop=true, bool pShowSubwindows=true) |
| Shows the subwindows for the window. | |
| cxWindow & | operator= (const cxWindow &pThatWindow) |
| Assignment operator. | |
| virtual void | writeText (int pRow, int pCol, const std::string &pText, bool pRefresh=true) |
| Writes text on the window. Note that the text is not permanant, so. | |
| bool | getHotkeyHighlighting () const |
| Returns whether hotkey attributes are used when writing the message. | |
| virtual bool | isEnabled () const |
| Returns whether or not the window is enabled. | |
| virtual void | setEnabled (bool pEnabled) |
| Enables or disables the window. If the window is. | |
| virtual void | setDisableCursorOnShow (bool pDisableCursorOnShow) |
| Sets whether the window should disable the cursor. | |
| virtual bool | getDisableCursorOnShow () const |
| Returns whether or not the window will disable. | |
| virtual int | getLastKey () const |
| Returns the last key pressed by the user (for showModal(), etc.) | |
| virtual bool | lastKeyWasMouseEvt () const |
| Returns whether or not the last keypress was a mouse event. | |
| virtual void | getLastMouseEvtCoords (int &pY, int &pX) |
| Returns the coordinates of the last mouse event in the window. | |
| virtual bool | getChangeColorsOnFocus () const |
| Returns whether the window will change. | |
| virtual void | setChangeColorsOnFocus (bool pChangeColorsOnFocus) |
| Sets whether colors should change when focus. | |
| virtual void | setOnFocusFunction (const std::shared_ptr< cxFunction > &pFunction) |
| Sets the window's "on focus" function. | |
| virtual void | setOnFocusFunction (funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pUseVal=false, bool pExitAfterRun=false) |
| Sets the "on focus" function pointer. | |
| virtual void | setOnFocusFunction (funcPtr2 pFunction, void *p1, void *p2, bool pUseVal=false, bool pExitAfterRun=false) |
| Sets the "on focus" function pointer. | |
| virtual void | setOnFocusFunction (funcPtr0 pFunction, bool pUseVal=false, bool pExitAfterRun=false) |
| Sets the "on focus" function pointer. | |
| virtual void | setOnLeaveFunction (const std::shared_ptr< cxFunction > &pFunction) |
| Sets the window's "on leave" function. | |
| virtual void | setOnLeaveFunction (funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4) |
| Sets the "on leave" function pointer. | |
| virtual void | setOnLeaveFunction (funcPtr2 pFunction, void *p1, void *p2) |
| Sets the "on focus" function pointer. | |
| virtual void | setOnLeaveFunction (funcPtr0 pFunction) |
| Sets the "on focus" function pointer. | |
| virtual bool | runOnLeaveFunction (std::string *pFunctionRetval=nullptr) |
| Runs the onLeave function, if it's set. However, if the last. | |
| virtual void | toggleOnFocusFunction (bool pRunOnFocus) |
| Sets whether or not the onFocus function should run. | |
| virtual void | toggleOnLeaveFunction (bool pRunOnLeave) |
| Sets whether or not the onLeave function should run. | |
| virtual bool | onFocusFunctionEnabled () const |
| Returns whether or not the onFocus function is set to run. | |
| virtual bool | onLeaveFunctionEnabled () const |
| Returns whether or not the onLeave function is set to run. | |
| virtual const std::shared_ptr< cxFunction > & | getOnFocusFunction () const |
| Accessor for the onFocus function. | |
| virtual const std::shared_ptr< cxFunction > & | getOnLeaveFunction () const |
| Accessor for the onLeave function. | |
| virtual bool | isModal () const |
| Returns whether or not the window is currently. | |
| virtual bool | setKeyFunction (int pKey, const std::shared_ptr< cxFunction > &pFunction) |
| Sets a function to be called when a key is pressed. | |
| virtual bool | setKeyFunction (int pKey, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true) |
| Sets a function to be called when a key is pressed. | |
| virtual bool | setKeyFunction (int pKey, funcPtr2 pFunction, void *p1, void *p2, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true) |
| Sets a function to be called when a key is pressed. | |
| virtual bool | setKeyFunction (int pKey, funcPtr0 pFunction, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true) |
| Sets a function to be called when a key is pressed. This. | |
| virtual void | clearKeyFunction (int pKey) |
| Removes a function pointer for a keypress so that it will no. | |
| virtual void | clearKeyFunctionByPtr (funcPtr4 pFunction) |
| Removes a keypress function pointer. | |
| virtual void | clearKeyFunctionByPtr (funcPtr2 pFunction) |
| Removes a keypress function pointer. | |
| virtual void | clearKeyFunctionByPtr (funcPtr0 pFunction) |
| Removes a keypress function pointer. | |
| virtual void | clearKeyFunctions () |
| Clears the list of external functions fired by hotkeys. | |
| virtual bool | hasKeyFunction (int pKey) const |
| Returns whether an external function exists for a keypress. | |
| virtual bool | setMouseFunction (int pMouseState, const std::shared_ptr< cxFunction > &pFunction) |
| Sets a function to be called for a certain mouse state. | |
| virtual bool | setMouseFunction (int pMouseState, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true) |
| Sets a function to be called for a certain mouse state. | |
| virtual bool | setMouseFunction (int pMouseState, funcPtr2 pFunction, void *p1, void *p2, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true) |
| Sets a function to be called for a certain mouse state. | |
| virtual bool | setMouseFunction (int pMouseState, funcPtr0 pFunction, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true) |
| Sets a function to be called for a certain mouse state. This. | |
| virtual void | clearMouseFunction (int pMouseState) |
| Removes a function pointer for a mouse event so that it will. | |
| virtual void | clearMouseFunctions () |
| Clears the list of external functions fired by mouse events. | |
| virtual bool | hasMouseFunction (int pMouseState) const |
| Returns whether an external function exists for a mouse event. | |
| std::map< int, std::shared_ptr< cxFunction > >::iterator | keyFunctions_begin () |
| Returns a begin iterator to the map of cxFunction pointers. | |
| std::map< int, std::shared_ptr< cxFunction > >::iterator | keyFunctions_end () |
| Returns an end iterator to the map of cxFunction pointers. | |
| virtual void | getFunctionKeyStrings (std::vector< std::string > &pKeys) const |
| Populates a collection of strings representing the keys. | |
| virtual void | getFunctionKeys (std::vector< int > &pKeys) const |
| Populates a collection with integers representing the keys. | |
| virtual void | setShowSubwinsForward (bool pShowSubwinsForward) |
| Toggles the order in which subwindows will be shown. | |
| virtual bool | getShowSubwinsForward () const |
| Returns whether or not the subwindows will be shown. | |
| virtual void | setShowSelfBeforeSubwins (bool pShowSelfBeforeSubwins) |
| Sets whether the window will show itself before. | |
| virtual bool | getShowSelfBeforeSubwins () const |
| Returns whether or not the window will show itself before. | |
| virtual long | getReturnCode () const |
| Returns the return code set by the last call to. | |
| virtual bool | addTitleString (int pHPos, const std::string &pStr, bool pRefreshTitle=false) |
| Adds/sets a string to appear in the title at. | |
| virtual std::string | getTitleString (int pHPos) const |
| Returns the title string set at a given horizontal position. | |
| virtual std::map< int, std::string > | getTitleStrings () const |
| Returns the map of title strings for the window. | |
| virtual void | getTitleStrings (std::map< int, std::string > &pTitleStrings) const |
| Returns the map of title strings for the window (using an. | |
| virtual void | setTitleStrings (const std::map< int, std::string > &pTitleStrings) |
| Sets all the title strings via a map of horizontal. | |
| virtual void | removeTitleString (int pHPos) |
| Removes a title string at a given horizontal position. | |
| virtual void | removeTitleStrings () |
| Removes all title strings. | |
| virtual bool | addStatusString (int pHPos, const std::string &pStr, bool pRefreshStatus=false) |
| Adds/sets a string to appear in the status line at. | |
| virtual std::string | getStatusString (int pHPos) const |
| Returns the status string set at a given horizontal position. | |
| virtual std::map< int, std::string > | getStatusStrings () const |
| Returns the map of status strings for the window. | |
| virtual void | getStatusStrings (std::map< int, std::string > &pStatusStrings) const |
| Returns the map of status strings for the window (using an. | |
| virtual void | setStatusStrings (const std::map< int, std::string > &pStatusStrings) |
| Sets all the status strings via a map of horizontal. | |
| virtual void | removeStatusString (int pHPos) |
| Removes a status string at a given horizontal position. | |
| virtual void | removeStatusStrings () |
| Removes all status strings. | |
| virtual bool | addQuitKey (int pKey, bool pRunOnLeaveFunction=true, bool pOverride=false) |
| Adds a key that will cause the window to quit its input loop. | |
| virtual void | removeQuitKey (int pKey) |
| Removes a quit key. | |
| virtual void | removeQuitKeys () |
| Removes all quit keys. | |
| virtual bool | addExitKey (int pKey, bool pRunOnLeaveFunction=true, bool pOverride=false) |
| Adds a key that will cause the window to quit its input loop. | |
| virtual void | removeExitKey (int pKey) |
| Removes an exit key. | |
| virtual void | removeExitKeys () |
| Removes all exit keys. | |
| virtual bool | hasExitKey (int pKey) const |
| Returns whether or not a key exists in the. | |
| virtual bool | hasQuitKey (int pKey) const |
| Returns whether or not a key exists in the. | |
| virtual void | quitNow () |
| This is mainly for deriving classes. This causes the object. | |
| virtual void | exitNow () |
| This is mainly for deriving classes. It tells the object. | |
| virtual void | getQuitKeyStrings (std::vector< std::string > &pKeys) const |
| Populates a collection of strings representing the keys. | |
| virtual std::string | getQuitKeyListString () const |
| Returns a string containing a comma-separated list of the. | |
| virtual void | getExitKeyStrings (std::vector< std::string > &pKeys) const |
| Populates a collection of strings representing the keys. | |
| virtual std::string | getExitKeyListString () const |
| Returns a string containing a comma-separated list of the. | |
| virtual std::map< int, bool > | getQuitKeys () const |
| Returns the keys that will make the window quit its input. | |
| virtual std::map< int, bool > | getExitKeys () const |
| Returns the keys that will make the window exit is input. | |
| void | toggleMessage (bool pDrawMessage) |
| Sets whether or not to draw the message area (the area within. | |
| void | toggleTitle (bool pDrawTitle) |
| Sets whether or not to draw the title. | |
| void | toggleStatus (bool pDrawStatus) |
| Sets whether or not to draw the status line. | |
| bool | messageWillDraw () const |
| Returns whether the message will draw or not. | |
| bool | titleWillDraw () const |
| Returns whether the title will draw or not. | |
| bool | statusWillDraw () const |
| Returns whether the status line will draw or not. | |
| void | toggleSpecialChars (bool pDrawSpecialChars) |
| Sets whether or not to draw the "special" characters (these are. | |
| bool | specialCharsWillDraw () const |
| Returns whether the "special" characters will be drawn or. | |
| virtual void | drawTitle () |
| Writes the title line. | |
| virtual void | drawStatus () |
| Writes the status line. | |
| virtual void | drawMessage () |
| Writes the message text (in the area within the borders) | |
| virtual void | drawSpecialChars () |
| Writes the set of "special" characters to the window. | |
| virtual void | setReturnCode (const long &pReturnCode) |
| Explicitly sets the member return code for the window. | |
| virtual void | setMessageColor (e_cxColors pColor) |
| Returns the message color. | |
| virtual void | setTitleColor (e_cxColors pColor) |
| Sets the title color. | |
| virtual void | setStatusColor (e_cxColors pColor) |
| Sets the color of the status line at bottom of window. | |
| virtual void | setBorderColor (e_cxColors pColor) |
| Sets the color of the window border. | |
| virtual bool | hasAttr (e_WidgetItems pItem, attr_t pAttr) |
| Returns whether an attribute is set for a widget item. | |
| bool | getLeaveNow () const |
| Returns whether or not something told the window to leave now. | |
| std::string | getName () const |
| virtual void | setName (const std::string &pName) |
| Sets the name of the window. The name is an alternative means. | |
| bool | mouseEvtWasInWindow () const |
| Returns whether the current mouse information stored in the. | |
| virtual bool | mouseEvtWasInTitle () const |
| Returns whether the current mouse information stored in the. | |
| virtual void | doMouseBehavior () |
| Triggers the window's mouse event behavior. This method can. | |
| virtual void | doMouseBehavior (int pMouseY, int pMouseX) |
| Triggers the window's mouse event behavior. Also sets the. | |
| std::shared_ptr< cxFunction > | getKeyFunction (int pKey) const |
| Returns a cxFunction pointer for a key. | |
| std::shared_ptr< cxFunction0 > | getKeyFunctionAsFunction0 (int pKey) const |
| Returns a cxFunction pointer for a key, casted to a cxFunction0. | |
| std::shared_ptr< cxFunction2 > | getKeyFunctionAsFunction2 (int pKey) const |
| Returns a cxFunction pointer for a key, casted to a cxFunction2. | |
| std::shared_ptr< cxFunction4 > | getKeyFunctionAsFunction4 (int pKey) const |
| Returns a cxFunction pointer for a key, casted to a cxFunction4. | |
| bool | mouseEvtWasButtonEvt () const |
| Returns whether or not the mouse event read in mMouse was. | |
| bool | mouseButton1Pressed () const |
| Returns whether or not the first mouse button was pressed. | |
| bool | mouseButton1Released () const |
| Returns whether or not the first mouse button was released. | |
| bool | mouseButton1Clicked () const |
| Returns whether or not the first mouse button was clicked. | |
| bool | mouseButton1DoubleClicked () const |
| Returns whether or not the first mouse button was double-clicked. | |
| bool | mouseButton2Clicked () const |
| Returns whether or not the second mouse button was clicked. | |
| bool | mouseButton2DoubleClicked () const |
| Returns whether or not the second mouse button was double-clicked. | |
| bool | mouseButton3Clicked () const |
| Returns whether or not the second mouse button was clicked. | |
| virtual void | mouseButton1Click (int pY, int pX) |
| Tells the window that mouse button 1 was clicked at a certain. | |
| virtual void | mouseButton2Click (int pY, int pX) |
| Tells the window that mouse button 2 was clicked at a certain. | |
| virtual void | mouseButton3Click (int pY, int pX) |
| Tells the window that mouse button 3 was clicked at a certain. | |
| std::string | getString (int pRow, int pCol, int pNumber) |
| Get the contents of a portion of the window. (for debugging/testing) | |
| void | info () |
| Display information about a window (for debugging/testing) | |
| virtual void | toggleBorderTop (bool pToggle) |
| Sets whether or not to display the top border. | |
| virtual void | toggleBorderBottom (bool pToggle) |
| Sets whether or not to display the bottom border. | |
| virtual void | toggleBorderLeft (bool pToggle) |
| Sets whether or not to display the left border. | |
| virtual void | toggleBorderRight (bool pToggle) |
| Sets whether or not to display the right border. | |
| virtual void | addSpecialChar (int pY, int pX, chtype pChar, attr_t pAttr=A_NORMAL) |
| Adds a character to be written somewhere in the window. These. | |
| virtual void | removeSpecialChar (int pY, int pX) |
| Removes a character from the set of special characters (by. | |
| virtual void | clearSpecialChars () |
| Clears the collection of special characters. | |
| virtual bool | functionExistsForLastMouseState () const |
| Returns whether an external function pointer exists for the. | |
| int | getMouseState () const |
| Returns the current mouse state as it was last captured by the. | |
| std::string | getMouseStateStr () const |
| Returns a string version of the current mouse state as it was. | |
Public Member Functions inherited from cx::cxObject | |
| cxObject () | |
| virtual | ~cxObject () |
| virtual void | beep () |
Static Public Member Functions | |
| static std::string | clearInput (void *theInput, void *unused) |
| Clears the value of a cxInput. | |
Static Public Member Functions inherited from cx::cxObject | |
| static bool | UseColors () |
| static void | UseColors (bool useIt) |
| static bool | UseBeeps () |
| static void | UseBeeps (bool useIt) |
Static Public Attributes | |
| static int | inputClearKey = KEY_F(10) |
| inputClearKey is a default key to be used to clear inputs. | |
Protected Member Functions | |
| virtual bool | handleFunctionForLastKey (bool *pFunctionExists=nullptr, bool *pRunOnLeaveFunction=nullptr) override |
| Looks for a function tied to the last keypress and. | |
| virtual void | enableAttrs (WINDOW *pWin, e_WidgetItems pItem) override |
| Enables the attributes for one of the m*Attrs sets for an ncurses window. | |
| virtual void | disableAttrs (WINDOW *pWin, e_WidgetItems pItem) override |
| Disables the attributes for one of the m*Attrs sets for an ncurses window. | |
| virtual e_cxColors | getItemColor (e_WidgetItems pItem) const override |
| Returns the color of one of the items in a window. | |
Protected Member Functions inherited from cx::cxWindow | |
| virtual void | reCreatePanel () |
| Creates mPanel (by calling new_panel()), then sets up. | |
| void | freeWindow () |
| Frees the memory used by the ncurses window and. | |
| virtual void | init (int pRow, int pCol, int pHeight, int pWidth, const std::string &pTitle, const std::string &pMessage, const std::string &pStatus, cxWindow *pParentWindow=nullptr, bool pResizeVertically=true) |
| Initializes the window parameters and sets up the internal. | |
| virtual void | removeAllSubwindows () |
| Removes all subwindow pointers. | |
| virtual void | addSubwindow (cxWindow *pSubWindow) |
| Adds a subwindow to the window. Subwindows of a. | |
| virtual void | removeSubWindow (const cxWindow *pSubWindow) |
| Removes a window from the subwindow list. | |
| virtual void | setElementColor (short &pColorPair, attr_t &pElementAttr, e_cxColors pColor) |
| Sets the color (and attribute, if necessary) of a color element. | |
| virtual void | writeWithHighlighting (WINDOW *pWindow, const std::string &pText, const int &pY, const int &pStartX, const int &pEndX, int pNormalTextItem=-1) |
| Writes text to an ncurses WINDOW, highlighting any characters. | |
| virtual void | copyCxWinStuff (const cxWindow *pThatWindow, bool pRecreateWin=true) |
| Makes a copy of a cxWindow's member variables. | |
| virtual void | getRowColBasedOn (cxWindow *pParentWindow, eHPosition pPosition, const std::string &pTitle, const std::string &pStatus, const std::string &pMessage, int &pRow, int &pCol) |
| Figures out how to align text based on a title & message. | |
| virtual bool | handleFunctionForLastMouseState (bool *pFunctionExists=nullptr, bool *pRunOnLeaveFunction=nullptr) |
| Looks for a function tied to the last mouse state captured. | |
| void | setKeyFunctions (const cxWindow &pWindow) |
| Returns whether or not a mouse event location is within. | |
| void | setFocusFunctions (const cxWindow &pWindow) |
| Re-sets the onFocus and onLeave functions from another. | |
| bool | parentIsCxPanel () const |
| Returns whether or not the parent window, if there is one, is. | |
| bool | parentIsCxForm () const |
| Returns whether or not the parent window, if there is one, is. | |
| bool | parentIsCxNotebook () const |
| Returns whether or not the parent window, if there is one, is. | |
| cxWindowPtrContainer::const_iterator | subWindows_begin () const |
| Returns a const iterator to the first subwindow. | |
| cxWindowPtrContainer::const_iterator | subWindows_end () const |
| Returns a const iterator to the one past the last subwindow. | |
| cxWindowPtrContainer::const_reverse_iterator | subWindows_rbegin () const |
| Returns a const reverse begin iterator for the subwindow collection. | |
| cxWindowPtrContainer::const_reverse_iterator | subWindows_rend () const |
| Returns a const reverse end iterator for the subwindow collection. | |
| bool | onFocusFunctionIsSet () const |
| Returns whether or not the onFocus function is set (if. | |
| bool | onLeaveFunctionIsSet () const |
| Returns whether or not the onLeave function is set (if. | |
Protected Attributes | |
| std::set< attr_t > | mLabelAttrs |
| Label attributes. | |
| std::set< attr_t > | mDataReadonlyAttrs |
| Read-only data attributes. | |
| std::set< attr_t > | mDataEditableAttrs |
| Editable data attributes. | |
Protected Attributes inherited from cx::cxWindow | |
| WINDOW * | mWindow = nullptr |
| Everything in the window is written here; this is an nCurses window structure. | |
| messageLineContainer | mMessageLines |
| Contains the text to be shown inside the window (note: the. | |
| std::map< std::pair< int, int >, chtype > | mSpecialChars |
| Contains "special" characters which are added to the window. | |
| std::set< attr_t > | mMessageAttrs |
| Message attributes. | |
| std::set< attr_t > | mTitleAttrs |
| Title attributes. | |
| std::set< attr_t > | mStatusAttrs |
| Status attributes. | |
| std::set< attr_t > | mBorderAttrs |
| Border attributes. | |
| std::set< attr_t > | mHotkeyAttrs |
| Hotkey attributes. | |
| std::map< std::pair< int, int >, attr_t > | mSpecialCharAttrs |
| Attributes for the "special" characters (which are added to. | |
| short | mMessageColorPair = eWHITE_BLUE |
| short | mTitleColorPair = eGRAY_BLUE |
| short | mStatusColorPair = eBROWN_BLUE |
| short | mBorderColorPair = eGRAY_BLUE |
| eHPosition | mHorizTitleAlignment = eHP_LEFT |
| eHPosition | mHorizMessageAlignment = eHP_LEFT |
| eHPosition | mHorizStatusAlignment = eHP_LEFT |
| eVPosition | mVerticalMessageAlignment = eVP_TOP |
| bool | mDrawMessage = true |
| bool | mDrawTitle = true |
| bool | mDrawStatus = true |
| bool | mDrawSpecialChars = true |
| std::shared_ptr< cxFunction > | mOnFocusFunction = nullptr |
| std::shared_ptr< cxFunction > | mOnLeaveFunction = nullptr |
| bool | mIsModal = false |
| bool | mLeaveNow = false |
| std::map< int, std::shared_ptr< cxFunction > > | mKeyFunctions |
| std::map< int, std::shared_ptr< cxFunction > > | mMouseFunctions |
| std::map< int, bool > | mQuitKeys |
| std::map< int, bool > | mExitKeys |
| bool | mHotkeyHighlighting |
Friends | |
| class | cxMultiLineInput |
Additional Inherited Members | |
Static Protected Attributes inherited from cx::cxObject | |
| static bool | useColors |
| Whether or not to use colors. | |
| static bool | useBeeps |
| Whether or not to enable beeping. | |
Represents a single-line input box with a label. This class.
generally should not be used directly, since cxMultiLineInput
uses this class, and cxMultiLineInput can do everything that
this class does, plus more.
This class allows you to get typed input from a user - the methods showModal() and setFocus() make the input appear on the screen and process input. They also return a return code, depending on the user's action. If the user pressed ESC, cxID_QUIT is returned to signify that the user quit out of the input and didn't want to do anything. If the user presses ENTER, cxID_EXIT is returned to signify that the value in the input should be used. getLastKey() can be called to get the last key typed by the user (see cxKeyDefines and the ncurses list of key definitions (man getch)).
There is also a set of functions that may be set, that will be run at various times. The order of the functions is as follows:
Note that the functions used must have the following signatures:
Also, you can force an input never to be editable with the function setCanBeEditable(). If you call this with false, then the input can never be set editable, even with a call to setInputOption() with a parameter of eINPUT_EDITABLE.
Also, note that if you call setValue() to set a value that is too long to be displayed in the input, the input will only display what can fit inside the input, although getValue() will return the entire string that was set by setValue(). For example:
cxInput iInput(nullptr, 0, 0, 10, "Text:");
iInput.setValue("Some text for the input to hold");
iInput.getValue(); // Returns "Some text for the input to hold"
iInput.setFocus(); // Can only display "Some " in the input, since the width is 10
Setting a value longer than the input can display can cause some behavior that you may not expect, however. If you set a value too long for the input to display and then call setFocus(), the input will leave focus as soon as the user types something, because the input is full. However, being able to store more than the input can display can be useful if you are using a cxInput for display purposes only, and you still need to be able to store the entire value.
This class has an overloaded setBorderStyle(), which changes the border style and re-calculates some of the internal data structures. One side-effect of this is that the acceptable length of input may increase. If you start out with a borderless input and turn on borders, the acceptable length of input will stay the same, but if you then turn the borders back off, the length of the input will increase because the borders are now gone, and there are 2 more available spaces for input; thus, the input will be 2 spaces wider than it originally started.
By default, when the user presses any function keys that aren't assigned to any functions, cxInput will exit its input loop so that calling code can process the function keys. This can be changed with a call to trapNonAssignedFKeys().
|
explicit |
Default constructor.
| pParentWindow | Pointer to parent window; defaults to nullptr |
| pRow | Y location of input window; defaults to 0 |
| pCol | X location of input window; defaults to 0 |
| pWidth | Width of input window; defaults to DEFAULT_WIDTH (defined as 80 in cxObject.h) |
| pLabel | Label for input window; defaults to blank |
| pBorderStyle | The type of border to use - Defaults to eBS_NOBORDER; See the enumeration in cxBorderStyles.h |
| pInputOption | The editibility option - Defaults to eINPUT_EDITABLE. See the enumeration in cxEditoptions.h |
| pExitOnFull | Whether setFocus() should return when the input is full; defaults to false |
| pExtVal | An external value that the input should be set to; defaults to nullptr |
| cx::cxInput::cxInput | ( | const cxInput & | pThatInput | ) |
Copy constructor.
| pThatInput | Another cxInput object to be copied |
References cx::left(), cx::mDataEditableAttrs, cx::mDataReadonlyAttrs, cx::mLabelAttrs, setValue(), cx::top(), and cx::width().
| cx::cxInput::cxInput | ( | const cxInput & | pThatInput, |
| cxMultiLineInput * | pParentMLInput | ||
| ) |
Copy constructor that will be used by cxMultiLineInput when.
copying a cxMultiLineInput. This was originally meant to be
private (with cxMultiLineInput as a friend class), but when
updating the code to use shared_ptr instead of raw
dynamically-allocated pointers, it looked like make_shared()
has trouble accessing private constructors.
| pThatInput | Another cxInput object to be copied |
References setValue().
|
virtual |
Destructor.
|
overridevirtual |
Adds an ncurses attribute to use for one of the items in the.
window (see the e_WidgetItems enumeration).
| pItem | The item to add the attribute for (see the e_WidgetItems enumeration). |
| pAttr | The ncurses atribute to add. |
Reimplemented from cx::cxWindow.
References cx::cxWindow::addAttr(), cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, mDataEditableAttrs, mDataReadonlyAttrs, and mLabelAttrs.
Referenced by setValueColor(), and testInput1().
| bool cx::cxInput::canBeEditable | ( | ) | const |
Returns whether the input can be editable.
|
overridevirtual |
Alias for clearValue() (this is here to overload the clear()
inherited from cxWindow).
| pRefresh | Whether or not to refresh the input (defaults to false) |
Reimplemented from cx::cxWindow.
References clearValue().
|
static |
Clears the value of a cxInput.
| theInput | A pointer to a cxInput object |
| unused | Not used |
References setValue(), and show().
|
virtual |
Un-sets the onKey function.
Referenced by setOnKeyFunction(), setOnKeyFunction(), and setOnKeyFunction().
| void cx::cxInput::clearValidatorFunction | ( | ) |
Un-sets the validator function.
Referenced by setValidatorFunction(), setValidatorFunction(), and setValidatorFunction().
|
virtual |
Clears the input value.
| pRefresh | Whether or not to refresh the input (defaults to false) |
References refreshValue().
Referenced by clear().
|
overridevirtual |
Returns the name of the cxWidgets class. This can be used to.
determine the type of cxWidgets object that deriving classes
derive from in applications.
Reimplemented from cx::cxWindow.
|
overrideprotectedvirtual |
Disables the attributes for one of the m*Attrs sets for an ncurses window.
If the m*Attrs collection is empty, this will disable the cxBase attributes
instead.
| pWin | A pointer to the ncurses window for which to disable the attributes (will usually be mWindow). |
| pItem | The item type to retrieve attributes for - see the e_cxWidgetItems enumeration (defined in cxWidgetItems.h). |
Reimplemented from cx::cxWindow.
References cx::cxWindow::disableAttrs(), cx::disableAttrs(), cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, mDataEditableAttrs, mDataReadonlyAttrs, and mLabelAttrs.
Referenced by showModal().
|
overrideprotectedvirtual |
Enables the attributes for one of the m*Attrs sets for an ncurses window.
If the m*Attrs collection is empty, this will enable the cxBase attributes
instead.
| pWin | A pointer to the ncurses window for which to enable the attributes (will usually be mWindow). |
| pItem | The item type to retrieve attributes for - see the e_cxWidgetItems enumeration (defined in cxWidgetItems.h). |
Reimplemented from cx::cxWindow.
References cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::cxWindow::enableAttrs(), cx::enableAttrs(), cx::eSTATUS, cx::eTITLE, mDataEditableAttrs, mDataReadonlyAttrs, and mLabelAttrs.
Referenced by refreshValue(), and showModal().
|
virtual |
Enables or disables the input loop.
If the input loop is disabled, you can still
call setFocus() and showModal() on the
input - the onFocus and onLeave functions
will still run, but the input won't
wait for user input.
| pDoInputLoop | Whether to enable or disable brief the input loop (true/false) |
|
overridevirtual |
Returns the set of ncurses attributes for a given item.
| pItem | The item to retrieve attributes for (see the e_WidgetItems enumeration). |
| pAttrs | This will contain the attributes for the item. |
Reimplemented from cx::cxWindow.
References cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, cx::cxWindow::getAttrs(), mDataEditableAttrs, mDataReadonlyAttrs, and mLabelAttrs.
|
virtual |
Returns whether the cursor will be left-aligned when the.
input is shown modally.
| bool cx::cxInput::getExitOnArrowAtBoundary | ( | ) | const |
Returns whether the input exits when the left arrow key is.
pressed at position 0 or the right arrow key is pressed at
the end of the text.
| bool cx::cxInput::getExitOnBackspaceAtFront | ( | ) | const |
Returns whether the input will exit the input loop when the.
user presses backspace in the first input position.
| bool cx::cxInput::getExitOnFull | ( | ) | const |
Accessor for mExitOnFull
|
overridevirtual |
Returns whether the input exits its input loop when a mouse.
click occurs outside the input window.
Reimplemented from cx::cxWindow.
| string * cx::cxInput::getExtValue | ( | ) | const |
Returns the pointer to the "external" variable storing user input.
| bool cx::cxInput::getForceUpper | ( | ) | const |
Returns the option for forcing text to upper-case.
| int cx::cxInput::getInputLen | ( | ) | const |
Returns the maximum length of input that can be accepted
| int cx::cxInput::getInputOption | ( | ) | const |
Accessor for mInputOption; Returns an int representing the.
editability option for the input - See the eInputOptions
enumeration in cxInputOptions.h
Referenced by isEditable(), and modalGetsKeypress().
|
overrideprotectedvirtual |
Returns the color of one of the items in a window.
| pItem | The item type (a member of the e_WidgetItems enumeration
|
Reimplemented from cx::cxWindow.
References cx::eBORDER, cx::eBROWN_BLACK, cx::eBROWN_BLUE, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eGRAY_BLACK, cx::eGRAY_BLUE, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, cx::eWHITE_BLACK, cx::eWHITE_BLUE, cx::eYELLOW_BLACK, cx::eYELLOW_BLUE, cx::cxWindow::getItemColor(), mDataEditableAttrs, mDataReadonlyAttrs, and mLabelAttrs.
Referenced by getLabelColor(), and getValueColor().
|
virtual |
Returns the label for the input
References cx::cxWindow::mMessageLines.
Referenced by setBorderStyle().
| e_cxColors cx::cxInput::getLabelColor | ( | ) | const |
Gets the label color
References cx::eMESSAGE, and getItemColor().
|
inline |
Accessor for the masking character
|
inline |
Accessor for mMasked
| int cx::cxInput::getMaxInputLength | ( | ) | const |
Returns the currently-set maximum input length.
| bool cx::cxInput::getMustFill | ( | ) | const |
Accessor for mMustFill
|
overridevirtual |
Returns a pointer to the parent window. If the cxInput.
has a parent cxMultiLineInput, a pointer to that will be
returned; otherwise, a pointer to the parent cxWindow
will be returned.
Reimplemented from cx::cxWindow.
References cx::cxWindow::getParent().
| int cx::cxInput::getTimeout | ( | ) | const |
Returns the amount of time that the.
|
virtual |
Returns whether or not the validator function will.
run when the user wants to move in reverse.
| const string & cx::cxInput::getValidatorStr | ( | ) | const |
Returns the validator string
References cx::cxTextValidator::getValidatorStr().
Referenced by singleLineInput().
|
virtual |
Returns the user's input
| pRemoveLeadingSpaces | Whether or not to remove leading spaces. Defaults to false. |
| pRemoveTrailingSpaces | Whether or not to remove trailing spaces. Defaults to false. |
References cx::cxTextValidator::addImpliedChars().
Referenced by cxInputBorderChange(), cxInputMasking(), cx::cxGrid::getCellValue(), main(), setInputLabel(), setValue(), singleLineInput(), testInput1(), and testInput2().
| e_cxColors cx::cxInput::getValueColor | ( | ) | const |
Gets the value color
References cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eDEFAULT, cx::eINPUT_EDITABLE, cx::eINPUT_READONLY, and getItemColor().
|
overrideprotectedvirtual |
Looks for a function tied to the last keypress and.
runs it, if one exists. If one exists, the return
value of the function may be set in the input if its
mUseReturnValue is true.
| pFunctionExists | A pointer to a bool (if non-null, it will store whether or not a function existed for the key). Defaults to nullptr. |
| pRunOnLeaveFunction | A pointer to a bool: If non-NUL, it will store whether or not to run the onLeave function when the window exits (this is an option for cxFunction). |
Reimplemented from cx::cxWindow.
References cx::cxWindow::getLastKey(), cx::cxWindow::mKeyFunctions, and cx::cxWindow::mWindow.
|
overridevirtual |
Returns whether or not the input currently has focus.
Reimplemented from cx::cxWindow.
|
virtual |
| bool cx::cxInput::isEditable | ( | ) | const |
Returns whether or not the input is editable. An input is editable if it passes the 3 following criteria:
References cx::eINPUT_READONLY, getInputOption(), inputLoopEnabled(), and cx::cxWindow::isEnabled().
|
virtual |
Returns whether the value in the input takes up the maximum possible space in the input.
|
virtual |
Returns the maximum length of the value that may be set.
|
overridevirtual |
Returns whether or not a call to showModal() will wait for a.
keypress from the user. This will be true if the input
is enabled and the input type is eINPUT_EDITABLE; it will be
false otherwise.
Reimplemented from cx::cxWindow.
References cx::eINPUT_EDITABLE, getInputOption(), and cx::cxWindow::isEnabled().
|
overridevirtual |
Changes the window's position, based on a new upper-left corner
| pNewRow | The new topmost row of the form |
| pNewCol | The new leftmost column of the form |
| pRefresh | Whether or not to refresh the window (defaults to true) |
Reimplemented from cx::cxWindow.
References cx::cxWindow::move(), cx::cxWindow::right(), and show().
Referenced by testInput1().
|
virtual |
Returns whether or not the onKey function will be run.
|
virtual |
Refreshes just the value portion of the input.
| pRefresh | Whether or not to refresh the window after re-drawing the value (defaults to true). |
References cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eINPUT_EDITABLE, cx::eINPUT_READONLY, enableAttrs(), cx::cxWindow::mWindow, cx::updateWindows(), and cx::cxObject::useColors.
Referenced by clearValue().
|
overridevirtual |
Removes an ncurses attribute from one of the item lists.
| pItem | The item to remove the attribute for (see the e_WidgetItems enumeration). |
| pAttr | The ncurses attribute to remove |
Reimplemented from cx::cxWindow.
References cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, mDataEditableAttrs, mDataReadonlyAttrs, mLabelAttrs, and cx::cxWindow::removeAttr().
|
overridevirtual |
Removes all attributes for a given window item.
| pItem | The item to remove attributes for (see the e_WidgetItems enumeration). |
Reimplemented from cx::cxWindow.
References cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, mDataEditableAttrs, mDataReadonlyAttrs, mLabelAttrs, and cx::cxWindow::removeAttrs().
Referenced by testInput1().
|
overridevirtual |
Changes the input's width. The upper-left coordinate stays.
the same. Note that pNewHeight is not used; that parameter is
only here so that this method will override cxWindow's resize()
method. The height is always 1.
| pNewHeight | Not used (always uses a height of 1) |
| pNewWidth | The new width |
| pRefresh | Whether or not to refresh the window (defaults to true) |
Reimplemented from cx::cxWindow.
References cx::cxWindow::hasBorder(), cx::cxWindow::resize(), cx::cxWindow::right(), and cx::cxWindow::width().
Referenced by setBorderStyle().
|
overridevirtual |
Runs the onFocus function, if it's set. If the.
onFocus function's mUseReturnVal is true, the return
value of the onFocus function will be set in the
input.
| pFunctionRetval | If not nullptr, the string that this points to will contain the return value of the onFocus function. Defaults to nullptr. |
Reimplemented from cx::cxWindow.
References cx::cxWindow::mOnFocusFunction, cx::cxWindow::onFocusFunctionIsSet(), and setValue().
Referenced by showModal().
|
virtual |
Runs the input's validator function and returns its return.
value. If the validator function is not set, this returns
a blank string.
Referenced by showModal().
|
overridevirtual |
Sets the ncurses attribute to use for one of the items in the.
window (see the e_WidgetItems enumeration). Clears the current
set of attributes for the item and inserts the given attribute
into the set.
| pItem | The item to apply the attribute for (see the e_WidgetItems enumeration). |
| pAttr | The ncurses atribute to apply. |
Reimplemented from cx::cxWindow.
References cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, mDataEditableAttrs, mDataReadonlyAttrs, mLabelAttrs, and cx::cxWindow::setAttr().
|
overridevirtual |
Sets the border style.
| pBorderStyle | A eBorderStyle enumeration value (see cxBorderStyles.h) |
Reimplemented from cx::cxWindow.
References cx::cxWindow::getBorderStyle(), getLabel(), cx::cxWindow::hasBorder(), resize(), cx::cxWindow::setBorderStyle(), cx::visualStrLen(), and cx::cxWindow::width().
Referenced by cxInputBorderChange().
| void cx::cxInput::setCanBeEditable | ( | bool | pCanBeEditable | ) |
Sets whether the input can be set editable.
| pCanBeEditable | If true, the input can be set editable; if false, the input will always be read-only. |
References cx::eINPUT_READONLY, and setInputOption().
|
overridevirtual |
Sets the color of one of the window items.
| pItem | The item to set the color of (see the e_WidgetItems enumeration in cxWidgetItems.h). |
| pColor | The color to set the item to (see the e_cxColors enumeration in cxColors.h) |
Reimplemented from cx::cxWindow.
References cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, cx::cxWindow::setColor(), setLabelColor(), and setValueColor().
|
virtual |
Sets whether the cursor should be left-aligned when the.
input is shown modally.
| pCursorLeftAlign | Whether or not the cursor should be left-aligned when the input is shown modally. |
| void cx::cxInput::setCursorX | ( | int | pCursorX | ) |
Sets the horizontal (x) cursor position
| pCursorX | Horizontal cursor position |
References cx::cxWindow::hasBorder(), and cx::cxWindow::mWindow.
| void cx::cxInput::setExitOnArrowAtBoundary | ( | bool | pExitOnArrowAtBoundary | ) |
Sets whether the input should exit its input loop when the.
left arrow key is pressed at position 0 or the right arrow
key is pressed at the end of the text. Useful for grid cells
where arrow keys should navigate between cells at text boundaries.
| void cx::cxInput::setExitOnBackspaceAtFront | ( | bool | pExitOnBackspaceAtFront | ) |
Sets whether the input should exit the input loop when the.
user presses backspace in the first input position.
| pExitOnBackspaceAtFront | Whether or not the input should exit the input loop when the user presses backspace in the first input position. |
| void cx::cxInput::setExitOnFKey | ( | bool | pExitOnFunctionKey | ) |
Sets whether or not to exit upon use of a function key.
| pExitOnFunctionKey | Whether to exit on function key press |
| void cx::cxInput::setExitOnFull | ( | bool | pExitOnFull | ) |
Sets whether the input should leave the input loop when it's.
full.
| pExitOnFull | Whether setFocus() should return when the input is full |
Referenced by testInput1().
|
overridevirtual |
Sets whether the input should exit its input loop when a.
mouse click occurs outside the input window. This is useful
for container widgets like cxGrid that need to redirect
focus to a different cell when the user clicks elsewhere.
| pExitOnMouseOutside | Whether to exit on outside mouse clicks |
Reimplemented from cx::cxWindow.
| void cx::cxInput::setExtValue | ( | std::string * | pExtVal, |
| bool | pRefresh = false |
||
| ) |
Setter for the "external" user value variable pointer.
| pExtVal | The new pointer to the external variable |
| pRefresh | Whether or not to refresh the input |
References setValue(), and show().
| void cx::cxInput::setForceUpper | ( | bool | pForceUpper | ) |
Toggles the option to force text to be upper-case.
| pForceUpper | true if text should be upper-case, or false if not. |
| void cx::cxInput::setInputOption | ( | eInputOptions | pInputOption | ) |
Sets the input editability (i.e., eINPUT_EDITABLE, eINPUT_READONLY) -.
See the eInputOptions enumeration in cxInputOptions.h
| pInputOption | The new editability option |
References cx::eINPUT_READONLY.
Referenced by setCanBeEditable(), and showModal().
|
virtual |
Sets the label for the input
| pLabel | The new label |
References cx::cxWindow::hasBorder(), cx::cxWindow::mMessageLines, cx::cxWindow::setMessage(), cx::visualStrLen(), and cx::cxWindow::width().
Referenced by setInputLabel().
| void cx::cxInput::setLabelColor | ( | e_cxColors | pColor | ) |
Sets the label color.
| pColor | A member of the e_cxColors enumeration from cxColors.h |
References cx::cxWindow::setMessageColor().
Referenced by inputsWithDifferentColors(), and setColor().
|
overridevirtual |
Sets the last keypress.
| pLastKey | A key (represented by an int) |
Reimplemented from cx::cxWindow.
References cx::cxWindow::setLastKey(), and cx::cxMultiLineInput::setLastKey().
|
inline |
Mutator for the masking character
| pMaskChar | The new masking character to use |
| void cx::cxInput::setMaxInputLength | ( | int | pLength | ) |
Sets the maximum text length that can be accepted by the input.
| pLength | The maximum text length that can be accepted by the input |
| void cx::cxInput::setMustFill | ( | bool | pMustFill | ) |
Mutator for mMustFill
| pMustFill | New value for mMustFill; boolean |
|
virtual |
Sets a function to be run whenever a key is pressed (referred.
to as the "onKey" function).
| pFunction | Function to point to |
|
virtual |
Sets a function to be run whenever a key is pressed (referred.
to as the "onKey" function).
| pFunction | Function to point to–must have signature string func() |
| p1 | Pointer to the first parameter to be used for the function |
| p2 | Pointer to the second parameter to be used for the function |
| p3 | Pointer to the 3rd parameter to be used for the function |
| p4 | Pointer to the 4th parameter to be used for the function |
References clearOnKeyFunction().
|
virtual |
Sets a function to be run whenever a key is pressed (referred.
to as the "onKey" function).
| pFunction | Function to point to–must have signature string func(void*, void*) |
| p1 | Pointer to the first parameter to be used for the function |
| p2 | Pointer to the second parameter to be used for the function |
| p3 | Pointer to the 3rd parameter to be used for the function |
| p4 | Pointer to the 4th parameter to be used for the function |
References clearOnKeyFunction().
|
virtual |
Sets a function to be run whenever a key is pressed (referred.
to as the "onKey" function).
| pFunction | Function to point to–must have signature string func(void*, void*, void*, void*) |
| p1 | Pointer to the first parameter to be used for the function |
| p2 | Pointer to the second parameter to be used for the function |
| p3 | Pointer to the 3rd parameter to be used for the function |
| p4 | Pointer to the 4th parameter to be used for the function |
References clearOnKeyFunction().
|
virtual |
Sets whether the input should go read-only when setFocus() exits.
| pReadOnlyOnLeave | If true, the input will change to read-only when setFocus() exits. |
|
virtual |
Sets the amount of time (in seconds) that the input should.
wait when idle before exiting the input loop (0 = no timeout).
| pTimeout | The amount of time (in seconds) that the input should wait when idle before exiting the input loop (0 = no timeout). |
|
virtual |
Sets whether or not to run the validator function.
when the user wants to move in reverse (i.e., by
pressing shift-tab or the up arrow to exit the
input). The default behavior is true when a
cxMultiLineInput is created.
| pValidateOnReverse | Whether or not to run the validator function when the user wants to move in reverse |
| void cx::cxInput::setValidator | ( | const std::string & | pVString | ) |
Sets the validator string
| pVString | The new validator string |
References cx::cxTextValidator::setValidatorStr().
Referenced by singleLineInput().
| bool cx::cxInput::setValidatorFunction | ( | funcPtr0 | pFunction | ) |
Sets a validator function to be run before focus is lost. If the function returns a blank string, it is assumed that the text is valid; if the function returns a non-blank string, it is assumed that the text was incorrect.
| pFunction | Function to point to–must have signature string func() |
References clearValidatorFunction().
| bool cx::cxInput::setValidatorFunction | ( | funcPtr2 | pFunction, |
| void * | p1, | ||
| void * | p2 | ||
| ) |
Sets a validator function to be run before focus is lost. If the function returns a blank string, it is assumed that the text is valid; if the function returns a non-blank string, it is assumed that the text was incorrect.
| pFunction | Function to point to–must have signature string func(void*, void*) |
| p1 | Pointer to the first parameter to be used for the function |
| p2 | Pointer to the second parameter to be used for the function |
References clearValidatorFunction().
| bool cx::cxInput::setValidatorFunction | ( | funcPtr4 | pFunction, |
| void * | p1, | ||
| void * | p2, | ||
| void * | p3, | ||
| void * | p4 | ||
| ) |
Sets a validator function to be run before focus is lost. If the function returns a blank string, it is assumed that the text is valid; if the function returns a non-blank string, it is assumed that the text was incorrect.
| pFunction | Function to point to–must have signature string func(void*, void*, void*, void*) |
| p1 | Pointer to the first parameter to be used for the function |
| p2 | Pointer to the second parameter to be used for the function |
| p3 | Pointer to the 3rd parameter to be used for the function |
| p4 | Pointer to the 4th parameter to be used for the function |
References clearValidatorFunction().
|
virtual |
Sets the input text
| pValue | The text of the input |
| pRefresh | Whether or not to refresh the input (defaults to false) |
References getValue(), and show().
Referenced by clearInput(), cxInput(), cxInput(), inputsWithDifferentColors(), main(), runOnFocusFunction(), cx::cxGrid::setCellValue(), setExtValue(), and show().
| void cx::cxInput::setValueColor | ( | e_cxColors | pColor | ) |
Sets the color of the value typed into the input.
| pColor | A member of the e_cxColors enumeration from cxColors.h |
References addAttr(), cx::eDATA_EDITABLE, cx::eDATA_READONLY, and cx::cxWindow::setElementColor().
Referenced by inputsWithDifferentColors(), and setColor().
|
overridevirtual |
Shows the window, along with the user's input.
| pBringToTop | Whether or not to bring this window to the top. Defaults to false. |
| pShowSubwindows | Whether or not to show sub-windows also. Always uses false. |
Reimplemented from cx::cxWindow.
References cx::cxFIRST_AVAIL_RETURN_CODE, cx::cxWindow::hide(), cx::cxWindow::isEnabled(), setValue(), cx::cxWindow::show(), and cx::updateWindows().
Referenced by clearInput(), inputsWithDifferentColors(), move(), setExtValue(), setValue(), showModal(), and testInput2().
|
overridevirtual |
Handles user input for the form.
| pShowSelf | Whether or not to show the window before running the input loop. Defaults to true. |
| pBringToTop | Whether or not to bring the window to the top (always uses true). |
| pShowSubwindows | Whether or not to show sub-windows also. Always uses false. |
Reimplemented from cx::cxWindow.
References cx::cxTextValidator::addImpliedChars(), cx::cxFIRST_AVAIL_RETURN_CODE, cx::cxID_EXIT, cx::cxID_QUIT, disableAttrs(), cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eINPUT_EDITABLE, cx::eINPUT_READONLY, enableAttrs(), cx::cxWindow::getLastKey(), cx::cxWindow::getLeaveNow(), cx::cxWindow::getReturnCode(), cx::cxWindow::hasExitKey(), cx::cxWindow::isEnabled(), cx::cxWindow::mIsModal, cx::cxWindow::mWindow, runOnFocusFunction(), cx::cxWindow::runOnLeaveFunction(), runValidatorFunction(), setInputOption(), cx::cxWindow::setReturnCode(), SHIFT_TAB, show(), and cx::cxObject::useColors.
Referenced by cxInputBorderChange(), cxInputMasking(), main(), setInputLabel(), singleLineInput(), testInput1(), and testInput2().
|
virtual |
Returns whether the text entered into the input is valid.
References cx::cxTextValidator::textIsValid().
|
virtual |
Returns whether some text is valid according to the input's validator.
| pText | The text to be validated |
| void cx::cxInput::toggleCursor | ( | bool | pShowCursor | ) |
Enables/disables the display of the cursor.
| pShowCursor | Whether or not to show the cursor (true/false). |
|
inline |
Enables/disables masking
| pMasking | Whether to mask input (display asterisks, not text, in input field) |
Referenced by cxInputMasking().
|
virtual |
Sets whether the onKey function should be fired or not.
| pRunOnKeyFunction | Whether or not the onKey function should be fired |
| void cx::cxInput::trapNonAssignedFKeys | ( | bool | pTrapNonAssignedFKeys | ) |
Sets whether non-assigned function keys should.
be trapped within the input loop and not cause
the input to stop its input loop.
| pTrapNonAssignedFKeys | If true, pressing function keys that are not assigned (when modal) will do nothing. If false, pressing non-assigned function keys while focus is set will cause the input to exit the input loop. |
|
friend |
|
static |
inputClearKey is a default key to be used to clear inputs.
Referenced by cx::cxMultiLineInput::doInputLoop().
|
protected |
Editable data attributes.
Referenced by addAttr(), disableAttrs(), enableAttrs(), getAttrs(), getItemColor(), removeAttr(), removeAttrs(), and setAttr().
|
protected |
Read-only data attributes.
Referenced by addAttr(), disableAttrs(), enableAttrs(), getAttrs(), getItemColor(), removeAttr(), removeAttrs(), and setAttr().
|
protected |
Label attributes.
Referenced by addAttr(), disableAttrs(), enableAttrs(), getAttrs(), getItemColor(), removeAttr(), removeAttrs(), and setAttr().