cxWidgets 1.0
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
cx::cxForm Class Reference

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>

Inheritance diagram for cx::cxForm:
Inheritance graph
Collaboration diagram for cx::cxForm:
Collaboration graph

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< cxMultiLineInputappend (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< cxComboBoxappendComboBox (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< cxMultiLineInputappend (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< cxComboBoxappendComboBox (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< cxMultiLineInputappend (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< cxMultiLineInputgetInput (int pIndex) const
 Returns a pointer to an input at a given index, or nullptr if the index.
 
std::shared_ptr< cxMultiLineInputgetInput (const std::string &pLabel, bool pIsLabel=true) const
 Returns a pointer to an input with a given label/name, or.
 
std::shared_ptr< cxMultiLineInputgetCurrentInput () 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.
 
cxFormoperator= (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.
 
cxMultiFormgetParentMultiForm () 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 cxWindowgetParent () 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.
 
cxWindowgetExtTitleWindow () 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.
 
cxWindowgetExtStatusWindow () 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.
 
cxWindowoperator= (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< cxFunctiongetKeyFunction (int pKey) const
 Returns a cxFunction pointer for a key.
 
std::shared_ptr< cxFunction0getKeyFunctionAsFunction0 (int pKey) const
 Returns a cxFunction pointer for a key, casted to a cxFunction0.
 
std::shared_ptr< cxFunction2getKeyFunctionAsFunction2 (int pKey) const
 Returns a cxFunction pointer for a key, casted to a cxFunction2.
 
std::shared_ptr< cxFunction4getKeyFunctionAsFunction4 (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< cxFunctionmOnFocusFunction = nullptr
 
std::shared_ptr< cxFunctionmOnLeaveFunction = 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.
 

Detailed Description

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().

Member Typedef Documentation

◆ inputPtrContainer

typedef std::vector<std::shared_ptr<cxMultiLineInput> > cx::cxForm::inputPtrContainer
protected

Constructor & Destructor Documentation

◆ cxForm() [1/2]

cx::cxForm::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 
)
explicit

Default constructor. All parameters have default values.

Parameters
pParentWindowPointer to parent window; default nullptr
pRowY location of form; default 0
pColX location of form; default 0
pHeightHeight of form, in lines; defaults to 24
pWidthWidth of form; defaults to 80
pTitleTitle of form; defaults to empty string
pBorderStyleThe type of border to use - can be eBS_SINGLE_LINE for a single-line border or eBS_NOBORDER for no border.
pExtTitleWindowA pointer to another cxWindow in which to display the window title.
pExtStatusWindowA pointer to another cxWindow in which to display the status.
pAutoExitWhether or not to exit the form when the user tries to go to the next input from the last input. Defaults to false.
pStackedIf true, the form will behave assuming each input is on its own line.

◆ cxForm() [2/2]

cx::cxForm::cxForm ( const cxForm pThatForm)

Copy constructor

Parameters
pThatFormAnother cxForm object to be copied

References cx::cxWindow::copyCxWinStuff(), cx::height(), cx::left(), mInputs, cx::top(), and cx::width().

◆ ~cxForm()

cx::cxForm::~cxForm ( )
virtual

Destructor

References cx::cxInitialized(), and hide().

Member Function Documentation

◆ addAttr()

void cx::cxForm::addAttr ( e_WidgetItems  pItem,
attr_t  pAttr 
)
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.

Parameters
pIndexAn index of an input on the form
Returns
The index of the next editable input after pIndex. Could return -1 if there are no editable inputs, and could return the same index if the given input is the only editable 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.

Parameters
pItemThe item to add the attribute for (see the e_WidgetItems enumeration).
pAttrThe 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().

◆ addExitKey()

bool cx::cxForm::addExitKey ( int  pKey,
bool  pRunOnLeaveFunction = true,
bool  pOverride = false 
)
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.

Parameters
pKeyThe key to add
pRunOnLeaveFunctionWhether 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.
pOverrideIf true, then the key will be added as an exit key regardless if the key exists as a function key. This defaults to false.
Returns
Whether or not the key was added

Reimplemented from cx::cxWindow.

Reimplemented in cx::cxMultiForm.

References cx::cxWindow::addExitKey(), mInputs, and cx::cxWindow::removeQuitKey().

Referenced by cx::cxMultiForm::addExitKey().

◆ addExtendedHelpKey()

void cx::cxForm::addExtendedHelpKey ( int  pKey)
virtual

Adds an additional key to be used to display the extended.

help key for all inputs.

Parameters
pKeyA key to be used to display extended help

References mInputs.

Referenced by setExtendedHelpKey().

◆ addInputJumpKey() [1/2]

virtual bool cx::cxForm::addInputJumpKey ( int  pKey,
const std::string &  pLabel,
bool  pIsLabel = true 
)
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.
Parameters
pKeyThe key to use as the hotkey
pLabelThe label/name of the input to which to jump
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.
Returns
True if successful, or false if not (i.e., if that hotkey is already set up for a form function, etc.)

◆ addInputJumpKey() [2/2]

bool cx::cxForm::addInputJumpKey ( int  pKey,
int  pIndex 
)
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.

Parameters
pKeyThe key to use as the hotkey
pIndexThe index of the input to which to jump
Returns
True if successful, or false if not (i.e., if that hotkey is already set up for a form function, etc.)

References mInputs, cx::cxWindow::mKeyFunctions, and setKeyFunction().

Referenced by formChangeInputFocusWhileModal().

◆ addQuitKey()

bool cx::cxForm::addQuitKey ( int  pKey,
bool  pRunOnLeaveFunction = true,
bool  pOverride = false 
)
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.

Parameters
pKeyThe key to add
pRunOnLeaveFunctionWhether 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.
pOverrideIf true, then the key will be added as an exit key regardless if the key exists as a function key. This defaults to false.
Returns
Whether or not the key was added

Reimplemented from cx::cxWindow.

Reimplemented in cx::cxMultiForm.

References cx::cxWindow::addQuitKey(), mInputs, and cx::cxWindow::removeExitKey().

Referenced by cx::cxMultiForm::addQuitKey(), and inputQuitKeysOnForm().

◆ allFieldsBlank()

bool cx::cxForm::allFieldsBlank ( ) const

Returns whether all field values are blank.

Returns
whether or not all field values are blank

References mInputs.

◆ allValidateOnJumpKey()

void cx::cxForm::allValidateOnJumpKey ( bool  pValidate)
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.

Parameters
pValidateIf 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().

◆ anyInputsCanBeEditable()

bool cx::cxForm::anyInputsCanBeEditable ( ) const
virtual

Returns whether any input on the form (at least 1) can be set editable.

Returns
Whether or not at least 1 input on the form can be set editable.

References mInputs.

◆ append() [1/4]

shared_ptr< cxMultiLineInput > cx::cxForm::append ( const cxMultiLineInput pInput)
virtual

Appends a copy of an input to a form.

Parameters
pInputA cxMultiLineInput object to be added to the form.

References lookForEditableInputs(), cx::cxWindow::mExitKeys, mInputPositions, mInputs, cx::cxWindow::mKeyFunctions, and cx::cxWindow::mQuitKeys.

◆ append() [2/4]

virtual std::shared_ptr< cxMultiLineInput > cx::cxForm::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 
)
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.

Parameters
pHeightThe height (# of lines) of the item
pWidthThe width (# of characters) of the item
pLabelThe label to use with the input
pValidatorString to use to validate input; see README.txt for details; blank by default
pHelpStringA string to be displayed in the statusbar of the form when the input has focus
pInputOptionDefines the input option (i.e., normal, read-only, etc.); from eInputOptions enumeration in cxInput.h
pNameA name for the input (can be used as an alternative way to identify the input)
pExtValueA pointer to a string to be linked to this input and used for its value. Defaults to nullptr for none.
pRightlabelOffsetThe distance between the right edge of the input and the right label. Defaults to 0.
pRightLabelHeightThe height of the label to the right of the input (defaults to 1)
pRightLabelHeightThe 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)
pShowRightLabelWhether or not to show the right label. Defaults to false.
pInputTypeThe 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.
Returns
A pointer to the new cxMultiLineInput object that is created.

◆ append() [3/4]

virtual std::shared_ptr< cxMultiLineInput > cx::cxForm::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 
)
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.

Parameters
pRowY location of the upper-left corner of the input, relative to the form
pColX location of the upper-left corner of the input, relative to the form
pHeightThe height of the input
pWidthThe width of the input
pLabelThe label to use with the input
pValidatorString to use to validate input; see README.txt for details; blank by default
pHelpStringA string to be displayed in the statusbar of the form when the input has focus; defaults to empty string
pInputOptionDefines the input option (i.e., normal, read-only, etc.); defaults to eINPUT_EDITABLE
pNameA name for the input (can be used as an alternative way to identify the input)
pExtValueA pointer to a string to be linked to this input and used for its value. Defaults to nullptr for none.
pRightlabelOffsetThe distance between the right edge of the input and the right label. Defaults to 0.
pRightLabelHeightThe height of the label to the right of the input (defaults to 1)
pRightLabelWidthThe 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)
pShowRightLabelWhether or not to show the right label. Defaults to false.
pInputTypeThe 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.
Returns
A pointer to the new cxMultiLineInput object that is created.

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().

◆ append() [4/4]

virtual void cx::cxForm::append ( std::shared_ptr< cxMultiLineInput > &  pInput,
int  pRow,
int  pCol,
bool *  pMoved = nullptr 
)
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.

Parameters
pInputA pointer to a cxMultiLineInput (or a deriving object)
pRowThe row on the form where you want the input to be located
pColThe column on the form where you want the input to be located
pMovedIf non-null, the boolean pointed to by this variable will store whether or not the input was able to be moved.

◆ appendComboBox() [1/2]

virtual std::shared_ptr< cxComboBox > cx::cxForm::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 
)
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.

Parameters
pHeightThe height (# of lines) of the item
pWidthThe width (# of characters) of the item
pLabelThe label to use with the input
pValidatorString to use to validate input; see README.txt for details; blank by default
pHelpStringA string to be displayed in the statusbar of the form when the input has focus
pInputOptionDefines the input option (i.e., normal, read-only, etc.); from eInputOptions enumeration in cxInput.h
pNameA name for the input (can be used as an alternative way to identify the input)
pExtValueA pointer to a string to be linked to this input and used for its value. Defaults to nullptr for none.
pRightlabelOffsetThe distance between the right edge of the input and the right label. Defaults to 0.
pRightLabelHeightThe height of the label to the right of the input (defaults to 1)
pRightLabelHeightThe 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)
pShowRightLabelWhether or not to show the right label. Defaults to false.
Returns
A pointer to the new cxMultiLineInput object that is created.

◆ appendComboBox() [2/2]

virtual std::shared_ptr< cxComboBox > cx::cxForm::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 
)
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.

Parameters
pRowY location of the upper-left corner of the input, relative to the form
pColX location of the upper-left corner of the input, relative to the form
pHeightThe height of the input
pWidthThe width of the input
pLabelThe label to use with the input
pValidatorString to use to validate input; see README.txt for details; blank by default
pHelpStringA string to be displayed in the statusbar of the form when the input has focus; defaults to empty string
pInputOptionDefines the input option (i.e., normal, read-only, etc.); defaults to eINPUT_EDITABLE
pNameA name for the input (can be used as an alternative way to identify the input)
pExtValueA pointer to a string to be linked to this input and used for its value. Defaults to nullptr for none.
pRightlabelOffsetThe distance between the right edge of the input and the right label. Defaults to 0.
pRightLabelHeightThe height of the label to the right of the input (defaults to 1)
pRightLabelWidthThe width of the label to the right of the input (defaults to 7 so there is room for "Invalid")
pShowRightLabelWhether or not to show the right label. Defaults to false.
Returns
A pointer to the new cxMultiLineInput object that is created.

Referenced by comboBoxOnForm(), and main().

◆ appendComboBoxPair()

cxComboBoxPtrPair cx::cxForm::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 
)
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.

Parameters
pRowY location of the upper-left corner of the inputs, relative to the form
pColX location of the upper-left corner of the inputs, relative to the form
pHeightThe height of each input
pWidthThe width of each input
pLabelThe label to use - This will only be used with the first input.
pValidatorString to use to validate inputs; see README.txt for details; blank by default
pHelpStringA string to be displayed in the statusbar of the form when the input has focus; defaults to empty string
pInputOptionDefinse the input option (editable or read-only). Defaults to eINPUT_EDITABLE.
pNameA name for the inputs. Note that "low" and "high" will be appended to the input names, referring to the first and second inputs, respectively.
pExtValue1A pointer to a string to be linked to the first input and used for its value. Defaults to nullptr for none.
pExtValue2A pointer to a string to be linked to the second input and used for its value. Defaults to nullptr for none.
pRightlabel1OffsetThe distance between the right edge of the first input and its right label. Defaults to 0.
pRightLabel1HeightThe height of the first input's right label (defaults to 1)
pRightLabel1WidthThe 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)
pShowRightLabel1Whether or not to show the right label for the first input. Defaults to false.
pRightlabel2OffsetThe distance between the right edge of the second input and its right label. Defaults to 0.
pRightLabel2HeightThe height of the second input's right label (defaults to 1)
pRightLabel2WidthThe 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)
pShowRightLabel2Whether or not to show the right label for the second input. Defaults to false.
pRightlabel2OffsetThe distance between the right edge of the second input and its right label. Defaults to 0.
pRightLabel2HeightThe height of the second input's right label (defaults to 1)
pRightLabel2WidthThe 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)
pShowRightLabel2Whether or not to show the right label for the second input. Defaults to false.
Returns
A pair of pointers to the cxComboBoxes appended to the form

