|
cxWidgets 1.0
|
Represents a form that contains text inputs. The user can move forward between the inputs on the form using the TAB and down arrow, and backward using SHIFT-TAB or the up arrow. The tab order is is based on the order in which the inputs are appended to the form. The input indexes also match the order in which the inputs are appended to the form, and they are zero-based.
It is a good idea to use unique labels for the inputs or unique names, since many of cxForm's methods access the fields the fields by label/name; in particular, getValues() populates a map of field labels/names and values, and if there are duplicate labels or names, it would not return the values of all the fields on the form.
The function getInput() can be used to get a pointer to one of the inputs, but one caveat of cxForm is that some operations shouldn't be performed on inputs added to a cxForm:
More...
#include <cxForm.h>


Public Member Functions | |
| cxForm (cxWindow *pParentWindow=nullptr, int pRow=0, int pCol=0, int pHeight=DEFAULT_HEIGHT, int pWidth=DEFAULT_WIDTH, const std::string &pTitle="", eBorderStyle pBorderStyle=eBS_SINGLE_LINE, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pAutoExit=false, bool pStacked=false) | |
| cxForm (const cxForm &pThatForm) | |
| virtual | ~cxForm () |
| virtual std::shared_ptr< cxMultiLineInput > | append (int pRow, int pCol, int pHeight, int pWidth, const std::string &pLabel, const std::string &pValidator="", const std::string &pHelpString="", eInputOptions pInputOption=eINPUT_EDITABLE, const std::string &pName="", std::string *pExtValue=nullptr, int pRightLabelOffset=0, int pRightLabelHeight=1, int pRightLabelWidth=7, bool pShowRightLabel=false, eInputType pInputType=eIT_CXMULTILINEINPUT) |
| Adds an input to the form. Applies the A_STANDOUT attribute. | |
| virtual std::shared_ptr< cxComboBox > | appendComboBox (int pRow, int pCol, int pHeight, int pWidth, const std::string &pLabel, const std::string &pValidator="", const std::string &pHelpString="", eInputOptions pInputOption=eINPUT_EDITABLE, const std::string &pName="", std::string *pExtValue=nullptr, int pRightLabelOffset=0, int pRightLabelHeight=1, int pRightLabelWidth=7, bool pShowRightLabel=false) |
| Adds a combo box to the form. Applies the A_STANDOUT attribute. | |
| virtual cxMLInputPtrPair | appendPair (int pRow, int pCol, int pHeight, int pWidth, const std::string &pLabel, const std::string &pValidator="", const std::string &pHelpString="", eInputOptions pInputOption=eINPUT_EDITABLE, const std::string &pName="", std::string *pExtValue1=nullptr, std::string *pExtValue2=nullptr, int pRightLabel1Offset=0, int pRightLabel1Height=1, int pRightLabel1Width=7, bool pShowRightLabel1=false, int pRightLabel2Offset=0, int pRightLabel2Height=1, int pRightLabel2Width=7, bool pShowRightLabel2=false, eInputType pInput1Type=eIT_CXMULTILINEINPUT, eInputType pInput2Type=eIT_CXMULTILINEINPUT) |
| Appends a pair of inputs to a form, one to the right of the. | |
| virtual cxComboBoxPtrPair | appendComboBoxPair (int pRow, int pCol, int pHeight, int pWidth, const std::string &pLabel, const std::string &pValidator="", const std::string &pHelpString="", eInputOptions pInputOption=eINPUT_EDITABLE, const std::string &pName="", std::string *pExtValue1=nullptr, std::string *pExtValue2=nullptr, int pRightLabel1Offset=0, int pRightLabel1Height=1, int pRightLabel1Width=7, bool pShowRightLabel1=false, int pRightLabel2Offset=0, int pRightLabel2Height=1, int pRightLabel2Width=7, bool pShowRightLabel2=false) |
| Appends a pair of cxComboBoxes to a form, one to the right of. | |
| virtual void | appendPair (std::shared_ptr< cxMultiLineInput > &pInput1, std::shared_ptr< cxMultiLineInput > &pInput2, int pRow, int pCol, const std::string &pName="") |
| Appends 2 inputs to the form, one to the right of the other. | |
| virtual std::shared_ptr< cxMultiLineInput > | append (int pHeight, int pWidth, const std::string &pLabel, const std::string &pValidator="", const std::string &pHelpString="", eInputOptions pInputOption=eINPUT_EDITABLE, const std::string &pName="", std::string *pExtValue=nullptr, int pRightLabelOffset=0, int pRightLabelHeight=1, int pRightLabelWidth=7, bool pShowRightLabel=false, eInputType pInputType=eIT_CXMULTILINEINPUT) |
| Appends an input to the form below the last item currently in. | |
| virtual std::shared_ptr< cxComboBox > | appendComboBox (int pHeight, int pWidth, const std::string &pLabel, const std::string &pValidator="", const std::string &pHelpString="", eInputOptions pInputOption=eINPUT_EDITABLE, const std::string &pName="", std::string *pExtValue=nullptr, int pRightLabelOffset=0, int pRightLabelHeight=1, int pRightLabelWidth=7, bool pShowRightLabel=false) |
| Appends a combo box to the form below the last. | |
| virtual std::shared_ptr< cxMultiLineInput > | append (const cxMultiLineInput &pInput) |
| Appends a copy of an input to a form. | |
| virtual void | append (std::shared_ptr< cxMultiLineInput > &pInput, int pRow, int pCol, bool *pMoved=nullptr) |
| Appends a cxMultiLineInput to the form via a pointer. | |
| virtual void | remove (unsigned int pIndex) |
| virtual void | remove (const std::string &pLabel, bool pIsLabel=true) |
| virtual void | remove (const std::shared_ptr< cxMultiLineInput > &pInput) |
| virtual void | remove (cxMultiLineInput *pInput) |
| virtual void | removeAll () |
| Removes all inputs from the form. | |
| virtual void | setFieldKeyFunction (const std::string &pLabel, int pFunctionKey, const std::shared_ptr< cxFunction > &pFieldFunction, bool pIsLabel=true) |
| virtual void | setFieldKeyFunction (const std::string &pLabel, int pFunctionKey, funcPtr4 pFieldFunction, void *p1, void *p2, void *p3, void *p4, bool pUseVal, bool pExitAfterRun=false, bool pIsLabel=true) |
| virtual void | setFieldKeyFunction (unsigned pIndex, int pFunctionKey, funcPtr4 pFieldFunction, void *p1, void *p2, void *p3, void *p4, bool pUseVal, bool pExitAfterRun=false) |
| virtual void | setFieldKeyFunction (const std::string &pLabel, int pFunctionKey, funcPtr2 pFieldFunction, void *p1, void *p2, bool pUseVal, bool pExitAfterRun=false, bool pIsLabel=true) |
| virtual void | setFieldKeyFunction (unsigned int pIndex, int pFunctionKey, const std::shared_ptr< cxFunction > &pFieldFunction) |
| virtual void | setFieldKeyFunction (unsigned int pIndex, int pFunctionKey, funcPtr2 pFieldFunction, void *p1, void *p2, bool pUseVal, bool pExitAfterRun=false) |
| virtual void | setOnFocusFunction (const std::shared_ptr< cxFunction > &pFunction) override |
| Sets the form window's "on focus" function. | |
| virtual void | setOnFocusFunction (const std::string &pLabel, const std::shared_ptr< cxFunction > &pFunction, bool pIsLabel=true) |
| virtual void | setOnFocusFunction (unsigned pIndex, const std::shared_ptr< cxFunction > &pFunction) |
| virtual void | setOnFocusFunction (const std::string &pLabel, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pUseVal, bool pIsLabel=true) |
| virtual void | setOnFocusFunction (unsigned pIndex, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pUseVal) |
| virtual void | setOnLeaveFunction (const std::shared_ptr< cxFunction > &pFunction) override |
| Sets the form window's "on leave" function. | |
| virtual void | setOnLeaveFunction (const std::string &pLabel, const std::shared_ptr< cxFunction > &pFunction, bool pIsLabel=true) |
| virtual void | setOnLeaveFunction (unsigned pIndex, const std::shared_ptr< cxFunction > &pFunction) |
| virtual void | setOnLeaveFunction (const std::string &pLabel, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pIsLabel=true) |
| virtual void | setOnLeaveFunction (unsigned pIndex, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4) |
| virtual void | setFieldLabel (unsigned pIndex, const std::string &pLabel) |
| virtual void | setFieldLabel (const std::string &pName, const std::string &pLabel) |
| virtual void | setFieldName (unsigned pIndex, const std::string &pName) |
| virtual void | setFieldName (const std::string &pLabel, const std::string &pName) |
| Sets a field name (by label) | |
| virtual void | enableInputLoop (const std::string &pLabel, bool pDoInputLoop, bool pIsLabel=true) |
| Enables or disables the input loop for one of the. | |
| virtual void | enableInputLoop (unsigned pIndex, bool pDoInputLoop) |
| Enables or disables the input loop for one of the. | |
| virtual void | setAutoExit (bool pAutoExit) |
| Sets whether the form should automatically exit when the user. | |
| bool | getAutoExit () const |
| Returns the set value of whether the form should exit upon. | |
| virtual void | setStartAtFirstInput (bool pStartAtFirstInput) |
| Sets whether or not to always start at the first editable. | |
| bool | getStartAtFirstInput () const |
| Returns whether or not the form will always start at the first. | |
| void | setApplyAttrDefaults (bool pApplyAttrDefaults) |
| Sets whether to apply the default attributes to the inputs when. | |
| bool | getApplyAttrDefaults () const |
| Returns whether default attributes are applied to new inputs. | |
| virtual long | show (bool pBringToTop=false, bool pShowSubwindows=true) override |
| Shows the form. | |
| virtual long | showModal (bool pShowSelf=true, bool pBringToTop=false, bool pShowSubwindows=true) override |
| Shows the form and waits for input. | |
| virtual bool | modalGetsKeypress () const override |
| Returns whether or not a call to showModal() will wait for a. | |
| virtual void | hide (bool pHideSubwindows=true) override |
| virtual void | unhide (bool pUnhideSubwindows=true) override |
| virtual bool | move (int pNewRow, int pNewCol, bool pRefresh=true) override |
| size_t | numInputs () const |
| Returns the number of inputs in the form. | |
| virtual std::string | getValue (int pIndex) const |
| virtual std::string | getValue (const std::string &pStr, bool pIsLabel=true) const |
| virtual std::string | getLabel (int pIndex) const |
| Returns the label of one of the inputs (by index). | |
| virtual std::string | getName (int pIndex) const |
| Returns the name of one of the inputs (by index). | |
| virtual std::string | getName (const std::string &pLabel) const |
| Returns the name of one of the inputs (by label). | |
| virtual std::string | getStatus (int pIndex) const |
| Returns the status text of one of the inputs (by index). | |
| virtual std::string | getStatus (const std::string &pLabel, bool pIsLabel=true) const |
| Returns the status text of one of the inputs (by label/name). | |
| virtual bool | setValue (int pIndex, const std::string &pValue, bool pRefresh=false) |
| virtual bool | setValue (const std::string &pLabel, const std::string &pValue, bool pIsLabel=true, bool pRefresh=false) |
| virtual int | refreshInput (unsigned pIndex) |
| virtual int | refreshInput (const std::string &pStr, bool pIsLabel=true) |
| bool | setMaskChar (int pIndex, char pMaskChar) |
| bool | setMaskChar (const std::string &pLabel, char pMaskChar, bool pIsLabel=true) |
| Sets the masking character for an input (by label). | |
| bool | getMasked (int pIndex) |
| bool | getMasked (const std::string &pLabel, bool pIsLabel=true) |
| virtual bool | toggleMasking (int pIndex, bool pMasking) |
| virtual bool | toggleMasking (const std::string &pLabel, bool pMasking, bool pIsLabel=true) |
| Enables/disables masking for an input (by label). | |
| virtual bool | setCurrentInput (int pIndex) |
| Changes which input on the form should have focus (by index). | |
| virtual bool | setCurrentInput (const std::string &pLabel, bool pIsLabel=true) |
| Changes which input on the form should have focus (by label/name). | |
| virtual bool | setCurrentInputByPtr (const std::shared_ptr< cxMultiLineInput > &pInput) |
| Changes which input on the form should have focus (by pointer). | |
| virtual bool | setCurrentInputByPtr (const cxMultiLineInput *const pInput) |
| virtual bool | setKeyFunction (int pKey, const std::shared_ptr< cxFunction > &pFunction) override |
| Sets a function to be called when a key is pressed. | |
| virtual void | clearKeyFunction (int pKey) override |
| Removes a function pointer for a keypress for the form so that it will no. | |
| virtual bool | setKeyFunction (int pKey, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true) override |
| Adds a function to call when the user presses some key. | |
| virtual bool | setKeyFunction (int pKey, funcPtr2 pFunction, void *p1, void *p2, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true) override |
| Adds a function to call when the user presses some key. | |
| virtual bool | setKeyFunction (int pKey, funcPtr0 pFunction, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true) override |
| Adds a function to call when the user presses some key. | |
| virtual bool | setKeyFunction (int pIndex, int pKey, const std::shared_ptr< cxFunction > &pFunction) |
| Sets a function to be called when a key is pressed. | |
| virtual bool | setKeyFunction (const std::string &pLabel, int pKey, const std::shared_ptr< cxFunction > &pFunction, bool pIsLabel=true) |
| Sets a function to be called when a key is pressed. | |
| virtual bool | setKeyFunction (int pIndex, int pKey, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pUseVal, bool pExitAfterRun, bool pRunOnLeaveFunction, bool pRunValidator) |
| Adds a function to call when the user presses some key for. | |
| virtual bool | setKeyFunction (const std::string &pLabel, int pKey, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pUseVal, bool pExitAfterRun, bool pRunOnLeaveFunction, bool pRunValidator, bool pIsLabel=true) |
| Adds a function to call when the user presses some key for. | |
| virtual bool | setKeyFunction (int pIndex, int pKey, funcPtr2 pFunction, void *p1, void *p2, bool pUseVal, bool pExitAfterRun, bool pRunOnLeaveFunction, bool pRunValidator) |
| Adds a function to call when the user presses some key for. | |
| virtual bool | setKeyFunction (const std::string &pLabel, int pKey, funcPtr2 pFunction, void *p1, void *p2, bool pUseVal, bool pExitAfterRun, bool pRunOnLeaveFunction, bool pRunValidator, bool pIsLabel=true) |
| Adds a function to call when the user presses some key for. | |
| virtual bool | setKeyFunction (int pIndex, int pKey, funcPtr0 pFunction, bool pUseVal, bool pExitAfterRun, bool pRunOnLeaveFunction, bool pRunValidator) |
| Adds a function to call when the user presses some key for. | |
| virtual bool | setKeyFunction (const std::string &pLabel, int pKey, funcPtr0 pFunction, bool pUseVal, bool pExitAfterRun, bool pRunOnLeaveFunction, bool pRunValidator, bool pIsLabel=true) |
| Adds a function to call when the user presses some key for. | |
| bool | allFieldsBlank () const |
| void | setLabelColor (const int &pIndex, e_cxColors pColor) |
| Sets the color of the label of one of the inputs (by index) | |
| void | setLabelColor (const std::string &pLabel, e_cxColors pColor, bool pIsLabel=true) |
| Sets the color of the label of one of the inputs (by label/name) | |
| void | setAllLabelColor (e_cxColors pColor) |
| Sets the color of the labels on all inputs. | |
| int | getLabelColor (const int &pIndex) const |
| Returns the label color of one of the inputs (by index). | |
| int | getLabelColor (const std::string &pLabel, bool pIsLabel=true) const |
| Returns the label color of one of the inputs (by label/name). | |
| void | setValueColor (const int &pIndex, e_cxColors pColor) |
| Sets the color of the value section of one of the inputs (by index) | |
| void | setValueColor (const std::string &pLabel, e_cxColors pColor, bool pIsLabel=true) |
| Sets the color of the value section of one of the inputs (by label/name) | |
| void | setAllValueColor (e_cxColors pColor) |
| Sets the color of the value section of all inputs on the form. | |
| int | getValueColor (const int &pIndex) const |
| Returns the color of the value section of one of the inputs (by index). | |
| int | getValueColor (const std::string &pLabel, bool pIsLabel=true) const |
| Returns the color of the value section of one of the inputs (by label/name). | |
| void | setAllColors (e_cxColors pLabelColor, e_cxColors pValueColor) |
| Sets the label & value colors of all inputs on the form. | |
| virtual void | setColor (e_WidgetItems pItem, e_cxColors pColor) override |
| Sets the color of one of the window items. For label & value. | |
| int | inputTopRow (int pIndex) const |
| Returns the top row of an input (by index), or -1 if the given. | |
| int | inputTopRow (const std::string &pLabel, bool pIslabel=true) const |
| Returns the top row of an input (by label/name), or -1 if there is no. | |
| int | inputLeftCol (int pIndex) const |
| Returns the left column of an input (by index), or -1 if the given. | |
| int | inputLeftCol (const std::string &pLabel, bool pIsLabel=true) const |
| Returns the left column of an input (by label/name), or -1 if there are. | |
| int | inputHeight (int pIndex) const |
| Returns the height of an input (by index), or -1 if the given index. | |
| int | inputHeight (const std::string &pLabel, bool pIsLabel=true) const |
| Returns the height of an input (by label/name), or -1 if there is no input. | |
| int | inputWidth (int pIndex) const |
| Returns the width of an input (by index), or -1 if the given index. | |
| int | inputWidth (const std::string &pLabel, bool pIsLabel=true) const |
| Returns the width of an input (by label/name), or -1 if there is. | |
| int | maxInputLen (int pIndex) const |
| Returns the maximum length of input accepted by an input (by index),. | |
| int | maxInputLen (const std::string &pLabel, bool pIsLabel=true) const |
| Returns the maximum length of input accepted by an input (by index),. | |
| std::string | inputLabel (int pIndex) const |
| Returns the label of an input at a given index. | |
| std::string | inputLabel (const std::string &pName) const |
| Returns the label of an input. | |
| std::string | inputName (int pIndex) const |
| Returns the name of an input at a given index. | |
| std::string | inputName (const std::string &pLabel) const |
| Returns the name of an input. | |
| virtual void | scrollInputs (int pVScrollAmt, int pHScrollAmt, bool pRefresh=false, bool pBringToTop=false) |
| Scrolls (moves) the inputs in the window. | |
| virtual void | toggleCursor (int pIndex, bool pShowCursor) |
| Toggles the display of the cursor for an input (by index). | |
| virtual void | toggleCursor (const std::string &pLabel, bool pShowCursor, bool pIsLabel=true) |
| Toggles the display of the cursor for an input (by label/name). | |
| virtual void | toggleCursor (bool pShowCursor) |
| Toggles the display of the cursor on all inputs. | |
| std::shared_ptr< cxMultiLineInput > | getInput (int pIndex) const |
| Returns a pointer to an input at a given index, or nullptr if the index. | |
| std::shared_ptr< cxMultiLineInput > | getInput (const std::string &pLabel, bool pIsLabel=true) const |
| Returns a pointer to an input with a given label/name, or. | |
| std::shared_ptr< cxMultiLineInput > | getCurrentInput () const |
| Returns a pointer to the current input. If there are no inputs. | |
| virtual int | getInputOption (int pIndex) const |
| Returns the editability option for an input (by index). | |
| virtual int | getInputOption (const std::string &pLabel, bool pIsLabel=true) const |
| Returns the editability option for an input (by label/name). | |
| virtual void | setInputOption (int pIndex, eInputOptions pInputOption, bool pRefresh=true) |
| Sets the input kind for one of the inputs (by index). | |
| virtual void | setInputOption (const std::string &pLabel, eInputOptions pInputOption, bool pIsLabel=true, bool pRefresh=true) |
| Sets the input kind for one of the inputs (by label/name). | |
| virtual void | setAllInputOption (eInputOptions pInputOption, bool pRefresh=true) |
| Sets the input kind for all inputs on the form. | |
| virtual void | setStatus (const std::string &pStatus, bool pRefreshStatus=true) override |
| Mutator for the status line text. After this method. | |
| virtual void | disableCustomStatus (bool pRefreshStatus=true) |
| Turns off the custom status text set with setStatus. | |
| virtual void | setValidatorFunction (int pIndex, const std::shared_ptr< cxFunction > &pFunction) |
| Sets a validator function to be run before focus is lost for one. | |
| virtual void | setValidatorFunction (int pIndex, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4) |
| Sets a validator function to be run before focus is lost for one. | |
| virtual void | setValidatorFunction (const std::string &pLabel, const std::shared_ptr< cxFunction > &pFunction, bool pIsLabel=true) |
| Sets a validator function to be run before focus is lost for one. | |
| virtual void | setValidatorFunction (const std::string &pLabel, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pIsLabel=true) |
| Sets a validator function to be run before focus is lost for one. | |
| virtual void | showInputsOnBorder (bool pShowInputsOnBorder) |
| Toggles whether to show inputs if they're on. | |
| virtual void | setOnKeyFunction (int pIndex, const std::shared_ptr< cxFunction > &pFunction) |
| Sets a function to be run whenever a key is pressed in an input (by index). | |
| virtual void | setOnKeyFunction (int pIndex, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4) |
| Sets a function to be run whenever a key is pressed in an input (by index). | |
| virtual void | setOnKeyFunction (const std::string &pLabel, const std::shared_ptr< cxFunction > &pFunction, bool pIsLabel=true) |
| Sets a function to be run whenever a key is pressed in an. | |
| virtual void | setOnKeyFunction (const std::string &pLabel, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pIsLabel=true) |
| Sets a function to be run whenever a key is pressed in an. | |
| virtual void | setOnKeyFunction (int pIndex, funcPtr2 pFunction, void *p1, void *p2) |
| Sets a function to be run whenever a key is pressed in an input (by index). | |
| virtual void | setOnKeyFunction (const std::string &pLabel, funcPtr2 pFunction, void *p1, void *p2, bool pIsLabel=true) |
| Sets a function to be run whenever a key is pressed in an. | |
| virtual void | setOnKeyFunction (int pIndex, funcPtr0 pFunction) |
| Sets a function to be run whenever a key is pressed in an input (by index). | |
| virtual void | setOnKeyFunction (const std::string &pLabel, funcPtr0 pFunction, bool pIsLabel=true) |
| Sets a function to be run whenever a key is pressed in an. | |
| virtual void | setAllOnKeyFunction (const std::shared_ptr< cxFunction > &pFunction) |
| Sets a function to be run whenever a key is pressed, in all. | |
| virtual void | setAllOnKeyFunction (funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4) |
| Sets a function to be run whenever a key is pressed, in all. | |
| virtual void | setAllOnKeyFunction (funcPtr2 pFunction, void *p1, void *p2) |
| Sets a function to be run whenever a key is pressed, in all. | |
| virtual void | setAllOnKeyFunction (funcPtr0 pFunction) |
| Sets a function to be run whenever a key is pressed, in all. | |
| virtual void | toggleOnKeyFunction (int pIndex, bool pRunOnKeyFunction) |
| Sets whether or not an onKey function should run for one of the. | |
| virtual void | toggleOnKeyFunction (const std::string &pLabel, bool pRunOnKeyFunction, bool pIsLabel=true) |
| Sets whether or not an onKey function should run for one of the. | |
| virtual void | toggleAllOnKeyFunction (bool pRunOnKeyFunction) |
| Sets whether or not the onKey function for all inputs should. | |
| virtual bool | onKeyFunctionEnabled (int pIndex) const |
| Returns whether the onKey function is enabled for one of the. | |
| virtual bool | onKeyFunctionEnabled (const std::string &pLabel, bool pIsLabel=true) const |
| Returns whether the onKey function is enabled for one of the. | |
| cxForm & | operator= (const cxForm &pThatForm) |
| Assignment operator. | |
| virtual bool | addInputJumpKey (int pKey, int pIndex) |
| virtual bool | addInputJumpKey (int pKey, const std::string &pLabel, bool pIsLabel=true) |
| Adds a hotkey for the form that will cause the. | |
| virtual int | getCurrentInputIndex () const |
| Returns the index of the input that currently has focus. | |
| virtual std::string | getCurrentInputLabel () const |
| Returns the label of the input that currently has focus. | |
| virtual std::string | getCurrentInputName () const |
| Returns the name of the input that currently has focus. | |
| virtual int | getInputIndex (const std::string &pLabel, bool pIsLabel=true) const |
| Returns the index of an input, based on its label or name. | |
| virtual int | getInputIndex (const std::shared_ptr< cxMultiLineInput > &pInput) const |
| Returns the index of an input based on a pointer. May. | |
| virtual int | getInputIndex (const cxMultiLineInput *pInput) const |
| virtual void | setInputJumpKey (int pInputJumpKey) |
| Sets the hotkey to be used to bring up the menu to choose. | |
| virtual int | getInputJumpKey () const |
| Returns which key is being used as the jump hotkey. | |
| virtual void | setCanBeEditable (int pIndex, bool pCanBeEditable) |
| Sets whether an input can be set editable (by index). If. | |
| virtual void | setCanBeEditable (const std::string &pLabel, bool pCanBeEditable, bool pIsLabel=true) |
| Sets whether an input can be set editable (by label/name). For. | |
| virtual void | setAllCanBeEditable (bool pCanBeEditable) |
| Sets the ability of all inputs to be able to be editable. | |
| virtual bool | canBeEditable (int pIndex) const |
| Returns whether or not an input can be set editable. | |
| virtual bool | canBeEditable (const std::string &pLabel, bool pIsLabel=true) const |
| Returns whether or not an input can be set editable. | |
| virtual bool | anyInputsCanBeEditable () const |
| Returns whether any input on the form (at least 1) can be set editable. | |
| virtual void | setAllowQuit (bool pAllowQuit) |
| Sets whether the form should allow the user to quit. | |
| virtual bool | getAllowQuit () const |
| Returns whether the user is able to quit out of the form. | |
| virtual void | setAllowExit (bool pAllowExit) |
| Sets whether the form should allow the user to exit. | |
| virtual bool | getAllowExit () const |
| Returns whether the user is able to exit out of the form. | |
| virtual bool | addQuitKey (int pKey, bool pRunOnLeaveFunction=true, bool pOverride=false) override |
| Adds a key that will cause the form to quit and return. | |
| virtual void | removeQuitKey (int pKey) override |
| Removes a quit key (but doesn't work for ESC) | |
| virtual bool | addExitKey (int pKey, bool pRunOnLeaveFunction=true, bool pOverride=false) override |
| Adds a key that will cause the form to quit and return. | |
| virtual void | removeExitKey (int pKey) override |
| Removes an exit key. | |
| virtual void | setOnFocusFunction (funcPtr4 pFuncPtr, void *p1, void *p2, void *p3, void *p4, bool pUseVal=false, bool pExitAfterRun=false) override |
| Sets a function to be run when focus is gained (at. | |
| virtual void | setOnFocusFunction (funcPtr2 pFuncPtr, void *p1, void *p2, bool pUseVal=false, bool pExitAfterRun=false) override |
| Sets a function to be run when focus is gained (at. | |
| virtual void | setOnFocusFunction (funcPtr0 pFuncPtr, bool pUseVal=false, bool pExitAfterRun=false) override |
| Sets a function to be run when focus is gained (at. | |
| virtual void | setLoopStartFunction (const std::shared_ptr< cxFunction > &pFuncPtr) |
| Sets a function to be run at the start of each. | |
| virtual void | setLoopEndFunction (const std::shared_ptr< cxFunction > &pFuncPtr) |
| Sets a function to be run at the end of each. | |
| virtual void | setOnLeaveFunction (funcPtr4 pFuncPtr, void *p1, void *p2, void *p3, void *p4) override |
| Sets a function to be run when focus is lost. | |
| virtual void | setOnLeaveFunction (funcPtr2 pFuncPtr, void *p1, void *p2) override |
| Sets a function to be run when focus is lost. | |
| virtual void | setOnLeaveFunction (funcPtr0 pFuncPtr) override |
| Sets a function to be run when focus is lost. | |
| virtual void | showAllInputs (bool pBringToTop=true, bool pSkipCurrentInput=false) const |
| Shows (refreshes) all inputs. | |
| virtual bool | formKeyIsSet (int pKey) const |
| Returns whether a key is set as a form function. | |
| virtual bool | isStacked () const |
| Returns whether or not the form is in 'stacked'. | |
| virtual bool | getExitOnLeaveFirst () const |
| Returns whether the form is set to exit its showModal() when. | |
| virtual void | setExitOnLeaveFirst (bool pExitOnLeaveFirst) |
| Sets whether the form should exit when the user leaves. | |
| virtual bool | hasEditableInputs () const |
| Returns whether the form has any inputs that are. | |
| virtual int | firstEditableInput () const |
| Returns the index of the first editable input in. | |
| virtual int | lastEditableInput () const |
| Returns the index of the last editable input in. | |
| virtual void | bringToTop (bool pRefresh=true) override |
| Brings the window to the top. | |
| virtual bool | hasChanged () const |
| Returns whether or not any data on the form has changed. | |
| virtual void | setChanged (bool pDataChanged) |
| Setter for whether or not data should be considered changed. | |
| virtual void | trapNonAssignedFKeys (bool pTrapNonAssignedFKeys) |
| Sets whether non-assigned function keys should. | |
| cxMultiForm * | getParentMultiForm () const |
| Returns the parent cxMultiForm pointer. | |
| virtual void | setParentMultiForm (cxMultiForm *pParentMultiForm) |
| Sets the parent cxMultiForm that this cxForm is associated with. | |
| virtual bool | runLoopStartFunction () |
| Runs the loop start function, if it's set. | |
| virtual bool | runLoopEndFunction () |
| Runs the loop end function, if it's set. | |
| virtual int | maxValueLen (int pIndex) const |
| Returns the maximum length of the value that may be set for an. | |
| virtual int | maxValueLen (const std::string &pLabel, bool pIsLabel=true) |
| Returns the maximum length of the value that may be set for an. | |
| virtual bool | isEditable (int pIndex) const |
| Returns whether one of the inputs on. | |
| virtual bool | isEditable (const std::string &pLabel, bool pIsLabel=true) const |
| Returns whether one of the inputs on. | |
| virtual void | setDisableCursorOnShow (bool pDisableCursorOnShow) override |
| Sets whether the window should disable the cursor. | |
| virtual void | setWaitForInputIfEmpty (bool pWaitForInputIfEmpty) |
| Toggles whether or not the form should wait for. | |
| virtual bool | getWaitForInputIfEmpty () const |
| Returns whether or not the form will wait for. | |
| virtual void | clearInputs (bool pRefresh=false, bool pOnlyEditable=false) |
| Clears the values of all the inputs on the form. | |
| virtual void | getValues (std::map< std::string, std::string > &pValues, bool pUseLabels=true, bool pSkipBlankIDs=false) const |
| Gets the values from the form in the form of a map of input. | |
| virtual void | setValues (const std::map< std::string, std::string > &pValues, bool pUseLabels=true, bool pRefresh=false, bool pDisableValidatorFunctions=false) |
| Sets the values in the form with a map of input labels/names. | |
| virtual void | setEnabled (bool pEnabled) override |
| Enables or disables the form. Enabling/disabling a. | |
| virtual void | useInputStatus (bool pUseInputStatus) |
| Toggles whether or not to use the status text of the inputs. | |
| virtual bool | hasInput (const std::string &pStr, bool pIsLabel=true) const |
| Returns whether or not the form has an input with a given. | |
| virtual cxWindow * | getParent () const override |
| Returns a pointer to the parent window. If the cxForm. | |
| virtual void | addAttr (e_WidgetItems pItem, attr_t pAttr) override |
| Returns the index of the next editable input after a given. | |
| 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. For. | |
| virtual void | removeAttrs (e_WidgetItems pItem) override |
| Removes all attributes for a given window item. For eLABEL,. | |
| virtual void | getAttrs (e_WidgetItems pItem, std::set< attr_t > &pAttrs) const override |
| Returns the set of ncurses attributes for a given item. | |
| virtual void | getNavKeys (std::set< int > &pNavKeys) const |
| Gathers a set of keys considered to be "navigational" keys from. | |
| virtual void | getNavKeyStrings (std::set< std::string > &pNavKeyStrings) const |
| Creates a set of string representations of keys considered to. | |
| virtual bool | hasNavKey (int pKey) const |
| Returns whether at least one of the inputs on the form has. | |
| virtual std::string | cxTypeStr () const override |
| Returns the name of the cxWidgets class. This can be used to. | |
| virtual void | setLastKey (int pLastKey) override |
| Sets the last keypress. | |
| virtual void | quitNow () override |
| This causes the form to exit its input loop with a code of. | |
| virtual void | exitNow () override |
| This causes the form to exit its input loop with a code of. | |
| virtual void | setExtendedHelpKey (int pKey) |
| Sets a single key to use to display extended help for all. | |
| virtual void | addExtendedHelpKey (int pKey) |
| Adds an additional key to be used to display the extended. | |
| virtual std::set< int > | getExtendedHelpKeys () const |
| Returns the keys used to display extended help for the inputs. | |
| std::string | getExtendedHelpKeyStrings () const |
| Returns a comma-separated list of strings representing the. | |
| virtual void | clearExtendedHelpKeys () |
| Removes all extended help keys. | |
| virtual void | setUseExtendedHelpKeys (bool pUseExtendedHelpKeys) |
| Sets whether or not to use the extended help keys. | |
| virtual bool | getUseExtendedHelpKeys () const |
| Returns whether or not the extended help keys are enabled. | |
| virtual std::string | getExtendedHelp (int pIndex) const |
| Gets the extended help string from one of the inputs (by. | |
| virtual std::string | getExtendedHelp (const std::string &pIDStr, bool pIsLabel=true) const |
| Returns the extended help string from one of the inputs (by. | |
| virtual void | setExtendedHelp (int pIndex, const std::string &pExtendedHelp) |
| Sets the extended help for one of the inputs (by index). | |
| virtual void | setExtendedHelp (const std::string &pIDStr, const std::string &pExtendedHelp, bool pIsLabel=true) |
| Sets the extended help for one of the inputs (by label/name). | |
| virtual void | validateOnJumpKey (int pIndex, bool pValidate) |
| Sets whether or not the validator function should run for an. | |
| virtual void | validateOnJumpKey (const std::string &pID, bool pValidate, bool pIsLabel=true) |
| Sets whether or not the validator function should run for an. | |
| virtual void | allValidateOnJumpKey (bool pValidate) |
| Sets whether or not the validator function should run for all. | |
| virtual bool | swap (int pInput1Index, int pInput2Index) |
| Swaps the order of 2 inputs (by index). If both indexes. | |
| virtual bool | swap (std::shared_ptr< cxWindow > &pInput1, std::shared_ptr< cxWindow > &pInput2) |
| Swaps the order of 2 inputs (by pointer). If both pointers. | |
| std::string | getName () const |
| std::string | getStatus () const |
| Accessor for the status line text. | |
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. | |
| 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 | 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. | |
| 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 void | resize (int pNewHeight, int pNewWidth, bool pRefresh=true) |
| Changes the window's width and height. The window's upper-left. | |
| 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). | |
| virtual bool | hasFocus () const |
| Returns true if window has focus, false otherwise. | |
| virtual void | setBorderStyle (eBorderStyle pBorderStyle) |
| Sets the border style. | |
| 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. | |
| virtual void | setHotkeyHighlighting (bool pHotkeyHighlighting) |
| Enables/disables the use of hotkey attributes when writing the message. | |
| 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 bool | getDisableCursorOnShow () const |
| Returns whether or not the window will disable. | |
| virtual bool | getExitOnMouseOutside () const |
| Returns whether the window exits its modal input loop when. | |
| virtual void | setExitOnMouseOutside (bool pExitOnMouseOutside) |
| Sets whether the window should exit its modal input loop. | |
| 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 bool | runOnFocusFunction (std::string *pFunctionRetval=nullptr) |
| Runs the onFocus function, if it's set. | |
| 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 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 void | removeQuitKeys () |
| Removes all quit keys. | |
| 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 | clear (bool pRefresh=false) |
| Clears the text from the window. | |
| 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. | |
| virtual e_cxColors | getItemColor (e_WidgetItems pItem) const |
| Returns the color of one of the items in a window. | |
Public Member Functions inherited from cx::cxObject | |
| cxObject () | |
| virtual | ~cxObject () |
| virtual void | beep () |
Protected Types | |
| typedef std::vector< std::shared_ptr< cxMultiLineInput > > | inputPtrContainer |
Protected Member Functions | |
| void | copyCxFormStuff (const cxForm *pThatForm) |
| Makes a copy of a cxForm's member variables. | |
| void | lookForEditableInputs () |
| Scans all inputs to see if any are editable and updates. | |
| long | doInputLoop (bool &pRunOnLeaveFunction) |
| Handles the input loop. Returns cxID_QUIT or cxID_EXIT,. | |
| virtual bool | doCurrentInput (long &pReturnCode, bool &pRunOnLeaveFunction, bool &pFunctionExists, bool pExitOverride=false) |
| Gets input from the current input (for use in the input loop). | |
| virtual void | setIsModal (bool pIsModal) |
| Sets whether the form is modal or not. | |
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 | enableAttrs (WINDOW *pWin, e_WidgetItems pItem) |
| Enables the attributes for one of the m*Attrs sets for an ncurses window. | |
| virtual void | disableAttrs (WINDOW *pWin, e_WidgetItems pItem) |
| Disables the attributes for one of the m*Attrs sets for an ncurses window. | |
| 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 | handleFunctionForLastKey (bool *pFunctionExists=nullptr, bool *pRunOnLeaveFunction=nullptr) |
| Looks for a function tied to the last keypress and. | |
| virtual bool | handleFunctionForLastMouseState (bool *pFunctionExists=nullptr, bool *pRunOnLeaveFunction=nullptr) |
| Looks for a function tied to the last mouse state captured. | |
| virtual void | draw () |
| Fills the member ncurses window structure with the current. | |
| 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 | |
| inputPtrContainer | mInputs |
| int | mCurrentInput = 0 |
| std::vector< std::pair< int, int > > | mInputPositions |
| bool | mTrapNonAssignedFKeys = true |
| If mTrapNonAssignedFKeys is true, function keys that aren't. | |
| bool | mStartAtFirstInput = false |
| mStartAtFirstInput keeps track of whether or not the form | |
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 |
| class | cxMultiForm |
| class | cxPanel |
Additional Inherited Members | |
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 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 form that contains text inputs. The user can move forward between the inputs on the form using the TAB and down arrow, and backward using SHIFT-TAB or the up arrow. The tab order is is based on the order in which the inputs are appended to the form. The input indexes also match the order in which the inputs are appended to the form, and they are zero-based.
It is a good idea to use unique labels for the inputs or unique names, since many of cxForm's methods access the fields the fields by label/name; in particular, getValues() populates a map of field labels/names and values, and if there are duplicate labels or names, it would not return the values of all the fields on the form.
The function getInput() can be used to get a pointer to one of the inputs, but one caveat of cxForm is that some operations shouldn't be performed on inputs added to a cxForm:
A cxForm also has the ability to let the user jump to a specific input while the form is being shown modally. This is done with a hotkey, which is F4 by default, but the hotkey can be changed with setInputJumpKey(). When the user presses this key, a cxMenu is used to display a list of choices containing each input label, or the input name if the label is blank. When the user chooses an input, the input will be set editable, and it will get the focus. Note that inputs that can't be set editable won't appear in the menu.
Note: Many functions provided by this class that do work on one of the inputs provide access to the input by index or by label/name. Many of them are just pass-through methods that call the appropriate method in cxMultiLineInput.
By default, function keys that don't have any function pointer associated with them will cause a cxForm's input loop to exit if the user is on the last input, if they're allowed to exit. This behavior can be changed with a call to trapNonAssignedFKeys().
|
protected |
|
explicit |
Default constructor. All parameters have default values.
| pParentWindow | Pointer to parent window; default nullptr |
| pRow | Y location of form; default 0 |
| pCol | X location of form; default 0 |
| pHeight | Height of form, in lines; defaults to 24 |
| pWidth | Width of form; defaults to 80 |
| pTitle | Title of form; defaults to empty string |
| pBorderStyle | The type of border to use - can be eBS_SINGLE_LINE for a single-line border or eBS_NOBORDER for no border. |
| pExtTitleWindow | A pointer to another cxWindow in which to display the window title. |
| pExtStatusWindow | A pointer to another cxWindow in which to display the status. |
| pAutoExit | Whether or not to exit the form when the user tries to go to the next input from the last input. Defaults to false. |
| pStacked | If true, the form will behave assuming each input is on its own line. |
| cx::cxForm::cxForm | ( | const cxForm & | pThatForm | ) |
Copy constructor
| pThatForm | Another cxForm object to be copied |
References cx::cxWindow::copyCxWinStuff(), cx::height(), cx::left(), mInputs, cx::top(), and cx::width().
|
virtual |
Destructor
References cx::cxInitialized(), and hide().
|
overridevirtual |
Returns the index of the next editable input after a given.
index. This can loop around - i.e., if a form has 10 inputs
and inputs 2 and 5 are editable, and 5 is passed to this
function, this function will return 2. Could also return -1
if there are no editable inputs or if the given input is out
of bounds.
| pIndex | An index of an input on the form |
Adds an ncurses attribute to use for one of the items in the
window (see the e_WidgetItems enumeration). For eLABEL,
eDATA_READONLY, and eDATA_EDITABLE, the attribute is added
to all inputs on the form. Other item types are added to
the form window.
| 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::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eLABEL, and mInputs.
Referenced by formInputColors(), and main().
|
overridevirtual |
Adds a key that will cause the form to quit and return.
cxID_EXIT. Normally, if the key already exists
as a function key, it will not be added as an exit key.
| pKey | The key to add |
| pRunOnLeaveFunction | Whether or not to run the onLeave functions when the form exits. Defaults to true. Note that this affects both the onLeave function for the form, as well as the current input on the form when it is modal. |
| pOverride | If true, then the key will be added as an exit key regardless if the key exists as a function key. This defaults to false. |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References cx::cxWindow::addExitKey(), mInputs, and cx::cxWindow::removeQuitKey().
Referenced by cx::cxMultiForm::addExitKey().
|
virtual |
Adds an additional key to be used to display the extended.
help key for all inputs.
| pKey | A key to be used to display extended help |
References mInputs.
Referenced by setExtendedHelpKey().
|
virtual |
Adds a hotkey for the form that will cause the.
focus to jump to another input during showModal().
For example:
cxForm iForm(nullptr, 1, 0, 12, 65, "Test form");
iForm.append(1, 1, 1, 25, "Input 1:");
iForm.append(1, 27, 1, 25, "Input 2:");
iForm.append(2, 1, 1, 25, "Input 3:");
iForm.append(2, 27, 1, 25, "Input 4:");
iForm.append(3, 1, 1, 25, "Input 5:");
iForm.append(3, 27, 1, 25, "Input 6:");
iForm.setAutoExit(true);
iForm.addInputJumpKey('n', "Input 6:");
iForm.showModal();
This will cause the form to jump to the input with the label "Input 6:"
when the user presses the 'n' key.
| pKey | The key to use as the hotkey |
| pLabel | The label/name of the input to which to jump |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
\brief Adds a hotkey for the form that will cause the
\brief focus to jump to another input during showModal().
\verbatim For example:
cxForm iForm(nullptr, 1, 0, 12, 65, "Test form");
iForm.append(1, 1, 1, 25, "Input 1:");
iForm.append(1, 27, 1, 25, "Input 2:");
iForm.append(2, 1, 1, 25, "Input 3:");
iForm.append(2, 27, 1, 25, "Input 4:");
iForm.append(3, 1, 1, 25, "Input 5:");
iForm.append(3, 27, 1, 25, "Input 6:");
iForm.setAutoExit(true);
iForm.addInputJumpKey('n', 5);
iForm.showModal();
This will cause the form to jump to the 5th input ("Input 6") when the user presses the 'n' key.
| pKey | The key to use as the hotkey |
| pIndex | The index of the input to which to jump |
References mInputs, cx::cxWindow::mKeyFunctions, and setKeyFunction().
Referenced by formChangeInputFocusWhileModal().
|
overridevirtual |
Adds a key that will cause the form to quit and return.
cxID_QUIT. Normally, if the key already exists
as a function key, it will not be added as an exit key.
| pKey | The key to add |
| pRunOnLeaveFunction | Whether or not to run the onLeave functions when the form exits. Defaults to true. Note that this affects both the onLeave function for the form, as well as the current input on the form when it is modal. |
| pOverride | If true, then the key will be added as an exit key regardless if the key exists as a function key. This defaults to false. |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References cx::cxWindow::addQuitKey(), mInputs, and cx::cxWindow::removeExitKey().
Referenced by cx::cxMultiForm::addQuitKey(), and inputQuitKeysOnForm().
| bool cx::cxForm::allFieldsBlank | ( | ) | const |
Returns whether all field values are blank.
References mInputs.
|
virtual |
Sets whether or not the validator function should run for all.
inputs when the user presses the input jump key. If not, the
user will always be able to jump from the inputs, whether or
not the input is valid.
| pValidate | If true, then the inputs will do validation when the user presses the jump key (possibly not allowing the user to jump if the input is not valid). If false, the user will be able to jump from the inputs whether or not the input is valid. |
References mInputs.
Referenced by itemSales().
|
virtual |
Returns whether any input on the form (at least 1) can be set editable.
References mInputs.
|
virtual |
Appends a copy of an input to a form.
| pInput | A cxMultiLineInput object to be added to the form. |
References lookForEditableInputs(), cx::cxWindow::mExitKeys, mInputPositions, mInputs, cx::cxWindow::mKeyFunctions, and cx::cxWindow::mQuitKeys.
|
virtual |
Appends an input to the form below the last item currently in.
the form. Applies the A_STANDOUT attribute to the value
portion of the input.
| pHeight | The height (# of lines) of the item |
| pWidth | The width (# of characters) of the item |
| pLabel | The label to use with the input |
| pValidator | String to use to validate input; see README.txt for details; blank by default |
| pHelpString | A string to be displayed in the statusbar of the form when the input has focus |
| pInputOption | Defines the input option (i.e., normal, read-only, etc.); from eInputOptions enumeration in cxInput.h |
| pName | A name for the input (can be used as an alternative way to identify the input) |
| pExtValue | A pointer to a string to be linked to this input and used for its value. Defaults to nullptr for none. |
| pRightlabelOffset | The distance between the right edge of the input and the right label. Defaults to 0. |
| pRightLabelHeight | The height of the label to the right of the input (defaults to 1) |
| pRightLabelHeight | The width of the label to the right of the input (defaults to 7 so that there is room for "Invalid" if validation is on and the user enters an invalid value) |
| pShowRightLabel | Whether or not to show the right label. Defaults to false. |
| pInputType | The type of input to append (either cxMultiLineInput or cxComboBox). This can be either eIT_CXMULTILINEINPUT (for a cxMultiLineInput) or eIT_CXCOMBOBOX (for a cxComboBox). Defaults to eIT_CXMULTILINEINPUT. If eIT_CXCOMBOBOX is specified, then the return value should be casted to a cxComboBox* to make use of cxComboBox's extended functionality. |
|
virtual |
Adds an input to the form. Applies the A_STANDOUT attribute.
to the value portion of the input. Returns a pointer to the new input.
| pRow | Y location of the upper-left corner of the input, relative to the form |
| pCol | X location of the upper-left corner of the input, relative to the form |
| pHeight | The height of the input |
| pWidth | The width of the input |
| pLabel | The label to use with the input |
| pValidator | String to use to validate input; see README.txt for details; blank by default |
| pHelpString | A string to be displayed in the statusbar of the form when the input has focus; defaults to empty string |
| pInputOption | Defines the input option (i.e., normal, read-only, etc.); defaults to eINPUT_EDITABLE |
| pName | A name for the input (can be used as an alternative way to identify the input) |
| pExtValue | A pointer to a string to be linked to this input and used for its value. Defaults to nullptr for none. |
| pRightlabelOffset | The distance between the right edge of the input and the right label. Defaults to 0. |
| pRightLabelHeight | The height of the label to the right of the input (defaults to 1) |
| pRightLabelWidth | The width of the label to the right of the input (defaults to 7 so that there is room for "Invalid" if validation is on and the user enters an invalid value) |
| pShowRightLabel | Whether or not to show the right label. Defaults to false. |
| pInputType | The type of input to append (either cxMultiLineInput or cxComboBox). This can be either eIT_CXMULTILINEINPUT (for a cxMultiLineInput) or eIT_CXCOMBOBOX (for a cxComboBox). Defaults to eIT_CXMULTILINEINPUT. If eIT_CXCOMBOBOX is specified, then the return value should be casted to a cxComboBox* to make use of cxComboBox's extended functionality. |
Referenced by allFormInputsGoReadOnly(), attributesSetter(), borderlessForm(), comboBoxOnForm(), cxFormAssignment(), cxFormClearOnlyEditable(), cxFormExtendedHelpKey(), cxFormMouseFunctionTest(), cxFormMultiLineInputFunctionKeyNoValidator(), cxFormNavKeys(), cxFormNoQuit(), cxFormStartAtFirstInput(), cxInputOnFormLoopDisabled(), cxMultiLineInputWithRightLabelOnForm(), enableDisableForm(), floatingPtValidateOnForm(), form(), formChangeInputFocusWhileModal(), formDataChanged(), formFunctionKeyNoOnLeave(), formFunctionKeys(), formInputColors(), formUpArrowFunction(), formWithFKeys(), formWithInputValueValidator(), formWithMenu(), getFormKeys(), inputQuitKeysOnForm(), inputWithoutBorder(), integerValidateOnForm(), itemSales(), keyFunctionAutoExitOnLastFormInput(), loneInputWithLoopDisabledOnForm(), main(), multiForm(), multiFormWithDisabledSubform(), setValFunc(), simpleForm1(), stackedFormScrolling(), stackedFormScrolling2(), testFormPos(), and testFormReadOnly().
|
virtual |
Appends a cxMultiLineInput to the form via a pointer.
The pointer that is passed in must point to a
dynamically-created cxMultiLineInput object created with
the 'new' operator, because cxForm cleans up its
input pointers in the destructor with the 'delete'
operator.
| pInput | A pointer to a cxMultiLineInput (or a deriving object) |
| pRow | The row on the form where you want the input to be located |
| pCol | The column on the form where you want the input to be located |
| pMoved | If non-null, the boolean pointed to by this variable will store whether or not the input was able to be moved. |
|
virtual |
Appends a combo box to the form below the last.
item currently in the form. Applies the A_STANDOUT
attribute to the value portion of the input. The new
input will be as wide as the inner width of the form.
| pHeight | The height (# of lines) of the item |
| pWidth | The width (# of characters) of the item |
| pLabel | The label to use with the input |
| pValidator | String to use to validate input; see README.txt for details; blank by default |
| pHelpString | A string to be displayed in the statusbar of the form when the input has focus |
| pInputOption | Defines the input option (i.e., normal, read-only, etc.); from eInputOptions enumeration in cxInput.h |
| pName | A name for the input (can be used as an alternative way to identify the input) |
| pExtValue | A pointer to a string to be linked to this input and used for its value. Defaults to nullptr for none. |
| pRightlabelOffset | The distance between the right edge of the input and the right label. Defaults to 0. |
| pRightLabelHeight | The height of the label to the right of the input (defaults to 1) |
| pRightLabelHeight | The width of the label to the right of the input (defaults to 7 so that there is room for "Invalid" if validation is on and the user enters an invalid value) |
| pShowRightLabel | Whether or not to show the right label. Defaults to false. |
|
virtual |
Adds a combo box to the form. Applies the A_STANDOUT attribute.
to the value portion of the input. Returns a pointer to the new input.
| pRow | Y location of the upper-left corner of the input, relative to the form |
| pCol | X location of the upper-left corner of the input, relative to the form |
| pHeight | The height of the input |
| pWidth | The width of the input |
| pLabel | The label to use with the input |
| pValidator | String to use to validate input; see README.txt for details; blank by default |
| pHelpString | A string to be displayed in the statusbar of the form when the input has focus; defaults to empty string |
| pInputOption | Defines the input option (i.e., normal, read-only, etc.); defaults to eINPUT_EDITABLE |
| pName | A name for the input (can be used as an alternative way to identify the input) |
| pExtValue | A pointer to a string to be linked to this input and used for its value. Defaults to nullptr for none. |
| pRightlabelOffset | The distance between the right edge of the input and the right label. Defaults to 0. |
| pRightLabelHeight | The height of the label to the right of the input (defaults to 1) |
| pRightLabelWidth | The width of the label to the right of the input (defaults to 7 so there is room for "Invalid") |
| pShowRightLabel | Whether or not to show the right label. Defaults to false. |
Referenced by comboBoxOnForm(), and main().
|
virtual |
Appends a pair of cxComboBoxes to a form, one to the right of.
the other. They will share similar names, and the words "_start"
and "_end" will be appended to the name for the first and
second inputs, respectively. Also, if the form doesn't have
enough room for the second input, it will not be appended.
| pRow | Y location of the upper-left corner of the inputs, relative to the form |
| pCol | X location of the upper-left corner of the inputs, relative to the form |
| pHeight | The height of each input |
| pWidth | The width of each input |
| pLabel | The label to use - This will only be used with the first input. |
| pValidator | String to use to validate inputs; see README.txt for details; blank by default |
| pHelpString | A string to be displayed in the statusbar of the form when the input has focus; defaults to empty string |
| pInputOption | Definse the input option (editable or read-only). Defaults to eINPUT_EDITABLE. |
| pName | A name for the inputs. Note that "low" and "high" will be appended to the input names, referring to the first and second inputs, respectively. |
| pExtValue1 | A pointer to a string to be linked to the first input and used for its value. Defaults to nullptr for none. |
| pExtValue2 | A pointer to a string to be linked to the second input and used for its value. Defaults to nullptr for none. |
| pRightlabel1Offset | The distance between the right edge of the first input and its right label. Defaults to 0. |
| pRightLabel1Height | The height of the first input's right label (defaults to 1) |
| pRightLabel1Width | The width of the first input's right label (defaults to 7 so that there is room for "Invalid" if validation is on and the user enters an invalid value) |
| pShowRightLabel1 | Whether or not to show the right label for the first input. Defaults to false. |
| pRightlabel2Offset | The distance between the right edge of the second input and its right label. Defaults to 0. |
| pRightLabel2Height | The height of the second input's right label (defaults to 1) |
| pRightLabel2Width | The width of the second input's right label (defaults to 7 so that there is room for "Invalid" if validation is on and the user enters an invalid value) |
| pShowRightLabel2 | Whether or not to show the right label for the second input. Defaults to false. |
| pRightlabel2Offset | The distance between the right edge of the second input and its right label. Defaults to 0. |
| pRightLabel2Height | The height of the second input's right label (defaults to 1) |
| pRightLabel2Width | The width of the second input's right label (defaults to 7 so that there is room for "Invalid" if validation is on and the user enters an invalid value) |
| pShowRightLabel2 | Whether or not to show the right label for the second input. Defaults to false. |
References appendPair(), and cx::eIT_CXCOMBOBOX.
Referenced by cxFormAppendComboBoxPair().
|
virtual |
Appends a pair of inputs to a form, one to the right of the.
other. They will share similar names, and the words "_start"
and "_end" will be appended to the name for the first and
second inputs, respectively. Also, if the form doesn't have
enough room for the second input, it will not be appended.
| pRow | Y location of the upper-left corner of the inputs, relative to the form |
| pCol | X location of the upper-left corner of the inputs, relative to the form |
| pHeight | The height of each input |
| pWidth | The width of each input |
| pLabel | The label to use - This will only be used with the first input. |
| pValidator | String to use to validate inputs; see README.txt for details; blank by default |
| pHelpString | A string to be displayed in the statusbar of the form when the input has focus; defaults to empty string |
| pInputOption | Defines the input option (editable or read-only). Defaults to eINPUT_EDITABLE. |
| pName | A name for the inputs. Note that "_low" and "_high" will be appended to the input names, referring to the first and second inputs, respectively. |
| pExtValue1 | A pointer to a string to be linked to the first input and used for its value. Defaults to nullptr for none. |
| pExtValue2 | A pointer to a string to be linked to the second input and used for its value. Defaults to nullptr for none. |
| pRightlabel1Offset | The distance between the right edge of the first input and its right label. Defaults to 0. |
| pRightLabel1Height | The height of the first input's right label (defaults to 1) |
| pRightLabel1Width | The width of the first input's right label (defaults to 7 so that there is room for "Invalid" if validation is on and the user enters an invalid value) |
| pShowRightLabel1 | Whether or not to show the right label for the first input. Defaults to false. |
| pRightLabel2Height | The height of the second input's right label (defaults to 1) |
| pRightLabel2Width | The width of the second input's right label (defaults to 7 so that there is room for "Invalid" if validation is on and the user enters an invalid value) |
| pShowRightLabel2 | Whether or not to show the right label for the second input. Defaults to false. |
| pRightlabel2Offset | The distance between the right edge of the second input and its right label. Defaults to 0. |
| pRightLabel2Height | The height of the second input's right label (defaults to 1) |
| pRightLabel2Width | The width of the second input's right label (defaults to 7 so that there is room for "Invalid" if validation is on and the user enters an invalid value) |
| pShowRightLabel2 | Whether or not to show the right label for the second input. Defaults to false. |
| pInputType1 | The type of input to append for the first input (either cxMultiLineInput or cxComboBox). This can be either eIT_CXMULTILINEINPUT (for a cxMultiLineInput) or eIT_CXCOMBOBOX (for a cxComboBox). Defaults to eIT_CXMULTILINEINPUT. If eIT_CXCOMBOBOX is specified, then the return value should be casted to a cxComboBox* to make use of cxComboBox's extended functionality. |
| pInputType2 | The type of input to append for the second input. |
Referenced by appendComboBoxPair(), cxFormAppendPair(), and itemSales().
|
virtual |
Appends 2 inputs to the form, one to the right of the other.
Their right labels will be moved one to the right of the other
with a "/" between them. The name of the first input will be
used for both, with "_start" and "_end" appended to the first
and second input name, respectively. The inputs need to be
created dynamically with the 'new' operator.
| pInput1 | A pointer to the first input |
| pInput2 | A pointer to the second input |
| pRow | The row on the form to append the inputs |
| pCol | The column on the form to append the inputs |
| pName | If this is non-blank, then this will be used for the input names. |
|
overridevirtual |
Brings the window to the top.
| pRefresh | Whether to refresh the screen (defaults to true) |
Reimplemented from cx::cxWindow.
References cx::cxWindow::bringToTop(), mInputs, and cx::updateWindows().
|
virtual |
Returns whether or not an input can be set editable.
| pLabel | The label/name of the input |
| pCanBeEditable | If true, the can be set editable. If false, the input will always be read-only. |
|
virtual |
Returns whether or not an input can be set editable.
| pIndex | The index of the input |
References mInputs.
Referenced by doInputLoop().
|
virtual |
|
virtual |
Clears the values of all the inputs on the form.
| pRefresh | Whether or not to refresh the inputs after clearing them (defaults to false) |
| pOnlyEditable | If true, then only the editable inputs on the form will be cleared. This defaults to false. |
References mInputs.
Referenced by cxFormClearOnlyEditable(), and formInputColors().
|
overridevirtual |
Removes a function pointer for a keypress for the form so that it will no.
longer fire a function.
| pKey | The hotkey for the function to remove |
Reimplemented from cx::cxWindow.
References cx::cxWindow::clearKeyFunction(), and mInputs.
|
protected |
Makes a copy of a cxForm's member variables.
| pThatForm | A pointer to another cxForm whose members to copy |
References cx::cxWindow::copyCxWinStuff(), cx::cxWindow::freeWindow(), cx::cxWindow::getBorderStyle(), cx::cxWindow::getExtStatusWindow(), cx::cxWindow::getExtTitleWindow(), cx::cxWindow::getMessage(), getStatus(), cx::cxWindow::getTitle(), cx::cxWindow::left(), mCurrentInput, mInputPositions, mInputs, move(), mStartAtFirstInput, mTrapNonAssignedFKeys, cx::cxWindow::setBorderStyle(), cx::cxWindow::setExtStatusWindow(), cx::cxWindow::setExtTitleWindow(), cx::cxWindow::setMessage(), setStatus(), cx::cxWindow::setTitle(), and cx::cxWindow::top().
Referenced by cx::cxMultiForm::copyCxMultiFormStuff(), and operator=().
|
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.
Reimplemented in cx::cxMultiForm.
|
virtual |
Turns off the custom status text set with setStatus.
After a call to this function, the current status
text will be cleared, and the form will go back to
using the help messages from the inputs as status.
| pRefreshStatus | Whether or not to refresh the status area (defaults to true) |
References cx::cxWindow::setStatus().
|
protectedvirtual |
Gets input from the current input (for use in the input loop).
| pReturnCode | This variable will hold the return code as a result of the user's interactions. |
| pRunOnLeaveFunction | This parameter will be set depending on whether the onLeave function should be run (this will be true unless the user presses a function key AND the form is on a parent multiForm). |
| pFunctionExists | This parameter will be set depending on whether a function existed for the key that was caught in the form. If a function did exist, it would be useful not to cycle to the next input the next time through the input loop. |
| pExitOverride | If true, this function will always return false when the user exits the last input (default). This is here to aid input loops in deriving classes. |
References cx::cxID_EXIT, cx::cxID_QUIT, cx::eINPUT_READONLY, ENTER, ESCAPE, getCurrentInputIndex(), getInputOption(), cx::cxWindow::getLastKey(), getValue(), cx::cxWindow::handleFunctionForLastKey(), cx::cxWindow::hasExitKey(), cx::cxWindow::hasQuitKey(), cx::cxWindow::isAbove(), lastEditableInput(), lookForEditableInputs(), mCurrentInput, mInputs, cx::cxWindow::mKeyFunctions, mTrapNonAssignedFKeys, cx::cxWindow::mWindow, NOKEY, setLastKey(), SHIFT_TAB, and TAB.
Referenced by doInputLoop().
|
protected |
Handles the input loop. Returns cxID_QUIT or cxID_EXIT,.
depending on the user's input. This function is meant
not to be virtual, since it is specifically for
| pRunOnLeaveFunction | This parameter will be set depending on whether the onLeave function should be run (this will be true unless the user presses a function key AND the form is on a parent multiForm). |
References canBeEditable(), cx::cxID_EXIT, cx::cxID_QUIT, doCurrentInput(), cx::eINPUT_EDITABLE, ESC, firstEditableInput(), cx::cxWindow::getLastKey(), cx::cxWindow::handleFunctionForLastKey(), cx::cxWindow::handleFunctionForLastMouseState(), hasEditableInputs(), cx::cxWindow::hasExitKey(), cx::cxWindow::hasQuitKey(), mCurrentInput, cx::messageBox(), mInputs, cx::cxWindow::mLeaveNow, cx::cxWindow::mouseButton1Clicked(), cx::cxWindow::mouseButton1Pressed(), cx::cxWindow::mouseButton1Released(), cx::cxWindow::mouseEvtWasButtonEvt(), cx::cxWindow::mouseEvtWasInTitle(), cx::cxWindow::mouseEvtWasInWindow(), cx::cxWindow::moveRelative(), cx::cxWindow::mQuitKeys, mStartAtFirstInput, cx::cxWindow::mWindow, NOKEY, cx::cxWindow::parentIsCxPanel(), cx::cxWindow::pointIsInWindow(), runLoopEndFunction(), runLoopStartFunction(), setCurrentInput(), setLastKey(), setStatus(), and cx::toggleCursor().
Referenced by showModal().
|
virtual |
Enables or disables the input loop for one of the.
inputs (by label/name). When the input loop for
an input is disabled, its onFocus and onLeave
functions will still be run, but the input won't
wait for input.
| pLabel | The label/name of the input |
| pDoInputLoop | Whether to enable or disable the input loop for the input (true/false) |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
Referenced by cxInputOnFormLoopDisabled().
|
virtual |
Enables or disables the input loop for one of the.
inputs (by index). When the input loop for an
input is disabled, its onFocus and onLeave
functions will still be run, but the input won't
wait for input.
| pIndex | The index of the input |
| pDoInputLoop | Whether to enable or disable the input loop for the input (true/false) |
References mInputs.
|
overridevirtual |
This causes the form to exit its input loop with a code of.
cxID_EXIT.
Reimplemented from cx::cxWindow.
References cx::cxWindow::exitNow(), getCurrentInputIndex(), and getInput().
|
virtual |
Returns the index of the first editable input in.
the form's collection of inputs, or -1 if there
are no editable inputs.
References isEditable(), mInputs, and numInputs().
Referenced by doInputLoop(), and form().
|
virtual |
Returns whether a key is set as a form function.
| pKey | The key to look for |
References cx::cxWindow::mKeyFunctions.
Referenced by cx::cxMultiLineInput::searchParentFormsForFKey().
|
virtual |
Returns whether the user is able to exit out of the form.
|
virtual |
Returns whether the user is able to quit out of the form.
Referenced by cx::cxMultiForm::doInputLoop().
| bool cx::cxForm::getApplyAttrDefaults | ( | ) | const |
Returns whether default attributes are applied to new inputs.
|
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::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eLABEL, cx::cxWindow::getAttrs(), and mInputs.
| bool cx::cxForm::getAutoExit | ( | ) | const |
Returns the set value of whether the form should exit upon.
exit of the last field.
Referenced by cx::cxMultiForm::doInputLoop().
| shared_ptr< cxMultiLineInput > cx::cxForm::getCurrentInput | ( | ) | const |
Returns a pointer to the current input. If there are no inputs.
on the form or there is some other error, this method will
return nullptr.
References getCurrentInputIndex(), and mInputs.
|
virtual |
Returns the index of the input that currently has focus.
References mCurrentInput, and mInputs.
Referenced by doCurrentInput(), exitNow(), getCurrentInput(), getCurrentInputLabel(), getCurrentInputName(), and quitNow().
|
virtual |
Returns the label of the input that currently has focus.
References getCurrentInputIndex(), getLabel(), and mInputs.
|
virtual |
Returns the name of the input that currently has focus.
References getCurrentInputIndex(), getName(), and mInputs.
|
virtual |
Returns whether the form is set to exit its showModal() when.
the user leaves the first input going backwards.
|
virtual |
Returns the extended help string from one of the inputs (by.
label/name). If the input is not found, this will return a
blank string.
| pIDStr | The label/name of the input |
| pIsLabel | If true (default), then pIDStr will specify the label of the input. Otherwise, pIDStr will specify the name of the input. |
|
virtual |
Gets the extended help string from one of the inputs (by.
index). If the given index is out of bounds, this will return
a blank string.
| pIndex | The index of the input |
References mInputs.
|
virtual |
Returns the keys used to display extended help for the inputs.
This returns the set of keys set in the form. This list is the
same for all inputs except when extended help keys are changed
on individual inputs.
| string cx::cxForm::getExtendedHelpKeyStrings | ( | ) | const |
Returns a comma-separated list of strings representing the.
extended help keys for the form. This list is the
same for all inputs except when extended help keys are changed
on individual inputs.
References cx::getKeyStr().
Referenced by cxFormExtendedHelpKey().
| std::shared_ptr< cxMultiLineInput > cx::cxForm::getInput | ( | const std::string & | pLabel, |
| bool | pIsLabel = true |
||
| ) | const |
Returns a pointer to an input with a given label/name, or.
nullptr if no input is found with the given label/name. Note
that inputs are dynamically allocated when they're appended
to a cxForm, and the memory is freed in the cxForm
destructor. Therefore, it is vital that if the return value
of this method is used, the 'delete' operator could be used
on it, but this should not be done; othewise, the
application could crash when the cxForm object is destroyed.
| pLabel | The label/name of the input |
| pIsLabel | True if pLabel specifies the label (default), or false if it specifies the name |
| shared_ptr< cxMultiLineInput > cx::cxForm::getInput | ( | int | pIndex | ) | const |
Returns a pointer to an input at a given index, or nullptr if the index.
is not valid. Note that inputs are dynamically allocated when
they're appended to a cxForm, and the memory is freed in the cxForm
destructor. Therefore, it is vital that if the return value of this
method is used, the 'delete' operator could be used on it, but
this should not be done; othewise, the application could crash
when the cxForm object is destroyed.
| pIndex | The index of the input |
References mInputs.
Referenced by allFormInputsGoReadOnly(), comboBoxOnForm(), cxFormAssignment(), exitNow(), form(), main(), quitNow(), and setValues().
|
virtual |
References mInputs, and numInputs().
|
virtual |
Returns the index of an input based on a pointer. May.
return -1 if the input is not in the form.
| pInput | A pointer to an input |
|
virtual |
Returns the index of an input, based on its label or name.
| pLabel | The label/name of the input |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
Referenced by cx::cxMultiLineInput::doInputLoop(), cx::cxMultiLineInput::exitNow(), cx::cxMultiLineInput::quitNow(), and setValues().
|
virtual |
Returns which key is being used as the jump hotkey.
Referenced by cx::cxMultiLineInput::searchParentFormsForFKey().
|
virtual |
Returns the editability option for an input (by label/name).
| pLabel | The label/name of the input |
| pIsLabel | If true (default), pLabel specifies the label. If false, pLabel specifies the name of the input. |
|
virtual |
Returns the editability option for an input (by index).
| pIndex | The index of the input |
References cx::eINPUT_READONLY, and mInputs.
Referenced by doCurrentInput(), and setInputOption().
|
virtual |
Returns the label of one of the inputs (by index).
| pIndex | The index of the input |
References mInputs.
Referenced by getCurrentInputLabel(), and inputLabel().
| int cx::cxForm::getLabelColor | ( | const int & | pIndex | ) | const |
Returns the label color of one of the inputs (by index).
| pIndex | The index of the input |
References cx::eDEFAULT, and mInputs.
| int cx::cxForm::getLabelColor | ( | const std::string & | pLabel, |
| bool | pIsLabel = true |
||
| ) | const |
Returns the label color of one of the inputs (by label/name).
| pLabel | The label/name of the input |
| pIsLabel | If true (default), pLabel is the input's label. If false, pLabel is the input's name. |
| bool cx::cxForm::getMasked | ( | const std::string & | pLabel, |
| bool | pIsLabel = true |
||
| ) |
Returns whether or not an input is masked (by label).
| pLabel | The label of the input |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
| bool cx::cxForm::getMasked | ( | int | pIndex | ) |
Returns whether or not an input is masked (by index).
| pIndex | The index of the input |
References mInputs.
| string cx::cxWindow::getName | ( | ) | const |
Accessor for the name for this input
References cx::cxWindow::getParent(), cx::cxWindow::getStatus(), cx::cxWindow::getTitle(), cx::cxWindow::height(), cx::cxWindow::init(), cx::cxWindow::left(), cx::cxWindow::top(), and cx::cxWindow::width().
Referenced by getCurrentInputName().
|
virtual |
Returns the name of one of the inputs (by label).
| pLabel | The label of the input |
|
virtual |
Returns the name of one of the inputs (by index).
| pIndex | The index of the input |
References mInputs.
|
virtual |
Gathers a set of keys considered to be "navigational" keys from.
all the inputs on the form. Note that each input could have
a different list of navigational keys; this method gets all
of them.
| pNavKeys | This will contain the navigational keys gathered from all inputs on the form. |
References mInputs.
Referenced by cxFormNavKeys(), and getNavKeyStrings().
|
virtual |
Creates a set of string representations of keys considered to.
be "navigational" keys, gathered from all inputs on the form.
| pNavKeyStrings | This will contain string representations of the navigational keys, gathered from all inputs on the form. |
References cx::getKeyStr(), and getNavKeys().
Referenced by cxFormNavKeys().
|
overridevirtual |
Returns a pointer to the parent window. If the cxForm.
has a parent cxMultiForm, 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().
Referenced by main(), and cx::cxMultiLineInput::searchParentFormsForFKey().
| cxMultiForm * cx::cxForm::getParentMultiForm | ( | ) | const |
Returns the parent cxMultiForm pointer.
Referenced by cx::cxMultiLineInput::searchParentFormsForFKey().
| bool cx::cxForm::getStartAtFirstInput | ( | ) | const |
Returns whether or not the form will always start at the first.
editable input when showModal() is called.
References mStartAtFirstInput.
| string cx::cxWindow::getStatus | ( | ) | const |
Accessor for the status line text.
References cx::cxID_EXIT, cx::eBS_SINGLE_LINE, and cx::init().
|
virtual |
Returns the status text of one of the inputs (by label/name).
| pLabel | The label/name of the input |
| pIsLabel | If true (default), pLabel specifies the label of the input. If false, pLabel specifies the name of the input. |
|
virtual |
Returns the status text of one of the inputs (by index).
| pIndex | The index of the input |
References mInputs.
Referenced by copyCxFormStuff(), and main().
|
virtual |
Returns whether or not the extended help keys are enabled.
|
virtual |
Returns the value associated with a particular input (by label or name).
| pStr | The label/name of the input |
| pIsLabel | Whether pStr is a label or a name (true = label, false = name) |
Reimplemented in cx::cxMultiForm.
|
virtual |
Returns the value associated with a particular input (by index).
| pIndex | The index of the input |
Reimplemented in cx::cxMultiForm.
References getValue(), and mInputs.
Referenced by doCurrentInput(), form(), formWithFKeys(), getValue(), cx::cxMultiForm::getValue(), and main().
| int cx::cxForm::getValueColor | ( | const int & | pIndex | ) | const |
Returns the color of the value section of one of the inputs (by index).
| pIndex | The index of the input |
References cx::eDEFAULT, and mInputs.
| int cx::cxForm::getValueColor | ( | const std::string & | pLabel, |
| bool | pIsLabel = true |
||
| ) | const |
Returns the color of the value section of one of the inputs (by label/name).
| pLabel | The label/name of the input |
| pIsLabel | If true (default), pLabel is the input's label. If false, pLabel is the input's name. |
|
virtual |
Gets the values from the form in the form of a map of input.
labels/names and their values.
| pValues | This map will be populated with the labels/names of the inputs mapped to their values. |
| pUseLabels | If true (default), the values will be mapped by the input labels. If false, the values will be mapped by the input names. |
| pSkipBlankIDs | If true, then inputs with a blank label/name will not be added to the map. This defaults to false. |
References mInputs.
Referenced by cxFormAppendPair().
|
virtual |
Returns whether or not the form will wait for.
user input if there are no editable inputs.
Referenced by cx::cxMultiForm::doInputLoop().
|
virtual |
Returns whether or not any data on the form has changed.
Reimplemented in cx::cxMultiForm.
Referenced by formDataChanged(), and cx::cxMultiForm::hasChanged().
|
virtual |
Returns whether the form has any inputs that are.
currently editable.
References cx::eINPUT_READONLY, and mInputs.
Referenced by doInputLoop(), cx::cxMultiForm::doInputLoop(), and modalGetsKeypress().
|
virtual |
Returns whether or not the form has an input with a given.
label/name.
| pStr | The label/name of the input |
| pIsLabel | If true, then pStr specifies the label; otherwise, pStr specifies the name of the input. Defaults to true. |
References mInputs.
|
virtual |
Returns whether at least one of the inputs on the form has.
a key in its list of navigational keys.
| pKey | The key to look for |
References mInputs.
Referenced by cxFormNavKeys().
|
overridevirtual |
Hides the form (along with all the inputs)
| pHideSubwindows | Whether or not to also hide the subwindows (defaults to true) |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References cx::cxWindow::hide(), and mInputs.
Referenced by cx::cxMultiForm::hide(), show(), and ~cxForm().
| int cx::cxForm::inputHeight | ( | const std::string & | pLabel, |
| bool | pIsLabel = true |
||
| ) | const |
Returns the height of an input (by label/name), or -1 if there is no input.
with the given label/name.
| pLabel | The label/name of the input |
| pIsLabel | If true (default), pLabel specifies the input's label. If false, pLabel specifies the input's name. |
| int cx::cxForm::inputHeight | ( | int | pIndex | ) | const |
| std::string cx::cxForm::inputLabel | ( | const std::string & | pName | ) | const |
Returns the label of an input.
| pName | The name of the input |
| string cx::cxForm::inputLabel | ( | int | pIndex | ) | const |
Returns the label of an input at a given index.
| index | The index of an input |
References getLabel(), and mInputs.
Referenced by main().
| int cx::cxForm::inputLeftCol | ( | const std::string & | pLabel, |
| bool | pIsLabel = true |
||
| ) | const |
Returns the left column of an input (by label/name), or -1 if there are.
no inputs wit the given label/name.
| pLabel | The label/name of the input |
| pIsLabel | If true (default), pLabel specifies the input's label. If false, pLabel specifies the input's name. |
| int cx::cxForm::inputLeftCol | ( | int | pIndex | ) | const |
| std::string cx::cxForm::inputName | ( | const std::string & | pLabel | ) | const |
Returns the name of an input.
| pLabel | The label of the input |
| string cx::cxForm::inputName | ( | int | pIndex | ) | const |
Returns the name of an input at a given index.
| index | The index of an input |
References mInputs.
| int cx::cxForm::inputTopRow | ( | const std::string & | pLabel, |
| bool | pIslabel = true |
||
| ) | const |
Returns the top row of an input (by label/name), or -1 if there is no.
input with the given label/name.
| pLabel | The label of the input |
| pIsLabel | If true (default), pLabel specifies the input's label. If false, pLabel specifies the input's name. |
| int cx::cxForm::inputTopRow | ( | int | pIndex | ) | const |
| int cx::cxForm::inputWidth | ( | const std::string & | pLabel, |
| bool | pIsLabel = true |
||
| ) | const |
Returns the width of an input (by label/name), or -1 if there is.
no input with the given label/name.
| pLabel | The label of the input |
| pIsLabel | If true (default), pLabel specifies the input's label. If false, pLabel specifies the input's name. |
| int cx::cxForm::inputWidth | ( | int | pIndex | ) | const |
|
virtual |
Returns whether one of the inputs on.
the form is editable (by label/name)
| pLabel | The label/name of the input |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Returns whether one of the inputs on.
the form is editable (by index)
| pIndex | The index of the input |
References mInputs.
Referenced by firstEditableInput(), lastEditableInput(), and setCurrentInput().
|
virtual |
Returns whether or not the form is in 'stacked'.
mode (which assumes each input is on top of the next).
|
virtual |
Returns the index of the last editable input in.
the form's collection of inputs, or -1 if there
are no editable inputs.
References isEditable(), and mInputs.
Referenced by doCurrentInput(), and form().
|
protected |
Scans all inputs to see if any are editable and updates.
mEditableInputsExist.
References cx::eINPUT_READONLY, and mInputs.
Referenced by append(), doCurrentInput(), remove(), remove(), and setInputOption().
| int cx::cxForm::maxInputLen | ( | const std::string & | pLabel, |
| bool | pIsLabel = true |
||
| ) | const |
Returns the maximum length of input accepted by an input (by index),.
or 0 if the given index is invalid.
| pLabel | The label of the input |
| pIsLabel | If true (default), pLabel specifies the input's label. If false, pLabel specifies the input's name. |
| int cx::cxForm::maxInputLen | ( | int | pIndex | ) | const |
Returns the maximum length of input accepted by an input (by index),.
or 0 if the given index is invalid.
| pIndex | The index of the input |
References mInputs.
|
virtual |
Returns the maximum length of the value that may be set for an.
input (by label/name).
| pLabel | The label/name of the input |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Returns the maximum length of the value that may be set for an.
input (by index).
| pIndex | The index of the input |
References mInputs.
|
overridevirtual |
Returns whether or not a call to showModal() will wait for a.
keypress from the user. A cxForm will wait for a keypress if
it is enabled and it has at least 1 editable input. If it is
enabled but does not have any editable inputs, it may or may
not wait for a keypress, depending on whether
setWaitForInputIfEmpty() has been called.
Reimplemented from cx::cxWindow.
References hasEditableInputs(), and cx::cxWindow::isEnabled().
|
overridevirtual |
Changes the window's position (based on a new upper-left corner). Also moves the input windows.
| pNewRow | The new topmost row of the form |
| pNewCol | The new leftmost column of the form |
| pRefresh | Whether or not to refrseh the window (defaults to true) |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References cx::cxWindow::left(), mInputPositions, mInputs, cx::cxWindow::move(), numInputs(), show(), and cx::cxWindow::top().
Referenced by copyCxFormStuff(), main(), and cx::cxMultiForm::move().
| size_t cx::cxForm::numInputs | ( | ) | const |
Returns the number of inputs in the form.
References mInputs.
Referenced by firstEditableInput(), getInputIndex(), main(), move(), remove(), scrollInputs(), setCurrentInputByPtr(), setInputJumpKey(), and showAllInputs().
|
virtual |
Returns whether the onKey function is enabled for one of the.
inputs (by label/name). If there are multiple inputs with the
same label/name, the onKey status of only the first one will
be returned.
| plabel | The label/name of the input |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Returns whether the onKey function is enabled for one of the.
inputs (by index).
| pIndex | The index of the input |
References mInputs.
Assignment operator.
| pThatForm | Another cxForm to be copied |
References copyCxFormStuff().
|
overridevirtual |
This causes the form to exit its input loop with a code of.
cxID_QUIT.
Reimplemented from cx::cxWindow.
References getCurrentInputIndex(), getInput(), and cx::cxWindow::quitNow().
Referenced by multiForm2_quit().
|
virtual |
|
virtual |
Refreshes an input (by calling its show() method)
| pIndex | The index of the input to refresh |
References cx::cxWindow::isAbove(), and mInputs.
|
virtual |
Removes an input from the form (by pointer)
| pInput | Pointer to the cxMultiLineInput object to remove |
|
virtual |
Removes an input from the form (by label or name)
| pLabel | Label of the input to be deleted |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
References cx::cxWindow::height(), lookForEditableInputs(), mCurrentInput, mInputPositions, mInputs, and numInputs().
|
virtual |
Removes an input from the form (by index)
| pIndex | The index of the input to be deleted |
References cx::cxWindow::height(), lookForEditableInputs(), mCurrentInput, mInputPositions, and mInputs.
Referenced by main().
|
virtual |
Removes all inputs from the form.
References mCurrentInput.
|
overridevirtual |
Removes an ncurses attribute from one of the item lists. For.
eLABEL, eDATA_READONLY, and eDATA_EDITABLE, the attribute is
removed from all inputs on the form. Other item types are
removed from the form window.
| 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::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eLABEL, mInputs, and cx::cxWindow::removeAttr().
Referenced by formInputColors().
|
overridevirtual |
Removes all attributes for a given window item. For eLABEL,.
eDATA_READONLY, and eDATA_EDITABLE, the attribute is removed
from all inputs on the form. Other item types are removed
from the form window.
| pItem | The item to remove attributes for (see the e_WidgetItems enumeration). |
Reimplemented from cx::cxWindow.
References cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eLABEL, mInputs, and cx::cxWindow::removeAttrs().
Referenced by formInputColors().
|
overridevirtual |
Removes an exit key.
| pKey | The key to remove from the list of exit keys |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References cx::cxWindow::mExitKeys, and mInputs.
Referenced by cx::cxMultiForm::removeExitKey(), setKeyFunction(), setKeyFunction(), and setKeyFunction().
|
overridevirtual |
Removes a quit key (but doesn't work for ESC)
| pKey | The key to remove from the list of quit keys |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References mInputs, and cx::cxWindow::mQuitKeys.
Referenced by inputQuitKeysOnForm(), cx::cxMultiForm::removeQuitKey(), setKeyFunction(), setKeyFunction(), and setKeyFunction().
|
virtual |
Runs the loop end function, if it's set.
Referenced by doInputLoop(), and cx::cxMultiForm::doInputLoop().
|
virtual |
Runs the loop start function, if it's set.
Referenced by doInputLoop(), and cx::cxMultiForm::doInputLoop().
|
virtual |
Scrolls (moves) the inputs in the window.
| pVScrollAmt | The amount by which to scroll vertically |
| pHScrollAmt | The amount by which to scroll horizontally |
| pRefresh | Whether or not to refresh the form (defaults to false). |
| pBringToTop | Whether or not to bring the window to the top when refreshing. Defaults to false. |
References cx::cxWindow::bottom(), cx::eBS_NOBORDER, cx::cxWindow::getBorderStyle(), mInputPositions, mInputs, numInputs(), showAllInputs(), and cx::cxWindow::top().
|
virtual |
Sets the ability of all inputs to be able to be editable.
| pCanBeEditable | If true, all inputs can be set editable. If false, all inputs will always be read-only. |
References mInputs.
| void cx::cxForm::setAllColors | ( | e_cxColors | pLabelColor, |
| e_cxColors | pValueColor | ||
| ) |
Sets the label & value colors of all inputs on the form.
| pLabelColor | The color to set for the labels |
| pValueColor | The color to set for the values |
References cx::eDATA, cx::eLABEL, and mInputs.
Referenced by formInputColors().
|
virtual |
Sets the input kind for all inputs on the form.
| pInputOption | The new input kind |
| pRefresh | Whether or not to refresh the input on the screen, since its visual attributes will be changed. Defaults to true. |
References cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eINPUT_EDITABLE, and mInputs.
Referenced by setAllInputsReadOnly().
| void cx::cxForm::setAllLabelColor | ( | e_cxColors | pColor | ) |
|
virtual |
Sets a function to be run whenever a key is pressed, in all.
inputs on the form.
| pFunction | The function to be run |
|
virtual |
Sets a function to be run whenever a key is pressed, in all.
inputs on the form.
| pFunction | The function to be run - Must have this signature: string func() |
References mInputs.
|
virtual |
Sets a function to be run whenever a key is pressed, in all.
inputs on the form.
| pFunction | The function to be run - Must have this 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 mInputs.
|
virtual |
Sets a function to be run whenever a key is pressed, in all.
inputs on the form.
| pFunction | The function to be run - Must have this 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 mInputs.
|
virtual |
Sets whether the form should allow the user to exit.
| pAllowExit | If true, the user will be able to exit out of the form; if false, the user won't be able to exit. |
|
virtual |
Sets whether the form should allow the user to quit.
| pAllowQuit | If true, the user will be able to quit out of the form; if false, the user won't be able to quit. |
Referenced by cxFormNoQuit().
| void cx::cxForm::setAllValueColor | ( | e_cxColors | pColor | ) |
Sets the color of the value section of all inputs on the form.
| pColor | The color to set |
References mInputs.
Referenced by borderlessForm().
| void cx::cxForm::setApplyAttrDefaults | ( | bool | pApplyAttrDefaults | ) |
Sets whether to apply the default attributes to the inputs when.
appending inputs.
| pApplyAttrDefaults | A boolean value (true/false) |
|
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. For eLABEL, eDATA_READONLY, and eDATA_EDITABLE,
the attribute is set in all inputs on the form. Other item
types are set in the form window.
| 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::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eLABEL, mInputs, and cx::cxWindow::setAttr().
Referenced by attributesSetter().
|
virtual |
Sets whether the form should automatically exit when the user.
presses enter/tab/etc. on the last field.
| pAutoExit | true/false; whether the form should automatically exit |
Referenced by borderlessForm(), cxFormAppendPair(), cxFormAssignment(), cxFormClearOnlyEditable(), cxFormMultiLineInputFunctionKeyNoValidator(), cxFormNoQuit(), cxFormStartAtFirstInput(), enableDisableForm(), form(), formChangeInputFocusWhileModal(), formDataChanged(), formFunctionKeyNoOnLeave(), formWithMenu(), inputQuitKeysOnForm(), itemSales(), keyFunctionAutoExitOnLastFormInput(), loneInputWithLoopDisabledOnForm(), multiForm(), multiForm2(), and testFormReadOnly().
|
virtual |
Sets whether an input can be set editable (by label/name). For.
example, if this is called with false, then the input will be
set read-only, and any calls to setInputOption() with eINPUT_EDITABLE,
which would normally set it editable, will not set it editable.
| pLabel | The label/name of the input |
| pCanBeEditable | If true, the can be set editable. If false, the input will always be read-only. |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Sets whether an input can be set editable (by index). If.
this is called with false, then the input will be set
read-only, and any calls to setInputOption() with eINPUT_EDITABLE, which
would normally set it editable, will not set it editable.
| pIndex | The index of the input |
| pCanBeEditable | If true, the can be set editable. If false, the input will always be read-only. |
References cx::eINPUT_EDITABLE, cx::eINPUT_READONLY, mInputs, and setInputOption().
Referenced by form().
|
virtual |
Setter for whether or not data should be considered changed.
| pDataChanged | Whether or not data should be considered changed (true/false) |
Reimplemented in cx::cxMultiForm.
Referenced by cx::cxMultiForm::setChanged(), and cx::cxMultiLineInput::setValue().
|
overridevirtual |
Sets the color of one of the window items. For label & value.
colors, sets those colors on all the inputs on the form; for
any other colors, sets those on the form.
| 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::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eLABEL, mInputs, and cx::cxWindow::setColor().
|
virtual |
Changes which input on the form should have focus (by label/name).
| pLabel | The label/name of which input on the form should get focus |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Changes which input on the form should have focus (by index).
| pIndex | The index of the input that should have focus. If this is out of bounds, or if the input is not editable, then nothing will be changed. |
References isEditable(), mCurrentInput, mInputs, and cx::cxWindow::mIsModal.
Referenced by doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxMultiLineInput::exitNow(), and cx::cxMultiLineInput::quitNow().
|
virtual |
References mCurrentInput, mInputs, cx::cxWindow::mIsModal, and numInputs().
|
virtual |
Changes which input on the form should have focus (by pointer).
| pInput | A pointer to the input on the form that should have focus. |
|
overridevirtual |
Sets whether the window should disable the cursor.
when it's shown (this is the default behavior).
| pDisableCursorOnShow | Whether or not to disable the cursor when shown |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References mInputs, and cx::cxWindow::setDisableCursorOnShow().
Referenced by cx::cxMultiForm::setDisableCursorOnShow().
|
overridevirtual |
Enables or disables the form. Enabling/disabling a.
cxForm consequently also enables/disables all the inputs
on the form.
| pEnabled | Whether the form should be enabled or not (true/false) |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References mInputs, and cx::cxWindow::setEnabled().
Referenced by enableDisableForm(), and cx::cxMultiForm::setEnabled().
|
virtual |
Sets whether the form should exit when the user leaves.
the first input going backwards.
| pExitOnLeaveFirst | If true, the form will exit its showModal() when the user leaves the first input going backwards (normally, the form doesn't exit). |
|
virtual |
Sets the extended help for one of the inputs (by label/name).
| pIDStr | The label/name of the input |
| pExtendedHelp | The extended help text to set in the input |
| pIsLabel | If true (default), then pIDStr will specify the label of the input. Otherwise, pIDStr will specify the name of the input. |
|
virtual |
Sets the extended help for one of the inputs (by index).
| pIndex | The index of the input |
| pExtendedHelp | The extended help text to set in the input |
|
virtual |
Sets a single key to use to display extended help for all.
inputs.
| pKey | A key to use to display extended help for the inputs |
References addExtendedHelpKey(), and clearExtendedHelpKeys().
Referenced by cxFormExtendedHelpKey().
|
virtual |
Sets a function to be executed via a keypress for one of the fields (by label). This version adds a pointer to a function with this signature: string func(void*, void*, void*, void*). Note that functions added with this method take precedence over functions with 2 void parameters.
| pLabel | The label of the input to add the function to |
| pFunctionKey | The key for the input to use to fire the function. |
| pFieldFunction | The function to add. |
| pExitAfterRun | Whether or not this field should exit from the input loop once the function is done. |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
Referenced by allFormInputsGoReadOnly(), and formWithFKeys().
|
virtual |
Sets a function to be executed via a keypress for one of the fields (by label).
| pLabel | The label of the input to add the function to |
| pFunctionKey | The key for the input to use to fire the function. |
| pFieldFunction | The name of the function to add. It must match this signature: string func(void*, void*) |
| p1 | A pointer to the first parameter to use in the function |
| p2 | A pointer to the second parameter to use in the function |
| pUseVal | Whether or not the function's return value should be set as the value in the field. |
| pExitAfterRun | Whether or not this field should exit from the input loop once the function is done. |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Sets a function to be executed via a keypress for one of the fields (by label). This version adds a pointer to a function with this signature: string func(void*, void*, void*, void*). Note that functions added with this method take precedence over functions with 2 void parameters.
| pLabel | The label of the input to add the function to |
| pFunctionKey | The key for the input to use to fire the function. |
| pFieldFunction | The name of the function to add. It must match this signature: string func(void*, void*, void*, void*) |
| p1 | A pointer to the first parameter to use in the function |
| p2 | A pointer to the second parameter to use in the function |
| p3 | A pointer to the 3rd parameter to use in the function |
| p4 | A pointer to the 4th parameter to use in the function |
| pUseVal | Whether or not the function's return value should be set as the value in the field. |
| pExitAfterRun | Whether or not this field should exit from the input loop once the function is done. |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Sets a function to be executed via a keypress for one of the fields (by index).
| pIndex | The index of the input to add the function to |
| pFunctionKey | The key for the input to use to fire the function. |
| pFieldFunction | The function to add. |
|
virtual |
Sets a function to be executed via a keypress for one of the fields (by index).
| pIndex | The index of the input to add the function to |
| pFunctionKey | The key for the input to use to fire the function. |
| pFieldFunction | The name of the function to add. It must match this signature: string func(void*, void*) |
| p1 | A pointer to the first parameter to use in the function |
| p2 | A pointer to the second parameter to use in the function |
| pUseVal | Whether or not the function's return value should be set as the value in the field. |
| pExitAfterRun | Whether or not this field should exit from the input loop once the function is done. |
|
virtual |
Sets a function to be executed via a keypress for one of the fields (by index). This version adds a pointer to a function with this signature: string func(void*, void*, void*, void*). Note that functions added with this method take precedence over functions with 2 void parameters.
| pIndex | The index of the input to add the function to |
| pFunctionKey | The key for the input to use to fire the function. |
| pFieldFunction | The name of the function to add. It must match this signature: string func(void*, void*) |
| p1 | A pointer to the first parameter to use in the function |
| p2 | A pointer to the second parameter to use in the function |
| p3 | A pointer to the 3rd parameter to use in the function |
| p4 | A pointer to the 4th parameter to use in the function |
| pUseVal | Whether or not the function's return value should be set as the value in the field. |
| pExitAfterRun | Whether or not this field should exit from the input loop once the function is done. |
|
virtual |
Sets a field label (by name)
| pName | The name of the field |
| pLabel | The label to be set in the field |
|
virtual |
Sets a field label (by index)
| pIndex | The index of the field |
| pLabel | The label to be set in the field |
|
virtual |
Sets a field name (by label)
| pLabel | The label of the field |
| pName | The name to be set in the field |
|
virtual |
Sets a field name (by index)
| pIndex | The index of the field |
| pName | The name to be set in the field |
|
virtual |
Sets the hotkey to be used to bring up the menu to choose.
which input to jump to.
| pInputJumpKey | The hotkey to use |
References mInputs, and numInputs().
|
virtual |
Sets the input kind for one of the inputs (by label/name).
| pLabel | The label/name of the input |
| pInputOption | The new input kind |
| pIsLabel | If true (default), pLabel specifies the label. If false, pLabel specifies the name of the input. |
| pRefresh | Whether or not to refresh the input on the screen, since its visual attributes will be changed. Defaults to true. |
|
virtual |
Sets the input kind for one of the inputs (by index).
| pIndex | The index of the input |
| pInputOption | The new input kind |
| pRefresh | Whether or not to refresh the input on the screen, since its visual attributes will be changed. Defaults to true. |
References cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eINPUT_EDITABLE, getInputOption(), cx::cxWindow::isAbove(), lookForEditableInputs(), and mInputs.
Referenced by cxFormClearOnlyEditable(), setCanBeEditable(), and testFormReadOnly().
|
protectedvirtual |
Sets whether the form is modal or not.
| pIsModal | true if the form is modal, or false if not. |
References cx::cxWindow::mIsModal.
Referenced by cx::cxMultiForm::copyCxMultiFormStuff(), and cx::cxMultiForm::cxMultiForm().
|
virtual |
Sets a function to be called when a key is pressed.
| pIndex | The index of the input on the form |
| pLabel | The label/name of the input |
| pFunction | The function to call. This can be an instance of one of the derived cxFunction classes as well. |
| pIsLabel | If true (default), pLabel is the input's label. If false, pLabel is the input's name. |
|
virtual |
Adds a function to call when the user presses some key for.
one of the inputs (by label/name).
| pLabel | The label/name of the input |
| pKey | The keypress to fire the function |
| pFunction | The function to be run - Must have this signature: string func(void*, void*) |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxForm, but could be useful for deriving classes - this is here so that setKeyFunction() in cxWindow will be overridden). Defaults to false. |
| pExitAfterRun | Whether or not to exit the form after running the function (defaults to false) |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
| pIsLabel | If true (default), pLabel is the input's label. If false, pLabel is the input's name. |
|
virtual |
Adds a function to call when the user presses some key for.
one of the inputs (by label/name).
| pLabel | The label/name of the input |
| pKey | The keypress to fire the function |
| pFunction | The function to be run - Must have this 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 |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxForm, but could be useful for deriving classes - this is here so that setKeyFunction() in cxWindow will be overridden). Defaults to false. |
| pExitAfterRun | Whether or not to exit the form after running the function (defaults to false) |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
| pIsLabel | If true (default), pLabel is the input's label. If false, pLabel is the input's name. |
|
virtual |
Adds a function to call when the user presses some key for.
one of the inputs (by label/name).
| pLabel | The label/name of the input |
| pKey | The keypress to fire the function |
| pFunction | The function to be run - Must have this 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 |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxForm, but could be useful for deriving classes - this is here so that setKeyFunction() in cxWindow will be overridden). Defaults to false. |
| pExitAfterRun | Whether or not to exit the form after running the function (defaults to false) |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
| pIsLabel | If true (default), pLabel is the input's label. If false, pLabel is the input's name. |
|
virtual |
Sets a function to be called when a key is pressed.
| pIndex | The index of the input on the form |
| pKey | The key to use for the function |
| pFunction | The function to call. This can be an instance of one of the derived cxFunction classes as well. |
|
virtual |
Adds a function to call when the user presses some key for.
one of the inputs (by index).
| pIndex | The index of the input on the form |
| pKey | The keypress to fire the function |
| pFunction | The function to be run - Must have this signature: string func() |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxForm, but could be useful for deriving classes - this is here so that setKeyFunction() in cxWindow will be overridden). Defaults to false. |
| pExitAfterRun | Whether or not to exit the form after running the function (defaults to false) |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
| pIsLabel | If true (default), pLabel is the input's label. If false, pLabel is the input's name. |
References mInputs.
|
virtual |
Adds a function to call when the user presses some key for.
one of the inputs (by index).
| pIndex | The index of the input on the form |
| pKey | The keypress to fire the function |
| pFunction | The function to be run - Must have this 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 |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxForm, but could be useful for deriving classes - this is here so that setKeyFunction() in cxWindow will be overridden). Defaults to false. |
| pExitAfterRun | Whether or not to exit the form after running the function (defaults to false) |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
| pIsLabel | If true (default), pLabel is the input's label. If false, pLabel is the input's name. |
References mInputs.
|
virtual |
Adds a function to call when the user presses some key for.
one of the inputs (by index).
| pIndex | The index of the input on the form |
| pKey | The keypress to fire the function |
| pFunction | The function to be run - Must have this 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 |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxForm, but could be useful for deriving classes - this is here so that setKeyFunction() in cxWindow will be overridden). Defaults to false. |
| pExitAfterRun | Whether or not to exit the form after running the function (defaults to false) |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
| pIsLabel | If true (default), pLabel is the input's label. If false, pLabel is the input's name. |
References mInputs.
|
overridevirtual |
Sets a function to be called when a key is pressed.
| pKey | The key to use for the function |
| pFunction | The function to call. This can be an instance of one of the derived cxFunction classes as well. |
Reimplemented from cx::cxWindow.
Referenced by addInputJumpKey(), cxFormMultiLineInputFunctionKeyNoValidator(), formFunctionKeyNoOnLeave(), formFunctionKeys(), formUpArrowFunction(), formWithFKeys(), getFormKeys(), cx::cxMultiForm::setKeyFunction(), cx::cxMultiForm::setKeyFunction(), and cx::cxMultiForm::setKeyFunction().
|
overridevirtual |
Adds a function to call when the user presses some key.
| pKey | The keypress to fire the function |
| pFunction | The function to be run - Must have signature string func() |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxForm, but could be useful for deriving classes - this is here so that setKeyFunction() in cxWindow will be overridden). Defaults to false. |
| pExitAfterRun | Whether or not to exit the form after running the function (defaults to false) |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References mInputs, removeExitKey(), removeQuitKey(), and cx::cxWindow::setKeyFunction().
|
overridevirtual |
Adds a function to call when the user presses some key.
| pKey | The keypress to fire the function |
| pFunction | The function to be run - 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 |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxForm, but could be useful for deriving classes - this is here so that setKeyFunction() in cxWindow will be overridden). Defaults to false. |
| pExitAfterRun | Whether or not to exit the form after running the function (defaults to false) |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References mInputs, removeExitKey(), removeQuitKey(), and cx::cxWindow::setKeyFunction().
|
overridevirtual |
Adds a function to call when the user presses some key.
| pKey | The keypress to fire the function |
| pFunction | The function to be run - 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 |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxForm, but could be useful for deriving classes - this is here so that setKeyFunction() in cxWindow will be overridden). Defaults to false. |
| pExitAfterRun | Whether or not to exit the form after running the function (defaults to false) |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References mInputs, removeExitKey(), removeQuitKey(), and cx::cxWindow::setKeyFunction().
| void cx::cxForm::setLabelColor | ( | const int & | pIndex, |
| e_cxColors | pColor | ||
| ) |
Sets the color of the label of one of the inputs (by index)
| pIndex | The index of the input whose label color to set |
| pColor | The color to set |
References mInputs.
Referenced by formInputColors().
| void cx::cxForm::setLabelColor | ( | const std::string & | pLabel, |
| e_cxColors | pColor, | ||
| bool | pIsLabel = true |
||
| ) |
Sets the color of the label of one of the inputs (by label/name)
| pLabel | The label/name of the input whose label color to set |
| pColor | The color to set |
| pIsLabel | If true (default), pLabel is the input's label. If false, pLabel is the input's name. |
|
overridevirtual |
Sets the last keypress.
| pLastKey | The last keypress |
Reimplemented from cx::cxWindow.
References cx::cxWindow::setLastKey(), and setLastKey().
Referenced by cx::cxMultiForm::copyCxMultiFormStuff(), doCurrentInput(), doInputLoop(), cx::cxMultiForm::doInputLoop(), setLastKey(), and cx::cxMultiLineInput::setLastKey().
|
virtual |
Sets a function to be run at the end of each.
cycle through the input loop. The return value
of the function is not used.
| pFuncPtr | A pointer to the function |
|
virtual |
Sets a function to be run at the start of each.
input loop. The return value of the function is
not used.
| pFuncPtr | A pointer to the function |
| bool cx::cxForm::setMaskChar | ( | const std::string & | pLabel, |
| char | pMaskChar, | ||
| bool | pIsLabel = true |
||
| ) |
Sets the masking character for an input (by label).
| pLabel | The label of the input |
| pMaskChar | The character to use for masking |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
| bool cx::cxForm::setMaskChar | ( | int | pIndex, |
| char | pMaskChar | ||
| ) |
Sets the masking character for an input (by index).
| pIndex | The index of the input |
| pMaskChar | The character to use for masking |
References mInputs.
|
overridevirtual |
Sets the form window's "on focus" function.
| pFunction | The function to be run |
Reimplemented from cx::cxWindow.
Referenced by cxInputOnFormLoopDisabled(), and main().
|
virtual |
Sets the "on focus" function pointer for a field (by label). The function must have this signature: string func(void*, void*, void*, void*).
| pLabel | The label of the field |
| pFunction | The function to be run - Must have this signature: string func(void*, void*, void*, void*) |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Sets the "on focus" function pointer for a field (by label). The function must have this signature: string func(void*, void*, void*, void*).
| pLabel | The label of the field |
| pFunction | The function to be run - Must have this 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 |
| pUseVal | Whether or not the function's return value should be set as the value in the field |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
overridevirtual |
Sets a function to be run when focus is gained (at.
the start of setFocus() or showModal(). The return
value of the function is not used.
| pFuncPtr | A pointer to the function - Must have the signature string someFunc(). |
| pUseVal | Whether or not the function's return value should be set as the value in the field (defaults to false) |
| pExitAfterRun | Whether or not to exit after the function runs (defaults to false; if true, the input loop won't be started). |
Reimplemented from cx::cxWindow.
References cx::cxWindow::setOnFocusFunction().
|
overridevirtual |
Sets a function to be run when focus is gained (at.
the start of setFocus() or showModal(). The return
value of the function is not used.
| pFuncPtr | A pointer to the function - Must have the signature string someFunc(void*, void). |
| p1 | A pointer to the first argument |
| p2 | A pointer to the 2nd argument |
| pUseVal | Whether or not the function's return value should be set as the value in the field (defaults to false) |
| pExitAfterRun | Whether or not to exit after the function runs (defaults to false; if true, the input loop won't be started). |
Reimplemented from cx::cxWindow.
References cx::cxWindow::setOnFocusFunction().
|
overridevirtual |
Sets a function to be run when focus is gained (at.
the start of setFocus() or showModal(). The return
value of the function is not used.
| pFuncPtr | A pointer to the function - Must have the signature string someFunc(void*, void*, void*, void). |
| p1 | A pointer to the first argument |
| p2 | A pointer to the 2nd argument |
| p3 | A pointer to the 3rd argument |
| p4 | A pointer to the 4th argument |
| pUseVal | Whether or not the function's return value should be set as the value in the field (defaults to false) |
| pExitAfterRun | Whether or not to exit after the function runs (defaults to false; if true, the input loop won't be started). |
Reimplemented from cx::cxWindow.
References cx::cxWindow::setOnFocusFunction().
|
virtual |
Sets the "on focus" function pointer for a field (by index). The function must have this signature: string func(void*, void*, void*, void*).
| pIndex | The index of the field |
| pFunction | The function to be run - Must have signature string func(void*, void*, void*, void*) |
|
virtual |
Sets the "on focus" function pointer for a field (by index). The function must have this signature: string func(void*, void*, void*, void*).
| pIndex | The index of the field |
| pFunction | The function to be run - 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 |
| pUseVal | Whether or not the function's return value should be set as the value in the field |
References mInputs.
|
virtual |
Sets a function to be run whenever a key is pressed in an.
input (by label/name). Note: If there are multiple inputs with
the same label/name, all of them will be affected.
| pLabel | The label/name of the input |
| pFunction | The function to be run |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Sets a function to be run whenever a key is pressed in an.
input (by label/name). Note: If there are multiple inputs with
the same label/name, all of them will be affected.
| pLabel | The label/name of the input |
| pFunction | The function to be run - Must have this signature: string func(void*, void*) |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Sets a function to be run whenever a key is pressed in an.
input (by label/name). Note: If there are multiple inputs with
the same label/name, all of them will be affected.
| pLabel | The label/name of the input |
| pFunction | The function to be run - Must have this 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 |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Sets a function to be run whenever a key is pressed in an.
input (by label/name). Note: If there are multiple inputs with
the same label/name, all of them will be affected.
| pLabel | The label/name of the input |
| pFunction | The function to be run - Must have this 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 |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Sets a function to be run whenever a key is pressed in an input (by index).
| pIndex | The index of the input |
| pFunction | The function to be run |
Referenced by comboBoxOnForm(), cxFormAssignment(), floatingPtValidateOnForm(), form(), and integerValidateOnForm().
|
virtual |
Sets a function to be run whenever a key is pressed in an input (by index).
| pIndex | The index of the input |
| pFunction | The function to be run - Must have this 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 |
References mInputs.
|
virtual |
Sets a function to be run whenever a key is pressed in an input (by index).
| pIndex | The index of the input |
| pFunction | The function to be run - Must have this 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 mInputs.
|
virtual |
Sets a function to be run whenever a key is pressed in an input (by index).
| pIndex | The index of the input |
| pFunction | The function to be run - Must have this 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 mInputs.
|
overridevirtual |
Sets the form window's "on leave" function.
| pFunction | The function to be run |
Reimplemented from cx::cxWindow.
Referenced by cxFormMultiLineInputFunctionKeyNoValidator(), cxInputOnFormLoopDisabled(), formFunctionKeyNoOnLeave(), formUpArrowFunction(), formWithFKeys(), inputQuitKeysOnForm(), and setValFunc().
|
virtual |
Sets the "on leave" function pointer for a field (by label/name). The function must have this signature: string func(void*, void*, void*, void*).
| pLabel | The label/name of the field |
| pFunction | The function to be run - Must have signature string func(void*, void*, void*, void*) |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Sets the "on leave" function pointer for a field (by label/name). The function must have this signature: string func(void*, void*, void*, void*).
| pLabel | The label/name of the field |
| pFunction | The function to be run - 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 |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
overridevirtual |
Sets a function to be run when focus is lost.
The return value of the function is not used.
| pFuncPtr | A pointer to the function - Must have the signature string someFunc(). |
| p1 | A pointer to the first argument |
| p2 | A pointer to the 2nd argument |
Reimplemented from cx::cxWindow.
References cx::cxWindow::setOnLeaveFunction().
|
overridevirtual |
Sets a function to be run when focus is lost.
The return value of the function is not used.
| pFuncPtr | A pointer to the function - Must have the signature string someFunc(void*, void). |
| p1 | A pointer to the first argument |
| p2 | A pointer to the 2nd argument |
Reimplemented from cx::cxWindow.
References cx::cxWindow::setOnLeaveFunction().
|
overridevirtual |
Sets a function to be run when focus is lost.
The return value of the function is not used.
| pFuncPtr | A pointer to the function - Must have the signature string someFunc(void*, void*, void*, void). |
| p1 | A pointer to the first argument |
| p2 | A pointer to the 2nd argument |
| p3 | A pointer to the 3rd argument |
| p4 | A pointer to the 4th argument |
Reimplemented from cx::cxWindow.
References cx::cxWindow::setOnLeaveFunction().
|
virtual |
Sets the "on leave" function pointer for a field (by index). The function must have this signature: string func(void*, void*, void*, void*).
| pIndex | The index of the field |
| pFunction | The function to be run - 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 |
|
virtual |
Sets the "on leave" function pointer for a field (by index). The function must have this signature: string func(void*, void*, void*, void*).
| pIndex | The index of the field |
| pFunction | The function to be run - 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 mInputs.
|
virtual |
Sets the parent cxMultiForm that this cxForm is associated with.
| pParentMultiForm | A pointer to the form's parent cxMultiForm (or nullptr if there is no parent cxMultiForm) |
|
virtual |
Sets whether or not to always start at the first editable.
input when showModal() is called.
| pStartAtFirstInput | Whether or not to always start at the first editable input when showModal() is called. |
References mStartAtFirstInput.
Referenced by cxFormStartAtFirstInput().
|
overridevirtual |
Mutator for the status line text. After this method.
is called, the status provided with this method will
be used instead of the help messages from the inputs.
| pStatus | The new status message for window |
| pRefreshStatus | Whether or not to refresh the status area (defaults to true) |
Reimplemented from cx::cxWindow.
References cx::cxWindow::setStatus().
Referenced by attributesSetter(), copyCxFormStuff(), doInputLoop(), and testFormReadOnly().
|
virtual |
Sets whether or not to use the extended help keys.
| pUseExtendedHelpKey | Whether or not to use the extended help keys (true/false) |
References mInputs.
Referenced by cxFormExtendedHelpKey().
|
virtual |
Sets a validator function to be run before focus is lost for one.
of the inputs (by label/name).
| pLabel | The label/name of the input |
| pFunction | The function to be run |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Sets a validator function to be run before focus is lost for one.
of the inputs (by label/name).
| pLabel | The label/name of the input |
| pFunction | The function to be run - 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 |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Sets a validator function to be run before focus is lost for one.
of the inputs (by index).
| pIndex | The index of the input |
| pFunction | The function to be run |
Referenced by formWithInputValueValidator(), and inputQuitKeysOnForm().
|
virtual |
Sets a validator function to be run before focus is lost for one.
of the inputs (by index).
| pIndex | The index of the input |
| pFunction | The function to be run - 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 mInputs.
|
virtual |
Sets the value of an input (by label/name).
| pLabel | The label/name of the input |
| pValue | The new string value for the input |
| pIsLabel | If true (default), pLabel specifies the label of the input. If false, pLabel specifies the name of the input. |
| pRefresh | Whether or not to refresh the input (defaults to false) |
Reimplemented in cx::cxMultiForm.
|
virtual |
Sets the value of an input (by index).
| pIndex | The index of the input |
| pValue | The value to be placed at that index. |
| pRefresh | Whether or not to refresh the input (defaults to false) |
Reimplemented in cx::cxMultiForm.
Referenced by attributesSetter(), cxFormAssignment(), cxFormClearOnlyEditable(), form(), formInputColors(), main(), setValFunc(), and setValues().
| void cx::cxForm::setValueColor | ( | const int & | pIndex, |
| e_cxColors | pColor | ||
| ) |
Sets the color of the value section of one of the inputs (by index)
| pIndex | The index of the input whose value color to set |
| pColor | The color to set |
References mInputs.
Referenced by formInputColors().
| void cx::cxForm::setValueColor | ( | const std::string & | pLabel, |
| e_cxColors | pColor, | ||
| bool | pIsLabel = true |
||
| ) |
Sets the color of the value section of one of the inputs (by label/name)
| pLabel | The label/name of the input whose value color to set |
| pColor | The color to set |
| pIsLabel | If true (default), pLabel is the input's label. If false, pLabel is the input's name. |
|
virtual |
Sets the values in the form with a map of input labels/names.
and values.
| pValues | A map of input labels/names and values to be set in the form. |
| pUseLabels | If true (default), the map keys will be used as input labels; if false, the map keys will be used as input names. |
| pRefresh | Whether or not to refresh the inputs after setting their values. Defaults to false. |
| pDisableValidatorFunctions | Whether or not to temporarily disable each input's validator function before setting its value. This can be useful if you want to set the values to some defaults, but the default values would normally be considered invalid. |
References getInput(), getInputIndex(), and setValue().
|
virtual |
Toggles whether or not the form should wait for.
user input if there are no editable inputs.
| pWaitForInputIfEmpty | Whether or not the form should wait for user input if there are no editable inputs. |
|
overridevirtual |
Shows the form.
| pBringToTop | Whether or not to bring this window to the top. Defaults to false. |
| pShowSubwindows | Whether or not to show sub-windows also. Defaults to true. |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References cx::cxID_EXIT, cx::cxWindow::getShowSelfBeforeSubwins(), hide(), cx::cxWindow::isEnabled(), cx::cxWindow::show(), and showAllInputs().
Referenced by attributesSetter(), move(), cx::cxMultiForm::show(), showModal(), and testFormReadOnly().
|
virtual |
Shows (refreshes) all inputs.
| pBringToTop | Whether or not to bring the inputs to the top (defaults to true) |
| pSkipCurrentInput | Whether or not to skip the current input (defaults to false) |
References cx::cxWindow::bottom(), cx::eBS_NOBORDER, cx::cxWindow::getBorderStyle(), cx::cxWindow::isAbove(), cx::cxWindow::left(), mCurrentInput, mInputPositions, mInputs, numInputs(), cx::cxWindow::right(), and cx::cxWindow::top().
Referenced by scrollInputs(), and show().
|
virtual |
Toggles whether to show inputs if they're on.
a border if the form has a border.
| pShowInputsOnBorder | Whether or not to show inputs if they're on a border |
References cx::eBS_NOBORDER, and cx::cxWindow::getBorderStyle().
|
overridevirtual |
Shows the form and waits for input.
| pShowSelf | Whether or not to show the window before running the input loop. Defaults to true. |
| pBringToTop | Whether or not to bring this window to the top. Defaults to false. |
| pShowSubwindows | Whether or not to show sub-windows also. Defaults to true. |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References cx::cxID_EXIT, doInputLoop(), cx::cxWindow::getLeaveNow(), cx::cxWindow::getReturnCode(), cx::cxWindow::isEnabled(), cx::cxWindow::mIsModal, cx::cxWindow::runOnFocusFunction(), cx::cxWindow::runOnLeaveFunction(), cx::cxWindow::setReturnCode(), and show().
Referenced by allFormInputsGoReadOnly(), borderlessForm(), comboBoxOnForm(), cxFormAppendComboBoxPair(), cxFormAppendPair(), cxFormAssignment(), cxFormClearOnlyEditable(), cxFormExtendedHelpKey(), cxFormMouseFunctionTest(), cxFormMultiLineInputFunctionKeyNoValidator(), cxFormNoQuit(), cx::cxFormShowModal(), cxFormStartAtFirstInput(), cxInputOnFormLoopDisabled(), cxMultiLineInputWithRightLabelOnForm(), enableDisableForm(), floatingPtValidateOnForm(), form(), formChangeInputFocusWhileModal(), formDataChanged(), formFunctionKeyNoOnLeave(), formFunctionKeys(), formInputColors(), formUpArrowFunction(), formWithFKeys(), formWithInputValueValidator(), formWithMenu(), inputQuitKeysOnForm(), inputWithoutBorder(), integerValidateOnForm(), itemSales(), keyFunctionAutoExitOnLastFormInput(), loneInputWithLoopDisabledOnForm(), main(), setValFunc(), simpleForm1(), stackedFormScrolling(), stackedFormScrolling2(), testFormPos(), and testFormReadOnly().
|
virtual |
Swaps the order of 2 inputs (by index). If both indexes.
are the same, or one or both is out of bounds, nothing
will be changed. This does not refresh the screen.
| pInput1Index | The index of the first input |
| pInput2Index | The index of the second input |
References mInputs.
|
virtual |
Swaps the order of 2 inputs (by pointer). If both pointers.
are the same, or one or both don't exist in the panel, nothing
will be changed. This does not refresh the screen.
| pInput1 | A pointer to the first input |
| pInput2 | A pointer to the second input |
|
virtual |
Sets whether or not the onKey function for all inputs should.
run.
| pRunOnKeyFunction | Whether or not the onKey function should run (for all inputs) |
References mInputs.
|
virtual |
Toggles the display of the cursor on all inputs.
| pShowCursor | Whether or not the cursor should be shown on all inputs (true/false). |
References mInputs.
|
virtual |
Toggles the display of the cursor for an input (by label/name).
| pLabel | The label/name of the input for which to toggle the cursor display. |
| pShowCursor | Whether or not the input should show the cursor (true/false). |
| pIsLabel | If true, pLabel specifies the label; if false, pLabel specifies the name of the input. |
|
virtual |
Toggles the display of the cursor for an input (by index).
| pIndex | The index of the input for which to toggle the cursor display. |
| pShowCursor | Whether or not the input should show the cursor (true/false). |
References mInputs.
|
virtual |
Enables/disables masking for an input (by label).
| pLabel | The label of the input |
| pMasking | Whether or not the input should be masked (true/false) |
| pIsLabel | True if pStr is the label (default), or false if pStr is the name |
|
virtual |
Enables/disables masking for an input (by index).
| pIndex | The index of the input |
| pMasking | Whether or not the input should be masked (true/false) |
References mInputs.
Referenced by formInputColors().
|
virtual |
Sets whether or not an onKey function should run for one of the.
inputs on the form (by label/name). Note: If there are
multiple inputs with the same label/name, they all will be
affected.
| pLabel | The label/name of the input |
| pRunOnKeyFunction | Whether or not the input's onKey function should run |
| pIsLabel | If true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input. |
|
virtual |
Sets whether or not an onKey function should run for one of the.
inputs on the form (by index).
| pIndex | The index of the input |
| pRunOnKeyFunction | Whether or not the input's onKey function should run |
References mInputs.
|
virtual |
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. |
References mTrapNonAssignedFKeys.
|
overridevirtual |
Un-hides the form (along with all the inputs).
| pUnhideSubwindows | Whether or not to also unhide the subwindows (defaults to true) |
Reimplemented from cx::cxWindow.
Reimplemented in cx::cxMultiForm.
References cx::cxWindow::isEnabled(), mInputs, and cx::cxWindow::unhide().
Referenced by cx::cxMultiForm::unhide().
|
virtual |
Toggles whether or not to use the status text of the inputs.
as the status text for the form (in the bottom border) when
the inputs gain focus. This is useful for inputs that have
help text.
| pUseInputStatus | Whether or not to use the status text of the inputs as the status text of the form. |
References cx::eBS_NOBORDER, cx::cxWindow::getBorderStyle(), cx::cxWindow::height(), cx::cxWindow::isEnabled(), cx::cxWindow::isHidden(), cx::cxWindow::mWindow, and cx::cxWindow::width().
|
virtual |
Sets whether or not the validator function should run for an.
input when the user presses the input jump key. If not, the
user will always be able to jump from that input, whether or
not the input is valid.
| pID | The label/name of the input |
| pValidate | If true, then the input will do validation when the user presses the jump key (possibly not allowing the user to jump if the input is not valid). If false, the user will be able to jump from the input whether or not the input is valid. |
| pIsLabel | If true (default), then pID specifies the input label. If false, then pID specifies the input name. |
|
virtual |
Sets whether or not the validator function should run for an.
input when the user presses the input jump key. If not, the
user will always be able to jump from that input, whether or
not the input is valid.
| pIndex | The index of the input |
| pValidate | If true, then the input will do validation when the user presses the jump key (possibly not allowing the user to jump if the input is not valid). If false, the user will be able to jump from the input whether or not the input is valid. |
References mInputs.
|
friend |
|
friend |
|
friend |
|
protected |
|
protected |
Referenced by append(), copyCxFormStuff(), move(), remove(), remove(), scrollInputs(), and showAllInputs().
|
protected |
Referenced by addAttr(), addExitKey(), addExtendedHelpKey(), addInputJumpKey(), addQuitKey(), allFieldsBlank(), allValidateOnJumpKey(), anyInputsCanBeEditable(), append(), bringToTop(), canBeEditable(), clearExtendedHelpKeys(), clearInputs(), clearKeyFunction(), copyCxFormStuff(), cxForm(), doCurrentInput(), doInputLoop(), enableInputLoop(), firstEditableInput(), getAttrs(), getCurrentInput(), getCurrentInputIndex(), getCurrentInputLabel(), getCurrentInputName(), getExtendedHelp(), getInput(), getInputIndex(), getInputOption(), getLabel(), getLabelColor(), getMasked(), getName(), getNavKeys(), getStatus(), getValue(), getValueColor(), getValues(), hasEditableInputs(), hasInput(), hasNavKey(), hide(), inputHeight(), inputLabel(), inputLeftCol(), inputName(), inputTopRow(), inputWidth(), isEditable(), lastEditableInput(), lookForEditableInputs(), maxInputLen(), maxValueLen(), move(), numInputs(), onKeyFunctionEnabled(), refreshInput(), remove(), remove(), removeAttr(), removeAttrs(), removeExitKey(), removeQuitKey(), scrollInputs(), setAllCanBeEditable(), setAllColors(), setAllInputOption(), setAllLabelColor(), setAllOnKeyFunction(), setAllOnKeyFunction(), setAllOnKeyFunction(), setAllValueColor(), setAttr(), setCanBeEditable(), setColor(), setCurrentInput(), setCurrentInputByPtr(), setDisableCursorOnShow(), setEnabled(), setInputJumpKey(), setInputOption(), setKeyFunction(), setKeyFunction(), setKeyFunction(), setKeyFunction(), setKeyFunction(), setKeyFunction(), setLabelColor(), setMaskChar(), setOnFocusFunction(), setOnKeyFunction(), setOnKeyFunction(), setOnKeyFunction(), setOnLeaveFunction(), setUseExtendedHelpKeys(), setValidatorFunction(), setValueColor(), showAllInputs(), swap(), toggleAllOnKeyFunction(), toggleCursor(), toggleCursor(), toggleMasking(), toggleOnKeyFunction(), unhide(), and validateOnJumpKey().
|
protected |
mStartAtFirstInput keeps track of whether or not the form
should always start at the first editable input when
showModal() is called.
Referenced by copyCxFormStuff(), doInputLoop(), getStartAtFirstInput(), and setStartAtFirstInput().
|
protected |
If mTrapNonAssignedFKeys is true, function keys that aren't.
assigned to anything won't cause the input to exit its
input loop.
Referenced by copyCxFormStuff(), doCurrentInput(), and trapNonAssignedFKeys().