cxWidgets 1.0
cxInput.h
Go to the documentation of this file.
1// Copyright (c) 2026 E. Oulashin
2#ifndef __CXINPUT_H__
3#define __CXINPUT_H__
4
5// Copyright (c) 2005-2007 Michael H. Kinney
6//
7// This class represents an input box with
8// a label.
9
10#include "cxWindow.h"
11#include "cxFunction.h"
12#include "cxTextValidator.h"
13#include "cxInputOptions.h"
14#include "cxColors.h"
15#ifdef WANT_TIMEOUT
16#include <sys/signal.h> // For sigaction
17#endif
18#include <string>
19#include <map>
20#include <set>
21#include <memory>
22
23// Forward declaration
24namespace cx {
25
26class cxMultiLineInput;
27
105class cxInput : public cxWindow
106{
107 public:
125 explicit cxInput(cxWindow *pParentWindow = nullptr, int pRow = 0,
126 int pCol = 0, int pWidth = DEFAULT_WIDTH,
127 const std::string& pLabel = "",
128 eBorderStyle pBorderStyle = eBS_NOBORDER,
129 eInputOptions pInputOption = eINPUT_EDITABLE,
130 bool pExitOnFull = false, std::string *pExtVal = nullptr);
131
136 cxInput(const cxInput& pThatInput);
137
147 cxInput(const cxInput& pThatInput, cxMultiLineInput *pParentMLInput);
148
152 virtual ~cxInput();
153
160 virtual long show(bool pBringToTop = false, bool pShowSubwindows = false) override;
161
175 virtual long showModal(bool pShowSelf = true, bool pBringToTop = true,
176 bool pShowSubwindows = false) override;
177
182 virtual std::string getLabel() const;
183
188 virtual void setLabel(const std::string& pLabel);
189
196 virtual void clearValue(bool pRefresh = false);
197
205 virtual void clear(bool pRefresh = false) override;
206
213 virtual std::string getValue(bool pRemoveLeadingSpaces = false, bool pRemoveTrailingSpaces = false) const;
214
221 virtual bool setValue(const std::string& pValue, bool pRefresh = false);
222
227 std::string* getExtValue() const;
228
234 void setExtValue(std::string *pExtVal, bool pRefresh = false);
235
240 bool getExitOnFull() const;
241
248 void setExitOnFull(bool pExitOnFull);
249
257 bool getExitOnBackspaceAtFront() const;
258
267 void setExitOnBackspaceAtFront(bool pExitOnBackspaceAtFront);
268
275 bool getExitOnMouseOutside() const override;
276
285 void setExitOnMouseOutside(bool pExitOnMouseOutside) override;
286
292 bool getExitOnArrowAtBoundary() const;
293
300 void setExitOnArrowAtBoundary(bool pExitOnArrowAtBoundary);
301
306 bool getMustFill() const;
307
312 void setMustFill(bool pMustFill);
313
318 bool getMasked() const { return(mMasked); }
319
324 void toggleMasking(bool pMasking) { mMasked = pMasking; }
325
330 char getMaskChar() const { return(mMaskChar); }
331
336 void setMaskChar(char pMaskChar) { mMaskChar = pMaskChar; }
337
344 int getInputOption() const;
345
352 void setInputOption(eInputOptions pInputOption);
353
358 void setValidator(const std::string& pVString);
359
364 const std::string& getValidatorStr() const;
365
370 int getInputLen() const;
371
376 void setCursorX(int pCursorX);
377
386 virtual bool move(int pNewRow, int pNewCol, bool pRefresh = true) override;
387
397 virtual void resize(int pNewHeight, int pNewWidth, bool pRefresh = true) override;
398
403 void setExitOnFKey(bool pExitOnFunctionKey);
404
410 virtual bool textIsValid() const;
411
417 virtual bool textIsValid(const std::string& pText) const;
418
424 void setLabelColor(e_cxColors pColor);
425
433
439 void setValueColor(e_cxColors pColor);
440
448
457 virtual void setColor(e_WidgetItems pItem, e_cxColors pColor) override;
458
464 void toggleCursor(bool pShowCursor);
465
474 static std::string clearInput(void* theInput, void* unused);
475
489 bool setValidatorFunction(funcPtr4 pFunction, void *p1, void *p2,
490 void *p3, void *p4);
491
503 bool setValidatorFunction(funcPtr2 pFunction, void *p1, void *p2);
504
514 bool setValidatorFunction(funcPtr0 pFunction);
515
520
528 virtual bool setOnKeyFunction(const std::shared_ptr<cxFunction>& pFunction);
529
541 virtual bool setOnKeyFunction(funcPtr4 pFunction, void *p1, void *p2,
542 void *p3, void *p4);
543
555 virtual bool setOnKeyFunction(funcPtr2 pFunction, void *p1, void *p2);
556
568 virtual bool setOnKeyFunction(funcPtr0 pFunction);
569
576 virtual void toggleOnKeyFunction(bool pRunOnKeyFunction);
577
581 virtual void clearOnKeyFunction();
582
588 virtual bool onKeyFunctionEnabled() const;
589
595 virtual bool isFull() const;
596
602 virtual int maxValueLen() const;
603
609 virtual bool hasFocus() const override;
610
617 virtual void setReadOnlyOnLeave(bool pReadOnlyOnLeave);
618
624 bool canBeEditable() const;
625
632 void setCanBeEditable(bool pCanBeEditable);
633
639 virtual void setBorderStyle(eBorderStyle pBorderStyle) override;
640
647 virtual void refreshValue(bool pRefresh = true);
648
659 void trapNonAssignedFKeys(bool pTrapNonAssignedFKeys);
660
672 virtual void enableInputLoop(bool pDoInputLoop);
673
679 virtual bool inputLoopEnabled() const;
680
693 bool isEditable() const;
694
702 virtual bool getCursorLeftAlign() const;
703
711 virtual void setCursorLeftAlign(bool pCursorLeftAlign);
712
723 virtual void setValidateOnReverse(bool pValidateOnReverse);
724
732 virtual bool getValidateOnReverse() const;
733
739 virtual void setLastKey(int pLastKey) override;
740
750 virtual bool modalGetsKeypress() const override;
751
766 virtual bool runOnFocusFunction(std::string *pFunctionRetval = nullptr) override;
767
776 virtual cxWindow* getParent() const override;
777
786 virtual void addAttr(e_WidgetItems pItem, attr_t pAttr) override;
787
798 virtual void setAttr(e_WidgetItems pItem, attr_t pAttr) override;
799
807 virtual void removeAttr(e_WidgetItems pItem, attr_t pAttr) override;
808
815 virtual void removeAttrs(e_WidgetItems pItem) override;
816
824 virtual void getAttrs(e_WidgetItems pItem, std::set<attr_t>& pAttrs) const override;
825
834 virtual std::string runValidatorFunction() const;
835
843 virtual void setTimeout(int pTimeout);
844
850 int getTimeout() const;
851
859 virtual std::string cxTypeStr() const override;
860
867 void setForceUpper(bool pForceUpper);
868
874 bool getForceUpper() const;
875
882 void setMaxInputLength(int pLength);
883
889 int getMaxInputLength() const;
890
894 static int inputClearKey;
895
896 protected:
897 // Attributes for various element (in addition to the ones provided
898 // in cxWindow)
902 std::set<attr_t> mLabelAttrs;
906 std::set<attr_t> mDataReadonlyAttrs;
910 std::set<attr_t> mDataEditableAttrs;
911
927 virtual bool handleFunctionForLastKey(bool *pFunctionExists = nullptr,
928 bool *pRunOnLeaveFunction = nullptr) override;
929
940 virtual void enableAttrs(WINDOW *pWin, e_WidgetItems pItem) override;
941
952 virtual void disableAttrs(WINDOW *pWin, e_WidgetItems pItem) override;
953
963 virtual e_cxColors getItemColor(e_WidgetItems pItem) const override;
964
965 private:
966 friend class cxMultiLineInput; // Because that class uses this class
967
968 // The following member is set if this input is in a cxMultiLineInput.
969 cxMultiLineInput *mParentMLInput = nullptr;
970 std::string mValue; // Holds the user's input
971 // mName is an alternative means of identifying the input (by name).
972 std::string mName;
973 // mExtValue points to an "external" location to load/store the user's input
974 // (basically, it will be used for user input storage as well as mValue,
975 // but the value in this input will always be the what mExtValue contains).
976 // If nullptr, then it won't be used.
977 std::string *mExtValue;
978 int mInputStartX = 0; // Starting X cursor position for text input
979 int mYPos = 0; // Y cursor position for input
980 int mInputLen = 0; // Valid length of input
981 int mRightMax = 0; // Rightmost input boundary
982 bool mExitOnFull; // Whether the input loop should stop when the input is full
983 // mExitOnBackspaceAtFront specifies whether the input loop should stop when
984 // backspace is pressed in the first input position.
985 bool mExitOnBackspaceAtFront = false;
986 bool mExitOnMouseOutside = false; // Exit input loop on mouse click outside this window
987 bool mExitOnArrowAtBoundary = false; // Exit on left arrow at pos 0 or right arrow at end of text
988 bool mMustFill = false; // Whether or not the user must fill the entire field
989 bool mMasked = false; // Whether or not the field is masked (i.e. for a password)
990 char mMaskChar = '*'; // The character to display for character masking
991 cxTextValidator mValidator; // For use with text validation
992 eInputOptions mInputOption; // Specifies normal, read-only, etc.
993 bool mExitOnFunctionKey = false; // Whether or not to exit on function key press.
994 bool mHasFocus = false; // Whether or not focus is set
995 // mReadOnlyOnLeave stores whether or not the input should go read-only
996 // when setFocus() finishes.
997 bool mReadOnlyOnLeave = false;
998 bool mCanBeEditable = true; // Whether or not the input can be editable
999 bool mJustStartedFocus = false; // True immediately when focus is set
1000 // If mTrapNonAssignedFKeys is true, function keys that aren't
1001 // assigned to anything won't cause the input to exit its
1002 // input loop.
1003 bool mTrapNonAssignedFKeys = false;
1004 bool mDoInputLoop = true; // Whether or not to run the input loop on focus
1005 // mCursorAfterInput specifies whether to place the cursor after the
1006 // input text when showing the input.
1007 bool mCursorAfterInput = true;
1008
1009 // Function to be run when a key is pressed
1010 std::shared_ptr<cxFunction> mOnKeyFunction; // Function to be run when a key is pressed
1011 bool mRunOnKeyFunction = true; // Whether or not to run the onKey function
1012 // Function to be run to validate the text before focus is lost
1013 std::shared_ptr<cxFunction> mValidatorFunction;
1014 short mValueColorPair;
1015 bool mShowCursor = true; // Whether or not to show the cursor
1016 // Whether or not to run the validator function when the user is
1017 // navigating in reverse (i.e., with the up arrow or shift-tab).
1018 bool mValidateOnReverse = true;
1019 bool mForceUpper = false; // Convert letters to upper-case
1020 int mMaxInputLength = 0; // Maximum length of text input (0 = unlimited)
1021 int mScrollOffset = 0; // Index of first visible character in mValue (for scrolling)
1022 int mCursorPos = 0; // Cursor position within mValue (0-based index)
1023
1024 // Returns the text entered in the window, from mInputStartX (inclusive)
1025 // to a given horizontal position (exclusive), as a string.
1026 //
1027 // Parameters:
1028 // pValue: This is where the text will be stored.
1029 // pX: The current horizontal position of the cursor.
1030 // pCheckPrintable: Whether or not to check whether the last key
1031 // pressed is a printable character before grabbing the value.
1032 // Defaults to true.
1033 void getInputText(std::string& pValue, int pX, bool pCheckPrintable = true);
1034
1035 // Performs a 'backspace' behavior. This was written as a facilitator for
1036 // setFocus().
1037 // Parameters:
1038 // y: The current vertical cursor position
1039 // x: The current horizontal cursor position
1040 // prevInput: The last contents of the input
1041 inline void doBackspace(int y, int x, std::string& prevInput);
1042
1043 // Redraws the visible portion of mValue in the ncurses window,
1044 // accounting for mScrollOffset. Pads with spaces to fill mInputLen.
1045 void redrawVisibleValue();
1046
1047 // Adjusts mScrollOffset so that mCursorPos is visible within the
1048 // display area (mInputLen characters wide).
1049 void ensureCursorVisible();
1050
1051 // Enables the attributes in mValueAttrs.
1052 inline void enableValueAttrs();
1053
1054 // Disables the attributes in mValueAttrs.
1055 inline void disableValueAttrs();
1056
1057 // Handles the input loop. Returns cxID_QUIT or cxID_EXIT,
1058 // depending on what happens when the user exits the input.
1059 // Parameters:
1060 // x: The current horizontal position of the cursor
1061 // y: The current vertical position of the cursor
1062 // rightLimit: The rightmost limit of the cursor position (inclusive)
1063 // updatePrevInput: Whether or not to update the previous input value
1064 // prevInput: The previous input value
1065 long doInputLoop(int x, int y, int rightLimit,
1066 bool updatePrevInput, std::string& prevInput);
1067
1068 // Adds a key to the list of keys that will stop the input
1069 // loop.
1070 void addStopKey(int pKey);
1071
1072 // Disable the use of setHotkeyHighlighting from the
1073 // outside.
1074 virtual void setHotkeyHighlighting(bool pMessageUnderlines) override;
1075
1076 // Fills mWindow with the current window text, but does not actually
1077 // show it.
1078 virtual void draw() override;
1079
1080#ifdef WANT_TIMEOUT
1081 // mTimeout is the length of time (in seconds) for the input to be idle
1082 // before exiting the input loop. mTimeoutSigaction is a struct that
1083 // specifies the timeout function to call.
1084 int mTimeout = 0;
1085 struct sigaction mTimeoutSigaction;
1086
1087 // This function will get called upon idle timeout. (This function will
1088 // get set up for the SIGALRM signal; pSignal is there because signal
1089 // functions need to have that particular signature (void return type,
1090 // and an int parameter)). This function will call exitNow() on the
1091 // input.
1092 static void idleTimeoutHandler(int pSignal);
1093#endif
1094
1095 // Runs the function pointed to by mOnKeyFunction, and returns the return
1096 // value of the function.
1097 std::string runOnKeyFunction() const;
1098
1099 // This is for copying a cxInput - This copies one of the cxFunction
1100 // pointers (mOnKeyFunction, mValidatorFunction) from the other input.
1101 //
1102 // Parameters:
1103 // pThatInput: The cxInput being copied
1104 // pDestFunc: The cxFunction pointer being copied into (mOnKeyFunction
1105 // or mValidatorFunction) - This is a reference to a cxFunction*,
1106 // so mOnKeyFunction or mValidatorFunction can be passed to this
1107 // method without any funky syntax.
1108 // pSrcFunc: The cxFunction pointer being copied from
1109 // (pThatInput.mOnKeyFunction or pThatInput.mValidatorFunction)
1110 //
1111 // An example function call:
1112 // copyCxFunction(pThatInput, mOnKeyFunction, pThatInput.mOnKeyFunction);
1113 void copyCxFunction(const cxInput& pThatInput, /*OUT*/std::shared_ptr<cxFunction>& pDestFunc,
1114 /*IN*/const std::shared_ptr<cxFunction>& pSrcFunc);
1115
1116 // Returns whether or not the validator function is set (if
1117 // mValidatorFunction is not nullptr and if its function pointer is set)
1118 bool validatorFunctionIsSet() const;
1119
1120};
1121
1122
1123} // namespace cx
1124
1125#endif
Represents a single-line input box with a label. This class.
Definition cxInput.h:106
virtual ~cxInput()
Destructor.
Definition cxInput.cpp:226
int getInputLen() const
Definition cxInput.cpp:568
virtual void setBorderStyle(eBorderStyle pBorderStyle) override
Sets the border style.
Definition cxInput.cpp:1188
virtual void toggleOnKeyFunction(bool pRunOnKeyFunction)
Sets whether the onKey function should be fired or not.
Definition cxInput.cpp:1132
void setExitOnMouseOutside(bool pExitOnMouseOutside) override
Sets whether the input should exit its input loop when a.
Definition cxInput.cpp:646
const std::string & getValidatorStr() const
Definition cxInput.cpp:563
void setExitOnBackspaceAtFront(bool pExitOnBackspaceAtFront)
Sets whether the input should exit the input loop when the.
Definition cxInput.cpp:636
cxInput(cxWindow *pParentWindow=nullptr, int pRow=0, int pCol=0, int pWidth=DEFAULT_WIDTH, const std::string &pLabel="", eBorderStyle pBorderStyle=eBS_NOBORDER, eInputOptions pInputOption=eINPUT_EDITABLE, bool pExitOnFull=false, std::string *pExtVal=nullptr)
Default constructor.
void toggleCursor(bool pShowCursor)
Enables/disables the display of the cursor.
Definition cxInput.cpp:998
virtual void clearOnKeyFunction()
Un-sets the onKey function.
Definition cxInput.cpp:1137
std::set< attr_t > mDataReadonlyAttrs
Read-only data attributes.
Definition cxInput.h:906
void trapNonAssignedFKeys(bool pTrapNonAssignedFKeys)
Sets whether non-assigned function keys should.
Definition cxInput.cpp:1313
virtual int maxValueLen() const
Returns the maximum length of the value that may be set.
Definition cxInput.cpp:1156
virtual bool handleFunctionForLastKey(bool *pFunctionExists=nullptr, bool *pRunOnLeaveFunction=nullptr) override
Looks for a function tied to the last keypress and.
Definition cxInput.cpp:1685
void setExitOnFull(bool pExitOnFull)
Sets whether the input should leave the input loop when it's.
Definition cxInput.cpp:626
bool setValidatorFunction(funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4)
Definition cxInput.cpp:1016
virtual bool onKeyFunctionEnabled() const
Returns whether or not the onKey function will be run.
Definition cxInput.cpp:1142
virtual e_cxColors getItemColor(e_WidgetItems pItem) const override
Returns the color of one of the items in a window.
Definition cxInput.cpp:1877
virtual void enableInputLoop(bool pDoInputLoop)
Enables or disables the input loop.
Definition cxInput.cpp:1318
int getTimeout() const
Returns the amount of time that the.
virtual void setReadOnlyOnLeave(bool pReadOnlyOnLeave)
Sets whether the input should go read-only when setFocus() exits.
Definition cxInput.cpp:1166
bool getExitOnBackspaceAtFront() const
Returns whether the input will exit the input loop when the.
Definition cxInput.cpp:631
bool getExitOnFull() const
Definition cxInput.cpp:621
virtual bool textIsValid() const
Definition cxInput.cpp:775
virtual std::string runValidatorFunction() const
Runs the input's validator function and returns its return.
Definition cxInput.cpp:1628
virtual bool textIsValid(const std::string &pText) const
void setExitOnArrowAtBoundary(bool pExitOnArrowAtBoundary)
Sets whether the input should exit its input loop when the.
Definition cxInput.cpp:656
virtual bool isFull() const
Returns whether the value in the input takes up the maximum possible space in the input.
Definition cxInput.cpp:1147
virtual void removeAttrs(e_WidgetItems pItem) override
Removes all attributes for a given window item.
Definition cxInput.cpp:1547
void clearValidatorFunction()
Un-sets the validator function.
Definition cxInput.cpp:1074
e_cxColors getValueColor() const
Definition cxInput.cpp:948
virtual std::string getLabel() const
Definition cxInput.cpp:439
virtual void enableAttrs(WINDOW *pWin, e_WidgetItems pItem) override
Enables the attributes for one of the m*Attrs sets for an ncurses window.
Definition cxInput.cpp:1753
virtual bool inputLoopEnabled() const
Returns whether the input loop is enabled.
Definition cxInput.cpp:1323
void setMaskChar(char pMaskChar)
Definition cxInput.h:336
virtual void setCursorLeftAlign(bool pCursorLeftAlign)
Sets whether the cursor should be left-aligned when the.
Definition cxInput.cpp:1339
std::string * getExtValue() const
Definition cxInput.cpp:593
int getInputOption() const
Accessor for mInputOption; Returns an int representing the.
Definition cxInput.cpp:671
static std::string clearInput(void *theInput, void *unused)
Clears the value of a cxInput.
Definition cxInput.cpp:1003
bool getMustFill() const
Definition cxInput.cpp:661
bool getMasked() const
Definition cxInput.h:318
void setMaxInputLength(int pLength)
Sets the maximum text length that can be accepted by the input.
Definition cxInput.cpp:1670
void setExtValue(std::string *pExtVal, bool pRefresh=false)
Definition cxInput.cpp:601
bool getForceUpper() const
Returns the option for forcing text to upper-case.
Definition cxInput.cpp:1665
virtual void disableAttrs(WINDOW *pWin, e_WidgetItems pItem) override
Disables the attributes for one of the m*Attrs sets for an ncurses window.
Definition cxInput.cpp:1815
virtual std::string cxTypeStr() const override
Returns the name of the cxWidgets class. This can be used to.
Definition cxInput.cpp:1655
void setValidator(const std::string &pVString)
Definition cxInput.cpp:557
e_cxColors getLabelColor() const
Definition cxInput.cpp:931
void setMustFill(bool pMustFill)
Definition cxInput.cpp:666
virtual void removeAttr(e_WidgetItems pItem, attr_t pAttr) override
Removes an ncurses attribute from one of the item lists.
Definition cxInput.cpp:1503
virtual bool getCursorLeftAlign() const
Returns whether the cursor will be left-aligned when the.
Definition cxInput.cpp:1334
virtual void setLastKey(int pLastKey) override
Sets the last keypress.
Definition cxInput.cpp:1355
bool canBeEditable() const
Returns whether the input can be editable.
Definition cxInput.cpp:1171
void setCanBeEditable(bool pCanBeEditable)
Sets whether the input can be set editable.
Definition cxInput.cpp:1176
virtual bool modalGetsKeypress() const override
Returns whether or not a call to showModal() will wait for a.
Definition cxInput.cpp:1366
virtual void addAttr(e_WidgetItems pItem, attr_t pAttr) override
Adds an ncurses attribute to use for one of the items in the.
Definition cxInput.cpp:1414
void setExitOnFKey(bool pExitOnFunctionKey)
Definition cxInput.cpp:770
virtual std::string getValue(bool pRemoveLeadingSpaces=false, bool pRemoveTrailingSpaces=false) const
Definition cxInput.cpp:499
virtual bool move(int pNewRow, int pNewCol, bool pRefresh=true) override
Definition cxInput.cpp:723
virtual bool hasFocus() const override
Returns whether or not the input currently has focus.
Definition cxInput.cpp:1161
virtual void setAttr(e_WidgetItems pItem, attr_t pAttr) override
Sets the ncurses attribute to use for one of the items in the.
Definition cxInput.cpp:1458
int getMaxInputLength() const
Returns the currently-set maximum input length.
Definition cxInput.cpp:1678
virtual cxWindow * getParent() const override
Returns a pointer to the parent window. If the cxInput.
Definition cxInput.cpp:1397
void setLabelColor(e_cxColors pColor)
Sets the label color.
Definition cxInput.cpp:925
virtual void clearValue(bool pRefresh=false)
Clears the input value.
Definition cxInput.cpp:481
virtual void refreshValue(bool pRefresh=true)
Refreshes just the value portion of the input.
Definition cxInput.cpp:1220
bool getExitOnArrowAtBoundary() const
Returns whether the input exits when the left arrow key is.
Definition cxInput.cpp:651
virtual bool runOnFocusFunction(std::string *pFunctionRetval=nullptr) override
Runs the onFocus function, if it's set. If the.
Definition cxInput.cpp:1371
std::set< attr_t > mDataEditableAttrs
Editable data attributes.
Definition cxInput.h:910
virtual bool setValue(const std::string &pValue, bool pRefresh=false)
Definition cxInput.cpp:573
virtual void clear(bool pRefresh=false) override
Alias for clearValue() (this is here to overload the clear()
Definition cxInput.cpp:493
void setInputOption(eInputOptions pInputOption)
Sets the input editability (i.e., eINPUT_EDITABLE, eINPUT_READONLY) -.
Definition cxInput.cpp:676
virtual long showModal(bool pShowSelf=true, bool pBringToTop=true, bool pShowSubwindows=false) override
Handles user input for the form.
Definition cxInput.cpp:258
void setValueColor(e_cxColors pColor)
Sets the color of the value typed into the input.
Definition cxInput.cpp:937
virtual void setLabel(const std::string &pLabel)
Definition cxInput.cpp:451
std::set< attr_t > mLabelAttrs
Label attributes.
Definition cxInput.h:902
virtual long show(bool pBringToTop=false, bool pShowSubwindows=false) override
Shows the window, along with the user's input.
Definition cxInput.cpp:230
static int inputClearKey
inputClearKey is a default key to be used to clear inputs.
Definition cxInput.h:894
virtual bool setOnKeyFunction(const std::shared_ptr< cxFunction > &pFunction)
Sets a function to be run whenever a key is pressed (referred.
virtual void resize(int pNewHeight, int pNewWidth, bool pRefresh=true) override
Changes the input's width. The upper-left coordinate stays.
Definition cxInput.cpp:743
void setForceUpper(bool pForceUpper)
Toggles the option to force text to be upper-case.
Definition cxInput.cpp:1660
char getMaskChar() const
Definition cxInput.h:330
bool isEditable() const
Returns whether or not the input is editable. An input is editable if it passes the 3 following crite...
Definition cxInput.cpp:1328
virtual void setValidateOnReverse(bool pValidateOnReverse)
Sets whether or not to run the validator function.
Definition cxInput.cpp:1345
void toggleMasking(bool pMasking)
Definition cxInput.h:324
virtual void getAttrs(e_WidgetItems pItem, std::set< attr_t > &pAttrs) const override
Returns the set of ncurses attributes for a given item.
Definition cxInput.cpp:1591
bool getExitOnMouseOutside() const override
Returns whether the input exits its input loop when a mouse.
Definition cxInput.cpp:641
virtual void setTimeout(int pTimeout)
Sets the amount of time (in seconds) that the input should.
virtual void setColor(e_WidgetItems pItem, e_cxColors pColor) override
Sets the color of one of the window items.
Definition cxInput.cpp:964
void setCursorX(int pCursorX)
Definition cxInput.cpp:699
virtual bool getValidateOnReverse() const
Returns whether or not the validator function will.
Definition cxInput.cpp:1350
This class represents an input box that can have a height.
Definition cxMultiLineInput.h:149
Provides some text validation functionality. See README.txt for.
Definition cxTextValidator.h:23
Represents a text-based window on the screen. Can contain a title, status, and a message to appear wi...
Definition cxWindow.h:195
Defines an enumeration for different input options (editable and.
#define DEFAULT_WIDTH
Definition cxWindow.h:69
cxBorderChars.h - Defines border characters to be used in drawing a box (i.e., in cxWindow and all it...
Definition cxApp.cpp:5
std::string(* funcPtr4)(void *p1, void *p2, void *p3, void *p4)
Definition cxFunction.h:21
e_WidgetItems
Definition cxWidgetItems.h:42
std::string(* funcPtr0)()
Definition cxFunction.h:19
std::string(* funcPtr2)(void *p1, void *p2)
Definition cxFunction.h:20
eInputOptions
Definition cxInputOptions.h:20
@ eINPUT_EDITABLE
Definition cxInputOptions.h:21
eBorderStyle
Definition cxBorderStyles.h:26
@ eBS_NOBORDER
Definition cxBorderStyles.h:27
e_cxColors
Definition cxColors.h:46