References appendPair(), and cx::eIT_CXCOMBOBOX.

Referenced by cxFormAppendComboBoxPair().

◆ appendPair() [1/2]

virtual cxMLInputPtrPair cx::cxForm::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 
)
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.

Parameters
pRowY location of the upper-left corner of the inputs, relative to the form
pColX location of the upper-left corner of the inputs, relative to the form
pHeightThe height of each input
pWidthThe width of each input
pLabelThe label to use - This will only be used with the first input.
pValidatorString to use to validate inputs; see README.txt for details; blank by default
pHelpStringA string to be displayed in the statusbar of the form when the input has focus; defaults to empty string
pInputOptionDefines the input option (editable or read-only). Defaults to eINPUT_EDITABLE.
pNameA name for the inputs. Note that "_low" and "_high" will be appended to the input names, referring to the first and second inputs, respectively.
pExtValue1A pointer to a string to be linked to the first input and used for its value. Defaults to nullptr for none.
pExtValue2A pointer to a string to be linked to the second input and used for its value. Defaults to nullptr for none.
pRightlabel1OffsetThe distance between the right edge of the first input and its right label. Defaults to 0.
pRightLabel1HeightThe height of the first input's right label (defaults to 1)
pRightLabel1WidthThe 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)
pShowRightLabel1Whether or not to show the right label for the first input. Defaults to false.
pRightLabel2HeightThe height of the second input's right label (defaults to 1)
pRightLabel2WidthThe 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)
pShowRightLabel2Whether or not to show the right label for the second input. Defaults to false.
pRightlabel2OffsetThe distance between the right edge of the second input and its right label. Defaults to 0.
pRightLabel2HeightThe height of the second input's right label (defaults to 1)
pRightLabel2WidthThe 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)
pShowRightLabel2Whether or not to show the right label for the second input. Defaults to false.
pInputType1The 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.
pInputType2The type of input to append for the second input.
Returns
A pair of pointers to the inputs appended to the form

Referenced by appendComboBoxPair(), cxFormAppendPair(), and itemSales().

◆ appendPair() [2/2]

virtual void cx::cxForm::appendPair ( std::shared_ptr< cxMultiLineInput > &  pInput1,
std::shared_ptr< cxMultiLineInput > &  pInput2,
int  pRow,
int  pCol,
const std::string &  pName = "" 
)
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.

Parameters
pInput1A pointer to the first input
pInput2A pointer to the second input
pRowThe row on the form to append the inputs
pColThe column on the form to append the inputs
pNameIf this is non-blank, then this will be used for the input names.

◆ bringToTop()

void cx::cxForm::bringToTop ( bool  pRefresh = true)
overridevirtual

Brings the window to the top.

Parameters
pRefreshWhether to refresh the screen (defaults to true)

Reimplemented from cx::cxWindow.

References cx::cxWindow::bringToTop(), mInputs, and cx::updateWindows().

◆ canBeEditable() [1/2]

virtual bool cx::cxForm::canBeEditable ( const std::string &  pLabel,
bool  pIsLabel = true 
) const
virtual

Returns whether or not an input can be set editable.

Parameters
pLabelThe label/name of the input
pCanBeEditableIf true, the can be set editable. If false, the input will always be read-only.
Returns
Whether or not the input can be set editable

◆ canBeEditable() [2/2]

bool cx::cxForm::canBeEditable ( int  pIndex) const
virtual

Returns whether or not an input can be set editable.

Parameters
pIndexThe index of the input
Returns
Whether or not the input can be set editable

References mInputs.

Referenced by doInputLoop().

◆ clearExtendedHelpKeys()

void cx::cxForm::clearExtendedHelpKeys ( )
virtual

Removes all extended help keys.

References mInputs.

Referenced by setExtendedHelpKey().

◆ clearInputs()

void cx::cxForm::clearInputs ( bool  pRefresh = false,
bool  pOnlyEditable = false 
)
virtual

Clears the values of all the inputs on the form.

Parameters
pRefreshWhether or not to refresh the inputs after clearing them (defaults to false)
pOnlyEditableIf true, then only the editable inputs on the form will be cleared. This defaults to false.

References mInputs.

Referenced by cxFormClearOnlyEditable(), and formInputColors().

◆ clearKeyFunction()

void cx::cxForm::clearKeyFunction ( int  pKey)
overridevirtual

Removes a function pointer for a keypress for the form so that it will no.

longer fire a function.

Parameters
pKeyThe hotkey for the function to remove

Reimplemented from cx::cxWindow.

References cx::cxWindow::clearKeyFunction(), and mInputs.

◆ copyCxFormStuff()

void cx::cxForm::copyCxFormStuff ( const cxForm pThatForm)
protected

◆ cxTypeStr()

string cx::cxForm::cxTypeStr ( ) const
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.

Returns
The name of the cxWidgets class.

Reimplemented from cx::cxWindow.

Reimplemented in cx::cxMultiForm.

◆ disableCustomStatus()

void cx::cxForm::disableCustomStatus ( bool  pRefreshStatus = true)
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.

Parameters
pRefreshStatusWhether or not to refresh the status area (defaults to true)

References cx::cxWindow::setStatus().

◆ doCurrentInput()

bool cx::cxForm::doCurrentInput ( long &  pReturnCode,
bool &  pRunOnLeaveFunction,
bool &  pFunctionExists,
bool  pExitOverride = false 
)
protectedvirtual

Gets input from the current input (for use in the input loop).

Parameters
pReturnCodeThis variable will hold the return code as a result of the user's interactions.
pRunOnLeaveFunctionThis 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).
pFunctionExistsThis 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.
pExitOverrideIf 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.
Returns
Whether or not to continue the input loop

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().

◆ doInputLoop()

long cx::cxForm::doInputLoop ( bool &  pRunOnLeaveFunction)
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

cxForm.

