cxWidgets 1.0
cxMultiLineInput.h
Go to the documentation of this file.
1// Copyright (c) 2026 E. Oulashin
2#ifndef __CXMULTILINEINPUT_H__
3#define __CXMULTILINEINPUT_H__
4
5/*
6 * cxMultiLineInput.h - This class represents a multi-line input with a label.
7 * Logically, this is one big input, and the value will be spread across all
8 * lines. Wrapping is handled as the user types to the end of each line.
9 * This class is made up of single-line cxInput objects; however, in
10 * retrospect, this seems rather janky; it would be good to just eliminate
11 * cxInput, rename this class to cxInput, and re-do this class so that it is
12 * just a single window and can handle scrolling.
13 *
14 * Copyright (C) 2005-2007 Michael H. Kinney
15 *
16 *
17 * Date User Description
18 * 08/23/07 erico Added a built-in onKeypress function to do per-keypress
19 * validation for numeric input types, and to allow deriving
20 * classes to override it to add additional functionality.
21 */
22
23#include "cxWindow.h"
24#include "cxInput.h"
25#include "cxInputTypes.h"
26#include "cxFunction.h"
27#include <signal.h> // For sigaction
28#include <string>
29#include <vector>
30#include <set>
31#include <map>
32#include <memory>
33
34namespace cx {
35
37{
40}; // enum for cxMultiLineInputFormat
41
42// eInputErrors is an enumeration that specifies an errors state for the
43// input. If validation fails, the input's mErrorState will be set to
44// one of these errors. If there is no error, it will be set to eNO_ERROR.
53
54class cxForm; // Pre-declaration to avoid a circular reference
55
149{
150 public:
177 explicit cxMultiLineInput(cxWindow *pParentWindow = nullptr, int pRow = 0,
178 int pCol = 0, int pHeight = 1,
179 int pWidth = DEFAULT_WIDTH,
180 const std::string& pLabel = "",
181 eBorderStyle pBorderStyle = eBS_NOBORDER,
182 eInputOptions pInputOption = eINPUT_EDITABLE,
183 eInputTypes pInputType = eINPUT_TYPE_TEXT,
184 std::string *pExtValue = nullptr,
185 int pRightLabelOffset = 0,
186 int pRightLabelHeight = 1,
187 int pRightLabelWidth = 7,
188 bool pShowRightLabel = false);
189
194 cxMultiLineInput(const cxMultiLineInput& pThatInput);
195
199 virtual ~cxMultiLineInput();
200
208 cxMultiLineInput& operator =(const cxMultiLineInput& pThatInput);
209
216 virtual long show(bool pBringToTop = false, bool pShowSubwindows = false) override;
217
232 virtual long showModal(bool pShowSelf = true, bool pBringToTop = true,
233 bool pShowSubwindows = false) override;
234
240 void hide(bool pHideSubwindows = false) override;
241
247 void unhide(bool pUnhideSubwindows = false) override;
248
254 virtual void erase(bool pEraseSubwindows = true) override;
255
260 virtual std::string getLabel() const;
261
266 virtual void setLabel(const std::string& pLabel);
267
274 virtual void clearValue(bool pRefresh = false);
275
283 virtual void clear(bool pRefresh = false) override;
284
289 virtual std::string getValue() const;
290
299 virtual bool setValue(std::string pValue, bool pRefresh = false);
300
305 std::string *getExtValue() const { return(mExtValue); }
306
312 void setExtValue(std::string *pExtVal, bool pRefresh = false);
313
319 virtual void setValidatorStr(const std::string& pValidator);
320
326 virtual std::string getValidatorStr() const;
327
333 virtual bool textIsValid() const;
334
341 virtual bool textIsValid(const std::string& pText) const;
342
347 bool getMasked();
348
353 void toggleMasking(bool pMasking);
354
359 char getMaskChar() const;
360
365 void setMaskChar(char pMaskChar);
366
375 virtual bool move(int pNewRow, int pNewCol, bool pRefresh = true) override;
376
384 virtual void resize(int pNewHeight, int pNewWidth, bool pRefresh = true) override;
385
395 virtual bool setKeyFunction(int pKey, const std::shared_ptr<cxFunction>& pFunction) override;
396
421 virtual bool setKeyFunction(int pKey, funcPtr4 pFunction,
422 void *p1, void *p2, void *p3, void *p4,
423 bool pUseVal, bool pExitAfterRun = false,
424 bool pRunOnLeaveFunction = true) override;
425
451 virtual bool setKeyFunction(int pKey, funcPtr4 pFunction,
452 void *p1, void *p2, void *p3, void *p4,
453 bool pUseVal, bool pExitAfterRun,
454 bool pRunOnLeaveFunction, bool pRunValidator);
455
474 virtual bool setKeyFunction(int pKey, funcPtr2 pFunction,
475 void *p1, void *p2, bool pUseVal,
476 bool pExitAfterRun = false,
477 bool pRunOnLeaveFunction = true) override;
478
502 virtual bool setKeyFunction(int pKey, funcPtr2 pFunction,
503 void *p1, void *p2, bool pUseVal,
504 bool pExitAfterRun, bool pRunOnLeaveFunction,
505 bool pRunValidator);
506
523 virtual bool setKeyFunction(int pKey, funcPtr0 pFunction,
524 bool pUseVal,
525 bool pExitAfterRun = false,
526 bool pRunOnLeaveFunction = true) override;
527
549 virtual bool setKeyFunction(int pKey, funcPtr0 pFunction,
550 bool pUseVal,
551 bool pExitAfterRun, bool pRunOnLeaveFunction,
552 bool pRunValidator);
553
560 virtual void addSkipValidatorKey(int pKey);
561
568 virtual void removeSkipValidatorKey(int pKey);
569
581 virtual bool hasSkipValidatorKey(int pKey) const;
582
589 virtual void clearKeyFunction(int pFunctionKey) override;
590
594 virtual void clearKeyFunctions() override;
595
601 void setLabelColor(e_cxColors pColor);
602
610
616 void setValueColor(e_cxColors pColor);
617
625
634 virtual void setColor(e_WidgetItems pItem, e_cxColors pColor) override;
635
642 virtual int getInputOption() const;
643
651 virtual void setInputOption(eInputOptions pInputKind);
652
658 void toggleCursor(bool pShowCursor);
659
668 static std::string clearInput(void* theInput, void* unused);
669
679 virtual bool setValidatorFunction(const std::shared_ptr<cxFunction>& pFunction);
680
694 bool setValidatorFunction(funcPtr4 pFunction, void *p1, void *p2,
695 void *p3, void *p4);
696
710 bool setValidatorFunction(funcPtr2 pFunction, void *p1, void *p2);
711
725 bool setValidatorFunction(funcPtr0 pFunction);
726
731
737 bool isFull() const;
738
747 virtual void setOnKeyFunction(const std::shared_ptr<cxFunction>& pFunction);
748
757 virtual void setOnKeyFunction(funcPtr4 pFunction, void *p1, void *p2,
758 void *p3, void *p4);
759
768 virtual void setOnKeyFunction(funcPtr2 pFunction, void *p1, void *p2);
769
778 virtual void setOnKeyFunction(funcPtr0 pFunction);
779
786 virtual void toggleOnKeyFunction(bool pRunOnKeyFunction);
787
791 virtual void clearOnKeyFunction();
792
798 bool onKeyFunctionEnabled() const;
799
809 void setEnterAlwaysExits(bool pEnterAlwaysExits);
810
818 bool enterAlwaysExits() const;
819
825 virtual int maxValueLen() const;
826
832 virtual bool hasFocus() const override;
833
840 virtual void setReadOnlyOnLeave(bool pReadOnlyOnLeave);
841
847 bool canBeEditable() const;
848
858 void setCanBeEditable(bool pCanBeEditable);
859
865 void setExitOnFull(bool pExitOnFull);
866
872 bool getExitOnFull() const;
873
879 virtual void setBorderStyle(eBorderStyle pBorderStyle) override;
880
888 virtual bool isAbove(const cxWindow& pThatWindow) const override;
889
897 virtual bool isBelow(const cxWindow& pThatWindow) const override;
898
903 virtual void bringToTop(bool pRefresh = true) override;
904
911 virtual void refreshValue(bool pRefresh = true);
912
923 void trapNonAssignedFKeys(bool pTrapNonAssignedFKeys);
924
939 virtual bool runOnFocusFunction(std::string *pFunctionRetval = nullptr) override;
940
945 void runFieldFunction(int pKey);
946
951 int getInputLen() const;
952
967 virtual bool addQuitKey(int pKey, bool pRunOnLeaveFunction = true,
968 bool pOverride = false) override;
969
975 virtual void removeQuitKey(int pKey) override;
976
991 virtual bool addExitKey(int pKey, bool pRunOnLeaveFunction = true,
992 bool pOverride = false) override;
993
999 virtual void removeExitKey(int pKey) override;
1000
1012 virtual void enableInputLoop(bool pDoInputLoop);
1013
1019 virtual bool inputLoopEnabled() const;
1020
1029 virtual void setEditable(bool pEditable);
1030
1043 virtual bool isEditable() const;
1044
1053 bool getAutoWrapAtBeginning() const;
1054
1068 void setAutoWrapAtBeginning(bool pWrapAtBeginning);
1069
1078 bool getSkipIfReadOnly() const;
1079
1090 void setSkipIfReadOnly(bool pSkipIfReadOnly);
1091
1099 virtual void setDisableCursorOnShow(bool pDisableCursorOnShow) override;
1100
1106 cxForm* getParentForm() const;
1107
1118 virtual void setValidateOnReverse(bool pValidateOnReverse);
1119
1127 virtual bool getValidateOnReverse() const;
1128
1134 virtual void setLastKey(int pLastKey) override;
1135
1145 virtual bool modalGetsKeypress() const override;
1146
1152 virtual void setEnabled(bool pEnabled) override;
1153
1164 virtual void quitNow(bool pMoveForward);
1165
1170 virtual void quitNow() override;
1171
1182 virtual void exitNow(bool pMoveForward);
1183
1188 virtual void exitNow() override;
1189
1196 virtual void toggleValidatorFunction(bool pRunValidatorFunction);
1197
1203 virtual bool getUseValidatorFunction() const;
1204
1213 virtual cxWindow* getParent() const override;
1214
1221 virtual bool ranFunctionAndShouldExit() const;
1222
1231 virtual void addAttr(e_WidgetItems pItem, attr_t pAttr) override;
1232
1243 virtual void setAttr(e_WidgetItems pItem, attr_t pAttr) override;
1244
1252 virtual void removeAttr(e_WidgetItems pItem, attr_t pAttr) override;
1253
1260 virtual void removeAttrs(e_WidgetItems pItem) override;
1261
1269 virtual void getAttrs(e_WidgetItems pItem, std::set<attr_t>& pAttrs) const override;
1270
1278 virtual bool getCursorLeftAlign() const;
1279
1287 virtual void setCursorLeftAlign(bool pCursorLeftAlign);
1288
1296 bool getExitOnBackspaceAtFront() const;
1297
1306 void setExitOnBackspaceAtFront(bool pExitOnBackspaceAtFront);
1307
1316 virtual std::string runValidatorFunction() const;
1317
1335 virtual bool hasNavKey(int pKey) const;
1336
1344 virtual void addNavKey(int pKey);
1345
1352 virtual void removeNavKey(int pKey);
1353
1357 virtual void removeNavKeys();
1358
1365 virtual void getNavKeys(std::set<int>& pNavKeys) const;
1366
1374 virtual void setTimeout(int pTimeout);
1375
1383 int getTimeout() const;
1384
1392 virtual std::string cxTypeStr() const override;
1393
1402 eInputTypes getInputType() const;
1403
1414 virtual void setInputType(eInputTypes pInputType);
1415
1422 long double getRangeLowDouble() const;
1423
1431 void setRangeLowDouble(const long double &pRangeLowDouble);
1432
1439 long double getRangeHighDouble() const;
1440
1448 void setRangeHighDouble(const long double &pRangeHighDouble);
1449
1455 long int getRangeLowInt() const;
1456
1462 void setRangeLowInt(const long int &pRangeLowInt);
1463
1469 long int getRangeHighInt() const;
1470
1476 void setRangeHighInt(const long int &pRangeHighInt);
1477
1484 void getRangeDouble(long double &pLow, long double &pHigh) const;
1485
1492 void setRangeDouble(const long double &pLow, const long double &pHigh);
1493
1500 void getRangeInt(long int &pLow, long int &pHigh);
1501
1508 void setRangeInt(const long int &pLow, const long int &pHigh);
1509
1521 virtual std::string inputValidator();
1522
1537 virtual std::string onKeypress();
1538
1548 virtual void useBuiltInValidator();
1549
1556 virtual bool usingBuiltInValidator() const;
1557
1566 virtual void useBuiltInOnKeyFunction();
1567
1575 virtual bool usingBuiltInOnKeyFunction() const;
1576
1584 void validatorFuncMessageBox(bool pEnable);
1585
1593 bool validatorFuncMessageBox() const;
1594
1607 virtual void addValidOptions(const std::string& pValidOptions,
1608 bool pValidate = true);
1609
1620 virtual void setValidOptions(const std::string& pValidOptions,
1621 bool pValidate = true);
1622
1632 virtual void setValidOptions(const std::map<std::string, std::string>& pValidOptions,
1633 bool pValidate = true);
1634
1645 virtual void addValidOption(const std::string& pValidOption,
1646 const std::string& pRightLabelText = "",
1647 bool pValidate = true);
1648
1657 virtual void getValidOptions(std::map<std::string, std::string>& pValidOptions) const;
1658
1666 std::string getValidOptionStrings(const eMLIF& pMLIF=eMLIF_COMMA_SEP) const;
1667
1674 void getValidOptionStrings(std::set<std::string>& pValidOptionStrings) const;
1675
1685 virtual bool hasValidOptionString(const std::string& pStr) const;
1686
1697 virtual std::string getValidOptionHelpText(const std::string& pInput) const;
1698
1703 virtual void clearValidOptions();
1704
1721 virtual bool autoFillFromValidOptions(bool pRefresh = false);
1722
1729 virtual void setForceUpper(bool pForceUpper);
1730
1736 virtual bool getForceUpper() const;
1737
1743 virtual void setAllowBlank(bool pAllowBlank);
1744
1750 virtual bool getAllowBlank() const;
1751
1758 virtual void setExtendedHelp(const std::string& pExtendedHelp);
1759
1765 virtual std::string getExtendedHelp() const;
1766
1772 virtual void setExtendedHelpColor(e_cxColors pColor);
1773
1780 virtual e_cxColors getExtendedHelpColor() const;
1781
1788 virtual void setExtendedHelpAttribute(attr_t pAttr);
1789
1795 virtual attr_t getExtendedHelpAttribute() const;
1796
1804 virtual void autoGenerateExtendedHelp(bool pAutoGenerateExtendedHelp);
1805
1814 virtual bool autoGenerateExtendeHelp() const;
1815
1821 virtual void setExtendedHelpKey(int pKey);
1822
1828 virtual void addExtendedHelpKey(int pKey);
1829
1835 virtual void setExtendedHelpKeys(const std::set<int>& pKeys);
1836
1842 virtual std::set<int> getExtendedHelpKeys() const;
1843
1851 virtual std::string getExtendedHelpKeyStrings() const;
1852
1856 virtual void clearExtendedHelpKeys();
1857
1864 virtual void setUseExtendedHelpKeys(bool pUseExtendedHelpKey);
1865
1871 virtual bool getUseExtendedHelpKeys() const;
1872
1881 virtual bool keyIsExtendedHelpKey(int pKey) const;
1882
1889 virtual void setShowRightLabel(bool pShowRightLabel);
1890
1898 virtual bool getShowRightLabel() const;
1899
1909 virtual void setRightLabelOffset(int pOffset, bool pRefresh = false);
1910
1917 virtual int getRightLabelOffset() const;
1918
1924 virtual int getRightLabelTop() const;
1925
1931 virtual int getRightLabelLeft() const;
1932
1938 virtual int getRightLabelBottom() const;
1939
1945 virtual int getRightLabelRight() const;
1946
1952 virtual int getRightLabelHeight() const;
1953
1959 virtual int getRightLabelWidth() const;
1960
1968 virtual void setRightLabelWidth(int pWidth, bool pRefresh = false);
1969
1977 virtual void setRightLabelHeight(int pHeight, bool pRefresh = false);
1978
1987 virtual void resizeRightLabel(int pHeight, int pWidth, bool pRefresh = false);
1988
1996 virtual void setRightLabel(const std::string& pText, bool pRefresh = false);
1997
2006 virtual void setRightLabel(int pOffset, const std::string& pText, bool pRefresh = false);
2007
2013 virtual std::string getRightLabel() const;
2014
2021 virtual void getRightLabelSize(int& pHeight, int& pWidth);
2022
2028 virtual e_cxColors getRightLabelColor() const;
2029
2035 virtual void setRightLabelColor(e_cxColors pColor);
2036
2042 virtual void setRightLabelAttr(attr_t pAttr);
2043
2050 virtual void setMaxInputLength(int pLength);
2051
2057 virtual int getMaxInputLength() const;
2058
2072 virtual eInputErrors getErrorState() const;
2073
2087 virtual void setErrorState(eInputErrors pErrorState);
2088
2094 virtual bool getUseClearKey() const;
2095
2101 virtual void setUseClearKey(bool pUseClearKey);
2102
2109 virtual void additionalOnClear();
2110
2116 virtual bool rightLabelEnabled() const;
2117
2124 bool validatorFunctionIsSet() const;
2125
2126 protected:
2131 std::shared_ptr<cxFunction> mValidatorFunction;
2132
2137
2143 void copyCxMultiLineInputStuff(const cxMultiLineInput *pThatInput);
2144
2163 long doInputLoop(bool pShowInputs, bool& pRunOnLeaveFunction);
2164
2170 bool focusFunctionsWillRun() const;
2171
2178 void runFocusFunctions(bool pRunFocusFunctions);
2179
2185 void setParentForm(cxForm *pParentForm);
2186
2201 bool searchParentFormsForFKey(int pFunctionKey,
2202 bool pIncludeNavigationalKeys = false);
2203
2207 void freeInputs();
2208
2224 virtual bool handleFunctionForLastKey(bool *pFunctionExists = nullptr,
2225 bool *pRunOnLeaveFunction = nullptr) override;
2226
2239 virtual void enableAttrs(WINDOW *pWin, e_WidgetItems pItem) override;
2240
2251 virtual void disableAttrs(WINDOW *pWin, e_WidgetItems pItem) override;
2252
2253 private:
2254 friend class cxForm; // Because that class uses this class
2255 friend class cxInput;
2256
2257 typedef std::vector<std::shared_ptr<cxInput> > cxInputPtrContainer;
2258 cxInputPtrContainer mInputs; // The collection of single-line inputs
2259 // mExtValue points to an "external" location to load/store the user's
2260 // input (basically, it will be used for user input storage as well as
2261 // mValue, but the value in this input will always be the what mExtValue
2262 // contains). If nullptr, then it won't be used.
2263 std::string *mExtValue;
2264 int mCurrentInputLine = 0; // The index of the current single-line input
2265 // If mEnterAlwaysExits is true, enter will exit the input loop if
2266 // the cursor is in the middle of one of the input lines; if
2267 // false, enter will go to the next input line and stay in
2268 // the input loop until the user presses enter on the last line.
2269 bool mEnterAlwaysExits = true;
2270 bool mReadOnlyOnLeave = false; // Make the input read-only when leaving showModal()?
2271 bool mExitOnFull = true; // Whether to exit automatically when full
2272 bool mDoInputLoop = true; // Whether to run the input loop on focus
2273 bool mSkipIfReadOnly = true; // Don't wait for input if read-only?
2274 bool mRunValidatorFunction = true; // Controls whether or not the validator function should run
2275 bool mUseClearKey = true; // Use built-in clear key?
2276
2277 // Whether or not to run the validator function when the user is
2278 // navigating in reverse (i.e., with the up arrow or shift-tab).
2279 bool mValidateOnReverse = true;
2280
2281 // mParentForm is a pointer to a cxForm, in case the input appears on a
2282 // cxForm. This can be null.
2283 cxForm *mParentForm = nullptr;
2284
2285 // If mApplyAttrDefaults is true, some attributes will be applied to
2286 // the input when its kind is set.
2287 bool mApplyAttrDefaults = true;
2288
2289 // mRanFunctionAndShouldExit keeps track of whether the input ran a key
2290 // function that was set up to have the input exit when it was done.
2291 bool mRanFunctionAndShouldExit = false;
2292
2293 // mSkipValidatorKeys keeps track of keys used with key functions where
2294 // we don't want to run the validator function.
2295 std::set<int> mSkipValidatorKeys;
2296
2297 // A set of keys that are designated as "navigation keys" -
2298 // Normally, when the user presses a key, a cxMultiLineInput will check
2299 // its parent window (if it's on a cxForm or cxPanel) to see if it has
2300 // a function associated with that key, and if so, the input will exit
2301 // its input loop without running its validator. However, navigational
2302 // keys are an exception, because usually you would want to run the
2303 // validator function to run before the user leaves the input. The
2304 // default navigational keys are pageUp, pageDown, arrow keys, tab, and
2305 // shift-tab.
2306 std::set<int> mNavKeys;
2307
2308 // mInputType defines the type of input (text, numeric floating point, or
2309 // numeric whole). This specifies which type of validation should be
2310 // used.
2311 eInputTypes mInputType;
2312
2313 // mValidOptionStrings contains strings enumerating all the possible
2314 // values for the input that are valid. If this is empty, that means
2315 // anything is valid. This is a map - The key is the valid string, and
2316 // the value is help text that goes along with it.
2317 std::map<std::string, std::string> mValidOptionStrings;
2318 // mAutoGenerateExtendedHelp specifies whether or not the extended help
2319 // should be auto-generated from the list of valid input strings and
2320 // their help texts.
2321 bool mAutoGenerateExtendedHelp = false;
2322
2323 // mRangeLowDouble and mRangeHighDouble define low & high numeric values
2324 // for floating-point numeric range validation. If both are 0, that
2325 // means any number is valid.
2326 long double mRangeLowDouble = 0.0;
2327 long double mRangeHighDouble = 0.0;
2328 // mRagneLowInt and mRangeLowHigh define low & high numeric values for
2329 // whole numeric range validation. If both are 0, that means any number
2330 // is valid.
2331 long int mRangeLowInt = 0;
2332 long int mRangeHighInt = 0;
2333
2334 // This bool specifies whether or not the validator function should
2335 // display a message box when the input is invalid.
2336 bool mValidatorFuncMessageBox = false;
2337
2338 bool mAllowBlank = true; // Allow a blank value?
2339
2340 // mExtendedHelp can contain long or more verbose help text. You can
2341 // also set the color & attribute for the extended help text.
2342 std::string mExtendedHelp;
2343 e_cxColors mExtendedHelpColor;
2344 attr_t mExtendedHelpAttribute = A_NORMAL;
2345 // mExtendedHelpKeys specifies keys that can be pressed to display the
2346 // extended help. mUseExtendedHelpKeys specifies whether or not to
2347 // use them.
2348 std::set<int> mExtendedHelpKeys;
2349 bool mUseExtendedHelpKeys = true;
2350
2351 // mRightLabel is a window that will display an additional label to
2352 // the right of the input. mRightLabelOffset is the distance between
2353 // the input and mRightLabel.
2354 //cxWindow mRightLabel;
2355 std::unique_ptr<cxWindow> mRightLabel;
2356 int mRightLabelOffset;
2357 bool mShowRightLabel; // Whether or not to display the right label
2358
2359 int mMaxInputLength = 32000; // The maximum length of input acceptable
2360
2361 // mErrorState specifies a current error for the input (i.e., if
2362 // validation failed).
2363 eInputErrors mErrorState = eNO_ERROR;
2364
2365 // Disable the use of setHotkeyHighlighting from the
2366 // outside.
2367 void setHotkeyHighlighting(bool pMessageUnderlines) override;
2368
2369 // Fills mWindow with the current window text, but does not actually
2370 // show it.
2371 virtual void draw() override;
2372
2373 // Returns whether or not what's on the screen differs from the member
2374 // data.
2375 bool scrDiff();
2376
2377 // This is for copying a cxMultiLineInput - This copies
2378 // cxValidatorFunction.
2379 void copyValidatorFunction(const cxMultiLineInput& pThatInput);
2380
2381 // This is a helper for setInputType() - This Returns whether
2382 // intOnKeyValidator() or floatingPtOnKeyValidator() from cxValidators
2383 // are set up as onKey functions for the input.
2384 bool usingOnKeyNumericValidator() const;
2385
2386 // Static cxWidgets function for validation - This calls inputValidator()
2387 // for a cxMultiLineInput.
2388 //
2389 // Parameters:
2390 // theInput: A pointer to the cxMultiLineInput
2391 // unused: Not used
2392 static std::string inputValidatorStatic(void *theInput, void *unused);
2393
2394 // Static cxWidgets onKeypress function - This calls onKeypress() for
2395 // a cxMultiLineInput.
2396 //
2397 // Parameters:
2398 // theInput: A pointer to the cxMultiLineInput
2399 // unused: Not used
2400 static std::string onKeypressStatic(void *theInput, void *unused);
2401
2402 // This will generate mExtendedHelp based on mValidOptionStrings, if
2403 // mValidOptionStrings has anything in it.
2404 void generateExtendedHelp();
2405
2406 // Validates a string against mValidOptionStrings. If mValidOptionStrings
2407 // is empty, or if the string is in it, this will return true. If
2408 // mValidOptionStrings is not empty and the string isn't in it, this
2409 // will return false.
2410 bool checkValidOptionStrings(const std::string& pValue);
2411
2412 // This is a helper for validation. For a numeric input type, this
2413 // returns whether or not a value is within the set valid range. If
2414 // both the low & high range values are 0, this will assume that any
2415 // number is valid and will return true. For a non-numeric input type,
2416 // this will return true. If the given value does not contain a valid
2417 // number, this will return false.
2418 //
2419 // Parameters:
2420 // pValue: A value to check
2421 bool valueInRange(const std::string& pValue) const;
2422
2423 // Word-wraps the text from the current line (mCurrentInputLine) downward
2424 // through subsequent lines. If text overflows the last visible line,
2425 // the overflow is discarded (the caller should handle dynamic line
2426 // addition if needed).
2427 //
2428 // Parameters:
2429 // pFromLine: The line index to start reflowing from
2430 void reflowFrom(int pFromLine);
2431
2432 // Gets the full text content from all input lines, concatenated.
2433 // Unlike getValue(), this always concatenates without newlines.
2434 std::string getAllText() const;
2435
2436 // Sets all text by distributing it across lines with word wrapping.
2437 // Unlike setValue(), this always word-wraps the text.
2438 void setAllTextWrapped(const std::string& pText);
2439
2440 // Whether word wrapping is enabled (default true)
2441 bool mWordWrap = true;
2442};
2443
2444
2445} // namespace cx
2446
2447#endif
Represents a form that contains text inputs. The user can move forward between the inputs on the form...
Definition cxForm.h:85
Represents a single-line input box with a label. This class.
Definition cxInput.h:106
This class represents an input box that can have a height.
Definition cxMultiLineInput.h:149
virtual void setCursorLeftAlign(bool pCursorLeftAlign)
Sets whether the cursor should be left-aligned when the.
Definition cxMultiLineInput.cpp:2188
virtual bool addExitKey(int pKey, bool pRunOnLeaveFunction=true, bool pOverride=false) override
Adds a key that will cause the input to quit and return.
Definition cxMultiLineInput.cpp:1900
virtual void setExtendedHelpAttribute(attr_t pAttr)
Sets the attribute to use for the extended help message.
Definition cxMultiLineInput.cpp:2815
virtual std::string getValue() const
Definition cxMultiLineInput.cpp:615
eInputTypes getInputType() const
Returns the input type. This is a member of the cxInputTypes.
Definition cxMultiLineInput.cpp:2278
virtual void useBuiltInValidator()
Sets up the input's built-in validator function for the input.
Definition cxMultiLineInput.cpp:2486
bool searchParentFormsForFKey(int pFunctionKey, bool pIncludeNavigationalKeys=false)
Searches the parent cxForm (if mParentForm isn't nullptr)
Definition cxMultiLineInput.cpp:3585
virtual bool textIsValid(const std::string &pText) const
Returns whether some text is valid according to the input's validator.
virtual void setExtendedHelpKey(int pKey)
Sets a single key to be used to display the extended help.
Definition cxMultiLineInput.cpp:2842
virtual bool move(int pNewRow, int pNewCol, bool pRefresh=true) override
Definition cxMultiLineInput.cpp:948
virtual void setInputType(eInputTypes pInputType)
Sets the input type. This is a member of the cxInputTypes.
Definition cxMultiLineInput.cpp:2283
virtual void setRightLabelAttr(attr_t pAttr)
Sets the ncurses attribute for the right label message.
Definition cxMultiLineInput.cpp:3066
virtual e_cxColors getExtendedHelpColor() const
Returns the color used for the extended help message.
Definition cxMultiLineInput.cpp:2810
virtual int getRightLabelWidth() const
Returns the width of the right label window.
Definition cxMultiLineInput.cpp:3006
virtual attr_t getExtendedHelpAttribute() const
Returns the attribute used for the extended help message.
Definition cxMultiLineInput.cpp:2820
void toggleCursor(bool pShowCursor)
Enables/disables the display of the cursor.
Definition cxMultiLineInput.cpp:1428
virtual void setRightLabelOffset(int pOffset, bool pRefresh=false)
Sets the horizontal distance of the right label from the right.
Definition cxMultiLineInput.cpp:2969
virtual void setColor(e_WidgetItems pItem, e_cxColors pColor) override
Sets the color of one of the window items.
Definition cxMultiLineInput.cpp:1374
bool validatorFunctionIsSet() const
Returns whether or not the validator function is set (if.
Definition cxMultiLineInput.cpp:3130
virtual void addValidOption(const std::string &pValidOption, const std::string &pRightLabelText="", bool pValidate=true)
Adds a string to the set of valid strings that can be typed.
Definition cxMultiLineInput.cpp:2610
void setRangeHighDouble(const long double &pRangeHighDouble)
Sets the high end of the floating-point numeric range for the.
Definition cxMultiLineInput.cpp:2303
bool getExitOnFull() const
Returns whether the input will exit automatically when full.
Definition cxMultiLineInput.cpp:1708
bool getExitOnBackspaceAtFront() const
Returns whether the input will exit the input loop when the.
Definition cxMultiLineInput.cpp:2204
virtual void setValidOptions(const std::string &pValidOptions, bool pValidate=true)
Sets single-character valid input strings to the input. This.
virtual void setRightLabelWidth(int pWidth, bool pRefresh=false)
Sets the width of the right label.
Definition cxMultiLineInput.cpp:3011
virtual std::set< int > getExtendedHelpKeys() const
Returns the keys currently set up to display extended help.
Definition cxMultiLineInput.cpp:2882
std::string * getExtValue() const
Definition cxMultiLineInput.h:305
virtual ~cxMultiLineInput()
Definition cxMultiLineInput.cpp:245
virtual std::string getRightLabel() const
Returns the text of the right label.
Definition cxMultiLineInput.cpp:3045
virtual bool setValidatorFunction(const std::shared_ptr< cxFunction > &pFunction)
Definition cxMultiLineInput.cpp:1449
virtual bool hasValidOptionString(const std::string &pStr) const
Returns whether or not a string exists in the input's set of.
Definition cxMultiLineInput.cpp:2680
virtual void clearKeyFunctions() override
Clears the list of external functions fired by hotkeys.
Definition cxMultiLineInput.cpp:1324
virtual void getRightLabelSize(int &pHeight, int &pWidth)
Returns the size of the right label.
Definition cxMultiLineInput.cpp:3050
virtual void setExtendedHelpKeys(const std::set< int > &pKeys)
Sets the keys to be used to display the extended help.
Definition cxMultiLineInput.cpp:2864
void getRangeInt(long int &pLow, long int &pHigh)
Returns the whole number range for the input.
Definition cxMultiLineInput.cpp:2340
bool enterAlwaysExits() const
Returns whether the enter key always causes the input.
Definition cxMultiLineInput.cpp:1640
virtual bool getForceUpper() const
Returns the option for forcing text to upper-case.
Definition cxMultiLineInput.cpp:2778
virtual long showModal(bool pShowSelf=true, bool pBringToTop=true, bool pShowSubwindows=false) override
Enters a loop for user input. Returns cxID_EXIT or cxID_QUIT,.
Definition cxMultiLineInput.cpp:330
virtual bool setKeyFunction(int pKey, const std::shared_ptr< cxFunction > &pFunction) override
Sets a function to be called when a key is pressed.
virtual e_cxColors getRightLabelColor() const
Returns the color used for the right label.
Definition cxMultiLineInput.cpp:3056
virtual int getRightLabelBottom() const
Returns the bottom row of the right label window.
Definition cxMultiLineInput.cpp:2991
char getMaskChar() const
Definition cxMultiLineInput.cpp:925
virtual void enableInputLoop(bool pDoInputLoop)
Enables or disables the input loop.
Definition cxMultiLineInput.cpp:1928
virtual void addValidOptions(const std::string &pValidOptions, bool pValidate=true)
Adds single-character valid input strings to the input.
Definition cxMultiLineInput.cpp:2560
virtual std::string getValidOptionHelpText(const std::string &pInput) const
Returns the help text for one of the valid input strings. If.
Definition cxMultiLineInput.cpp:2685
virtual void setExtendedHelpColor(e_cxColors pColor)
Sets the color to use for the extended help message.
Definition cxMultiLineInput.cpp:2805
virtual bool getUseValidatorFunction() const
Returns whether or not the validator function should be used.
Definition cxMultiLineInput.cpp:2103
virtual void setBorderStyle(eBorderStyle pBorderStyle) override
Sets the border style.
Definition cxMultiLineInput.cpp:1713
virtual void autoGenerateExtendedHelp(bool pAutoGenerateExtendedHelp)
Enables or disables automatic generation of the extended help.
Definition cxMultiLineInput.cpp:2825
virtual void exitNow() override
Tells the input to exit the input loop now, with a return value.
Definition cxMultiLineInput.cpp:2089
void trapNonAssignedFKeys(bool pTrapNonAssignedFKeys)
Sets whether non-assigned function keys should.
Definition cxMultiLineInput.cpp:1801
void getValidOptionStrings(std::set< std::string > &pValidOptionStrings) const
Returns a set of all the valid input strings currently set.
void freeInputs()
Frees the memory used by the single-line inputs.
Definition cxMultiLineInput.cpp:3658
virtual int getMaxInputLength() const
Returns the currently-set maximum input length.
Definition cxMultiLineInput.cpp:3094
void setCanBeEditable(bool pCanBeEditable)
Sets whether the input can be set editable. If this is called.
Definition cxMultiLineInput.cpp:1695
virtual void enableAttrs(WINDOW *pWin, e_WidgetItems pItem) override
Enables the attributes for one of the m*Attrs sets for an ncurses window.
Definition cxMultiLineInput.cpp:3724
virtual void setLastKey(int pLastKey) override
Sets the last keypress.
Definition cxMultiLineInput.cpp:2005
virtual void resize(int pNewHeight, int pNewWidth, bool pRefresh=true) override
Changes input's width and height. The upper-left coordinate.
Definition cxMultiLineInput.cpp:1024
void getRangeDouble(long double &pLow, long double &pHigh) const
Returns the floating-point numeric range for in the input.
Definition cxMultiLineInput.cpp:2328
virtual int getRightLabelLeft() const
Returns the leftmost column of the right label window.
Definition cxMultiLineInput.cpp:2986
bool getMasked()
Definition cxMultiLineInput.cpp:895
int getTimeout() const
Returns the amount of time that the input will wait before.
Definition cxMultiLineInput.cpp:2261
virtual bool getValidateOnReverse() const
Returns whether or not the validator function will.
Definition cxMultiLineInput.cpp:2000
virtual bool keyIsExtendedHelpKey(int pKey) const
Returns whether or not a key is set up as an extended help key.
Definition cxMultiLineInput.cpp:2953
virtual bool getShowRightLabel() const
Returns whether or not the label to the right of the input.
Definition cxMultiLineInput.cpp:2964
virtual void setValidateOnReverse(bool pValidateOnReverse)
Sets whether or not to run the validator function.
Definition cxMultiLineInput.cpp:1995
virtual std::string inputValidator()
onLeave validator function - This runs just before the user
Definition cxMultiLineInput.cpp:2352
void setMaskChar(char pMaskChar)
Definition cxMultiLineInput.cpp:937
void setRangeLowDouble(const long double &pRangeLowDouble)
Sets the low end of the floating-point numeric range for the.
Definition cxMultiLineInput.cpp:2293
cxMultiLineInput & operator=(const cxMultiLineInput &pThatInput)
Assignment operator.
Definition cxMultiLineInput.cpp:251
virtual void removeAttr(e_WidgetItems pItem, attr_t pAttr) override
Removes an ncurses attribute from one of the item lists.
Definition cxMultiLineInput.cpp:2148
void setRangeInt(const long int &pLow, const long int &pHigh)
Sets the whole number range for the input.
Definition cxMultiLineInput.cpp:2346
cxMultiLineInput(cxWindow *pParentWindow=nullptr, int pRow=0, int pCol=0, int pHeight=1, int pWidth=DEFAULT_WIDTH, const std::string &pLabel="", eBorderStyle pBorderStyle=eBS_NOBORDER, eInputOptions pInputOption=eINPUT_EDITABLE, eInputTypes pInputType=eINPUT_TYPE_TEXT, std::string *pExtValue=nullptr, int pRightLabelOffset=0, int pRightLabelHeight=1, int pRightLabelWidth=7, bool pShowRightLabel=false)
virtual void removeExitKey(int pKey) override
Removes an exit key.
Definition cxMultiLineInput.cpp:1917
e_cxColors getLabelColor() const
Definition cxMultiLineInput.cpp:1338
virtual void addNavKey(int pKey)
Add a key to be considered a "navigational" key. The key will.
Definition cxMultiLineInput.cpp:2229
virtual std::string getValidatorStr() const
Returns the validator string.
Definition cxMultiLineInput.cpp:845
virtual void removeNavKey(int pKey)
Removes a key from the input's list of "navigational" keys (see.
Definition cxMultiLineInput.cpp:2234
std::string getValidOptionStrings(const eMLIF &pMLIF=eMLIF_COMMA_SEP) const
Get the valid input strings formatted.
Definition cxMultiLineInput.cpp:2647
virtual void erase(bool pEraseSubwindows=true) override
Erases the window.
Definition cxMultiLineInput.cpp:580
virtual void additionalOnClear()
This function is called when the user clears the input. This.
Definition cxMultiLineInput.cpp:3119
virtual std::string onKeypress()
This runs each time the user presses a key. If built-in.
Definition cxMultiLineInput.cpp:2452
bool getSkipIfReadOnly() const
Returns whether the input will skip all.
Definition cxMultiLineInput.cpp:1971
virtual void disableAttrs(WINDOW *pWin, e_WidgetItems pItem) override
Disables the attributes for one of the m*Attrs sets for an ncurses window.
Definition cxMultiLineInput.cpp:3733
virtual bool handleFunctionForLastKey(bool *pFunctionExists=nullptr, bool *pRunOnLeaveFunction=nullptr) override
Looks for a function tied to the last keypress and.
Definition cxMultiLineInput.cpp:3665
virtual bool rightLabelEnabled() const
Returns whether or not the right label window is enabled.
Definition cxMultiLineInput.cpp:3125
long int getRangeLowInt() const
Returns the low end of the whole numeric range for the input.
Definition cxMultiLineInput.cpp:2308
e_cxColors getValueColor() const
Definition cxMultiLineInput.cpp:1361
cxForm * getParentForm() const
Returns the parent cxForm pointer.
Definition cxMultiLineInput.cpp:1990
virtual void removeQuitKey(int pKey) override
Removes a quit key (but doesn't work for ESC)
Definition cxMultiLineInput.cpp:1889
virtual void bringToTop(bool pRefresh=true) override
Brings the window to the top.
Definition cxMultiLineInput.cpp:1777
virtual void setOnKeyFunction(const std::shared_ptr< cxFunction > &pFunction)
Sets a function to be run whenever a key is pressed.
virtual void setUseExtendedHelpKeys(bool pUseExtendedHelpKey)
Toggles whether or not to use the extended help keys.
Definition cxMultiLineInput.cpp:2916
virtual void removeSkipValidatorKey(int pKey)
Removes a key from the list of keys that skip the validator.
Definition cxMultiLineInput.cpp:1308
virtual bool addQuitKey(int pKey, bool pRunOnLeaveFunction=true, bool pOverride=false) override
Adds a key that will cause the input to quit and return.
Definition cxMultiLineInput.cpp:1872
bool focusFunctionsWillRun() const
Returns whether the onFocus and onLeave functions will be run.
Definition cxMultiLineInput.cpp:3561
virtual void getNavKeys(std::set< int > &pNavKeys) const
Returns the input's list of what it considers "navigational".
Definition cxMultiLineInput.cpp:2244
void setAutoWrapAtBeginning(bool pWrapAtBeginning)
Sets whether auto-wrapping of text.
Definition cxMultiLineInput.cpp:1959
void setRangeLowInt(const long int &pRangeLowInt)
Sets the low end of the whole numeric range for the input.
Definition cxMultiLineInput.cpp:2313
long int getRangeHighInt() const
Returns the high end of the whole numeric range for the input.
Definition cxMultiLineInput.cpp:2318
void setLabelColor(e_cxColors pColor)
Sets the label color.
Definition cxMultiLineInput.cpp:1330
std::shared_ptr< cxFunction > mValidatorFunction
This is the function to be run to validate.
Definition cxMultiLineInput.h:2131
virtual void setValidatorStr(const std::string &pValidator)
Sets the validator string for this input.
Definition cxMultiLineInput.cpp:800
virtual std::string cxTypeStr() const override
Returns the name of the cxWidgets class. This can be used to.
Definition cxMultiLineInput.cpp:2273
virtual void setEditable(bool pEditable)
Enables or disables editing of the input. If disabled, the.
Definition cxMultiLineInput.cpp:1938
virtual bool autoGenerateExtendeHelp() const
Returns whether or not the extended help text will be.
Definition cxMultiLineInput.cpp:2837
virtual void setLabel(const std::string &pLabel)
Definition cxMultiLineInput.cpp:606
virtual void setUseClearKey(bool pUseClearKey)
Sets whether or not the clear key should be used.
Definition cxMultiLineInput.cpp:3114
void setExitOnFull(bool pExitOnFull)
Sets whether the input should exit automatically when it's full.
Definition cxMultiLineInput.cpp:1703
virtual std::string getExtendedHelpKeyStrings() const
Returns a comma-separated list of strings representing the.
Definition cxMultiLineInput.cpp:2887
virtual int maxValueLen() const
Returns the maximum length of the value that may be set.
Definition cxMultiLineInput.cpp:1645
virtual void setExtendedHelp(const std::string &pExtendedHelp)
Sets the "extended" help text for the input (this can be as.
Definition cxMultiLineInput.cpp:2795
virtual void addSkipValidatorKey(int pKey)
Adds a key to the list of keys that, when pressed, the input.
Definition cxMultiLineInput.cpp:1303
virtual void getAttrs(e_WidgetItems pItem, std::set< attr_t > &pAttrs) const override
Returns the set of ncurses attributes for a given item.
Definition cxMultiLineInput.cpp:2166
virtual eInputErrors getErrorState() const
Returns the current error state of the input. This can be.
Definition cxMultiLineInput.cpp:3099
virtual bool getUseClearKey() const
Returns whether or not the clear key will be used.
Definition cxMultiLineInput.cpp:3109
virtual void removeAttrs(e_WidgetItems pItem) override
Removes all attributes for a given window item.
Definition cxMultiLineInput.cpp:2157
virtual bool hasSkipValidatorKey(int pKey) const
Returns whether a key is in the list of keys that cause the.
Definition cxMultiLineInput.cpp:1313
void hide(bool pHideSubwindows=false) override
Definition cxMultiLineInput.cpp:554
virtual void setMaxInputLength(int pLength)
Sets the maximum text length that can be accepted by the input.
Definition cxMultiLineInput.cpp:3071
virtual bool textIsValid() const
Returns whether the text entered into the input is valid.
Definition cxMultiLineInput.cpp:858
virtual void setEnabled(bool pEnabled) override
Enables or disables the input.
Definition cxMultiLineInput.cpp:2021
void unhide(bool pUnhideSubwindows=false) override
Definition cxMultiLineInput.cpp:565
virtual void setDisableCursorOnShow(bool pDisableCursorOnShow) override
Sets whether the window should disable the cursor.
Definition cxMultiLineInput.cpp:1981
virtual bool ranFunctionAndShouldExit() const
Returns whether the input ran a key function that was set up.
Definition cxMultiLineInput.cpp:2125
bool validatorFuncMessageBox() const
Returns whether or not the message box for errors is enabled.
Definition cxMultiLineInput.cpp:2555
void setRangeDouble(const long double &pLow, const long double &pHigh)
Sets the floating-point numeric range for the input.
Definition cxMultiLineInput.cpp:2334
virtual void setAllowBlank(bool pAllowBlank)
Sets whether or not to allow a blank value.
Definition cxMultiLineInput.cpp:2785
virtual cxWindow * getParent() const override
Returns a pointer to the parent window. If the cxMultiLineInput.
Definition cxMultiLineInput.cpp:2108
void runFocusFunctions(bool pRunFocusFunctions)
Enables or disables the onFocus and onLeave functions.
Definition cxMultiLineInput.cpp:3566
virtual bool hasNavKey(int pKey) const
Returns whether a key is in the input's list of what it.
Definition cxMultiLineInput.cpp:2224
virtual bool getCursorLeftAlign() const
Returns whether the cursor will be left-aligned when the.
Definition cxMultiLineInput.cpp:2177
int getInputLen() const
Definition cxMultiLineInput.cpp:1860
virtual bool modalGetsKeypress() const override
Returns whether or not a call to showModal() will wait for a.
Definition cxMultiLineInput.cpp:2016
virtual void clearOnKeyFunction()
Un-sets the onKey function.
Definition cxMultiLineInput.cpp:1619
long doInputLoop(bool pShowInputs, bool &pRunOnLeaveFunction)
Handles the input loop. Returns cxID_QUIT or cxID_EXIT,.
Definition cxMultiLineInput.cpp:3229
virtual void setShowRightLabel(bool pShowRightLabel)
Sets whether or not to show the label to the right of the input.
Definition cxMultiLineInput.cpp:2958
virtual std::string runValidatorFunction() const
Runs the input's validator function and returns its return.
Definition cxMultiLineInput.cpp:3742
virtual bool getAllowBlank() const
Returns the option for allowing a blank value.
Definition cxMultiLineInput.cpp:2790
virtual int getInputOption() const
Returns the input option for the input (i.e., eINPUT_EDITABLE,.
Definition cxMultiLineInput.cpp:1383
virtual bool setValue(std::string pValue, bool pRefresh=false)
Sets the text in the input.
Definition cxMultiLineInput.cpp:671
virtual void refreshValue(bool pRefresh=true)
Refreshes just the value portion of the input.
Definition cxMultiLineInput.cpp:1793
virtual void setInputOption(eInputOptions pInputKind)
Sets the input option for the input (i.e., eINPUT_EDITABLE,.
Definition cxMultiLineInput.cpp:1399
virtual void setRightLabel(int pOffset, const std::string &pText, bool pRefresh=false)
Sets the offset & the text of the right label.
virtual void toggleOnKeyFunction(bool pRunOnKeyFunction)
Sets whether the onKey function should be fired or not.
Definition cxMultiLineInput.cpp:1610
virtual std::string getExtendedHelp() const
Returns the extended help set in the input.
Definition cxMultiLineInput.cpp:2800
virtual void setRightLabelColor(e_cxColors pColor)
Sets the color to use for the right label.
Definition cxMultiLineInput.cpp:3061
void runFieldFunction(int pKey)
Runs the function that was set with setKeyFunction for this key.
Definition cxMultiLineInput.cpp:1836
virtual bool autoFillFromValidOptions(bool pRefresh=false)
For a text input, this will try to auto-fill the input based.
Definition cxMultiLineInput.cpp:2703
virtual int getRightLabelTop() const
Returns the top row of the right label window.
Definition cxMultiLineInput.cpp:2981
virtual void setReadOnlyOnLeave(bool pReadOnlyOnLeave)
Sets whether the input should go read-only when setFocus() exits.
Definition cxMultiLineInput.cpp:1676
virtual void clearKeyFunction(int pFunctionKey) override
Removes a hotkey from the window so that it will not.
Definition cxMultiLineInput.cpp:1318
virtual void removeNavKeys()
Removes all keys that the input considers "navigational" keys.
Definition cxMultiLineInput.cpp:2239
virtual long show(bool pBringToTop=false, bool pShowSubwindows=false) override
Definition cxMultiLineInput.cpp:261
virtual int getRightLabelOffset() const
Returns the offset of the right label from the right edge of.
Definition cxMultiLineInput.cpp:2976
virtual bool hasFocus() const override
Returns whether or not the input currently has focus.
Definition cxMultiLineInput.cpp:1657
virtual void setValidOptions(const std::map< std::string, std::string > &pValidOptions, bool pValidate=true)
Sets all the strings that may be typed into the input.
virtual bool isEditable() const
Returns whether or not the input is editable. An input is editable if it passes the 3 following crite...
Definition cxMultiLineInput.cpp:1943
virtual int getRightLabelHeight() const
Returns the height of the right label window.
Definition cxMultiLineInput.cpp:3001
virtual void setErrorState(eInputErrors pErrorState)
Sets the error state for the input. This can be one of the.
Definition cxMultiLineInput.cpp:3104
virtual void quitNow() override
Tells the input to exit the input loop now, with a return value.
Definition cxMultiLineInput.cpp:2058
void setExitOnBackspaceAtFront(bool pExitOnBackspaceAtFront)
Sets whether the input should exit the input loop when the.
Definition cxMultiLineInput.cpp:2215
virtual bool isBelow(const cxWindow &pThatWindow) const override
Returns whether the input is below another window.
Definition cxMultiLineInput.cpp:1761
static std::string clearInput(void *theInput, void *unused)
Clears the value of a cxMultiLineInput.
Definition cxMultiLineInput.cpp:1436
virtual std::string getLabel() const
Definition cxMultiLineInput.cpp:592
long double getRangeLowDouble() const
Returns the low end of the floating-point numeric range for.
Definition cxMultiLineInput.cpp:2288
long double getRangeHighDouble() const
Returns the high end of the floating-point numeric range for.
Definition cxMultiLineInput.cpp:2298
void setRangeHighInt(const long int &pRangeHighInt)
Sets the high end of the whole numeric range for the input.
Definition cxMultiLineInput.cpp:2323
virtual void resizeRightLabel(int pHeight, int pWidth, bool pRefresh=false)
Re-sizes the right label.
Definition cxMultiLineInput.cpp:3021
virtual bool usingBuiltInOnKeyFunction() const
Returns whether or not the built-in onKeypress function is.
Definition cxMultiLineInput.cpp:2522
void setExtValue(std::string *pExtVal, bool pRefresh=false)
Definition cxMultiLineInput.cpp:780
void setParentForm(cxForm *pParentForm)
Sets the parent cxForm pointer.
Definition cxMultiLineInput.cpp:3571
virtual void clear(bool pRefresh=false) override
Alias for clearValue() (this is here to overload the clear()
Definition cxMultiLineInput.cpp:666
void copyCxMultiLineInputStuff(const cxMultiLineInput *pThatInput)
Copies another cxMultiLineInput's member variables.
Definition cxMultiLineInput.cpp:3146
void setEnterAlwaysExits(bool pEnterAlwaysExits)
Sets whether the enter key always causes the input.
Definition cxMultiLineInput.cpp:1635
virtual void setAttr(e_WidgetItems pItem, attr_t pAttr) override
Sets the ncurses attribute to use for one of the items in the.
Definition cxMultiLineInput.cpp:2139
bool onKeyFunctionEnabled() const
Returns whether or not the onKey function will be run.
Definition cxMultiLineInput.cpp:1628
virtual void clearValue(bool pRefresh=false)
Clears the input value.
Definition cxMultiLineInput.cpp:658
void clearValidatorFunction()
Un-sets the validator function.
Definition cxMultiLineInput.cpp:1554
virtual void setForceUpper(bool pForceUpper)
Toggles the option to force text to be upper-case.
Definition cxMultiLineInput.cpp:2769
void setSkipIfReadOnly(bool pSkipIfReadOnly)
Sets whether the input should skip.
Definition cxMultiLineInput.cpp:1976
bool mRunFocusFunctions
Whether or not to run the onFocus and onLeave functions.
Definition cxMultiLineInput.h:2136
virtual bool isAbove(const cxWindow &pThatWindow) const override
Returns whether the input is above another window.
Definition cxMultiLineInput.cpp:1745
virtual bool usingBuiltInValidator() const
Returns whether or not the built-in validator function is set.
Definition cxMultiLineInput.cpp:2491
virtual bool runOnFocusFunction(std::string *pFunctionRetval=nullptr) override
Runs the onFocus function, if it's set. If the.
Definition cxMultiLineInput.cpp:1810
virtual void addAttr(e_WidgetItems pItem, attr_t pAttr) override
Adds an ncurses attribute to use for one of the items in the.
Definition cxMultiLineInput.cpp:2130
virtual int getRightLabelRight() const
Returns the rightmost column of the right label window.
Definition cxMultiLineInput.cpp:2996
virtual void setTimeout(int pTimeout)
Sets the amount of time (in seconds) that the input should.
Definition cxMultiLineInput.cpp:2250
virtual bool getUseExtendedHelpKeys() const
Returns whether the extended help keys are set to be used.
Definition cxMultiLineInput.cpp:2948
void setValueColor(e_cxColors pColor)
Sets the color of the value typed into the input.
Definition cxMultiLineInput.cpp:1352
void toggleMasking(bool pMasking)
Definition cxMultiLineInput.cpp:917
bool canBeEditable() const
Returns whether the input can be editable.
Definition cxMultiLineInput.cpp:1681
virtual void clearExtendedHelpKeys()
Removes all extended help keys.
Definition cxMultiLineInput.cpp:2900
virtual bool inputLoopEnabled() const
Returns whether the input loop is enabled.
Definition cxMultiLineInput.cpp:1933
virtual void setRightLabelHeight(int pHeight, bool pRefresh=false)
Sets the height of the right label.
Definition cxMultiLineInput.cpp:3016
virtual void addExtendedHelpKey(int pKey)
Adds an additional key to be used to display the extended help.
Definition cxMultiLineInput.cpp:2850
virtual void clearValidOptions()
Clears the set of valid strings that can be typed into the.
Definition cxMultiLineInput.cpp:2698
virtual void setRightLabel(const std::string &pText, bool pRefresh=false)
Sets the text of the right label.
virtual void getValidOptions(std::map< std::string, std::string > &pValidOptions) const
Returns the collection of valid input strings that can be typed.
Definition cxMultiLineInput.cpp:2631
virtual void useBuiltInOnKeyFunction()
Sets up the input's built-in onKey function for the input.
Definition cxMultiLineInput.cpp:2517
bool isFull() const
Returns whether the value in the input takes up the maximum possible space for the input.
Definition cxMultiLineInput.cpp:1559
virtual void toggleValidatorFunction(bool pRunValidatorFunction)
Sets whether or not the validator function should be used.
Definition cxMultiLineInput.cpp:2098
bool getAutoWrapAtBeginning() const
Returns whether or not auto-wrapping of text.
Definition cxMultiLineInput.cpp:1949
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 input types (text,.
#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
eInputTypes
Definition cxInputTypes.h:20
@ eINPUT_TYPE_TEXT
Definition cxInputTypes.h:21
std::string(* funcPtr2)(void *p1, void *p2)
Definition cxFunction.h:20
eInputOptions
Definition cxInputOptions.h:20
@ eINPUT_EDITABLE
Definition cxInputOptions.h:21
eMLIF
Definition cxMultiLineInput.h:37
@ eMLIF_COMMA_SEP_WITH_DESC
Definition cxMultiLineInput.h:39
@ eMLIF_COMMA_SEP
Definition cxMultiLineInput.h:38
eBorderStyle
Definition cxBorderStyles.h:26
@ eBS_NOBORDER
Definition cxBorderStyles.h:27
eInputErrors
Definition cxMultiLineInput.h:46
@ eOUT_OF_RANGE
Definition cxMultiLineInput.h:48
@ eINVALID_VALUE
Definition cxMultiLineInput.h:49
@ eNO_ERROR
Definition cxMultiLineInput.h:47
@ eBLANK
Definition cxMultiLineInput.h:50
@ eCUSTOM_VALIDATION_FAILED
Definition cxMultiLineInput.h:51
e_cxColors
Definition cxColors.h:46