cxWidgets 1.0
Classes | Typedefs | Enumerations | Functions | Variables
cx Namespace Reference

cxBorderChars.h - Defines border characters to be used in drawing a box (i.e., in cxWindow and all its derivitives) More...

Classes

class  cxApp
 Holds application setup & exit logic, as well as the application's main frame. More...
 
struct  cxBorderChars
 
class  cxButton
 
class  cxComboBox
 A text box that also has a drop-down box with a list of items that the user can choose from. More...
 
class  cxDate
 Enables easy management of dates. C++17-enhanced version of the original 'date' class. More...
 
class  cxDatePicker
 This is a dialog that displays a calendar, allowing the user to choose a date while viewing a calendar; this dialog also allows the user to navigate through the months and specify different years to view calendars of various months and years. More...
 
class  cxDialog
 Represents a dialog window on the screen (i.e., something to be shown. More...
 
class  cxFileViewer
 Represents a window that displays a file. While the object is being displayed with showModal(), the user can go to a specific line by pressing CTRL-G (this is the default; it can be changed with setGoToKey()). The user can also search for text with the '/' key (this is the default; it can be changed with setSearchKey()). By default, the previous keyword is used when searching again; this behavior can be changed with useLastKeyword().
Also, cxFileViewer supports page scrolling with the pageUp and pageDown keys. In addition, cxMenu also uses alternate keys for doing a pageUp and pageDown, which by default are '.' and ',', respectively. These defaults can be changed via setAltPgUpKey() and setAltPgDownKey(). More...
 
class  cxForm
 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...
 
class  cxFrame
 Similar to wxFrame and other frame classes in GUI frameworks, this. More...
 
class  cxFunction
 Base class for cxFunction2 and cxFunction4. This class is pure. More...
 
class  cxFunction0
 A more intelligent function pointer, which can run a. More...
 
class  cxFunction1RefTemplated
 This class is a cxFunction that is templated to take a reference of a specific type. More...
 
class  cxFunction2
 A more intelligent function pointer, which can run a function with. More...
 
class  cxFunction2RefTemplated
 This class is a cxFunction that is templated to take 2 references of specific types. More...
 
class  cxFunction2Templated
 This class is a cxFunction that is templated to take 2 pointers of specific types. More...
 
class  cxFunction3RefTemplated
 This class is a cxFunction that is templated to take 2 references of specific types. More...
 
class  cxFunction4
 This class is just like cxFunction2, but for functions. More...
 
class  cxFunction4RefTemplated
 This class is a cxFunction that is templated to take 4 references of specific types. More...
 
class  cxFunction4Templated
 This class is a cxFunction that is templated to take 4 pointers of specific types. More...
 
class  cxGrid
 This is a class representing a grid of data, similar to a spreadsheet, with rows & columns of cells where data can be entered. More...
 
class  cxInput
 Represents a single-line input box with a label. This class. More...
 
class  cxLabel
 This is a class for displaying a read-only label. More...
 
class  cxMenu
 Represents a list of items, one of which may be selected. More...
 
class  cxMenuBar
 This is a menu bar class, designed for displaying a horizontal. More...
 
class  cxMessageDialog
 Represents a dialog box with "OK" and/or "Cancel". More...
 
class  cxMultiForm
 Represents a form that can. More...
 
class  cxMultiLineInput
 This class represents an input box that can have a height. More...
 
class  cxNotebook
 This class represents a notebook control, which manages multiple. More...
 
class  cxObject
 The base class for windowing classes in the cxWidgets. More...
 
class  cxOpenFileDialog
 This is a dialog class that is designed to allow the user to choose a filename in a specific directory, with a directory browser. This class is designed to be similar to file choosers in GUI libraries, such as OpenFileDialog in .NET Core 8, QtFileDilog in Qt, etc. More...
 
class  cxPanel
 cxPanel is a window that contains other windows. When showModal() More...
 
class  cxScrolledWindow
 Represents a text window with scrolling. This class is. More...
 
class  cxSearchPanel
 This class is based on cxPanel, and it contains a cxForm at the top. More...
 
class  cxTextValidator
 Provides some text validation functionality. See README.txt for. More...
 
class  cxTimer
 Represents a timer that will run a function after. More...
 
class  cxWidgetsException
 Represents an exception in cxWidgets. More...
 
class  cxWindow
 Represents a text-based window on the screen. Can contain a title, status, and a message to appear within the window. A cxWindow can have a border or be borderless. A cxWindow may also have a parent and may also have subwindows. When setting up a cxWindow to have a parent, it will tell the parent to also add the window as one of its subwindows. Also, when a cxWindow is destroyed, it will be removed from its parent's subwindow list (if it has a parent); additionally, when a cxWindow is destroyed, it will orphan all of its subwindows (so they have no parent).
Note to authors deriving from cxWindow or a cxWindow-based class: In the destructor, if you do anything that would affect the screen, you should first check to see if cxWidgets is initialized (via a call to cxBase::cxInitialized()), or else the application may segfault. This might happen if someone writes a simple program using cxWidgets objects in their main() method. In that situation, cxBase::cleanup() would get called before the cxWidgets object destructors get called when the objects go out of scope.

The parent/child cxWindow relationship has the following effects:
More...
 
class  floatingPtInputWithRightLabel
 

Typedefs

typedef std::pair< std::shared_ptr< cxMultiLineInput >, std::shared_ptr< cxMultiLineInput > > cxMLInputPtrPair
 
typedef std::pair< std::shared_ptr< cxComboBox >, std::shared_ptr< cxComboBox > > cxComboBoxPtrPair
 
typedef std::string(* funcPtr0) ()
 
typedef std::string(* funcPtr2) (void *p1, void *p2)
 
typedef std::string(* funcPtr4) (void *p1, void *p2, void *p3, void *p4)
 
typedef std::vector< std::string > stringContainer
 
typedef std::vector< std::string >::iterator stringContainerIterator
 
typedef std::vector< cxWindow * > cxWindowPtrContainer
 
typedef std::deque< std::string > messageLineContainer
 

Enumerations

enum  eBorderStyle {
  eBS_NOBORDER = 0 , eBS_SINGLE_LINE , eBS_DOUBLE_LINE , eBS_DOUBLE_TOP_SINGLE_SIDES ,
  eBS_SINGLE_TOP_DOUBLE_SIDES , eBS_SPACE
}
 
enum  e_cxColors {
  eDEFAULT = 0 , eRED_BLACK = 2 , eBRTRED_BLACK , eGREEN_BLACK ,
  eBRTGREEN_BLACK , eBROWN_BLACK , eYELLOW_BLACK , eBLUE_BLACK ,
  eBRTBLUE_BLACK , eCYAN_BLACK , eBRTCYAN_BLACK , eMAGENTA_BLACK ,
  eBRTMAGENTA_BLACK , eGRAY_BLACK , eWHITE_BLACK , eBLACK_BLACK ,
  eRED_WHITE = eBLACK_BLACK + 2 , eBRTRED_WHITE , eGREEN_WHITE , eBRTGREEN_WHITE ,
  eBROWN_WHITE , eYELLOW_WHITE , eBLUE_WHITE , eBRTBLUE_WHITE ,
  eCYAN_WHITE , eBRTCYAN_WHITE , eMAGENTA_WHITE , eBRTMAGENTA_WHITE ,
  eGRAY_WHITE , eWHITE_WHITE , eBLACK_WHITE , eRED_BLUE = eBLACK_WHITE + 2 ,
  eBRTRED_BLUE , eGREEN_BLUE , eBRTGREEN_BLUE , eBROWN_BLUE ,
  eYELLOW_BLUE , eBLUE_BLUE , eBRTBLUE_BLUE , eCYAN_BLUE ,
  eBRTCYAN_BLUE , eMAGENTA_BLUE , eBRTMAGENTA_BLUE , eGRAY_BLUE ,
  eWHITE_BLUE , eBLACK_BLUE , eRED_GREEN = eBLACK_BLUE + 2 , eBRTRED_GREEN ,
  eBROWN_GREEN , eYELLOW_GREEN , eBLUE_GREEN , eBRTBLUE_GREEN ,
  eCYAN_GREEN , eBRTCYAN_GREEN , eMAGENTA_GREEN , eBRTMAGENTA_GREEN ,
  eGRAY_GREEN , eWHITE_GREEN , eGREEN_GREEN , eBRTGREEN_GREEN ,
  eBLACK_GREEN , eRED_RED = eBLACK_GREEN + 2 , eBRTRED_RED , eGREEN_RED ,
  eBRTGREEN_RED , eBROWN_RED , eYELLOW_RED , eBLUE_RED ,
  eBRTBLUE_RED , eCYAN_RED , eBRTCYAN_RED , eMAGENTA_RED ,
  eBRTMAGENTA_RED , eGRAY_RED , eWHITE_RED , eBLACK_RED ,
  eRED_CYAN = eBLACK_RED + 2 , eBRTRED_CYAN , eGREEN_CYAN , eBRTGREEN_CYAN ,
  eBROWN_CYAN , eYELLOW_CYAN , eBLUE_CYAN , eBRTBLUE_CYAN ,
  eCYAN_CYAN , eBRTCYAN_CYAN , eMAGENTA_CYAN , eBRTMAGENTA_CYAN ,
  eGRAY_CYAN , eWHITE_CYAN , eBLACK_CYAN
}
 
enum  eDateFormats {
  YYYY_MM_DD , MM_DD_YYYY , DD_MM_YYYY , YY_MM_DD ,
  MM_DD_YY , DD_MM_YY , YYYYMMDD , MMDDYYYY ,
  DDMMYYYY , YYMMDD , MMDDYY , DDMMYY ,
  UNKNOWN
}
 
enum  eWeekDays {
  eSUNDAY , eMONDAY , eTUESDAY , eWEDNESDAY ,
  eTHURSDAY , eFRIDAY , eSATURDAY
}
 
enum  eInputType { eIT_CXMULTILINEINPUT , eIT_CXCOMBOBOX }
 
enum  eInputOptions { eINPUT_EDITABLE = 0 , eINPUT_READONLY }
 
enum  eInputTypes { eINPUT_TYPE_TEXT = 0 , eINPUT_TYPE_NUMERIC_FLOATING_PT , eINPUT_TYPE_NUMERIC_WHOLE }
 
enum  cxMenuItemType {
  cxITEM_NORMAL = 0 , cxITEM_SUBMENU , cxITEM_POPUPMENU , cxITEM_SEPARATOR ,
  cxITEM_UNSELECTABLE
}
 
enum  eMessageDialogStyles {
  cxYES = 2 , cxOK = 4 , cxNO = 8 , cxCANCEL = 16 ,
  cxYES_NO = (cxYES | cxNO) , cxOK_CANCEL = (cxOK | cxCANCEL) , cxYES_DEFAULT = 0 , cxNO_DEFAULT = 32
}
 
enum  eMLIF { eMLIF_COMMA_SEP = 0 , eMLIF_COMMA_SEP_WITH_DESC }
 
enum  eInputErrors {
  eNO_ERROR , eOUT_OF_RANGE , eINVALID_VALUE , eBLANK ,
  eCUSTOM_VALIDATION_FAILED
}
 
enum  eHPosition { eHP_CENTER = 0 , eHP_LEFT , eHP_RIGHT }
 
enum  eVPosition { eVP_CENTER = 0 , eVP_TOP , eVP_BOTTOM }
 
enum  eReturnCode {
  cxID_OK = -400L , cxID_CANCEL = -399L , cxID_EXIT = -398L , cxID_QUIT = -397L ,
  cxFIRST_AVAIL_RETURN_CODE = 0L
}
 
enum  e_WidgetItems {
  eMESSAGE = 0 , eTITLE , eSTATUS , eBORDER ,
  eMENU_SELECTION , eLABEL , eDATA_READONLY , eDATA_EDITABLE ,
  eDATA , eHOTKEY
}
 

Functions

string eBorderStyleToStr (eBorderStyle borderStyle)
 Converts an eBorderStyle value to a string representation.
 
ostream & operator<< (ostream &pOS, const cxDate &pDate)
 
istream & operator>> (istream &pIS, cxDate &pDate)
 
void init (bool pEnableMouse=true)
 Initializes the cxWidgets library. This must be called before.
 
void cleanup ()
 Cleans up the cxWidgets library. Must be called after all.
 
int top ()
 Returns the top row # of the main screen.
 
int centerRow ()
 Returns the center row # of the main screen.
 
int bottom ()
 Returns the bottom row # of the main screen.
 
int left ()
 Returns the leftmost column # of the main screen.
 
int centerCol ()
 Returns the center column # of the main screen.
 
int right ()
 Returns the rightmost column # of the main screen.
 
int width ()
 Returns the width of the main screen.
 
int height ()
 Returns the height of the main screen.
 
void getTermDimensions (int &pHeight, int &pWidth)
 Returns the terminal's current height & width.
 
bool resizeTerm (int pNewHeight, int pNewWidth)
 Resizes the terminal screen.
 
e_cxColors getDefaultMessageColor ()
 Returns the default message color.
 
void setDefaultMessageColor (e_cxColors pColor)
 Sets the default message color.
 
e_cxColors getDefaultTitleColor ()
 Returns the default title color.
 
void setDefaultTitleColor (e_cxColors pColor)
 Sets the default title color.
 
e_cxColors getDefaultStatusColor ()
 Returns the default status color.
 
void setDefaultStatusColor (e_cxColors pColor)
 Sets the default status color.
 
e_cxColors getDefaultBorderColor ()
 Returns the default border color.
 
void setDefaultBorderColor (e_cxColors pColor)
 Sets the default border color.
 
void messageBox (int pRow, int pCol, int pHeight, int pWidth, const std::string &pTitle, const std::string &pMessage, const std::string &pStatus="", eBorderStyle pBorderStyle=eBS_SINGLE_LINE)
 Shows a message box.
 
void messageBox (int pRow, int pCol, const std::string &pTitle, const std::string &pMessage, const std::string &pStatus)
 Shows a message box automatically setting its height & width.
 
void messageBox (int pRow, int pCol, const std::string &pMessage)
 Shows a message box, automatically setting its height & width.
 
void messageBox (const std::string &pTitle, const std::string &pMessage, const std::string &pStatus="")
 
void messageBox (const std::string &pTitle, const std::string &pMessage, const std::string &pStatus, int pHeight, int pWidth)
 Shows a message box.
 
void messageBox (const std::string &pMessage, const std::string &pStatus, int pHeight, int pWidth)
 Shows a message box.
 
void messageBox (const std::string &pMessage, e_cxColors pMessageColor=getDefaultMessageColor(), attr_t pMessageAttr=A_NORMAL, e_cxColors pTitleColor=getDefaultTitleColor(), e_cxColors pStatusColor=getDefaultStatusColor(), e_cxColors pBorderColor=getDefaultBorderColor())
 Shows a message box.
 
void messageDialog (const std::string &pMessage)
 Shows a message dialog (a message box with an OK button)
 
void messageDialog (const std::list< std::string > &pMessages)
 Shows a message dialog (a message box with an OK button)
 
void splash (const std::string &pTitle, const std::string &pMessage, int pSleep)
 Shows a splash message.
 
void splash (const std::string &pMessage, int pSleep)
 Shows a splash message.
 
void eraseScreen ()
 Erases the screen.
 
void updateWindows ()
 Updates (refreshes) all windows on the screen.
 
bool isFunctionKey (int pKey)
 Returns whether a key is a function key, pageDown, or pageUp (these keys are tested by cxInput and cxMultiLineInput in their input loops).
 
bool toggleCursor (bool pToggleCursor)
 Enables or disables the display of the cursor.
 
std::string getTermType ()
 Returns a string representing the terminal type. This is the.
 
bool colorIsBright (e_cxColors pColor)
 Returns whether a color has the brightness bit set.
 
int countHotkeys (const std::string &pStr)
 Counts the number of hotkeys in a string. This is useful when working with cxMenu, which can contain items with hotkeys.
 
std::string stringWithoutHotkeyChars (const std::string &pStr)
 Takes a string and returns a version without the & characters.
 
unsigned visualStrLen (const std::string &pStr)
 Returns the length of a string without its hotkey characters -.
 
std::string bringToTop (void *theWindow, void *unused)
 Brings a cxWindow to the top of the stack. Doesn't refresh.
 
std::string cxFormShowModal (void *theForm, void *unused)
 Runs showModal() on a cxForm and returns the result. This.
 
std::string cxMenuShowModal (void *theMenu, void *unused)
 Runs showModal() on a cxMenu and returns the result. This.
 
std::string noOp (void *p1, void *p2)
 Does nothing. Can be used, for example, as an event function.
 
std::string noOp (void *p1, void *p2, void *p3, void *p4)
 Does nothing. Can be used, for example, as an event function.
 
int runSystemCmd (const std::string &pCmd)
 Runs a command on the system, calling the system() function.
 
void writeText (int pRow, int pCol, const std::string &pText, attr_t pAttr=A_NORMAL, e_cxColors pColor=eGRAY_BLACK)
 Writes text on the screen.
 
void getHotkeyChars (const std::string &pStr, std::set< char > &pHotkeys, bool pConvertCase=false, bool pToUpper=false)
 Scans a string for hotkeys (characters preceeded by an ampersand)
 
void showAllWindows (bool pBringToTop=false)
 Shows all windows currently in use everywhere, from the.
 
cxWindowgetTopWindow ()
 Gets a pointer to the topmost cxWindow on the stack. This could.
 
cxWindowgetBottomWindow ()
 Gets a pointer to the bottom-most cxWindow on the stack. This could.
 
std::string getKeyStr (int pKey)
 Returns a string version of a key.
 
std::string getMouseStateStr (int pMouseState)
 Returns a string version of a mouse state.
 
std::string getReturnCodeStr (long pReturnCode)
 Returns a string version of a return code.
 
std::string getInputOptionStr (eInputOptions pInputOption)
 Returns a string version of a value from the eInputOptions.
 
std::string getBorderStyleStr (eBorderStyle pBorderStyle)
 Returns a string version of an eBorderStyle value.
 
std::string getInputTypeStr (eInputTypes pInputType)
 Returns a string version of an eInputType value.
 
void signalHandler (int pSignal)
 Handler for system signals.
 
bool promptYesNo (const std::string &pMessage, const std::string &pTitle="", long pButtons=cxYES_NO)
 Prompts the user with a cxMessageDialog for a yes/no choice.
 
bool cxInitialized ()
 Returns whether or not cxWidgets has been initialized.
 
void addAttr (e_WidgetItems pItem, attr_t pAttr)
 Adds an ncurses attribute to use for one of the items in the.
 
void setAttr (e_WidgetItems pItem, attr_t pAttr)
 Sets the ncurses attribute to use for one of the items in the.
 
void removeAttr (e_WidgetItems pItem, attr_t pAttr)
 Removes an ncurses attribute from one of the item lists.
 
void removeAttrs (e_WidgetItems pItem)
 Removes all attributes for a given window item.
 
void getAttrs (e_WidgetItems pItem, std::set< attr_t > &pAttrs)
 Returns the set of ncurses attributes for a given item.
 
bool hasAttr (e_WidgetItems pItem, attr_t pAttr)
 Determine if the widget has an attribute "set".
 
void enableAttrs (WINDOW *pWindow, e_WidgetItems pItem)
 Enables all of a set of attributes for a given item type on an.
 
void disableAttrs (WINDOW *pWindow, e_WidgetItems pItem)
 Disables all of a set of attributes for a given item type on an.
 
attr_t getAttr (const std::string &pAttr)
 Figure out the appropriate ncurses attr_t from a "string".
 
std::string getAttrStr (attr_t pAttr)
 Returns a string version of an ncurses attribute.
 
std::string getWidgetItemStr (e_WidgetItems pItem)
 Returns a string version of an e_WidgetItems value.
 
void setMenuClearKeywordKey (int pKey)
 Sets the key that should be used to clear the "Keyword" input.
 
int getMenuClearKeywordKey ()
 Returns the key that is set to clear the "Keyword" input for.
 
std::string dump (bool pFancy=false, const std::string &pFilename="")
 dump the contents to the screen to a file
 
bool isNavKey (int pKey)
 Returns whether a key is a navigational key, according to.
 
void addNavKey (int pKey)
 Add a key to be considered a "navigational" key. The key will.
 
void removeNavKey (int pKey)
 Removes a key from cx's list of "navigational" keys.
 
std::string getString (int pRow, int pCol, int pNumber, WINDOW *pWin=nullptr)
 Get the contents of the screen (for debugging/testing)
 
bool findString (const std::string &pSearch, int &pRow, int &pCol, WINDOW *pWin=nullptr)
 Look for a string on the screen (for debugging/testing)
 

Variables

constexpr int CXDATE_DEFAULT_YEAR = 2000
 
constexpr int CXDATE_YEAR_2DIGIT_LAST_CENT = 49
 
constexpr int CXDATE_MONTHS_IN_YEAR = 12
 
constexpr int CXDATE_START_MONTH = 1
 
constexpr int CXDATE_END_MONTH = 12
 
constexpr int CXDATE_START_DAY = 1
 
constexpr int CXDATE_YEAR_MIN = 1800
 
constexpr int CXDATE_YEAR_MAX = 2500
 
bool mInitialized = false
 
set< attr_t > mMessageAttrs
 
set< attr_t > mTitleAttrs
 
set< attr_t > mStatusAttrs
 
set< attr_t > mBorderAttrs
 
set< attr_t > mHotkeyAttrs
 
set< attr_t > mMenuSelectionAttrs
 
set< attr_t > mLabelAttrs
 
set< attr_t > mDataReadonlyAttrs
 
set< attr_t > mDataEditableAttrs
 
attr_t mLabelAttr =A_DIM
 
attr_t mDataEditableAttr =A_REVERSE
 
attr_t mDataReadonlyAttr =A_BOLD
 
int mMenuClearKeywordKey = KEY_F(10)
 
attr_t mMenuSelectionAttr =A_REVERSE
 
set< int > mNavKeys
 
e_cxColors mDefaultMessageColor = eGRAY_BLUE
 
e_cxColors mDefaultTitleColor = eWHITE_BLUE
 
e_cxColors mDefaultStatusColor = eYELLOW_BLUE
 
e_cxColors mDefaultBorderColor = eGRAY_BLUE
 
static const std::string termType = getTermType()
 Contains the terminal type string.
 

Detailed Description

cxBorderChars.h - Defines border characters to be used in drawing a box (i.e., in cxWindow and all its derivitives)

Contains some miscellaneous cxWidgets helper functions.

cxBorderStyles.h - defines border styles used by cxWindow and all its derivitives.

Copyright (C) 2026 Eric N. Oulashin

Date User Description

Copyright (C) 2007 Michael H. Kinney

Date User Description

Typedef Documentation

◆ cxComboBoxPtrPair

typedef std::pair<std::shared_ptr<cxComboBox>, std::shared_ptr<cxComboBox> > cx::cxComboBoxPtrPair

◆ cxMLInputPtrPair

typedef std::pair<std::shared_ptr<cxMultiLineInput>, std::shared_ptr<cxMultiLineInput> > cx::cxMLInputPtrPair

◆ cxWindowPtrContainer

typedef std::vector<cxWindow*> cx::cxWindowPtrContainer

◆ funcPtr0

typedef std::string(* cx::funcPtr0) ()

◆ funcPtr2

typedef std::string(* cx::funcPtr2) (void *p1, void *p2)

◆ funcPtr4

typedef std::string(* cx::funcPtr4) (void *p1, void *p2, void *p3, void *p4)

◆ messageLineContainer

typedef std::deque<std::string> cx::messageLineContainer

◆ stringContainer

typedef std::vector<std::string> cx::stringContainer

◆ stringContainerIterator

typedef std::vector<std::string>::iterator cx::stringContainerIterator

Enumeration Type Documentation

◆ cxMenuItemType

Enumerator
cxITEM_NORMAL 
cxITEM_SUBMENU 
cxITEM_POPUPMENU 
cxITEM_SEPARATOR 
cxITEM_UNSELECTABLE 

◆ e_cxColors

These are the color definitions used in cxWidgets.

Enumerator
eDEFAULT 
eRED_BLACK 
eBRTRED_BLACK 
eGREEN_BLACK 
eBRTGREEN_BLACK 
eBROWN_BLACK 
eYELLOW_BLACK 
eBLUE_BLACK 
eBRTBLUE_BLACK 
eCYAN_BLACK 
eBRTCYAN_BLACK 
eMAGENTA_BLACK 
eBRTMAGENTA_BLACK 
eGRAY_BLACK 
eWHITE_BLACK 
eBLACK_BLACK 
eRED_WHITE 
eBRTRED_WHITE 
eGREEN_WHITE 
eBRTGREEN_WHITE 
eBROWN_WHITE 
eYELLOW_WHITE 
eBLUE_WHITE 
eBRTBLUE_WHITE 
eCYAN_WHITE 
eBRTCYAN_WHITE 
eMAGENTA_WHITE 
eBRTMAGENTA_WHITE 
eGRAY_WHITE 
eWHITE_WHITE 
eBLACK_WHITE 
eRED_BLUE 
eBRTRED_BLUE 
eGREEN_BLUE 
eBRTGREEN_BLUE 
eBROWN_BLUE 
eYELLOW_BLUE 
eBLUE_BLUE 
eBRTBLUE_BLUE 
eCYAN_BLUE 
eBRTCYAN_BLUE 
eMAGENTA_BLUE 
eBRTMAGENTA_BLUE 
eGRAY_BLUE 
eWHITE_BLUE 
eBLACK_BLUE 
eRED_GREEN 
eBRTRED_GREEN 
eBROWN_GREEN 
eYELLOW_GREEN 
eBLUE_GREEN 
eBRTBLUE_GREEN 
eCYAN_GREEN 
eBRTCYAN_GREEN 
eMAGENTA_GREEN 
eBRTMAGENTA_GREEN 
eGRAY_GREEN 
eWHITE_GREEN 
eGREEN_GREEN 
eBRTGREEN_GREEN 
eBLACK_GREEN 
eRED_RED 
eBRTRED_RED 
eGREEN_RED 
eBRTGREEN_RED 
eBROWN_RED 
eYELLOW_RED 
eBLUE_RED 
eBRTBLUE_RED 
eCYAN_RED 
eBRTCYAN_RED 
eMAGENTA_RED 
eBRTMAGENTA_RED 
eGRAY_RED 
eWHITE_RED 
eBLACK_RED 
eRED_CYAN 
eBRTRED_CYAN 
eGREEN_CYAN 
eBRTGREEN_CYAN 
eBROWN_CYAN 
eYELLOW_CYAN 
eBLUE_CYAN 
eBRTBLUE_CYAN 
eCYAN_CYAN 
eBRTCYAN_CYAN 
eMAGENTA_CYAN 
eBRTMAGENTA_CYAN 
eGRAY_CYAN 
eWHITE_CYAN 
eBLACK_CYAN 

◆ e_WidgetItems

Enumerator
eMESSAGE 
eTITLE 
eSTATUS 
eBORDER 
eMENU_SELECTION 
eLABEL 
eDATA_READONLY 
eDATA_EDITABLE 
eDATA 
eHOTKEY 

◆ eBorderStyle

Defines border styles used by cxWindow and its derivitives: eBS_NOBORDER: This signifies windows without a border eBS_SINGLE_LINE: This signifies a single-line border

Enumerator
eBS_NOBORDER 
eBS_SINGLE_LINE 
eBS_DOUBLE_LINE 
eBS_DOUBLE_TOP_SINGLE_SIDES 
eBS_SINGLE_TOP_DOUBLE_SIDES 
eBS_SPACE 

◆ eDateFormats

Enumerator
YYYY_MM_DD 
MM_DD_YYYY 
DD_MM_YYYY 
YY_MM_DD 
MM_DD_YY 
DD_MM_YY 
YYYYMMDD 
MMDDYYYY 
DDMMYYYY 
YYMMDD 
MMDDYY 
DDMMYY 
UNKNOWN 

◆ eHPosition

Defines values for horizontal positioning.

Enumerator
eHP_CENTER 
eHP_LEFT 
eHP_RIGHT 

◆ eInputErrors

Enumerator
eNO_ERROR 
eOUT_OF_RANGE 
eINVALID_VALUE 
eBLANK 
eCUSTOM_VALIDATION_FAILED 

◆ eInputOptions

Specifies editability options (editable or read-only).

Enumerator
eINPUT_EDITABLE 
eINPUT_READONLY 

◆ eInputType

Enumerator
eIT_CXMULTILINEINPUT 
eIT_CXCOMBOBOX 

◆ eInputTypes

Specifies different types of inputs (text, numeric, etc.)

Enumerator
eINPUT_TYPE_TEXT 
eINPUT_TYPE_NUMERIC_FLOATING_PT 
eINPUT_TYPE_NUMERIC_WHOLE 

◆ eMessageDialogStyles

Enumerator
cxYES 
cxOK 
cxNO 
cxCANCEL 
cxYES_NO 
cxOK_CANCEL 
cxYES_DEFAULT 
cxNO_DEFAULT 

◆ eMLIF

enum cx::eMLIF
Enumerator
eMLIF_COMMA_SEP 
eMLIF_COMMA_SEP_WITH_DESC 

◆ eReturnCode

Defines return codes used in various windows: cxID_OK: This is returned from modal dialog boxes when the user selects "OK" or "Yes". cxID_CANCEL: This is returned from modal dialog boxes when the user selects "Cancel" or "No". cxID_EXIT: This is returned from modal windows when the user completes the input successfully. cxID_QUIT: This is returned from modal windows when the user chooses to exit the window without doing anything. cxFIRST_AVAIL_RETURN_CODE: When using cxMenu or other windows that need return codes, this is the first return code you should use.

Enumerator
cxID_OK 
cxID_CANCEL 
cxID_EXIT 
cxID_QUIT 
cxFIRST_AVAIL_RETURN_CODE 

◆ eVPosition

Defines values for vertical positioning.

Enumerator
eVP_CENTER 
eVP_TOP 
eVP_BOTTOM 

◆ eWeekDays

Enumerator
eSUNDAY 
eMONDAY 
eTUESDAY 
eWEDNESDAY 
eTHURSDAY 
eFRIDAY 
eSATURDAY 

Function Documentation

◆ addAttr()

void cx::addAttr ( e_WidgetItems  pItem,
attr_t  pAttr 
)

Adds an ncurses attribute to use for one of the items in the.

window (see the e_WidgetItems enumeration).

Parameters
pItemThe item type to add the attribute for (see the e_WidgetItems enumeration).
pAttrThe ncurses atribute to add.

References eBORDER, eDATA, eDATA_EDITABLE, eDATA_READONLY, eHOTKEY, eLABEL, eMENU_SELECTION, eMESSAGE, eSTATUS, eTITLE, mBorderAttrs, mDataEditableAttrs, mDataReadonlyAttrs, mHotkeyAttrs, mLabelAttrs, mMenuSelectionAttrs, mMessageAttrs, mStatusAttrs, and mTitleAttrs.

Referenced by cx::cxWindow::setStatusColor().

◆ addNavKey()

void cx::addNavKey ( int  pKey)

Add a key to be considered a "navigational" key. The key will.

be added to cx's set of navigational keys.

Parameters
pKeyThe key to be added

References mNavKeys.

◆ bottom()

int cx::bottom ( )

Returns the bottom row # of the main screen.

Returns
The bottom row # of the main screen

Referenced by cx::cxWindow::alignVert(), cx::cxMessageDialog::cxMessageDialog(), and cx::cxWindow::info().

◆ bringToTop()

string cx::bringToTop ( void *  theWindow,
void *  unused 
)

Brings a cxWindow to the top of the stack. Doesn't refresh.

its subwindows. This is designed to be used as an event

function in cxWidgets (i.e., for when the user presses a certain

key, etc.).

Parameters
theWindowA pointer to a cxWindow
unusedNot used
Returns
A blank string

References cx::cxWindow::show().

Referenced by cx::cxNotebook::showModal(), and cx::cxPanel::showModal().

◆ centerCol()

int cx::centerCol ( )

Returns the center column # of the main screen.

Returns
The center column # of the main screen

Referenced by cx::cxWindow::alignHoriz(), and cx::cxMessageDialog::cxMessageDialog().

◆ centerRow()

int cx::centerRow ( )

Returns the center row # of the main screen.

Returns
The center row # of the main screen

Referenced by cx::cxWindow::alignVert(), cx::cxWindow::getRowColBasedOn(), and main().

◆ cleanup()

void cx::cleanup ( )

Cleans up the cxWidgets library. Must be called after all.

screen-related cxWidgets objects & functions are done being used.

References cxInitialized(), and mInitialized.

Referenced by cxWindowSizeTest(), main(), main(), and SpreadsheetApp::run().

◆ colorIsBright()

bool cx::colorIsBright ( e_cxColors  pColor)

Returns whether a color has the brightness bit set.

Parameters
pColorThe color to test
Returns
Whether or not the color has the brightness bit set.

References cxCOLOR_BRIGHT.

Referenced by cx::cxWindow::setElementColor().

◆ countHotkeys()

int cx::countHotkeys ( const std::string &  pStr)

Counts the number of hotkeys in a string. This is useful when working with cxMenu, which can contain items with hotkeys.

Parameters
pStrThe string for which to count hotkeys
Returns
The number of hotkeys in pStr

◆ cxFormShowModal()

string cx::cxFormShowModal ( void *  theForm,
void *  unused 
)

Runs showModal() on a cxForm and returns the result. This.

function was designed to be used as an event function in

cxWidgets, which is why it returns the value as a string and

takes 2 void pointers.

Parameters
theFormThe cxForm to show modally
unusedNot used
Returns
The return value of the form's showModal(), as a string, or the string value of cxID_QUIT on error.

References cxID_QUIT, and cx::cxForm::showModal().

◆ cxInitialized()

bool cx::cxInitialized ( )

Returns whether or not cxWidgets has been initialized.

Returns
Whether or not cxWidgets has been initialized.

References mInitialized.

Referenced by cleanup(), cxWindowSizeTest(), eraseScreen(), showAllWindows(), updateWindows(), cx::cxForm::~cxForm(), and cx::cxWindow::~cxWindow().

◆ cxMenuShowModal()

string cx::cxMenuShowModal ( void *  theMenu,
void *  unused 
)

Runs showModal() on a cxMenu and returns the result. This.

function was designed to be used as an event function in

cxWidgets, which is why it returns the value as a string and

takes 2 void pointers.

Parameters
theMenuThe cxMenu to show modally
unusedNot used
Returns
The return value of the form's showModal(), as a string, or the string value of cxID_QUIT on error.

References cxID_QUIT, and cx::cxMenu::showModal().

◆ disableAttrs()

void cx::disableAttrs ( WINDOW *  pWindow,
e_WidgetItems  pItem 
)

Disables all of a set of attributes for a given item type on an.

ncurses window.

Parameters
pWindowA pointer to the ncurses window for which to disable the attributes.
pItemThe item type to retrieve attributes for (see the e_cxWidgetItems enumeration).

References eBORDER, eDATA, eDATA_EDITABLE, eDATA_READONLY, eHOTKEY, eLABEL, eMENU_SELECTION, eMESSAGE, eSTATUS, eTITLE, mBorderAttrs, mDataEditableAttrs, mDataReadonlyAttrs, mHotkeyAttrs, mLabelAttrs, mMenuSelectionAttrs, mMessageAttrs, mStatusAttrs, and mTitleAttrs.

Referenced by cx::cxWindow::disableAttrs(), cx::cxInput::disableAttrs(), and cx::cxMenu::disableAttrs().

◆ dump()

std::string cx::dump ( bool  pFancy = false,
const std::string &  pFilename = "" 
)

dump the contents to the screen to a file

Parameters
pFancy- print fields that have underlines as underscores '_'.
pFilenameto write to
Returns
string "" on success otherwise message

Referenced by borderlessForm(), and testFormReadOnly().

◆ eBorderStyleToStr()

std::string cx::eBorderStyleToStr ( eBorderStyle  borderStyle)

Converts an eBorderStyle value to a string representation.

Parameters
borderStyleThe eBorderStyle value to convert.
Returns
A string representation of the eBorderStyle value.

References eBS_DOUBLE_LINE, eBS_DOUBLE_TOP_SINGLE_SIDES, eBS_NOBORDER, eBS_SINGLE_LINE, eBS_SINGLE_TOP_DOUBLE_SIDES, and eBS_SPACE.

Referenced by cxWindowVariousBorderStyles().

◆ enableAttrs()

void cx::enableAttrs ( WINDOW *  pWindow,
e_WidgetItems  pItem 
)

Enables all of a set of attributes for a given item type on an.

ncurses window.

Parameters
pWindowA pointer to the ncurses window for which to enable the attributes.
pItemThe item type to retrieve attributes for (see the e_cxWidgetItems enumeration).

References eBORDER, eDATA, eDATA_EDITABLE, eDATA_READONLY, eHOTKEY, eLABEL, eMENU_SELECTION, eMESSAGE, eSTATUS, eTITLE, mBorderAttrs, mDataEditableAttrs, mDataReadonlyAttrs, mHotkeyAttrs, mLabelAttrs, mMenuSelectionAttrs, mMessageAttrs, mStatusAttrs, and mTitleAttrs.

Referenced by cx::cxWindow::enableAttrs(), cx::cxInput::enableAttrs(), and cx::cxMenu::enableAttrs().

◆ eraseScreen()

void cx::eraseScreen ( )

Erases the screen.

References cxInitialized().

◆ findString()

bool cx::findString ( const std::string &  pSearch,
int &  pRow,
int &  pCol,
WINDOW *  pWin = nullptr 
)

Look for a string on the screen (for debugging/testing)

Parameters
pSearchstring to search for
pRowthe row it was found on
pColthe column it was found on
pWinA pointer to an ncurses window structure to get contents from. If this is nullptr, curscr will be used.
Returns
bool true if we were able to find the string, false otherwise

◆ getAttr()

attr_t cx::getAttr ( const std::string &  pAttr)

Figure out the appropriate ncurses attr_t from a "string".

see "man curs_attr"

Parameters
pAttr"NORMAL", "BOLD", etc..
Returns
attr_t that corresponds with that string

Referenced by main().

◆ getAttrs()

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

Returns the set of ncurses attributes for a given item.

Parameters
pItemThe item type to retrieve attributes for (see the e_WidgetItems enumeration).
pAttrsThis will contain the attributes for the item.

Referenced by hasAttr().

◆ getAttrStr()

string cx::getAttrStr ( attr_t  pAttr)

Returns a string version of an ncurses attribute.

Parameters
pAttrAn ncurses attribute
Returns
A descriptive string version of the attribute

◆ getBorderStyleStr()

string cx::getBorderStyleStr ( eBorderStyle  pBorderStyle)

Returns a string version of an eBorderStyle value.

Parameters
pBorderStyleA member of the eBorderStyle enumeration
Returns
A string representation of the eBorderStyle value

References eBS_NOBORDER, eBS_SINGLE_LINE, eBS_SPACE, and cxStringUtils::toString().

◆ getBottomWindow()

cxWindow * cx::getBottomWindow ( )

Gets a pointer to the bottom-most cxWindow on the stack. This could.

return nullptr, if it can't get to the topmost window.

Returns
A pointer to the bottom-most cxWindow on the stack, or nullptr if there is none.

◆ getDefaultBorderColor()

e_cxColors cx::getDefaultBorderColor ( )

Returns the default border color.

Returns
The default border color

References mDefaultBorderColor.

Referenced by cx::cxWindow::init().

◆ getDefaultMessageColor()

e_cxColors cx::getDefaultMessageColor ( )

Returns the default message color.

Returns
The default message color

References mDefaultMessageColor.

Referenced by cx::cxWindow::init().

◆ getDefaultStatusColor()

e_cxColors cx::getDefaultStatusColor ( )

Returns the default status color.

Returns
The default status color

References mDefaultStatusColor.

Referenced by cx::cxWindow::init().

◆ getDefaultTitleColor()

e_cxColors cx::getDefaultTitleColor ( )

Returns the default title color.

Returns
The default title color

References mDefaultTitleColor.

Referenced by cx::cxWindow::init().

◆ getHotkeyChars()

void cx::getHotkeyChars ( const std::string &  pStr,
std::set< char > &  pHotkeys,
bool  pConvertCase = false,
bool  pToUpper = false 
)

Scans a string for hotkeys (characters preceeded by an ampersand)

and adds the hotkey characters to a collection.

Parameters
pStrThe string to scan
pHotkeysThe collection to which to add hotkey characters
pConvertCaseWhether or not to convert the case of the hotkeys (defaults to false)
ptoUpperIf pConvertCase is true, this parameter specifies whether or not to convert the characters to upper case. If true, the characters will be converted to upper-case; if false, they will be converted to lowercase (if pConvertCase is true).

◆ getInputOptionStr()

string cx::getInputOptionStr ( eInputOptions  pInputOption)

Returns a string version of a value from the eInputOptions.

enumeration.

Parameters
pInputOptionA member of the eInputOptions enumeration
Returns
A string representation of pInputOption

References eINPUT_EDITABLE, eINPUT_READONLY, and cxStringUtils::toString().

◆ getInputTypeStr()

string cx::getInputTypeStr ( eInputTypes  pInputType)

Returns a string version of an eInputType value.

Parameters
pInputTypeA member of the eInputType enumeration
Returns
A string representation of the value

References eINPUT_TYPE_NUMERIC_FLOATING_PT, eINPUT_TYPE_NUMERIC_WHOLE, eINPUT_TYPE_TEXT, and cxStringUtils::toString().

◆ getKeyStr()

string cx::getKeyStr ( int  pKey)

◆ getMenuClearKeywordKey()

int cx::getMenuClearKeywordKey ( )

Returns the key that is set to clear the "Keyword" input for.

cxMenu item searching.

Returns
The key that is set to clear the "Keyword" input for cxMenu item searching.

References mMenuClearKeywordKey.

◆ getMouseStateStr()

string cx::getMouseStateStr ( int  pMouseState)

◆ getReturnCodeStr()

string cx::getReturnCodeStr ( long  pReturnCode)

Returns a string version of a return code.

Parameters
pReturnCodeThe return code to convert to a string
Returns
A string representation of the return code

References cxFIRST_AVAIL_RETURN_CODE, cxID_CANCEL, cxID_EXIT, cxID_OK, cxID_QUIT, and cxStringUtils::toString().

Referenced by cxPanelTest(), cxWindowWithFunctionKeys(), enableDisableForm(), getMenuItemIDStr(), and inputQuitKeysOnForm().

◆ getString()

string cx::getString ( int  pRow,
int  pCol,
int  pNumber,
WINDOW *  pWin = nullptr 
)

Get the contents of the screen (for debugging/testing)

Parameters
pRowthe starting row
pColthe starting column
pNumbernumber of characters to get
pWinA pointer to an ncurses window structure to get contents from. If this is nullptr, curscr will be used.
Returns
the "string" value of the screen

Referenced by cx::cxWindow::getString().

◆ getTermDimensions()

void cx::getTermDimensions ( int &  pHeight,
int &  pWidth 
)

Returns the terminal's current height & width.

Parameters
pHeight(OUT) This will store the terminal's current height.
pWidth(OUT) This will store the terminal's current width.

References height(), and width().

Referenced by cxGridTest(), and SpreadsheetApp::run().

◆ getTermType()

string cx::getTermType ( )

Returns a string representing the terminal type. This is the.

value of the environment variable TERM.

Returns
A string representing the terminal type, i.e. "xterm", "wy50", etc.

◆ getTopWindow()

cxWindow * cx::getTopWindow ( )

Gets a pointer to the topmost cxWindow on the stack. This could.

return nullptr, if it can't get to the topmost window.

Returns
A pointer to the topmost cxWindow on the stack, or nullptr if there is none.

◆ getWidgetItemStr()

string cx::getWidgetItemStr ( e_WidgetItems  pItem)

Returns a string version of an e_WidgetItems value.

Parameters
pItemA member of the e_WidgetItems enumeration (see cxWidgetItems.h)
Returns
The string version of the item

References eBORDER, eDATA, eDATA_EDITABLE, eDATA_READONLY, eHOTKEY, eLABEL, eMENU_SELECTION, eMESSAGE, eSTATUS, and eTITLE.

◆ hasAttr()

bool cx::hasAttr ( e_WidgetItems  pItem,
attr_t  pAttr 
)

Determine if the widget has an attribute "set".

Parameters
pItemThe item type to check (see e_WidgetItems)
pAttrThe attribute. (i.e., A_NORMAL, etc.)
Returns
true if the widget has that attribute

References getAttrs().

Referenced by cx::cxMessageDialog::setFocus().

◆ height()

int cx::height ( )

◆ init()

void cx::init ( bool  pEnableMouse = true)

Initializes the cxWidgets library. This must be called before.

any screen-related cxWidgets library objects & functions are used.

Parameters
pEnableMouseWhether or not to enable mouse input. Defaults to true. Note that if the version of ncurses on the system doesn't support the mouse at the time when cxWidgets is compiled, the mouse will not be enabled, even if this parameter is true.

References eBLACK_BLACK, eBLACK_BLUE, eBLACK_CYAN, eBLACK_GREEN, eBLACK_RED, eBLACK_WHITE, eBLUE_BLACK, eBLUE_BLUE, eBLUE_CYAN, eBLUE_GREEN, eBLUE_RED, eBLUE_WHITE, eBROWN_BLACK, eBROWN_BLUE, eBROWN_CYAN, eBROWN_GREEN, eBROWN_RED, eBROWN_WHITE, eBRTBLUE_BLACK, eBRTBLUE_BLUE, eBRTBLUE_CYAN, eBRTBLUE_GREEN, eBRTBLUE_RED, eBRTBLUE_WHITE, eBRTCYAN_BLACK, eBRTCYAN_BLUE, eBRTCYAN_CYAN, eBRTCYAN_GREEN, eBRTCYAN_RED, eBRTCYAN_WHITE, eBRTGREEN_BLACK, eBRTGREEN_BLUE, eBRTGREEN_CYAN, eBRTGREEN_GREEN, eBRTGREEN_RED, eBRTGREEN_WHITE, eBRTMAGENTA_BLACK, eBRTMAGENTA_BLUE, eBRTMAGENTA_CYAN, eBRTMAGENTA_GREEN, eBRTMAGENTA_RED, eBRTMAGENTA_WHITE, eBRTRED_BLACK, eBRTRED_BLUE, eBRTRED_CYAN, eBRTRED_GREEN, eBRTRED_RED, eBRTRED_WHITE, eCYAN_BLACK, eCYAN_BLUE, eCYAN_CYAN, eCYAN_GREEN, eCYAN_RED, eCYAN_WHITE, eGRAY_BLACK, eGRAY_BLUE, eGRAY_CYAN, eGRAY_GREEN, eGRAY_RED, eGRAY_WHITE, eGREEN_BLACK, eGREEN_BLUE, eGREEN_CYAN, eGREEN_GREEN, eGREEN_RED, eGREEN_WHITE, eMAGENTA_BLACK, eMAGENTA_BLUE, eMAGENTA_CYAN, eMAGENTA_GREEN, eMAGENTA_RED, eMAGENTA_WHITE, eRED_BLACK, eRED_BLUE, eRED_CYAN, eRED_GREEN, eRED_RED, eRED_WHITE, eWHITE_BLACK, eWHITE_BLUE, eWHITE_CYAN, eWHITE_GREEN, eWHITE_RED, eWHITE_WHITE, eYELLOW_BLACK, eYELLOW_BLUE, eYELLOW_CYAN, eYELLOW_GREEN, eYELLOW_RED, eYELLOW_WHITE, mHotkeyAttrs, mInitialized, mMenuSelectionAttrs, mNavKeys, PAGE_DOWN, PAGE_UP, SHIFT_TAB, signalHandler(), and TAB.

Referenced by cxWindowSizeTest(), cx::cxForm::getStatus(), main(), main(), and SpreadsheetApp::run().

◆ isFunctionKey()

bool cx::isFunctionKey ( int  pKey)

Returns whether a key is a function key, pageDown, or pageUp (these keys are tested by cxInput and cxMultiLineInput in their input loops).

Parameters
pKeyThe key to be checked
Returns
Whether or not the key is a function key, pageDown, or pageUp

◆ isNavKey()

bool cx::isNavKey ( int  pKey)

Returns whether a key is a navigational key, according to.

cx's list of navigational keys. The defaults are the arrow

keys, pageUp, pageDown, tab, and shift-tab. cxMultiLineInput

has its own list of navigational keys, but this may be useful

for other things.

Parameters
pKeyThe key to test
Returns
Whether or not the key is a navigational key

References mNavKeys.

◆ left()

int cx::left ( )

◆ messageBox() [1/7]

void cx::messageBox ( const std::string &  pMessage,
const std::string &  pStatus,
int  pHeight,
int  pWidth 
)

Shows a message box.

Parameters
pMessageMessage of message box
pStatusStatus of message box. Defaults to blank.
pHeightThe height for the message box
pWidthThe width for the message box

References cx::cxMessageDialog::hide(), cx::cxWindow::setStatus(), and cx::cxMessageDialog::showModal().

◆ messageBox() [2/7]

void cx::messageBox ( const std::string &  pMessage,
e_cxColors  pMessageColor = getDefaultMessageColor(),
attr_t  pMessageAttr = A_NORMAL,
e_cxColors  pTitleColor = getDefaultTitleColor(),
e_cxColors  pStatusColor = getDefaultStatusColor(),
e_cxColors  pBorderColor = getDefaultBorderColor() 
)

Shows a message box.

Parameters
pMessageThe message for the message box
pMessageColorThe color for the message portion
pMessageAttrThe attribute for the message portion
pTitleColorThe color for the title
pStatusColorThe color for the status
pBorderColorThe color for the border

References messageBox().

◆ messageBox() [3/7]

void cx::messageBox ( const std::string &  pTitle,
const std::string &  pMessage,
const std::string &  pStatus,
int  pHeight,
int  pWidth 
)

Shows a message box.

Parameters
pTitletitle of message box
pMessagemessage of message box
pStatusstatus of message box
pHeightThe height for the message box
pWidthThe width for the message box

References cx::cxMessageDialog::hide(), cx::cxWindow::setStatus(), and cx::cxMessageDialog::showModal().

◆ messageBox() [4/7]

void cx::messageBox ( const std::string &  pTitle,
const std::string &  pMessage,
const std::string &  pStatus = "" 
)

References messageBox().

◆ messageBox() [5/7]

void cx::messageBox ( int  pRow,
int  pCol,
const std::string &  pMessage 
)

Shows a message box, automatically setting its height & width.

Parameters
pRowRow of upper-left corner
pColColumn of upper-left corner
pMessageThe message to appear in the box

References messageBox().

◆ messageBox() [6/7]

void cx::messageBox ( int  pRow,
int  pCol,
const std::string &  pTitle,
const std::string &  pMessage,
const std::string &  pStatus 
)

Shows a message box automatically setting its height & width.

Parameters
pRowrow of upper-left corner
pColcolumn of upper-left corner
pTitletitle of message box
pMessagemessage of message box
pStatusstatus of message box

References messageBox().

◆ messageBox() [7/7]

void cx::messageBox ( int  pRow,
int  pCol,
int  pHeight,
int  pWidth,
const std::string &  pTitle,
const std::string &  pMessage,
const std::string &  pStatus = "",
eBorderStyle  pBorderStyle = eBS_SINGLE_LINE 
)

Shows a message box.

Parameters
pRowrow of upper-left corner
pColcolumn of upper-left corner
pHeightheight of message box
pWidthwidth of message box
pTitletitle of message box
pMessagemessage of message box
pStatusstatus of message box
pBorderStyleThe type of border to use for the message box - Defaults to eBS_SINGLE_LINE

References messageBox().

Referenced by allFormInputsGoReadOnly(), buttonClickFunction(), comboBox(), comboBoxMenuDisable(), compareWin(), cxButtonOnClick(), cxComboBoxNotEditableMenuEnabled(), cxDatePickerTest(), cxFormAppendComboBoxPair(), cxFormAppendPair(), cxFormExtendedHelpKey(), cxFormMultiLineInputFunctionKeyNoValidator(), cxFormNavKeys(), cxFormNoQuit(), cxFormStartAtFirstInput(), cxInputBorderChange(), cxInputMasking(), cxMenuAltItemText(), cxMenuMiscTests(), cxMenuNoMoreSelectableItemsWhileModal(), cxMenuNoQuit(), cxMenuResize(), cxMenuScrolling(), cxMenuWithMultipleItemHotkeys(), cxMultiLineInputBorderChange(), cxMultiLineInputExtendedHelpColorsAndAttrs(), cxMultiLineInputExtendedHelpKey(), cxMultiLineInputForceUpper(), cxMultiLineInputFunctionKeyNoValidator(), cxMultiLineInputMasking(), cxMultiLineInputMaxInputLength(), cxMultiLineInputNonBlank(), cxMultiLineInputNumericFloatingPt(), cxMultiLineInputNumericFloatingPtWithRange(), cxMultiLineInputNumericWhole(), cxMultiLineInputNumericWholeWithRange(), cxMultiLineInputSetValue(), cxMultiLineInputTextValidation(), cxMultiLineInputTextValidationAutoCompletion(), cxMultiLineInputTextValidationNonBlankForceUpper(), cxOpenFileDialogTest(), cxPanel_cxMenuUpArrowLeave(), cxPanelGetLastWindow(), cxPanelTest(), cxSearchPanelResize(), cxSearchPanelTest(), cxWindowAlignTest(), cxWindowSizeTest(), cxWindowWithFunctionKeys(), demoPanels(), cx::cxForm::doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxMultiForm::doInputLoop(), doMenu(), enableDisableForm(), floatingPtValidate(), form(), formChangeInputFocusWhileModal(), formDataChanged(), formFunctionKeyNoOnLeave(), formFunctionKeys(), formUpArrowFunction(), formWithFKeys(), formWithInputValueValidator(), genericMessageFunction(), genericMessageFunction_1str(), getFormKeys(), gridButtonClicked(), hello(), inputQuitKeysOnForm(), inputsWithFKeys(), cx::cxMultiLineInput::inputValidator(), integerValidate(), keyFunctionAutoExitOnLastFormInput(), FlashcardApp::loadCards(), menuItemWithMultipleHotkeys(), menuOnEnter(), messageBox(), messageBox(), messageBox(), messageBox(), messageBox(), mouseFunction(), msgBox1(), msgBox2(), msgBox3(), msgBox4(), msgCancel(), msgNo(), msgNoYes(), msgOK(), msgOKCancel(), msgYes(), msgYesNo(), multiFormWithDisabledSubform(), multiLineInputResize(), onFocus(), onFocusWinForCxPanelGetLastPage(), onLeave(), CentipedeGame::run(), FlashcardApp::run(), SnakeGame::run(), sayHello(), sayHello2(), setInputLabel(), showAMessageBox(), FlashcardApp::showHelp(), someFunction(), someFunction3(), someWeirdFunc(), testBoxSuccess(), testInput1(), testInputValidator(), testKeyFunction(), testMenu1(), testOnFocusFunction(), testOnLeaveFunction(), unselectableMenuItem(), and windowFunctionKeyNoOnLeave().

◆ messageDialog() [1/2]

void cx::messageDialog ( const std::list< std::string > &  pMessages)

Shows a message dialog (a message box with an OK button)

Parameters
pMessagesmessage of message dialog

◆ messageDialog() [2/2]

void cx::messageDialog ( const std::string &  pMessage)

Shows a message dialog (a message box with an OK button)

Parameters
pMessagemessage of message dialog

Referenced by cxMenuAssignment(), cxWindowAssignment(), cxWindowCopyConstructor(), and demoPanels().

◆ noOp() [1/2]

string cx::noOp ( void *  p1,
void *  p2 
)

Does nothing. Can be used, for example, as an event function.

on a cxForm when you want to have a keypress exit the form.

Parameters
p1Not used
p2Not used
Returns
A blank string

Referenced by formUpArrowFunction().

◆ noOp() [2/2]

string cx::noOp ( void *  p1,
void *  p2,
void *  p3,
void *  p4 
)

Does nothing. Can be used, for example, as an event function.

on a cxForm when you want to have a keypress exit the form.

Parameters
p1Not used
p2Not used
p3Not used
p4Not used
Returns
An empty string

◆ operator<<()

ostream & cx::operator<< ( ostream &  pOS,
const cxDate pDate 
)

◆ operator>>()

istream & cx::operator>> ( istream &  pIS,
cxDate pDate 
)

◆ promptYesNo()

bool cx::promptYesNo ( const std::string &  pMessage,
const std::string &  pTitle = "",
long  pButtons = cxYES_NO 
)

Prompts the user with a cxMessageDialog for a yes/no choice.

Returns their choice as a boolean.

Parameters
pMessageThe message to put in the message dialog
pTitleThe title for the message dialog. Defaults to a blank string.
pButtonsSpecifies the buttons to appear on the dialog. Defaults to cxYES_NO (to display yes & no buttons). Note that you can use multiple values listed in cxMessageDialogStyles.h ORed together. For example, cxYES_NO | cxNO_DEFAULT would display Yes and No buttons and default to No.
Returns
True if the user chose yes, or false otherwise.

Referenced by SpreadsheetApp::run().

◆ removeAttr()

void cx::removeAttr ( e_WidgetItems  pItem,
attr_t  pAttr 
)

Removes an ncurses attribute from one of the item lists.

Parameters
pItemThe item type to remove the attribute for (see the e_WidgetItems enumeration).
pAttrThe ncurses attribute to remove

References eBORDER, eDATA, eDATA_EDITABLE, eDATA_READONLY, eHOTKEY, eLABEL, eMENU_SELECTION, eMESSAGE, eSTATUS, eTITLE, mBorderAttrs, mDataEditableAttrs, mDataReadonlyAttrs, mHotkeyAttrs, mLabelAttrs, mMenuSelectionAttrs, mMessageAttrs, mStatusAttrs, and mTitleAttrs.

◆ removeAttrs()

void cx::removeAttrs ( e_WidgetItems  pItem)

Removes all attributes for a given window item.

Parameters
pItemThe item type to remove attributes for (see the e_WidgetItems enumeration).

References eBORDER, eDATA, eDATA_EDITABLE, eDATA_READONLY, eHOTKEY, eLABEL, eMENU_SELECTION, eMESSAGE, eSTATUS, eTITLE, mBorderAttrs, mDataEditableAttrs, mDataReadonlyAttrs, mHotkeyAttrs, mLabelAttrs, mMenuSelectionAttrs, mMessageAttrs, mStatusAttrs, and mTitleAttrs.

◆ removeNavKey()

void cx::removeNavKey ( int  pKey)

Removes a key from cx's list of "navigational" keys.

Parameters
pKeyThe key to be removed

References mNavKeys.

◆ resizeTerm()

bool cx::resizeTerm ( int  pNewHeight,
int  pNewWidth 
)

Resizes the terminal screen.

Parameters
pNewHeightThe new height (# of rows)
pNewWidthThe new width (# of columns)
Returns
true if successful or false if not

◆ right()

int cx::right ( )

Returns the rightmost column # of the main screen.

Returns
The rightmost column # of the main screen

Referenced by cx::cxWindow::alignHoriz(), cx::cxWindow::getRowColBasedOn(), cx::cxWindow::info(), main(), cx::cxNotebook::mouseEvtWasInTitle(), and cx::cxNotebook::setTabSpacing().

◆ runSystemCmd()

int cx::runSystemCmd ( const std::string &  pCmd)

Runs a command on the system, calling the system() function.

If your application has called cx::init(), this

function should be called to run a system command.

After running cx::init(), cx::cleanup() must be

called before running system commands to get the

terminal back to the state it was in before; then,

cx::init() must be called again after the call to

system() to restore cxWidgets graphical functions.

This function does the wrapping for you.

Parameters
pCmdThe command to run
Returns
The return value of system()

◆ setAttr()

void cx::setAttr ( e_WidgetItems  pItem,
attr_t  pAttr 
)

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.

Parameters
pItemThe item type to apply the attribute for (see the e_WidgetItems enumeration).
pAttrThe ncurses atribute to apply.

References eBORDER, eDATA, eDATA_EDITABLE, eDATA_READONLY, eHOTKEY, eLABEL, eMENU_SELECTION, eMESSAGE, eSTATUS, eTITLE, mBorderAttrs, mDataEditableAttrs, mDataReadonlyAttrs, mHotkeyAttrs, mLabelAttrs, mMenuSelectionAttrs, mMessageAttrs, mStatusAttrs, and mTitleAttrs.

Referenced by attributesSetter(), and main().

◆ setDefaultBorderColor()

void cx::setDefaultBorderColor ( e_cxColors  pColor)

Sets the default border color.

Parameters
pColorA member of the e_cxColors enumeration (see cxColors.h)

References mDefaultBorderColor.

◆ setDefaultMessageColor()

void cx::setDefaultMessageColor ( e_cxColors  pColor)

Sets the default message color.

Parameters
pColorA member of the e_cxColors enumeration (see cxColors.h)

References mDefaultMessageColor.

◆ setDefaultStatusColor()

void cx::setDefaultStatusColor ( e_cxColors  pColor)

Sets the default status color.

Parameters
pColorA member of the e_cxColors enumeration (see cxColors.h)

References mDefaultStatusColor.

◆ setDefaultTitleColor()

void cx::setDefaultTitleColor ( e_cxColors  pColor)

Sets the default title color.

Parameters
pColorA member of the e_cxColors enumeration (see cxColors.h)

References mDefaultTitleColor.

◆ setMenuClearKeywordKey()

void cx::setMenuClearKeywordKey ( int  pKey)

Sets the key that should be used to clear the "Keyword" input.

for cxMenu item searching.

Parameters
pKeyThe key that should be used to clear the "Keyword" input for cxMenu item searching.

References mMenuClearKeywordKey.

◆ showAllWindows()

void cx::showAllWindows ( bool  pBringToTop = false)

Shows all windows currently in use everywhere, from the.

bottom of the stack to the top.

Parameters
pBringToTopWhether or not to bring each window to the top as it's shown.

References cxInitialized(), and cx::cxWindow::show().

◆ signalHandler()

void cx::signalHandler ( int  pSignal)

Handler for system signals.

Parameters
pSignalThe signal to handle

Referenced by init().

◆ splash() [1/2]

void cx::splash ( const std::string &  pMessage,
int  pSleep 
)

Shows a splash message.

Parameters
pMessageMessage of splash message
pSleepDuration in seconds of splash message

◆ splash() [2/2]

void cx::splash ( const std::string &  pTitle,
const std::string &  pMessage,
int  pSleep 
)

Shows a splash message.

Parameters
pTitleTitle of splash message
pMessageMessage of splash message
pSleepDuration in seconds of splash message

Referenced by splash1(), and splash2().

◆ stringWithoutHotkeyChars()

std::string cx::stringWithoutHotkeyChars ( const std::string &  pStr)

Takes a string and returns a version without the & characters.

that are used for highlighting the next character.

Parameters
pStrThe string to process
Returns
A version of pStr without the highlighting characters.

References stringWithoutHotkeyChars().

Referenced by cx::cxMenu::itemExists(), and stringWithoutHotkeyChars().

◆ toggleCursor()

bool cx::toggleCursor ( bool  pToggleCursor)

Enables or disables the display of the cursor.

Parameters
pToggleCursorIf true, the cursor will be enabled. If false, the cursor will be disabled.
Returns
The previous state of the cursor - true if it was enabled, or false if not.

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

◆ top()

int cx::top ( )

◆ updateWindows()

void cx::updateWindows ( )

◆ visualStrLen()

unsigned cx::visualStrLen ( const std::string &  pStr)

Returns the length of a string without its hotkey characters -.

This is useful for counting the number of characters that

will actually appear on the screen (not counting the

characters that specify underlined characters).

Parameters
pStrThe string to process
Returns
The length of the string as it would appear on the screen

References visualStrLen().

Referenced by cx::cxWindow::drawMessage(), cx::cxWindow::init(), cx::cxInput::setBorderStyle(), cx::cxInput::setLabel(), and visualStrLen().

◆ width()

int cx::width ( )

◆ writeText()

void cx::writeText ( int  pRow,
int  pCol,
const std::string &  pText,
attr_t  pAttr = A_NORMAL,
e_cxColors  pColor = eGRAY_BLACK 
)

Writes text on the screen.

Parameters
pRowThe row at which to write the text
pColThe column at which to write the text
pTextThe text to be written
pAttrThe text attribute (see the man page for wattron). Defaults to normal.
pColorThe text color (see e_cxColors enumeration in cxColors.h). Defaults to gray on black.

Variable Documentation

◆ CXDATE_DEFAULT_YEAR

constexpr int cx::CXDATE_DEFAULT_YEAR = 2000
inlineconstexpr

◆ CXDATE_END_MONTH

constexpr int cx::CXDATE_END_MONTH = 12
inlineconstexpr

◆ CXDATE_MONTHS_IN_YEAR

constexpr int cx::CXDATE_MONTHS_IN_YEAR = 12
inlineconstexpr

Referenced by cx::cxDate::addMonths().

◆ CXDATE_START_DAY

constexpr int cx::CXDATE_START_DAY = 1
inlineconstexpr

Referenced by cx::cxDate::addDays().

◆ CXDATE_START_MONTH

constexpr int cx::CXDATE_START_MONTH = 1
inlineconstexpr

◆ CXDATE_YEAR_2DIGIT_LAST_CENT

constexpr int cx::CXDATE_YEAR_2DIGIT_LAST_CENT = 49
inlineconstexpr

◆ CXDATE_YEAR_MAX

constexpr int cx::CXDATE_YEAR_MAX = 2500
inlineconstexpr

◆ CXDATE_YEAR_MIN

constexpr int cx::CXDATE_YEAR_MIN = 1800
inlineconstexpr

◆ mBorderAttrs

set<attr_t> cx::mBorderAttrs

◆ mDataEditableAttr

attr_t cx::mDataEditableAttr =A_REVERSE

◆ mDataEditableAttrs

set<attr_t> cx::mDataEditableAttrs

◆ mDataReadonlyAttr

attr_t cx::mDataReadonlyAttr =A_BOLD

◆ mDataReadonlyAttrs

set<attr_t> cx::mDataReadonlyAttrs

◆ mDefaultBorderColor

e_cxColors cx::mDefaultBorderColor = eGRAY_BLUE

◆ mDefaultMessageColor

e_cxColors cx::mDefaultMessageColor = eGRAY_BLUE

◆ mDefaultStatusColor

e_cxColors cx::mDefaultStatusColor = eYELLOW_BLUE

◆ mDefaultTitleColor

e_cxColors cx::mDefaultTitleColor = eWHITE_BLUE

◆ mHotkeyAttrs

set<attr_t> cx::mHotkeyAttrs

◆ mInitialized

bool cx::mInitialized = false

Referenced by cleanup(), cxInitialized(), and init().

◆ mLabelAttr

attr_t cx::mLabelAttr =A_DIM

◆ mLabelAttrs

set<attr_t> cx::mLabelAttrs

◆ mMenuClearKeywordKey

int cx::mMenuClearKeywordKey = KEY_F(10)

◆ mMenuSelectionAttr

attr_t cx::mMenuSelectionAttr =A_REVERSE

◆ mMenuSelectionAttrs

set<attr_t> cx::mMenuSelectionAttrs

◆ mMessageAttrs

set<attr_t> cx::mMessageAttrs

◆ mNavKeys

set<int> cx::mNavKeys

◆ mStatusAttrs

set<attr_t> cx::mStatusAttrs

◆ mTitleAttrs

set<attr_t> cx::mTitleAttrs

◆ termType

const std::string cx::termType = getTermType()
static

Contains the terminal type string.