Parameters
pRunOnLeaveFunctionThis 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).
Returns
A return code (cxID_QUIT or cxID_EXIT, depending on the user's input).

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().

◆ enableInputLoop() [1/2]

virtual void cx::cxForm::enableInputLoop ( const std::string &  pLabel,
bool  pDoInputLoop,
bool  pIsLabel = true 
)
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.

Parameters
pLabelThe label/name of the input
pDoInputLoopWhether to enable or disable the input loop for the input (true/false)
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

Referenced by cxInputOnFormLoopDisabled().

◆ enableInputLoop() [2/2]

void cx::cxForm::enableInputLoop ( unsigned  pIndex,
bool  pDoInputLoop 
)
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.

Parameters
pIndexThe index of the input
pDoInputLoopWhether to enable or disable the input loop for the input (true/false)

References mInputs.

◆ exitNow()

void cx::cxForm::exitNow ( )
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().

◆ firstEditableInput()

int cx::cxForm::firstEditableInput ( ) const
virtual

Returns the index of the first editable input in.

the form's collection of inputs, or -1 if there

are no editable inputs.

Returns
The index of the first editable input on the form

References isEditable(), mInputs, and numInputs().

Referenced by doInputLoop(), and form().

◆ formKeyIsSet()

bool cx::cxForm::formKeyIsSet ( int  pKey) const
virtual

Returns whether a key is set as a form function.

Parameters
pKeyThe key to look for
Returns
true/false, whether or not pKey is associated with a function on the form (not on the inputs).

References cx::cxWindow::mKeyFunctions.

Referenced by cx::cxMultiLineInput::searchParentFormsForFKey().

◆ getAllowExit()

bool cx::cxForm::getAllowExit ( ) const
virtual

Returns whether the user is able to exit out of the form.

Returns
Whether or not the use is able to exit out of the form

◆ getAllowQuit()

bool cx::cxForm::getAllowQuit ( ) const
virtual

Returns whether the user is able to quit out of the form.

Returns
Whether or not the use is able to quit out of the form

Referenced by cx::cxMultiForm::doInputLoop().

◆ getApplyAttrDefaults()

bool cx::cxForm::getApplyAttrDefaults ( ) const

Returns whether default attributes are applied to new inputs.

Returns
The value of the default attributes setting

◆ getAttrs()

void cx::cxForm::getAttrs ( e_WidgetItems  pItem,
std::set< attr_t > &  pAttrs 
) const
overridevirtual

Returns the set of ncurses attributes for a given item.

Parameters
pItemThe item to retrieve attributes for (see the e_WidgetItems enumeration).
pAttrsThis 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.

◆ getAutoExit()

bool cx::cxForm::getAutoExit ( ) const

Returns the set value of whether the form should exit upon.

exit of the last field.

Returns
whether the form should auto exit upon exit of the last field

Referenced by cx::cxMultiForm::doInputLoop().

◆ getCurrentInput()

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.

Returns
A pointer to the current input on the form, or nullptr if there are no inputs or if there is an error.

References getCurrentInputIndex(), and mInputs.

◆ getCurrentInputIndex()

int cx::cxForm::getCurrentInputIndex ( ) const
virtual

Returns the index of the input that currently has focus.

Returns
The index of the input that currently has focus

References mCurrentInput, and mInputs.

Referenced by doCurrentInput(), exitNow(), getCurrentInput(), getCurrentInputLabel(), getCurrentInputName(), and quitNow().

◆ getCurrentInputLabel()

string cx::cxForm::getCurrentInputLabel ( ) const
virtual

Returns the label of the input that currently has focus.

Returns
The label of the input taht currently has focus

References getCurrentInputIndex(), getLabel(), and mInputs.

◆ getCurrentInputName()

string cx::cxForm::getCurrentInputName ( ) const
virtual

Returns the name of the input that currently has focus.

Returns
The name of the input taht currently has focus

References getCurrentInputIndex(), getName(), and mInputs.

◆ getExitOnLeaveFirst()

bool cx::cxForm::getExitOnLeaveFirst ( ) const
virtual

Returns whether the form is set to exit its showModal() when.

the user leaves the first input going backwards.

Returns
Whether or not the form is set to exit its showModal() when the user leaves the first input going backwards

◆ getExtendedHelp() [1/2]

virtual std::string cx::cxForm::getExtendedHelp ( const std::string &  pIDStr,
bool  pIsLabel = true 
) const
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.

Parameters
pIDStrThe label/name of the input
pIsLabelIf true (default), then pIDStr will specify the label of the input. Otherwise, pIDStr will specify the name of the input.
Returns
The extended help for the input, or a blank string if the input is not found.

◆ getExtendedHelp() [2/2]

string cx::cxForm::getExtendedHelp ( int  pIndex) const
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.

Parameters
pIndexThe index of the input
Returns
The extended help for the input, or a blank string if pIndex is out of bounds.

References mInputs.

◆ getExtendedHelpKeys()

set< int > cx::cxForm::getExtendedHelpKeys ( ) const
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.

Returns
The keys used to display extended help for the inputs

◆ getExtendedHelpKeyStrings()

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.

Returns
A comma-separated list of strings representing the extended help keys for the input.

References cx::getKeyStr().

Referenced by cxFormExtendedHelpKey().

◆ getInput() [1/2]

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.

Parameters
pLabelThe label/name of the input
pIsLabelTrue if pLabel specifies the label (default), or false if it specifies the name
Returns
A pointer to the input with the given label/name, or nullptr if none is found

◆ getInput() [2/2]

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.

Parameters
pIndexThe index of the input
Returns
A pointer to the input at pIndex, or nullptr if the input is not valid

References mInputs.

Referenced by allFormInputsGoReadOnly(), comboBoxOnForm(), cxFormAssignment(), exitNow(), form(), main(), quitNow(), and setValues().

◆ getInputIndex() [1/3]

int cx::cxForm::getInputIndex ( const cxMultiLineInput pInput) const
virtual

References mInputs, and numInputs().

◆ getInputIndex() [2/3]

virtual int cx::cxForm::getInputIndex ( const std::shared_ptr< cxMultiLineInput > &  pInput) const
virtual

Returns the index of an input based on a pointer. May.

return -1 if the input is not in the form.

Parameters
pInputA pointer to an input
Returns
The index of the input on the form, or -1 if the input is not in the form.

◆ getInputIndex() [3/3]

virtual int cx::cxForm::getInputIndex ( const std::string &  pLabel,
bool  pIsLabel = true 
) const
virtual

Returns the index of an input, based on its label or name.

Parameters
pLabelThe label/name of the input
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.
Returns
The index of the input, or -1 if there was no input with the given label/name.

Referenced by cx::cxMultiLineInput::doInputLoop(), cx::cxMultiLineInput::exitNow(), cx::cxMultiLineInput::quitNow(), and setValues().

◆ getInputJumpKey()

int cx::cxForm::getInputJumpKey ( ) const
virtual

Returns which key is being used as the jump hotkey.

Returns
The key currently being used as the jump hotkey

Referenced by cx::cxMultiLineInput::searchParentFormsForFKey().

◆ getInputOption() [1/2]

virtual int cx::cxForm::getInputOption ( const std::string &  pLabel,
bool  pIsLabel = true 
) const
virtual

Returns the editability option for an input (by label/name).

Parameters
pLabelThe label/name of the input
pIsLabelIf true (default), pLabel specifies the label. If false, pLabel specifies the name of the input.
Returns
The kind of the input - See the eInputOptions enumeration in cxInput.h. Returns eINPUT_READONLY if no matching input is found.

◆ getInputOption() [2/2]

int cx::cxForm::getInputOption ( int  pIndex) const
virtual

Returns the editability option for an input (by index).

Parameters
pIndexThe index of the input
Returns
The kind of the input - See the eInputOptions enumeration in cxInput.h. If pIndex is out of bounds, eINPUT_READONLY will be returned.

References cx::eINPUT_READONLY, and mInputs.

Referenced by doCurrentInput(), and setInputOption().

◆ getLabel()

string cx::cxForm::getLabel ( int  pIndex) const
virtual

Returns the label of one of the inputs (by index).

Parameters
pIndexThe index of the input
Returns
The label of the input, or a blank string if pIndex is out of bounds.

References mInputs.

Referenced by getCurrentInputLabel(), and inputLabel().

◆ getLabelColor() [1/2]

int cx::cxForm::getLabelColor ( const int &  pIndex) const

Returns the label color of one of the inputs (by index).

Parameters
pIndexThe index of the input
Returns
The label color of the input at pIndex, or eDEFAULT if not found.

References cx::eDEFAULT, and mInputs.

◆ getLabelColor() [2/2]

int cx::cxForm::getLabelColor ( const std::string &  pLabel,
bool  pIsLabel = true 
) const

Returns the label color of one of the inputs (by label/name).

Parameters
pLabelThe label/name of the input
pIsLabelIf true (default), pLabel is the input's label. If false, pLabel is the input's name.
Returns
The label color of the input at pIndex, or eDEFAULT if not found.

◆ getMasked() [1/2]

bool cx::cxForm::getMasked ( const std::string &  pLabel,
bool  pIsLabel = true 
)

Returns whether or not an input is masked (by label).

Parameters
pLabelThe label of the input
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.
Returns
Whether or not the input is masked

◆ getMasked() [2/2]

bool cx::cxForm::getMasked ( int  pIndex)

Returns whether or not an input is masked (by index).

Parameters
pIndexThe index of the input
Returns
Whether or not the input is masked

References mInputs.

◆ getName() [1/3]

string cx::cxWindow::getName ( ) const

◆ getName() [2/3]

virtual std::string cx::cxForm::getName ( const std::string &  pLabel) const
virtual

Returns the name of one of the inputs (by label).

Parameters
pLabelThe label of the input
Returns
The name of the input, or a blank string if there is no input with the given label.

◆ getName() [3/3]

string cx::cxForm::getName ( int  pIndex) const
virtual

Returns the name of one of the inputs (by index).

Parameters
pIndexThe index of the input
Returns
The name of the input, or a blank string if pIndex is out of bounds.

References mInputs.

◆ getNavKeys()

void cx::cxForm::getNavKeys ( std::set< int > &  pNavKeys) const
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.

Parameters
pNavKeysThis will contain the navigational keys gathered from all inputs on the form.

References mInputs.

Referenced by cxFormNavKeys(), and getNavKeyStrings().

◆ getNavKeyStrings()

void cx::cxForm::getNavKeyStrings ( std::set< std::string > &  pNavKeyStrings) const
virtual

Creates a set of string representations of keys considered to.

be "navigational" keys, gathered from all inputs on the form.

Parameters
pNavKeyStringsThis will contain string representations of the navigational keys, gathered from all inputs on the form.

References cx::getKeyStr(), and getNavKeys().

Referenced by cxFormNavKeys().

◆ getParent()

cxWindow * cx::cxForm::getParent ( ) const
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.

Returns
A pointer to the parent window

Reimplemented from cx::cxWindow.

References cx::cxWindow::getParent().

Referenced by main(), and cx::cxMultiLineInput::searchParentFormsForFKey().

◆ getParentMultiForm()

cxMultiForm * cx::cxForm::getParentMultiForm ( ) const

Returns the parent cxMultiForm pointer.

Returns
The parent cxMultiForm pointer

Referenced by cx::cxMultiLineInput::searchParentFormsForFKey().

◆ getStartAtFirstInput()

bool cx::cxForm::getStartAtFirstInput ( ) const

Returns whether or not the form will always start at the first.

editable input when showModal() is called.

Returns
Whether or not the form will always start at the first input when showModal() is called.

References mStartAtFirstInput.

◆ getStatus() [1/3]

string cx::cxWindow::getStatus ( ) const

Accessor for the status line text.

Returns
The status line from the bottom row of window

References cx::cxID_EXIT, cx::eBS_SINGLE_LINE, and cx::init().

◆ getStatus() [2/3]

virtual std::string cx::cxForm::getStatus ( const std::string &  pLabel,
bool  pIsLabel = true 
) const
virtual

Returns the status text of one of the inputs (by label/name).

Parameters
pLabelThe label/name of the input
pIsLabelIf true (default), pLabel specifies the label of the input. If false, pLabel specifies the name of the input.
Returns
The status text of the input, or a blank string if there is no input with the given label/name.

◆ getStatus() [3/3]

string cx::cxForm::getStatus ( int  pIndex) const
virtual

Returns the status text of one of the inputs (by index).

Parameters
pIndexThe index of the input
Returns
The status text of the input, or a blank string if the given index is out of range.

References mInputs.

Referenced by copyCxFormStuff(), and main().

◆ getUseExtendedHelpKeys()

bool cx::cxForm::getUseExtendedHelpKeys ( ) const
virtual

Returns whether or not the extended help keys are enabled.

Returns
Whether or not the extended help keys are enabled (true/false)

◆ getValue() [1/2]

virtual std::string cx::cxForm::getValue ( const std::string &  pStr,
bool  pIsLabel = true 
) const
virtual

Returns the value associated with a particular input (by label or name).

Parameters
pStrThe label/name of the input
pIsLabelWhether pStr is a label or a name (true = label, false = name)
Returns
The input (string) associated with that label

Reimplemented in cx::cxMultiForm.

◆ getValue() [2/2]

string cx::cxForm::getValue ( int  pIndex) const
virtual

Returns the value associated with a particular input (by index).

Parameters
pIndexThe index of the input
Returns
The string at that index

Reimplemented in cx::cxMultiForm.

References getValue(), and mInputs.

Referenced by doCurrentInput(), form(), formWithFKeys(), getValue(), cx::cxMultiForm::getValue(), and main().

◆ getValueColor() [1/2]

int cx::cxForm::getValueColor ( const int &  pIndex) const

Returns the color of the value section of one of the inputs (by index).

Parameters
pIndexThe index of the input
Returns
The color of the value section of the input at pIndex, or A_NORMAL if not found.

References cx::eDEFAULT, and mInputs.

◆ getValueColor() [2/2]

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

Parameters
pLabelThe label/name of the input
pIsLabelIf true (default), pLabel is the input's label. If false, pLabel is the input's name.
Returns
The color of the value section of the input at pIndex, or A_NORMAL if not found.

◆ getValues()

void cx::cxForm::getValues ( std::map< std::string, std::string > &  pValues,
bool  pUseLabels = true,
bool  pSkipBlankIDs = false 
) const
virtual

Gets the values from the form in the form of a map of input.

labels/names and their values.

Parameters
pValuesThis map will be populated with the labels/names of the inputs mapped to their values.
pUseLabelsIf true (default), the values will be mapped by the input labels. If false, the values will be mapped by the input names.
pSkipBlankIDsIf true, then inputs with a blank label/name will not be added to the map. This defaults to false.

References mInputs.

Referenced by cxFormAppendPair().

◆ getWaitForInputIfEmpty()

bool cx::cxForm::getWaitForInputIfEmpty ( ) const
virtual

Returns whether or not the form will wait for.

user input if there are no editable inputs.

Returns
Whether or not the form will wait for user input if there are no editable inputs.

Referenced by cx::cxMultiForm::doInputLoop().

◆ hasChanged()

bool cx::cxForm::hasChanged ( ) const
virtual

Returns whether or not any data on the form has changed.

Returns
true if any data on the form has been changed, otherwise returns false.

Reimplemented in cx::cxMultiForm.

Referenced by formDataChanged(), and cx::cxMultiForm::hasChanged().

◆ hasEditableInputs()

bool cx::cxForm::hasEditableInputs ( ) const
virtual

Returns whether the form has any inputs that are.

currently editable.

Returns
Whether or not the form has any inputs that are currently editable

References cx::eINPUT_READONLY, and mInputs.

Referenced by doInputLoop(), cx::cxMultiForm::doInputLoop(), and modalGetsKeypress().

◆ hasInput()

bool cx::cxForm::hasInput ( const std::string &  pStr,
bool  pIsLabel = true 
) const
virtual

Returns whether or not the form has an input with a given.

label/name.

Parameters
pStrThe label/name of the input
pIsLabelIf true, then pStr specifies the label; otherwise, pStr specifies the name of the input. Defaults to true.
Returns
true if the form has an input with the given label/name; false if not.

References mInputs.

◆ hasNavKey()

bool cx::cxForm::hasNavKey ( int  pKey) const
virtual

Returns whether at least one of the inputs on the form has.

a key in its list of navigational keys.

Parameters
pKeyThe key to look for

References mInputs.

Referenced by cxFormNavKeys().

◆ hide()

void cx::cxForm::hide ( bool  pHideSubwindows = true)
overridevirtual

Hides the form (along with all the inputs)

Parameters
pHideSubwindowsWhether 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().

◆ inputHeight() [1/2]

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.

Parameters
pLabelThe label/name of the input
pIsLabelIf true (default), pLabel specifies the input's label. If false, pLabel specifies the input's name.
Returns
The height of the input, or -1 if there is no input with the given label.

◆ inputHeight() [2/2]

int cx::cxForm::inputHeight ( int  pIndex) const

Returns the height of an input (by index), or -1 if the given index.

is invalid.

Parameters
pIndexThe index of the input
Returns
The height of the input, or -1 if the index is out of bounds.

References mInputs.

Referenced by main().

◆ inputLabel() [1/2]

std::string cx::cxForm::inputLabel ( const std::string &  pName) const

Returns the label of an input.

Parameters
pNameThe name of the input
Returns
The input's label, or a blank string if there is no input with the given name.

◆ inputLabel() [2/2]

string cx::cxForm::inputLabel ( int  pIndex) const

Returns the label of an input at a given index.

Parameters
indexThe index of an input
Returns
The label of the input at the given index, or a blank string if the index is out of bounds.

References getLabel(), and mInputs.

Referenced by main().

◆ inputLeftCol() [1/2]

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.

Parameters
pLabelThe label/name of the input
pIsLabelIf true (default), pLabel specifies the input's label. If false, pLabel specifies the input's name.
Returns
The left column of the input, or -1 if there is no input with the given label.

◆ inputLeftCol() [2/2]

int cx::cxForm::inputLeftCol ( int  pIndex) const

Returns the left column of an input (by index), or -1 if the given.

index is out of bounds.

Parameters
pIndexThe index of the input
Returns
The left column of the input, or -1 if the given index is out of bounds.

References mInputs.

Referenced by main().

◆ inputName() [1/2]

std::string cx::cxForm::inputName ( const std::string &  pLabel) const

Returns the name of an input.

Parameters
pLabelThe label of the input
Returns
The input's name, or a blank string if there is no input with the given name.

◆ inputName() [2/2]

string cx::cxForm::inputName ( int  pIndex) const

Returns the name of an input at a given index.

Parameters
indexThe index of an input
Returns
The name of the input at the given index, or a blank string if the index is out of bounds.

References mInputs.

◆ inputTopRow() [1/2]

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.

Parameters
pLabelThe label of the input
pIsLabelIf true (default), pLabel specifies the input's label. If false, pLabel specifies the input's name.
Returns
The top row of the input, or -1 if there is no input with the given label.

◆ inputTopRow() [2/2]

int cx::cxForm::inputTopRow ( int  pIndex) const

Returns the top row of an input (by index), or -1 if the given.

index is out of bounds.

Parameters
pIndexThe index of the input
Returns
The top row of the input, or -1 if the given index is out of bounds.

References mInputs.

Referenced by main().

◆ inputWidth() [1/2]

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.

Parameters
pLabelThe label of the input
pIsLabelIf true (default), pLabel specifies the input's label. If false, pLabel specifies the input's name.
Returns
The width of the input, or -1 if there is no input with the given label.

◆ inputWidth() [2/2]

int cx::cxForm::inputWidth ( int  pIndex) const

Returns the width of an input (by index), or -1 if the given index.

is invalid.

Parameters
pIndexThe index of the input
Returns
The width of the input, or -1 if the given index is out of bounds.

References mInputs.

Referenced by main().

◆ isEditable() [1/2]

virtual bool cx::cxForm::isEditable ( const std::string &  pLabel,
bool  pIsLabel = true 
) const
virtual

Returns whether one of the inputs on.

the form is editable (by label/name)

Parameters
pLabelThe label/name of the input
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.
Returns
Whether or not the input is editable

◆ isEditable() [2/2]

bool cx::cxForm::isEditable ( int  pIndex) const
virtual

Returns whether one of the inputs on.

the form is editable (by index)

Parameters
pIndexThe index of the input
Returns
Whether or not the input is editable

References mInputs.

Referenced by firstEditableInput(), lastEditableInput(), and setCurrentInput().

◆ isStacked()

bool cx::cxForm::isStacked ( ) const
virtual

Returns whether or not the form is in 'stacked'.

mode (which assumes each input is on top of the next).

Returns
Whether or not the form is in 'stacked' mode

◆ lastEditableInput()

int cx::cxForm::lastEditableInput ( ) const
virtual

Returns the index of the last editable input in.

the form's collection of inputs, or -1 if there

are no editable inputs.

Returns
The index of the last editable input on the form

References isEditable(), and mInputs.

Referenced by doCurrentInput(), and form().

◆ lookForEditableInputs()

void cx::cxForm::lookForEditableInputs ( )
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().

◆ maxInputLen() [1/2]

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.

Parameters
pLabelThe label of the input
pIsLabelIf true (default), pLabel specifies the input's label. If false, pLabel specifies the input's name.
Returns
The maximum length of input accepted by the input, or 0 if there is no input with the given label/name.

◆ maxInputLen() [2/2]

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.

Parameters
pIndexThe index of the input
Returns
The maximum length of input accepted by the input, or 0 if the given index is out of bounds.

References mInputs.

◆ maxValueLen() [1/2]

virtual int cx::cxForm::maxValueLen ( const std::string &  pLabel,
bool  pIsLabel = true 
)
virtual

Returns the maximum length of the value that may be set for an.

input (by label/name).

Parameters
pLabelThe label/name of the input
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.
Returns
The maximum length of the value that may be set.

◆ maxValueLen() [2/2]

int cx::cxForm::maxValueLen ( int  pIndex) const
virtual

Returns the maximum length of the value that may be set for an.

input (by index).

Parameters
pIndexThe index of the input
Returns
The maximum length of the value that may be set.

References mInputs.

◆ modalGetsKeypress()

bool cx::cxForm::modalGetsKeypress ( ) const
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.

Returns
Whether or not a call to showModal() will wait for a keypress from the user.

Reimplemented from cx::cxWindow.

References hasEditableInputs(), and cx::cxWindow::isEnabled().

◆ move()

bool cx::cxForm::move ( int  pNewRow,
int  pNewCol,
bool  pRefresh = true 
)
overridevirtual

Changes the window's position (based on a new upper-left corner). Also moves the input windows.

Parameters
pNewRowThe new topmost row of the form
pNewColThe new leftmost column of the form
pRefreshWhether or not to refrseh the window (defaults to true)
Returns
Whether or not the move succeeded or not (true/false)

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().

◆ numInputs()

size_t cx::cxForm::numInputs ( ) const

Returns the number of inputs in the form.

Returns
The number of inputs in the form

References mInputs.

Referenced by firstEditableInput(), getInputIndex(), main(), move(), remove(), scrollInputs(), setCurrentInputByPtr(), setInputJumpKey(), and showAllInputs().

◆ onKeyFunctionEnabled() [1/2]

virtual bool cx::cxForm::onKeyFunctionEnabled ( const std::string &  pLabel,
bool  pIsLabel = true 
) const
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.

Parameters
plabelThe label/name of the input
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.
Returns
Whether or not the onKey function is enabled for that input. If there is no input with the given label/name, this function will return false.

◆ onKeyFunctionEnabled() [2/2]

bool cx::cxForm::onKeyFunctionEnabled ( int  pIndex) const
virtual

Returns whether the onKey function is enabled for one of the.

inputs (by index).

Parameters
pIndexThe index of the input
Returns
Whether or not the onKey function is enabled for that input. If pIndex is out of bounds (< 0 or more than the number of inputs), this function will return false.

References mInputs.

◆ operator=()

cxForm & cx::cxForm::operator= ( const cxForm pThatForm)

Assignment operator.

Parameters
pThatFormAnother cxForm to be copied
Returns

References copyCxFormStuff().

◆ quitNow()

void cx::cxForm::quitNow ( )
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().

◆ refreshInput() [1/2]

virtual int cx::cxForm::refreshInput ( const std::string &  pStr,
bool  pIsLabel = true 
)
virtual

Refreshes an input (by calling its show() method)

Parameters
pStrThe label of the input to refresh
pIsLabelIf true, pStr specifies the input label. If false, pStr specifies the input name.
Returns
The return value of the input's show() method (0)

◆ refreshInput() [2/2]

int cx::cxForm::refreshInput ( unsigned  pIndex)
virtual

Refreshes an input (by calling its show() method)

Parameters
pIndexThe index of the input to refresh
Returns
The return value of the input's show() method (0)

References cx::cxWindow::isAbove(), and mInputs.

◆ remove() [1/4]

virtual void cx::cxForm::remove ( const std::shared_ptr< cxMultiLineInput > &  pInput)
virtual

Removes an input from the form (by pointer)

Parameters
pInputPointer to the cxMultiLineInput object to remove

◆ remove() [2/4]

virtual void cx::cxForm::remove ( const std::string &  pLabel,
bool  pIsLabel = true 
)
virtual

Removes an input from the form (by label or name)

Parameters
pLabelLabel of the input to be deleted
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ remove() [3/4]

void cx::cxForm::remove ( cxMultiLineInput pInput)
virtual

◆ remove() [4/4]

void cx::cxForm::remove ( unsigned int  pIndex)
virtual

Removes an input from the form (by index)

Parameters
pIndexThe index of the input to be deleted

References cx::cxWindow::height(), lookForEditableInputs(), mCurrentInput, mInputPositions, and mInputs.

Referenced by main().

◆ removeAll()

void cx::cxForm::removeAll ( )
virtual

Removes all inputs from the form.

References mCurrentInput.

◆ removeAttr()

void cx::cxForm::removeAttr ( e_WidgetItems  pItem,
attr_t  pAttr 
)
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.

Parameters
pItemThe item to remove the attribute for (see the e_WidgetItems enumeration).
pAttrThe 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().

◆ removeAttrs()

void cx::cxForm::removeAttrs ( e_WidgetItems  pItem)
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.

Parameters
pItemThe 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().

◆ removeExitKey()

void cx::cxForm::removeExitKey ( int  pKey)
overridevirtual

Removes an exit key.

Parameters
pKeyThe 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().

◆ removeQuitKey()

void cx::cxForm::removeQuitKey ( int  pKey)
overridevirtual

Removes a quit key (but doesn't work for ESC)

Parameters
pKeyThe 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().

◆ runLoopEndFunction()

bool cx::cxForm::runLoopEndFunction ( )
virtual

Runs the loop end function, if it's set.

Returns
The value of the loop end function's mExitAfterRun, or false if the loop start end isn't set.

Referenced by doInputLoop(), and cx::cxMultiForm::doInputLoop().

◆ runLoopStartFunction()

bool cx::cxForm::runLoopStartFunction ( )
virtual

Runs the loop start function, if it's set.

Returns
The value of the loop start function's mExitAfterRun, or false if the loop start function isn't set.

Referenced by doInputLoop(), and cx::cxMultiForm::doInputLoop().

◆ scrollInputs()

void cx::cxForm::scrollInputs ( int  pVScrollAmt,
int  pHScrollAmt,
bool  pRefresh = false,
bool  pBringToTop = false 
)
virtual

Scrolls (moves) the inputs in the window.

Parameters
pVScrollAmtThe amount by which to scroll vertically
pHScrollAmtThe amount by which to scroll horizontally
pRefreshWhether or not to refresh the form (defaults to false).
pBringToTopWhether 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().

◆ setAllCanBeEditable()

void cx::cxForm::setAllCanBeEditable ( bool  pCanBeEditable)
virtual

Sets the ability of all inputs to be able to be editable.

Parameters
pCanBeEditableIf true, all inputs can be set editable. If false, all inputs will always be read-only.

References mInputs.

◆ setAllColors()

void cx::cxForm::setAllColors ( e_cxColors  pLabelColor,
e_cxColors  pValueColor 
)

Sets the label & value colors of all inputs on the form.

Parameters
pLabelColorThe color to set for the labels
pValueColorThe color to set for the values

References cx::eDATA, cx::eLABEL, and mInputs.

Referenced by formInputColors().

◆ setAllInputOption()

void cx::cxForm::setAllInputOption ( eInputOptions  pInputOption,
bool  pRefresh = true 
)
virtual

Sets the input kind for all inputs on the form.

Parameters
pInputOptionThe new input kind
pRefreshWhether 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().

◆ setAllLabelColor()

void cx::cxForm::setAllLabelColor ( e_cxColors  pColor)

Sets the color of the labels on all inputs.

Parameters
pColorThe color to set

References mInputs.

◆ setAllOnKeyFunction() [1/4]

virtual void cx::cxForm::setAllOnKeyFunction ( const std::shared_ptr< cxFunction > &  pFunction)
virtual

Sets a function to be run whenever a key is pressed, in all.

inputs on the form.

Parameters
pFunctionThe function to be run

◆ setAllOnKeyFunction() [2/4]

void cx::cxForm::setAllOnKeyFunction ( funcPtr0  pFunction)
virtual

Sets a function to be run whenever a key is pressed, in all.

inputs on the form.

Parameters
pFunctionThe function to be run - Must have this signature: string func()

References mInputs.

◆ setAllOnKeyFunction() [3/4]

void cx::cxForm::setAllOnKeyFunction ( funcPtr2  pFunction,
void *  p1,
void *  p2 
)
virtual

Sets a function to be run whenever a key is pressed, in all.

inputs on the form.

Parameters
pFunctionThe function to be run - Must have this signature: string func(void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function

References mInputs.

◆ setAllOnKeyFunction() [4/4]

void cx::cxForm::setAllOnKeyFunction ( funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4 
)
virtual

Sets a function to be run whenever a key is pressed, in all.

inputs on the form.

Parameters
pFunctionThe function to be run - Must have this signature: string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function

References mInputs.

◆ setAllowExit()

void cx::cxForm::setAllowExit ( bool  pAllowExit)
virtual

Sets whether the form should allow the user to exit.

Parameters
pAllowExitIf true, the user will be able to exit out of the form; if false, the user won't be able to exit.

◆ setAllowQuit()

void cx::cxForm::setAllowQuit ( bool  pAllowQuit)
virtual

Sets whether the form should allow the user to quit.

Parameters
pAllowQuitIf 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().

◆ setAllValueColor()

void cx::cxForm::setAllValueColor ( e_cxColors  pColor)

Sets the color of the value section of all inputs on the form.

Parameters
pColorThe color to set

References mInputs.

Referenced by borderlessForm().

◆ setApplyAttrDefaults()

void cx::cxForm::setApplyAttrDefaults ( bool  pApplyAttrDefaults)

Sets whether to apply the default attributes to the inputs when.

appending inputs.

Parameters
pApplyAttrDefaultsA boolean value (true/false)

◆ setAttr()

void cx::cxForm::setAttr ( e_WidgetItems  pItem,
attr_t  pAttr 
)
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.

Parameters
pItemThe item to apply the attribute for (see the e_WidgetItems enumeration).
pAttrThe 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().

◆ setAutoExit()

void cx::cxForm::setAutoExit ( bool  pAutoExit)
virtual

◆ setCanBeEditable() [1/2]

virtual void cx::cxForm::setCanBeEditable ( const std::string &  pLabel,
bool  pCanBeEditable,
bool  pIsLabel = true 
)
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.

Parameters
pLabelThe label/name of the input
pCanBeEditableIf true, the can be set editable. If false, the input will always be read-only.
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ setCanBeEditable() [2/2]

void cx::cxForm::setCanBeEditable ( int  pIndex,
bool  pCanBeEditable 
)
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.

Parameters
pIndexThe index of the input
pCanBeEditableIf 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().

◆ setChanged()

void cx::cxForm::setChanged ( bool  pDataChanged)
virtual

Setter for whether or not data should be considered changed.

Parameters
pDataChangedWhether or not data should be considered changed (true/false)

Reimplemented in cx::cxMultiForm.

Referenced by cx::cxMultiForm::setChanged(), and cx::cxMultiLineInput::setValue().

◆ setColor()

void cx::cxForm::setColor ( e_WidgetItems  pItem,
e_cxColors  pColor 
)
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.

Parameters
pItemThe item to set the color of (see the e_WidgetItems enumeration in cxWidgetItems.h).
pColorThe 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().

◆ setCurrentInput() [1/2]

virtual bool cx::cxForm::setCurrentInput ( const std::string &  pLabel,
bool  pIsLabel = true 
)
virtual

Changes which input on the form should have focus (by label/name).

Parameters
pLabelThe label/name of which input on the form should get focus
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.
Returns
True if successful or false if not.

◆ setCurrentInput() [2/2]

bool cx::cxForm::setCurrentInput ( int  pIndex)
virtual

Changes which input on the form should have focus (by index).

Parameters
pIndexThe 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.
Returns
True if successful or false if not.

References isEditable(), mCurrentInput, mInputs, and cx::cxWindow::mIsModal.

Referenced by doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxMultiLineInput::exitNow(), and cx::cxMultiLineInput::quitNow().

◆ setCurrentInputByPtr() [1/2]

bool cx::cxForm::setCurrentInputByPtr ( const cxMultiLineInput *const  pInput)
virtual

◆ setCurrentInputByPtr() [2/2]

virtual bool cx::cxForm::setCurrentInputByPtr ( const std::shared_ptr< cxMultiLineInput > &  pInput)
virtual

Changes which input on the form should have focus (by pointer).

Parameters
pInputA pointer to the input on the form that should have focus.
Returns
True if succeeded or false if not (i.e., will return false if the input is not on the form).

◆ setDisableCursorOnShow()

void cx::cxForm::setDisableCursorOnShow ( bool  pDisableCursorOnShow)
overridevirtual

Sets whether the window should disable the cursor.

when it's shown (this is the default behavior).

Parameters
pDisableCursorOnShowWhether 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().

◆ setEnabled()

void cx::cxForm::setEnabled ( bool  pEnabled)
overridevirtual

Enables or disables the form. Enabling/disabling a.

cxForm consequently also enables/disables all the inputs

on the form.

Parameters
pEnabledWhether 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().

◆ setExitOnLeaveFirst()

void cx::cxForm::setExitOnLeaveFirst ( bool  pExitOnLeaveFirst)
virtual

Sets whether the form should exit when the user leaves.

the first input going backwards.

Parameters
pExitOnLeaveFirstIf true, the form will exit its showModal() when the user leaves the first input going backwards (normally, the form doesn't exit).

◆ setExtendedHelp() [1/2]

virtual void cx::cxForm::setExtendedHelp ( const std::string &  pIDStr,
const std::string &  pExtendedHelp,
bool  pIsLabel = true 
)
virtual

Sets the extended help for one of the inputs (by label/name).

Parameters
pIDStrThe label/name of the input
pExtendedHelpThe extended help text to set in the input
pIsLabelIf true (default), then pIDStr will specify the label of the input. Otherwise, pIDStr will specify the name of the input.

◆ setExtendedHelp() [2/2]

virtual void cx::cxForm::setExtendedHelp ( int  pIndex,
const std::string &  pExtendedHelp 
)
virtual

Sets the extended help for one of the inputs (by index).

Parameters
pIndexThe index of the input
pExtendedHelpThe extended help text to set in the input

◆ setExtendedHelpKey()

void cx::cxForm::setExtendedHelpKey ( int  pKey)
virtual

Sets a single key to use to display extended help for all.

inputs.

Parameters
pKeyA key to use to display extended help for the inputs

References addExtendedHelpKey(), and clearExtendedHelpKeys().

Referenced by cxFormExtendedHelpKey().

◆ setFieldKeyFunction() [1/6]

virtual void cx::cxForm::setFieldKeyFunction ( const std::string &  pLabel,
int  pFunctionKey,
const std::shared_ptr< cxFunction > &  pFieldFunction,
bool  pIsLabel = true 
)
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.

Parameters
pLabelThe label of the input to add the function to
pFunctionKeyThe key for the input to use to fire the function.
pFieldFunctionThe function to add.
pExitAfterRunWhether or not this field should exit from the input loop once the function is done.
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

Referenced by allFormInputsGoReadOnly(), and formWithFKeys().

◆ setFieldKeyFunction() [2/6]

virtual void cx::cxForm::setFieldKeyFunction ( const std::string &  pLabel,
int  pFunctionKey,
funcPtr2  pFieldFunction,
void *  p1,
void *  p2,
bool  pUseVal,
bool  pExitAfterRun = false,
bool  pIsLabel = true 
)
virtual

Sets a function to be executed via a keypress for one of the fields (by label).

Parameters
pLabelThe label of the input to add the function to
pFunctionKeyThe key for the input to use to fire the function.
pFieldFunctionThe name of the function to add. It must match this signature: string func(void*, void*)
p1A pointer to the first parameter to use in the function
p2A pointer to the second parameter to use in the function
pUseValWhether or not the function's return value should be set as the value in the field.
pExitAfterRunWhether or not this field should exit from the input loop once the function is done.
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ setFieldKeyFunction() [3/6]

virtual void cx::cxForm::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

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.

Parameters
pLabelThe label of the input to add the function to
pFunctionKeyThe key for the input to use to fire the function.
pFieldFunctionThe name of the function to add. It must match this signature: string func(void*, void*, void*, void*)
p1A pointer to the first parameter to use in the function
p2A pointer to the second parameter to use in the function
p3A pointer to the 3rd parameter to use in the function
p4A pointer to the 4th parameter to use in the function
pUseValWhether or not the function's return value should be set as the value in the field.
pExitAfterRunWhether or not this field should exit from the input loop once the function is done.
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ setFieldKeyFunction() [4/6]

virtual void cx::cxForm::setFieldKeyFunction ( unsigned int  pIndex,
int  pFunctionKey,
const std::shared_ptr< cxFunction > &  pFieldFunction 
)
virtual

Sets a function to be executed via a keypress for one of the fields (by index).

Parameters
pIndexThe index of the input to add the function to
pFunctionKeyThe key for the input to use to fire the function.
pFieldFunctionThe function to add.

◆ setFieldKeyFunction() [5/6]

virtual void cx::cxForm::setFieldKeyFunction ( unsigned int  pIndex,
int  pFunctionKey,
funcPtr2  pFieldFunction,
void *  p1,
void *  p2,
bool  pUseVal,
bool  pExitAfterRun = false 
)
virtual

Sets a function to be executed via a keypress for one of the fields (by index).

Parameters
pIndexThe index of the input to add the function to
pFunctionKeyThe key for the input to use to fire the function.
pFieldFunctionThe name of the function to add. It must match this signature: string func(void*, void*)
p1A pointer to the first parameter to use in the function
p2A pointer to the second parameter to use in the function
pUseValWhether or not the function's return value should be set as the value in the field.
pExitAfterRunWhether or not this field should exit from the input loop once the function is done.

◆ setFieldKeyFunction() [6/6]

virtual void cx::cxForm::setFieldKeyFunction ( unsigned  pIndex,
int  pFunctionKey,
funcPtr4  pFieldFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4,
bool  pUseVal,
bool  pExitAfterRun = false 
)
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.

Parameters
pIndexThe index of the input to add the function to
pFunctionKeyThe key for the input to use to fire the function.
pFieldFunctionThe name of the function to add. It must match this signature: string func(void*, void*)
p1A pointer to the first parameter to use in the function
p2A pointer to the second parameter to use in the function
p3A pointer to the 3rd parameter to use in the function
p4A pointer to the 4th parameter to use in the function
pUseValWhether or not the function's return value should be set as the value in the field.
pExitAfterRunWhether or not this field should exit from the input loop once the function is done.

◆ setFieldLabel() [1/2]

virtual void cx::cxForm::setFieldLabel ( const std::string &  pName,
const std::string &  pLabel 
)
virtual

Sets a field label (by name)

Parameters
pNameThe name of the field
pLabelThe label to be set in the field

◆ setFieldLabel() [2/2]

virtual void cx::cxForm::setFieldLabel ( unsigned  pIndex,
const std::string &  pLabel 
)
virtual

Sets a field label (by index)

Parameters
pIndexThe index of the field
pLabelThe label to be set in the field

◆ setFieldName() [1/2]

virtual void cx::cxForm::setFieldName ( const std::string &  pLabel,
const std::string &  pName 
)
virtual

Sets a field name (by label)

Parameters
pLabelThe label of the field
pNameThe name to be set in the field

◆ setFieldName() [2/2]

virtual void cx::cxForm::setFieldName ( unsigned  pIndex,
const std::string &  pName 
)
virtual

Sets a field name (by index)

Parameters
pIndexThe index of the field
pNameThe name to be set in the field

◆ setInputJumpKey()

void cx::cxForm::setInputJumpKey ( int  pInputJumpKey)
virtual

Sets the hotkey to be used to bring up the menu to choose.

which input to jump to.

Parameters
pInputJumpKeyThe hotkey to use

References mInputs, and numInputs().

◆ setInputOption() [1/2]

virtual void cx::cxForm::setInputOption ( const std::string &  pLabel,
eInputOptions  pInputOption,
bool  pIsLabel = true,
bool  pRefresh = true 
)
virtual

Sets the input kind for one of the inputs (by label/name).

Parameters
pLabelThe label/name of the input
pInputOptionThe new input kind
pIsLabelIf true (default), pLabel specifies the label. If false, pLabel specifies the name of the input.
pRefreshWhether or not to refresh the input on the screen, since its visual attributes will be changed. Defaults to true.

◆ setInputOption() [2/2]

void cx::cxForm::setInputOption ( int  pIndex,
eInputOptions  pInputOption,
bool  pRefresh = true 
)
virtual

Sets the input kind for one of the inputs (by index).

Parameters
pIndexThe index of the input
pInputOptionThe new input kind
pRefreshWhether 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().

◆ setIsModal()

void cx::cxForm::setIsModal ( bool  pIsModal)
protectedvirtual

Sets whether the form is modal or not.

Parameters
pIsModaltrue if the form is modal, or false if not.

References cx::cxWindow::mIsModal.

Referenced by cx::cxMultiForm::copyCxMultiFormStuff(), and cx::cxMultiForm::cxMultiForm().

◆ setKeyFunction() [1/12]

virtual bool cx::cxForm::setKeyFunction ( const std::string &  pLabel,
int  pKey,
const std::shared_ptr< cxFunction > &  pFunction,
bool  pIsLabel = true 
)
virtual

Sets a function to be called when a key is pressed.

Parameters
pIndexThe index of the input on the form
pLabelThe label/name of the input
pFunctionThe function to call. This can be an instance of one of the derived cxFunction classes as well.
pIsLabelIf true (default), pLabel is the input's label. If false, pLabel is the input's name.
Returns
True if the key & function was added or false if not

◆ setKeyFunction() [2/12]

virtual bool cx::cxForm::setKeyFunction ( const std::string &  pLabel,
int  pKey,
funcPtr0  pFunction,
bool  pUseVal,
bool  pExitAfterRun,
bool  pRunOnLeaveFunction,
bool  pRunValidator,
bool  pIsLabel = true 
)
virtual

Adds a function to call when the user presses some key for.

one of the inputs (by label/name).

Parameters
pLabelThe label/name of the input
pKeyThe keypress to fire the function
pFunctionThe function to be run - Must have this signature: string func(void*, void*)
pUseReturnValWhether 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.
pExitAfterRunWhether or not to exit the form after running the function (defaults to false)
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
pIsLabelIf true (default), pLabel is the input's label. If false, pLabel is the input's name.
Returns
True if the key & function was added or false if not

◆ setKeyFunction() [3/12]

virtual bool cx::cxForm::setKeyFunction ( const std::string &  pLabel,
int  pKey,
funcPtr2  pFunction,
void *  p1,
void *  p2,
bool  pUseVal,
bool  pExitAfterRun,
bool  pRunOnLeaveFunction,
bool  pRunValidator,
bool  pIsLabel = true 
)
virtual

Adds a function to call when the user presses some key for.

one of the inputs (by label/name).

Parameters
pLabelThe label/name of the input
pKeyThe keypress to fire the function
pFunctionThe function to be run - Must have this signature: string func(void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
pUseReturnValWhether 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.
pExitAfterRunWhether or not to exit the form after running the function (defaults to false)
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
pIsLabelIf true (default), pLabel is the input's label. If false, pLabel is the input's name.
Returns
True if the key & function was added or false if not

◆ setKeyFunction() [4/12]

virtual bool cx::cxForm::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 
)
virtual

Adds a function to call when the user presses some key for.

one of the inputs (by label/name).

Parameters
pLabelThe label/name of the input
pKeyThe keypress to fire the function
pFunctionThe function to be run - Must have this signature: string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function
pUseReturnValWhether 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.
pExitAfterRunWhether or not to exit the form after running the function (defaults to false)
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
pIsLabelIf true (default), pLabel is the input's label. If false, pLabel is the input's name.
Returns
True if the key & function was added or false if not

◆ setKeyFunction() [5/12]

virtual bool cx::cxForm::setKeyFunction ( int  pIndex,
int  pKey,
const std::shared_ptr< cxFunction > &  pFunction 
)
virtual

Sets a function to be called when a key is pressed.

Parameters
pIndexThe index of the input on the form
pKeyThe key to use for the function
pFunctionThe function to call. This can be an instance of one of the derived cxFunction classes as well.
Returns
True if the key & function was added or false if not

◆ setKeyFunction() [6/12]

bool cx::cxForm::setKeyFunction ( int  pIndex,
int  pKey,
funcPtr0  pFunction,
bool  pUseVal,
bool  pExitAfterRun,
bool  pRunOnLeaveFunction,
bool  pRunValidator 
)
virtual

Adds a function to call when the user presses some key for.

one of the inputs (by index).

Parameters
pIndexThe index of the input on the form
pKeyThe keypress to fire the function
pFunctionThe function to be run - Must have this signature: string func()
pUseReturnValWhether 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.
pExitAfterRunWhether or not to exit the form after running the function (defaults to false)
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
pIsLabelIf true (default), pLabel is the input's label. If false, pLabel is the input's name.
Returns
True if the key & function was added or false if not

References mInputs.

◆ setKeyFunction() [7/12]

bool cx::cxForm::setKeyFunction ( int  pIndex,
int  pKey,
funcPtr2  pFunction,
void *  p1,
void *  p2,
bool  pUseVal,
bool  pExitAfterRun,
bool  pRunOnLeaveFunction,
bool  pRunValidator 
)
virtual

Adds a function to call when the user presses some key for.

one of the inputs (by index).

Parameters
pIndexThe index of the input on the form
pKeyThe keypress to fire the function
pFunctionThe function to be run - Must have this signature: string func(void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
pUseReturnValWhether 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.
pExitAfterRunWhether or not to exit the form after running the function (defaults to false)
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
pIsLabelIf true (default), pLabel is the input's label. If false, pLabel is the input's name.
Returns
True if the key & function was added or false if not

References mInputs.

◆ setKeyFunction() [8/12]

bool cx::cxForm::setKeyFunction ( int  pIndex,
int  pKey,
funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4,
bool  pUseVal,
bool  pExitAfterRun,
bool  pRunOnLeaveFunction,
bool  pRunValidator 
)
virtual

Adds a function to call when the user presses some key for.

one of the inputs (by index).

Parameters
pIndexThe index of the input on the form
pKeyThe keypress to fire the function
pFunctionThe function to be run - Must have this signature: string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function
pUseReturnValWhether 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.
pExitAfterRunWhether or not to exit the form after running the function (defaults to false)
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
pIsLabelIf true (default), pLabel is the input's label. If false, pLabel is the input's name.
Returns
True if the key & function was added or false if not

References mInputs.

◆ setKeyFunction() [9/12]

virtual bool cx::cxForm::setKeyFunction ( int  pKey,
const std::shared_ptr< cxFunction > &  pFunction 
)
overridevirtual

Sets a function to be called when a key is pressed.

Parameters
pKeyThe key to use for the function
pFunctionThe function to call. This can be an instance of one of the derived cxFunction classes as well.
Returns
True if the key & function was added or false if not

Reimplemented from cx::cxWindow.

Referenced by addInputJumpKey(), cxFormMultiLineInputFunctionKeyNoValidator(), formFunctionKeyNoOnLeave(), formFunctionKeys(), formUpArrowFunction(), formWithFKeys(), getFormKeys(), cx::cxMultiForm::setKeyFunction(), cx::cxMultiForm::setKeyFunction(), and cx::cxMultiForm::setKeyFunction().

◆ setKeyFunction() [10/12]

bool cx::cxForm::setKeyFunction ( int  pKey,
funcPtr0  pFunction,
bool  pUseReturnVal = false,
bool  pExitAfterRun = false,
bool  pRunOnLeaveFunction = true 
)
overridevirtual

Adds a function to call when the user presses some key.

Parameters
pKeyThe keypress to fire the function
pFunctionThe function to be run - Must have signature string func()
pUseReturnValWhether 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.
pExitAfterRunWhether or not to exit the form after running the function (defaults to false)
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
Returns
True if the key & function was added or false if not

Reimplemented from cx::cxWindow.

Reimplemented in cx::cxMultiForm.

References mInputs, removeExitKey(), removeQuitKey(), and cx::cxWindow::setKeyFunction().

◆ setKeyFunction() [11/12]

bool cx::cxForm::setKeyFunction ( int  pKey,
funcPtr2  pFunction,
void *  p1,
void *  p2,
bool  pUseReturnVal = false,
bool  pExitAfterRun = false,
bool  pRunOnLeaveFunction = true 
)
overridevirtual

Adds a function to call when the user presses some key.

Parameters
pKeyThe keypress to fire the function
pFunctionThe function to be run - Must have signature string func(void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
pUseReturnValWhether 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.
pExitAfterRunWhether or not to exit the form after running the function (defaults to false)
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
Returns
True if the key & function was added or false if not

Reimplemented from cx::cxWindow.

Reimplemented in cx::cxMultiForm.

References mInputs, removeExitKey(), removeQuitKey(), and cx::cxWindow::setKeyFunction().

◆ setKeyFunction() [12/12]

bool cx::cxForm::setKeyFunction ( int  pKey,
funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4,
bool  pUseReturnVal = false,
bool  pExitAfterRun = false,
bool  pRunOnLeaveFunction = true 
)
overridevirtual

Adds a function to call when the user presses some key.

Parameters
pKeyThe keypress to fire the function
pFunctionThe function to be run - Must have signature string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function
pUseReturnValWhether 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.
pExitAfterRunWhether or not to exit the form after running the function (defaults to false)
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
Returns
True if the key & function was added or false if not

Reimplemented from cx::cxWindow.

Reimplemented in cx::cxMultiForm.

References mInputs, removeExitKey(), removeQuitKey(), and cx::cxWindow::setKeyFunction().

◆ setLabelColor() [1/2]

void cx::cxForm::setLabelColor ( const int &  pIndex,
e_cxColors  pColor 
)

Sets the color of the label of one of the inputs (by index)

Parameters
pIndexThe index of the input whose label color to set
pColorThe color to set

References mInputs.

Referenced by formInputColors().

◆ setLabelColor() [2/2]

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)

Parameters
pLabelThe label/name of the input whose label color to set
pColorThe color to set
pIsLabelIf true (default), pLabel is the input's label. If false, pLabel is the input's name.

◆ setLastKey()

void cx::cxForm::setLastKey ( int  pLastKey)
overridevirtual

Sets the last keypress.

Parameters
pLastKeyThe 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().

◆ setLoopEndFunction()

void cx::cxForm::setLoopEndFunction ( const std::shared_ptr< cxFunction > &  pFuncPtr)
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.

Parameters
pFuncPtrA pointer to the function

◆ setLoopStartFunction()

void cx::cxForm::setLoopStartFunction ( const std::shared_ptr< cxFunction > &  pFuncPtr)
virtual

Sets a function to be run at the start of each.

input loop. The return value of the function is

not used.

Parameters
pFuncPtrA pointer to the function

◆ setMaskChar() [1/2]

bool cx::cxForm::setMaskChar ( const std::string &  pLabel,
char  pMaskChar,
bool  pIsLabel = true 
)

Sets the masking character for an input (by label).

Parameters
pLabelThe label of the input
pMaskCharThe character to use for masking
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.
Returns
True if successful or false if not

◆ setMaskChar() [2/2]

bool cx::cxForm::setMaskChar ( int  pIndex,
char  pMaskChar 
)

Sets the masking character for an input (by index).

Parameters
pIndexThe index of the input
pMaskCharThe character to use for masking
Returns
True if it successful or false if not

References mInputs.

◆ setOnFocusFunction() [1/8]

virtual void cx::cxForm::setOnFocusFunction ( const std::shared_ptr< cxFunction > &  pFunction)
overridevirtual

Sets the form window's "on focus" function.

Parameters
pFunctionThe function to be run

Reimplemented from cx::cxWindow.

Referenced by cxInputOnFormLoopDisabled(), and main().

◆ setOnFocusFunction() [2/8]

virtual void cx::cxForm::setOnFocusFunction ( const std::string &  pLabel,
const std::shared_ptr< cxFunction > &  pFunction,
bool  pIsLabel = true 
)
virtual

Sets the "on focus" function pointer for a field (by label). The function must have this signature: string func(void*, void*, void*, void*).

Parameters
pLabelThe label of the field
pFunctionThe function to be run - Must have this signature: string func(void*, void*, void*, void*)
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ setOnFocusFunction() [3/8]

virtual void cx::cxForm::setOnFocusFunction ( const std::string &  pLabel,
funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4,
bool  pUseVal,
bool  pIsLabel = true 
)
virtual

Sets the "on focus" function pointer for a field (by label). The function must have this signature: string func(void*, void*, void*, void*).

Parameters
pLabelThe label of the field
pFunctionThe function to be run - Must have this signature: string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function
pUseValWhether or not the function's return value should be set as the value in the field
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ setOnFocusFunction() [4/8]

void cx::cxForm::setOnFocusFunction ( funcPtr0  pFuncPtr,
bool  pUseVal = false,
bool  pExitAfterRun = false 
)
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.

Parameters
pFuncPtrA pointer to the function - Must have the signature string someFunc().
pUseValWhether or not the function's return value should be set as the value in the field (defaults to false)
pExitAfterRunWhether 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().

◆ setOnFocusFunction() [5/8]

void cx::cxForm::setOnFocusFunction ( funcPtr2  pFuncPtr,
void *  p1,
void *  p2,
bool  pUseVal = false,
bool  pExitAfterRun = false 
)
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.

Parameters
pFuncPtrA pointer to the function - Must have the signature string someFunc(void*, void).
p1A pointer to the first argument
p2A pointer to the 2nd argument
pUseValWhether or not the function's return value should be set as the value in the field (defaults to false)
pExitAfterRunWhether 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().

◆ setOnFocusFunction() [6/8]

void cx::cxForm::setOnFocusFunction ( funcPtr4  pFuncPtr,
void *  p1,
void *  p2,
void *  p3,
void *  p4,
bool  pUseVal = false,
bool  pExitAfterRun = false 
)
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.

Parameters
pFuncPtrA pointer to the function - Must have the signature string someFunc(void*, void*, void*, void).
p1A pointer to the first argument
p2A pointer to the 2nd argument
p3A pointer to the 3rd argument
p4A pointer to the 4th argument
pUseValWhether or not the function's return value should be set as the value in the field (defaults to false)
pExitAfterRunWhether 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().

◆ setOnFocusFunction() [7/8]

virtual void cx::cxForm::setOnFocusFunction ( unsigned  pIndex,
const std::shared_ptr< cxFunction > &  pFunction 
)
virtual

Sets the "on focus" function pointer for a field (by index). The function must have this signature: string func(void*, void*, void*, void*).

Parameters
pIndexThe index of the field
pFunctionThe function to be run - Must have signature string func(void*, void*, void*, void*)

◆ setOnFocusFunction() [8/8]

void cx::cxForm::setOnFocusFunction ( unsigned  pIndex,
funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4,
bool  pUseVal 
)
virtual

Sets the "on focus" function pointer for a field (by index). The function must have this signature: string func(void*, void*, void*, void*).

Parameters
pIndexThe index of the field
pFunctionThe function to be run - Must have signature string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function
pUseValWhether or not the function's return value should be set as the value in the field

References mInputs.

◆ setOnKeyFunction() [1/8]

virtual void cx::cxForm::setOnKeyFunction ( const std::string &  pLabel,
const std::shared_ptr< cxFunction > &  pFunction,
bool  pIsLabel = true 
)
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.

Parameters
pLabelThe label/name of the input
pFunctionThe function to be run
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ setOnKeyFunction() [2/8]

virtual void cx::cxForm::setOnKeyFunction ( const std::string &  pLabel,
funcPtr0  pFunction,
bool  pIsLabel = true 
)
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.

Parameters
pLabelThe label/name of the input
pFunctionThe function to be run - Must have this signature: string func(void*, void*)
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ setOnKeyFunction() [3/8]

virtual void cx::cxForm::setOnKeyFunction ( const std::string &  pLabel,
funcPtr2  pFunction,
void *  p1,
void *  p2,
bool  pIsLabel = true 
)
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.

Parameters
pLabelThe label/name of the input
pFunctionThe function to be run - Must have this signature: string func(void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ setOnKeyFunction() [4/8]

virtual void cx::cxForm::setOnKeyFunction ( const std::string &  pLabel,
funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4,
bool  pIsLabel = true 
)
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.

Parameters
pLabelThe label/name of the input
pFunctionThe function to be run - Must have this signature: string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ setOnKeyFunction() [5/8]

virtual void cx::cxForm::setOnKeyFunction ( int  pIndex,
const std::shared_ptr< cxFunction > &  pFunction 
)
virtual

Sets a function to be run whenever a key is pressed in an input (by index).

Parameters
pIndexThe index of the input
pFunctionThe function to be run

Referenced by comboBoxOnForm(), cxFormAssignment(), floatingPtValidateOnForm(), form(), and integerValidateOnForm().

◆ setOnKeyFunction() [6/8]

void cx::cxForm::setOnKeyFunction ( int  pIndex,
funcPtr0  pFunction 
)
virtual

Sets a function to be run whenever a key is pressed in an input (by index).

Parameters
pIndexThe index of the input
pFunctionThe function to be run - Must have this signature: string func()
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function

References mInputs.

◆ setOnKeyFunction() [7/8]

void cx::cxForm::setOnKeyFunction ( int  pIndex,
funcPtr2  pFunction,
void *  p1,
void *  p2 
)
virtual

Sets a function to be run whenever a key is pressed in an input (by index).

Parameters
pIndexThe index of the input
pFunctionThe function to be run - Must have this signature: string func(void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function

References mInputs.

◆ setOnKeyFunction() [8/8]

void cx::cxForm::setOnKeyFunction ( int  pIndex,
funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4 
)
virtual

Sets a function to be run whenever a key is pressed in an input (by index).

Parameters
pIndexThe index of the input
pFunctionThe function to be run - Must have this signature: string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function

References mInputs.

◆ setOnLeaveFunction() [1/8]

virtual void cx::cxForm::setOnLeaveFunction ( const std::shared_ptr< cxFunction > &  pFunction)
overridevirtual

Sets the form window's "on leave" function.

Parameters
pFunctionThe function to be run

Reimplemented from cx::cxWindow.

Referenced by cxFormMultiLineInputFunctionKeyNoValidator(), cxInputOnFormLoopDisabled(), formFunctionKeyNoOnLeave(), formUpArrowFunction(), formWithFKeys(), inputQuitKeysOnForm(), and setValFunc().

◆ setOnLeaveFunction() [2/8]

virtual void cx::cxForm::setOnLeaveFunction ( const std::string &  pLabel,
const std::shared_ptr< cxFunction > &  pFunction,
bool  pIsLabel = true 
)
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*).

Parameters
pLabelThe label/name of the field
pFunctionThe function to be run - Must have signature string func(void*, void*, void*, void*)
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ setOnLeaveFunction() [3/8]

virtual void cx::cxForm::setOnLeaveFunction ( const std::string &  pLabel,
funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4,
bool  pIsLabel = true 
)
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*).

Parameters
pLabelThe label/name of the field
pFunctionThe function to be run - Must have signature string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ setOnLeaveFunction() [4/8]

void cx::cxForm::setOnLeaveFunction ( funcPtr0  pFuncPtr)
overridevirtual

Sets a function to be run when focus is lost.

The return value of the function is not used.

Parameters
pFuncPtrA pointer to the function - Must have the signature string someFunc().
p1A pointer to the first argument
p2A pointer to the 2nd argument

Reimplemented from cx::cxWindow.

References cx::cxWindow::setOnLeaveFunction().

◆ setOnLeaveFunction() [5/8]

void cx::cxForm::setOnLeaveFunction ( funcPtr2  pFuncPtr,
void *  p1,
void *  p2 
)
overridevirtual

Sets a function to be run when focus is lost.

The return value of the function is not used.

Parameters
pFuncPtrA pointer to the function - Must have the signature string someFunc(void*, void).
p1A pointer to the first argument
p2A pointer to the 2nd argument

Reimplemented from cx::cxWindow.

References cx::cxWindow::setOnLeaveFunction().

◆ setOnLeaveFunction() [6/8]

void cx::cxForm::setOnLeaveFunction ( funcPtr4  pFuncPtr,
void *  p1,
void *  p2,
void *  p3,
void *  p4 
)
overridevirtual

Sets a function to be run when focus is lost.

The return value of the function is not used.

Parameters
pFuncPtrA pointer to the function - Must have the signature string someFunc(void*, void*, void*, void).
p1A pointer to the first argument
p2A pointer to the 2nd argument
p3A pointer to the 3rd argument
p4A pointer to the 4th argument

Reimplemented from cx::cxWindow.

References cx::cxWindow::setOnLeaveFunction().

◆ setOnLeaveFunction() [7/8]

virtual void cx::cxForm::setOnLeaveFunction ( unsigned  pIndex,
const std::shared_ptr< cxFunction > &  pFunction 
)
virtual

Sets the "on leave" function pointer for a field (by index). The function must have this signature: string func(void*, void*, void*, void*).

Parameters
pIndexThe index of the field
pFunctionThe function to be run - Must have signature string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function

◆ setOnLeaveFunction() [8/8]

void cx::cxForm::setOnLeaveFunction ( unsigned  pIndex,
funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4 
)
virtual

Sets the "on leave" function pointer for a field (by index). The function must have this signature: string func(void*, void*, void*, void*).

Parameters
pIndexThe index of the field
pFunctionThe function to be run - Must have signature string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function

References mInputs.

◆ setParentMultiForm()

void cx::cxForm::setParentMultiForm ( cxMultiForm pParentMultiForm)
virtual

Sets the parent cxMultiForm that this cxForm is associated with.

Parameters
pParentMultiFormA pointer to the form's parent cxMultiForm (or nullptr if there is no parent cxMultiForm)

◆ setStartAtFirstInput()

void cx::cxForm::setStartAtFirstInput ( bool  pStartAtFirstInput)
virtual

Sets whether or not to always start at the first editable.

input when showModal() is called.

Parameters
pStartAtFirstInputWhether or not to always start at the first editable input when showModal() is called.

References mStartAtFirstInput.

Referenced by cxFormStartAtFirstInput().

◆ setStatus()

void cx::cxForm::setStatus ( const std::string &  pStatus,
bool  pRefreshStatus = true 
)
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.

Parameters
pStatusThe new status message for window
pRefreshStatusWhether 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().

◆ setUseExtendedHelpKeys()

void cx::cxForm::setUseExtendedHelpKeys ( bool  pUseExtendedHelpKeys)
virtual

Sets whether or not to use the extended help keys.

Parameters
pUseExtendedHelpKeyWhether or not to use the extended help keys (true/false)

References mInputs.

Referenced by cxFormExtendedHelpKey().

◆ setValidatorFunction() [1/4]

virtual void cx::cxForm::setValidatorFunction ( const std::string &  pLabel,
const std::shared_ptr< cxFunction > &  pFunction,
bool  pIsLabel = true 
)
virtual

Sets a validator function to be run before focus is lost for one.

of the inputs (by label/name).

Parameters
pLabelThe label/name of the input
pFunctionThe function to be run
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ setValidatorFunction() [2/4]

virtual void cx::cxForm::setValidatorFunction ( const std::string &  pLabel,
funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4,
bool  pIsLabel = true 
)
virtual

Sets a validator function to be run before focus is lost for one.

of the inputs (by label/name).

Parameters
pLabelThe label/name of the input
pFunctionThe function to be run - Must have signature string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ setValidatorFunction() [3/4]

virtual void cx::cxForm::setValidatorFunction ( int  pIndex,
const std::shared_ptr< cxFunction > &  pFunction 
)
virtual

Sets a validator function to be run before focus is lost for one.

of the inputs (by index).

Parameters
pIndexThe index of the input
pFunctionThe function to be run

Referenced by formWithInputValueValidator(), and inputQuitKeysOnForm().

◆ setValidatorFunction() [4/4]

void cx::cxForm::setValidatorFunction ( int  pIndex,
funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4 
)
virtual

Sets a validator function to be run before focus is lost for one.

of the inputs (by index).

Parameters
pIndexThe index of the input
pFunctionThe function to be run - Must have signature string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function

References mInputs.

◆ setValue() [1/2]

virtual bool cx::cxForm::setValue ( const std::string &  pLabel,
const std::string &  pValue,
bool  pIsLabel = true,
bool  pRefresh = false 
)
virtual

Sets the value of an input (by label/name).

Parameters
pLabelThe label/name of the input
pValueThe new string value for the input
pIsLabelIf true (default), pLabel specifies the label of the input. If false, pLabel specifies the name of the input.
pRefreshWhether or not to refresh the input (defaults to false)
Returns
True if successful or false if not

Reimplemented in cx::cxMultiForm.

◆ setValue() [2/2]

virtual bool cx::cxForm::setValue ( int  pIndex,
const std::string &  pValue,
bool  pRefresh = false 
)
virtual

Sets the value of an input (by index).

Parameters
pIndexThe index of the input
pValueThe value to be placed at that index.
pRefreshWhether or not to refresh the input (defaults to false)
Returns
True if successful or false if not

Reimplemented in cx::cxMultiForm.

Referenced by attributesSetter(), cxFormAssignment(), cxFormClearOnlyEditable(), form(), formInputColors(), main(), setValFunc(), and setValues().

◆ setValueColor() [1/2]

void cx::cxForm::setValueColor ( const int &  pIndex,
e_cxColors  pColor 
)

Sets the color of the value section of one of the inputs (by index)

Parameters
pIndexThe index of the input whose value color to set
pColorThe color to set

References mInputs.

Referenced by formInputColors().

◆ setValueColor() [2/2]

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)

Parameters
pLabelThe label/name of the input whose value color to set
pColorThe color to set
pIsLabelIf true (default), pLabel is the input's label. If false, pLabel is the input's name.

◆ setValues()

void cx::cxForm::setValues ( const std::map< std::string, std::string > &  pValues,
bool  pUseLabels = true,
bool  pRefresh = false,
bool  pDisableValidatorFunctions = false 
)
virtual

Sets the values in the form with a map of input labels/names.

and values.

Parameters
pValuesA map of input labels/names and values to be set in the form.
pUseLabelsIf true (default), the map keys will be used as input labels; if false, the map keys will be used as input names.
pRefreshWhether or not to refresh the inputs after setting their values. Defaults to false.
pDisableValidatorFunctionsWhether 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().

◆ setWaitForInputIfEmpty()

void cx::cxForm::setWaitForInputIfEmpty ( bool  pWaitForInputIfEmpty)
virtual

Toggles whether or not the form should wait for.

user input if there are no editable inputs.

Parameters
pWaitForInputIfEmptyWhether or not the form should wait for user input if there are no editable inputs.

◆ show()

long cx::cxForm::show ( bool  pBringToTop = false,
bool  pShowSubwindows = true 
)
overridevirtual

Shows the form.

Parameters
pBringToTopWhether or not to bring this window to the top. Defaults to false.
pShowSubwindowsWhether or not to show sub-windows also. Defaults to true.
Returns
The return value of cxWindow::show()

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().

◆ showAllInputs()

void cx::cxForm::showAllInputs ( bool  pBringToTop = true,
bool  pSkipCurrentInput = false 
) const
virtual

Shows (refreshes) all inputs.

Parameters
pBringToTopWhether or not to bring the inputs to the top (defaults to true)
pSkipCurrentInputWhether 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().

◆ showInputsOnBorder()

void cx::cxForm::showInputsOnBorder ( bool  pShowInputsOnBorder)
virtual

Toggles whether to show inputs if they're on.

a border if the form has a border.

Parameters
pShowInputsOnBorderWhether or not to show inputs if they're on a border

References cx::eBS_NOBORDER, and cx::cxWindow::getBorderStyle().

◆ showModal()

long cx::cxForm::showModal ( bool  pShowSelf = true,
bool  pBringToTop = false,
bool  pShowSubwindows = true 
)
overridevirtual

Shows the form and waits for input.

Parameters
pShowSelfWhether or not to show the window before running the input loop. Defaults to true.
pBringToTopWhether or not to bring this window to the top. Defaults to false.
pShowSubwindowsWhether or not to show sub-windows also. Defaults to true.
Returns
A return code based on user input. Returns cxID_QUIT if the user presses ESC; otherwise, returns cxID_EXIT.

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().

◆ swap() [1/2]

bool cx::cxForm::swap ( int  pInput1Index,
int  pInput2Index 
)
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.

Parameters
pInput1IndexThe index of the first input
pInput2IndexThe index of the second input
Returns
Whether or not the inputs got swapped

References mInputs.

◆ swap() [2/2]

virtual bool cx::cxForm::swap ( std::shared_ptr< cxWindow > &  pInput1,
std::shared_ptr< cxWindow > &  pInput2 
)
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.

Parameters
pInput1A pointer to the first input
pInput2A pointer to the second input
Returns
Whether or not the inputs got swapped

◆ toggleAllOnKeyFunction()

void cx::cxForm::toggleAllOnKeyFunction ( bool  pRunOnKeyFunction)
virtual

Sets whether or not the onKey function for all inputs should.

run.

Parameters
pRunOnKeyFunctionWhether or not the onKey function should run (for all inputs)

References mInputs.

◆ toggleCursor() [1/3]

void cx::cxForm::toggleCursor ( bool  pShowCursor)
virtual

Toggles the display of the cursor on all inputs.

Parameters
pShowCursorWhether or not the cursor should be shown on all inputs (true/false).

References mInputs.

◆ toggleCursor() [2/3]

virtual void cx::cxForm::toggleCursor ( const std::string &  pLabel,
bool  pShowCursor,
bool  pIsLabel = true 
)
virtual

Toggles the display of the cursor for an input (by label/name).

Parameters
pLabelThe label/name of the input for which to toggle the cursor display.
pShowCursorWhether or not the input should show the cursor (true/false).
pIsLabelIf true, pLabel specifies the label; if false, pLabel specifies the name of the input.

◆ toggleCursor() [3/3]

void cx::cxForm::toggleCursor ( int  pIndex,
bool  pShowCursor 
)
virtual

Toggles the display of the cursor for an input (by index).

Parameters
pIndexThe index of the input for which to toggle the cursor display.
pShowCursorWhether or not the input should show the cursor (true/false).

References mInputs.

◆ toggleMasking() [1/2]

virtual bool cx::cxForm::toggleMasking ( const std::string &  pLabel,
bool  pMasking,
bool  pIsLabel = true 
)
virtual

Enables/disables masking for an input (by label).

Parameters
pLabelThe label of the input
pMaskingWhether or not the input should be masked (true/false)
pIsLabelTrue if pStr is the label (default), or false if pStr is the name
Returns
True if successul or false if not

◆ toggleMasking() [2/2]

bool cx::cxForm::toggleMasking ( int  pIndex,
bool  pMasking 
)
virtual

Enables/disables masking for an input (by index).

Parameters
pIndexThe index of the input
pMaskingWhether or not the input should be masked (true/false)
Returns
True if successul or false if not

References mInputs.

Referenced by formInputColors().

◆ toggleOnKeyFunction() [1/2]

virtual void cx::cxForm::toggleOnKeyFunction ( const std::string &  pLabel,
bool  pRunOnKeyFunction,
bool  pIsLabel = true 
)
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.

Parameters
pLabelThe label/name of the input
pRunOnKeyFunctionWhether or not the input's onKey function should run
pIsLabelIf true (default), pLabel specifies the input label. If false, pLabel specifies the name of the input.

◆ toggleOnKeyFunction() [2/2]

void cx::cxForm::toggleOnKeyFunction ( int  pIndex,
bool  pRunOnKeyFunction 
)
virtual

Sets whether or not an onKey function should run for one of the.

inputs on the form (by index).

Parameters
pIndexThe index of the input
pRunOnKeyFunctionWhether or not the input's onKey function should run

References mInputs.

◆ trapNonAssignedFKeys()

void cx::cxForm::trapNonAssignedFKeys ( bool  pTrapNonAssignedFKeys)
virtual

Sets whether non-assigned function keys should.

be trapped within the input loop and not cause

the input to stop its input loop.

Parameters
pTrapNonAssignedFKeysIf 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.

◆ unhide()

void cx::cxForm::unhide ( bool  pUnhideSubwindows = true)
overridevirtual

Un-hides the form (along with all the inputs).

Parameters
pUnhideSubwindowsWhether 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().

◆ useInputStatus()

void cx::cxForm::useInputStatus ( bool  pUseInputStatus)
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.

Parameters
pUseInputStatusWhether 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().

◆ validateOnJumpKey() [1/2]

virtual void cx::cxForm::validateOnJumpKey ( const std::string &  pID,
bool  pValidate,
bool  pIsLabel = true 
)
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.

Parameters
pIDThe label/name of the input
pValidateIf 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.
pIsLabelIf true (default), then pID specifies the input label. If false, then pID specifies the input name.

◆ validateOnJumpKey() [2/2]

void cx::cxForm::validateOnJumpKey ( int  pIndex,
bool  pValidate 
)
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.

Parameters
pIndexThe index of the input
pValidateIf 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.

Friends And Related Symbol Documentation

◆ cxMultiForm

friend class cxMultiForm
friend

◆ cxMultiLineInput

friend class cxMultiLineInput
friend

◆ cxPanel

friend class cxPanel
friend

Member Data Documentation

◆ mCurrentInput

int cx::cxForm::mCurrentInput = 0
protected

◆ mInputPositions

std::vector<std::pair<int, int> > cx::cxForm::mInputPositions
protected

◆ mInputs

inputPtrContainer cx::cxForm::mInputs
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().

◆ mStartAtFirstInput

bool cx::cxForm::mStartAtFirstInput = false
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().

◆ mTrapNonAssignedFKeys

bool cx::cxForm::mTrapNonAssignedFKeys = true
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().


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