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

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

#include <cxWindow.h>

Inheritance diagram for cx::cxWindow:
Inheritance graph
Collaboration diagram for cx::cxWindow:
Collaboration graph

Public Member Functions

 cxWindow (cxWindow *pParentWindow=nullptr, int pRow=0, int pCol=0, int pHeight=DEFAULT_HEIGHT, int pWidth=DEFAULT_WIDTH, const std::string &pTitle="", const std::string &pMessage="", const std::string &pStatus="", eBorderStyle pBorderStyle=eBS_SINGLE_LINE, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false)
 Default constructor.
 
 cxWindow (cxWindow *pParentWindow, int pRow, int pCol, const std::string &pTitle, const std::string &pMessage, const std::string &pStatus, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false)
 Overloaded constructor.
 
 cxWindow (cxWindow *pParentWindow, const std::string &pTitle, const std::string &pMessage, const std::string &pStatus, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false)
 Overloaded constructor - Centers the window in the middle of the screen.
 
 cxWindow (cxWindow *pParentWindow, const std::string &pTitle, const std::string &pMessage, const std::string &pStatus, int pHeight, int pWidth, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false)
 Overloaded constructor - Centers the window in the middle of the screen.
 
 cxWindow (cxWindow *pParentWindow, const std::string &pMessage, const std::string &pStatus, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false)
 Overloaded constructor - Centers the window in the middle of the screen.
 
 cxWindow (cxWindow *pParentWindow, const std::string &pMessage, const std::string &pStatus, int pHeight, int pWidth, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false)
 Overloaded constructor - Centers the window in the middle of the screen.
 
 cxWindow (cxWindow *pParentWindow, const std::string &pMessage, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false)
 Overloaded constructor - Centers the window in the middle of the screen.
 
 cxWindow (cxWindow *pParentWindow, eHPosition pHPosition, const std::string &pTitle, const std::string &pMessage, const std::string &pStatus, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false)
 Overloaded constructor - Lets you specify the horizontal position.
 
 cxWindow (const cxWindow &pThatWindow)
 Copy constructor.
 
virtual ~cxWindow ()
 
virtual void centerHoriz (bool pRefresh=true)
 Centers the window horizontally on the screen.
 
virtual void alignHoriz (eHPosition pPosition, bool pRefresh=true)
 Aligns the window horizontally on the screen.
 
virtual void centerVert (bool pRefresh=true)
 Centers the window vertically on the screen.
 
virtual void alignVert (eVPosition pPosition, bool pRefresh=true)
 Aligns the window vertically on the screen.
 
virtual void center (bool pRefresh=true)
 Centers the window on the screen.
 
virtual std::string getTitle () const
 Accessor for title text - Returns the first string in the.
 
virtual void setTitle (const std::string &pTitle, bool pRefreshTitle=true)
 Setter for the title text - This sets the first string in the.
 
std::string getStatus () const
 Accessor for the status line text.
 
virtual void setStatus (const std::string &pStatus, bool pRefreshStatus=true)
 Mutator for the status line text.
 
std::string getMessage () const
 Returns the message that appears in the window, concatenating all message lines together.
 
virtual void setMessage (const std::string &pMessage)
 Sets the text that appears within the window.
 
virtual void addMessageLineBelow (const std::string &pLine)
 Adds a line to the message to be displayed in the window,.
 
virtual void addMessageLinesBelow (const std::vector< std::string > &pLines)
 Adds lines to the message below the current message text.
 
virtual void addMessageLinesBelow (const std::list< std::string > &pLines)
 Adds lines to the message below the current message text.
 
virtual void addMessageLinesBelow (const std::deque< std::string > &pLines)
 Adds lines to the message below the current message text.
 
virtual void addMessageLineAbove (const std::string &pLine)
 Adds a line to the message to be displayed in the window,.
 
virtual void addMessageLinesAbove (const std::vector< std::string > &pLines)
 Adds lines to the message above the current message text.
 
virtual void addMessageLinesAbove (const std::list< std::string > &pLines)
 Adds lines to the message above the current message text.
 
virtual void addMessageLinesAbove (const std::deque< std::string > &pLines)
 Adds lines to the message above the current message text.
 
virtual void setMessageLines (const std::vector< std::string > &pLines)
 Sets the message lines in the window.
 
virtual void setMessageLines (const std::list< std::string > &pLines)
 Sets the message lines in the window.
 
virtual void setMessageLines (const std::deque< std::string > &pLines)
 Sets the message lines in the window.
 
virtual void removeMessageLine (unsigned pIndex)
 Removes a line from the text inside the window (by index).
 
virtual void setMessageLine (unsigned pIndex, const std::string &pLine)
 Modifies one of the lines displayed in the window.
 
void setHorizTitleAlignment (eHPosition pHAlignment)
 Sets the horizontal alignment of the title text.
 
eHPosition getHorizTitleAlignment () const
 Accessor for the title text alignment.
 
void setHorizMessageAlignment (eHPosition pHAlignment)
 Sets the horizontal alignment of the message text.
 
eHPosition getHorizMessageAlignment () const
 Accessor for the horizontal message text alignment.
 
void setHorizStatusAlignment (eHPosition pHAlignment)
 Sets the horizontal alignment of the status text.
 
eHPosition getHorizStatusAlignment () const
 Accessor for the horizontal status text alignment.
 
void setVerticalMessageAlignment (eVPosition pVAlignment)
 Sets the vertical alignment of the message text.
 
eVPosition getVerticalMessageAlignment () const
 Accessor for the vertical message text alignment.
 
void setExtTitleWindow (cxWindow *pWindow, bool pRefreshTitle=true)
 Sets an external cxWindow object to be used for the title, rather.
 
cxWindowgetExtTitleWindow () const
 Accessor for the external title window pointer.
 
void setExtStatusWindow (cxWindow *pWindow, bool pRefreshStatus=true)
 Sets an external cxWindow object to be used for status, rather.
 
cxWindowgetExtStatusWindow () const
 Accessor for the external status window pointer.
 
bool isHidden () const
 Returns whether or not the window is hidden.
 
virtual long show (bool pBringToTop=false, bool pShowSubwindows=true)
 Shows the window.
 
virtual long showModal (bool pShowSelf=true, bool pBringToTop=true, bool pShowSubwindows=true)
 Shows the window and waits for input.
 
virtual bool modalGetsKeypress () const
 Returns whether or not a call to showModal() will wait for a.
 
virtual long setFocus (bool pShowSelf=true, bool pBringToTop=true, bool pShowSubwindows=true)
 Alias for showModal()
 
virtual void setFocusColors ()
 Turns on the ncurses attribute A_REVERSE for the window to.
 
virtual void setFocusColors (attr_t pAttr)
 Turns on the ncurses attribute pAttr for the window to.
 
virtual void unSetFocusColors ()
 Disables focus for this window and unhighlights the message.
 
virtual void unSetFocusColors (attr_t pAttr)
 Disables focus for this window and un-highlights the message (using pAttr)
 
virtual void erase (bool pEraseSubwindows=true)
 Erases the window.
 
virtual void bringToTop (bool pRefresh=true)
 Brings the window to the top.
 
virtual void bringToBottom (bool pRefresh=false)
 Puts the window on the bottom of all other windows.
 
virtual bool isOnTop () const
 Returns whether the window is on top of all other windows.
 
virtual bool isOnBottom () const
 Returns whether the window is on the bottom of all other windows.
 
virtual bool isAbove (const cxWindow &pThatWindow) const
 Returns whether the window is above another window.
 
virtual bool isBelow (const cxWindow &pThatWindow) const
 Returns whether a window is below another window.
 
virtual void hide (bool pHideSubwindows=true)
 Hides the window.
 
virtual void unhide (bool pUnhideSubwindows=true)
 Un-hides the window.
 
void touchWindow ()
 Marks the window's entire content as dirty so that the next.
 
virtual void drawBorder (int pRow, int pCol, int pHeight, int pWidth, bool pTop=true, bool pBottom=true, bool pLeft=true, bool pRight=true)
 Draws the border (based on the border style)
 
virtual void drawBorder (int pHeight, int pWidth)
 Draws a box in the window.
 
virtual void drawBorder ()
 Draws a box for the window border.
 
virtual int top () const
 Returns the top row of the window.
 
virtual int centerRow () const
 Returns the center row of the window.
 
virtual int bottom () const
 Returns the bottom row of the window.
 
virtual int left () const
 Returns the left column of the window.
 
virtual int centerCol () const
 Returns the center column of the window.
 
virtual int right () const
 Returns the right column of the window.
 
virtual int width (int pWidth)
 Changes the width of the window.
 
virtual int width () const
 Returns the width of the window.
 
virtual int height (int pHeight)
 Changes the height of the window.
 
virtual int height () const
 Returns the height of the window.
 
virtual void getRect (int &pTop, int &pLeft, int &pBottom, int &pRight)
 Returns the coordinates of the rectangle defining the window.
 
virtual bool pointIsInWindow (int pY, int pX) const
 Returns whether a screen location is in the window (including.
 
virtual bool pointIsInTitle (int pY, int pX) const
 Returns whether a screen location is in the title of the window.
 
virtual void getSize (int &pHeight, int &pWidth)
 Returns the height & width of the window.
 
virtual void addAttr (e_WidgetItems pItem, attr_t pAttr)
 Adds an ncurses attribute to use for one of the items in the.
 
virtual void setAttr (e_WidgetItems pItem, attr_t pAttr)
 Sets the ncurses attribute to use for one of the items in the.
 
virtual void removeAttr (e_WidgetItems pItem, attr_t pAttr)
 Removes an ncurses attribute from one of the item lists.
 
virtual void removeAttrs (e_WidgetItems pItem)
 Removes all attributes for a given window item.
 
virtual void getAttrs (e_WidgetItems pItem, std::set< attr_t > &pAttrs) const
 Returns the set of ncurses attributes for a given item.
 
virtual void resize (int pNewHeight, int pNewWidth, bool pRefresh=true)
 Changes the window's width and height. The window's upper-left.
 
virtual bool move (int pNewRow, int pNewCol, bool pRefresh=true)
 Changes the window's position, based on a new upper-left corner.
 
virtual bool moveRelative (int pVerticalOffset, int pHorizOffset, bool pRefresh=true)
 Changes the window's position via vertical & horizontal offsets.
 
unsigned numSubWindows ()
 Returns the number of subwindows in this window.
 
void setSubWinMessage (unsigned pIndex, const std::string &pMessage)
 Sets the message of one of the subwindows (by index).
 
void setSubWinMessage (const std::string &pTitle, const std::string &pMessage)
 Sets the message of one of the subwindows (by title).
 
virtual bool hasFocus () const
 Returns true if window has focus, false otherwise.
 
virtual void setBorderStyle (eBorderStyle pBorderStyle)
 Sets the border style.
 
eBorderStyle getBorderStyle () const
 Returns the border style.
 
bool hasBorder () const
 Does this window have a border?
 
virtual cxWindowgetParent () const
 Returns a pointer to the parent window.
 
void setParent (cxWindow *pNewParent)
 Changes the pointer to the parent window; changes the parent window.
 
virtual void dump (std::string &pResult)
 Returns a string containing all the characters.
 
virtual void showSubwindows (bool pBringToTop=true, bool pShowSubwindows=true)
 Shows the subwindows for the window.
 
cxWindowoperator= (const cxWindow &pThatWindow)
 Assignment operator.
 
virtual void writeText (int pRow, int pCol, const std::string &pText, bool pRefresh=true)
 Writes text on the window. Note that the text is not permanant, so.
 
virtual void setHotkeyHighlighting (bool pHotkeyHighlighting)
 Enables/disables the use of hotkey attributes when writing the message.
 
bool getHotkeyHighlighting () const
 Returns whether hotkey attributes are used when writing the message.
 
virtual bool isEnabled () const
 Returns whether or not the window is enabled.
 
virtual void setEnabled (bool pEnabled)
 Enables or disables the window. If the window is.
 
virtual void setDisableCursorOnShow (bool pDisableCursorOnShow)
 Sets whether the window should disable the cursor.
 
virtual bool getDisableCursorOnShow () const
 Returns whether or not the window will disable.
 
virtual bool getExitOnMouseOutside () const
 Returns whether the window exits its modal input loop when.
 
virtual void setExitOnMouseOutside (bool pExitOnMouseOutside)
 Sets whether the window should exit its modal input loop.
 
virtual int getLastKey () const
 Returns the last key pressed by the user (for showModal(), etc.)
 
virtual void setLastKey (int pLastKey)
 Sets the last keypress.
 
virtual bool lastKeyWasMouseEvt () const
 Returns whether or not the last keypress was a mouse event.
 
virtual void getLastMouseEvtCoords (int &pY, int &pX)
 Returns the coordinates of the last mouse event in the window.
 
virtual bool getChangeColorsOnFocus () const
 Returns whether the window will change.
 
virtual void setChangeColorsOnFocus (bool pChangeColorsOnFocus)
 Sets whether colors should change when focus.
 
virtual void setOnFocusFunction (const std::shared_ptr< cxFunction > &pFunction)
 Sets the window's "on focus" function.
 
virtual void setOnFocusFunction (funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pUseVal=false, bool pExitAfterRun=false)
 Sets the "on focus" function pointer.
 
virtual void setOnFocusFunction (funcPtr2 pFunction, void *p1, void *p2, bool pUseVal=false, bool pExitAfterRun=false)
 Sets the "on focus" function pointer.
 
virtual void setOnFocusFunction (funcPtr0 pFunction, bool pUseVal=false, bool pExitAfterRun=false)
 Sets the "on focus" function pointer.
 
virtual void setOnLeaveFunction (const std::shared_ptr< cxFunction > &pFunction)
 Sets the window's "on leave" function.
 
virtual void setOnLeaveFunction (funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4)
 Sets the "on leave" function pointer.
 
virtual void setOnLeaveFunction (funcPtr2 pFunction, void *p1, void *p2)
 Sets the "on focus" function pointer.
 
virtual void setOnLeaveFunction (funcPtr0 pFunction)
 Sets the "on focus" function pointer.
 
virtual bool runOnFocusFunction (std::string *pFunctionRetval=nullptr)
 Runs the onFocus function, if it's set.
 
virtual bool runOnLeaveFunction (std::string *pFunctionRetval=nullptr)
 Runs the onLeave function, if it's set. However, if the last.
 
virtual void toggleOnFocusFunction (bool pRunOnFocus)
 Sets whether or not the onFocus function should run.
 
virtual void toggleOnLeaveFunction (bool pRunOnLeave)
 Sets whether or not the onLeave function should run.
 
virtual bool onFocusFunctionEnabled () const
 Returns whether or not the onFocus function is set to run.
 
virtual bool onLeaveFunctionEnabled () const
 Returns whether or not the onLeave function is set to run.
 
virtual const std::shared_ptr< cxFunction > & getOnFocusFunction () const
 Accessor for the onFocus function.
 
virtual const std::shared_ptr< cxFunction > & getOnLeaveFunction () const
 Accessor for the onLeave function.
 
virtual bool isModal () const
 Returns whether or not the window is currently.
 
virtual bool setKeyFunction (int pKey, const std::shared_ptr< cxFunction > &pFunction)
 Sets a function to be called when a key is pressed.
 
virtual bool setKeyFunction (int pKey, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true)
 Sets a function to be called when a key is pressed.
 
virtual bool setKeyFunction (int pKey, funcPtr2 pFunction, void *p1, void *p2, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true)
 Sets a function to be called when a key is pressed.
 
virtual bool setKeyFunction (int pKey, funcPtr0 pFunction, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true)
 Sets a function to be called when a key is pressed. This.
 
virtual void clearKeyFunction (int pKey)
 Removes a function pointer for a keypress so that it will no.
 
virtual void clearKeyFunctionByPtr (funcPtr4 pFunction)
 Removes a keypress function pointer.
 
virtual void clearKeyFunctionByPtr (funcPtr2 pFunction)
 Removes a keypress function pointer.
 
virtual void clearKeyFunctionByPtr (funcPtr0 pFunction)
 Removes a keypress function pointer.
 
virtual void clearKeyFunctions ()
 Clears the list of external functions fired by hotkeys.
 
virtual bool hasKeyFunction (int pKey) const
 Returns whether an external function exists for a keypress.
 
virtual bool setMouseFunction (int pMouseState, const std::shared_ptr< cxFunction > &pFunction)
 Sets a function to be called for a certain mouse state.
 
virtual bool setMouseFunction (int pMouseState, funcPtr4 pFunction, void *p1, void *p2, void *p3, void *p4, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true)
 Sets a function to be called for a certain mouse state.
 
virtual bool setMouseFunction (int pMouseState, funcPtr2 pFunction, void *p1, void *p2, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true)
 Sets a function to be called for a certain mouse state.
 
virtual bool setMouseFunction (int pMouseState, funcPtr0 pFunction, bool pUseReturnVal=false, bool pExitAfterRun=false, bool pRunOnLeaveFunction=true)
 Sets a function to be called for a certain mouse state. This.
 
virtual void clearMouseFunction (int pMouseState)
 Removes a function pointer for a mouse event so that it will.
 
virtual void clearMouseFunctions ()
 Clears the list of external functions fired by mouse events.
 
virtual bool hasMouseFunction (int pMouseState) const
 Returns whether an external function exists for a mouse event.
 
std::map< int, std::shared_ptr< cxFunction > >::iterator keyFunctions_begin ()
 Returns a begin iterator to the map of cxFunction pointers.
 
std::map< int, std::shared_ptr< cxFunction > >::iterator keyFunctions_end ()
 Returns an end iterator to the map of cxFunction pointers.
 
virtual void getFunctionKeyStrings (std::vector< std::string > &pKeys) const
 Populates a collection of strings representing the keys.
 
virtual void getFunctionKeys (std::vector< int > &pKeys) const
 Populates a collection with integers representing the keys.
 
virtual void setShowSubwinsForward (bool pShowSubwinsForward)
 Toggles the order in which subwindows will be shown.
 
virtual bool getShowSubwinsForward () const
 Returns whether or not the subwindows will be shown.
 
virtual void setShowSelfBeforeSubwins (bool pShowSelfBeforeSubwins)
 Sets whether the window will show itself before.
 
virtual bool getShowSelfBeforeSubwins () const
 Returns whether or not the window will show itself before.
 
virtual long getReturnCode () const
 Returns the return code set by the last call to.
 
virtual bool addTitleString (int pHPos, const std::string &pStr, bool pRefreshTitle=false)
 Adds/sets a string to appear in the title at.
 
virtual std::string getTitleString (int pHPos) const
 Returns the title string set at a given horizontal position.
 
virtual std::map< int, std::string > getTitleStrings () const
 Returns the map of title strings for the window.
 
virtual void getTitleStrings (std::map< int, std::string > &pTitleStrings) const
 Returns the map of title strings for the window (using an.
 
virtual void setTitleStrings (const std::map< int, std::string > &pTitleStrings)
 Sets all the title strings via a map of horizontal.
 
virtual void removeTitleString (int pHPos)
 Removes a title string at a given horizontal position.
 
virtual void removeTitleStrings ()
 Removes all title strings.
 
virtual bool addStatusString (int pHPos, const std::string &pStr, bool pRefreshStatus=false)
 Adds/sets a string to appear in the status line at.
 
virtual std::string getStatusString (int pHPos) const
 Returns the status string set at a given horizontal position.
 
virtual std::map< int, std::string > getStatusStrings () const
 Returns the map of status strings for the window.
 
virtual void getStatusStrings (std::map< int, std::string > &pStatusStrings) const
 Returns the map of status strings for the window (using an.
 
virtual void setStatusStrings (const std::map< int, std::string > &pStatusStrings)
 Sets all the status strings via a map of horizontal.
 
virtual void removeStatusString (int pHPos)
 Removes a status string at a given horizontal position.
 
virtual void removeStatusStrings ()
 Removes all status strings.
 
virtual bool addQuitKey (int pKey, bool pRunOnLeaveFunction=true, bool pOverride=false)
 Adds a key that will cause the window to quit its input loop.
 
virtual void removeQuitKey (int pKey)
 Removes a quit key.
 
virtual void removeQuitKeys ()
 Removes all quit keys.
 
virtual bool addExitKey (int pKey, bool pRunOnLeaveFunction=true, bool pOverride=false)
 Adds a key that will cause the window to quit its input loop.
 
virtual void removeExitKey (int pKey)
 Removes an exit key.
 
virtual void removeExitKeys ()
 Removes all exit keys.
 
virtual bool hasExitKey (int pKey) const
 Returns whether or not a key exists in the.
 
virtual bool hasQuitKey (int pKey) const
 Returns whether or not a key exists in the.
 
virtual void clear (bool pRefresh=false)
 Clears the text from the window.
 
virtual void quitNow ()
 This is mainly for deriving classes. This causes the object.
 
virtual void exitNow ()
 This is mainly for deriving classes. It tells the object.
 
virtual void getQuitKeyStrings (std::vector< std::string > &pKeys) const
 Populates a collection of strings representing the keys.
 
virtual std::string getQuitKeyListString () const
 Returns a string containing a comma-separated list of the.
 
virtual void getExitKeyStrings (std::vector< std::string > &pKeys) const
 Populates a collection of strings representing the keys.
 
virtual std::string getExitKeyListString () const
 Returns a string containing a comma-separated list of the.
 
virtual std::map< int, bool > getQuitKeys () const
 Returns the keys that will make the window quit its input.
 
virtual std::map< int, bool > getExitKeys () const
 Returns the keys that will make the window exit is input.
 
void toggleMessage (bool pDrawMessage)
 Sets whether or not to draw the message area (the area within.
 
void toggleTitle (bool pDrawTitle)
 Sets whether or not to draw the title.
 
void toggleStatus (bool pDrawStatus)
 Sets whether or not to draw the status line.
 
bool messageWillDraw () const
 Returns whether the message will draw or not.
 
bool titleWillDraw () const
 Returns whether the title will draw or not.
 
bool statusWillDraw () const
 Returns whether the status line will draw or not.
 
void toggleSpecialChars (bool pDrawSpecialChars)
 Sets whether or not to draw the "special" characters (these are.
 
bool specialCharsWillDraw () const
 Returns whether the "special" characters will be drawn or.
 
virtual void drawTitle ()
 Writes the title line.
 
virtual void drawStatus ()
 Writes the status line.
 
virtual void drawMessage ()
 Writes the message text (in the area within the borders)
 
virtual void drawSpecialChars ()
 Writes the set of "special" characters to the window.
 
virtual void setReturnCode (const long &pReturnCode)
 Explicitly sets the member return code for the window.
 
virtual void setMessageColor (e_cxColors pColor)
 Returns the message color.
 
virtual void setTitleColor (e_cxColors pColor)
 Sets the title color.
 
virtual void setStatusColor (e_cxColors pColor)
 Sets the color of the status line at bottom of window.
 
virtual void setBorderColor (e_cxColors pColor)
 Sets the color of the window border.
 
virtual void setColor (e_WidgetItems pItem, e_cxColors pColor)
 Sets the color of one of the window items.
 
virtual bool hasAttr (e_WidgetItems pItem, attr_t pAttr)
 Returns whether an attribute is set for a widget item.
 
virtual std::string cxTypeStr () const override
 Returns the name of the cxWidgets class. This is overridden.
 
bool getLeaveNow () const
 Returns whether or not something told the window to leave now.
 
std::string getName () const
 
virtual void setName (const std::string &pName)
 Sets the name of the window. The name is an alternative means.
 
bool mouseEvtWasInWindow () const
 Returns whether the current mouse information stored in the.
 
virtual bool mouseEvtWasInTitle () const
 Returns whether the current mouse information stored in the.
 
virtual void doMouseBehavior ()
 Triggers the window's mouse event behavior. This method can.
 
virtual void doMouseBehavior (int pMouseY, int pMouseX)
 Triggers the window's mouse event behavior. Also sets the.
 
std::shared_ptr< cxFunctiongetKeyFunction (int pKey) const
 Returns a cxFunction pointer for a key.
 
std::shared_ptr< cxFunction0getKeyFunctionAsFunction0 (int pKey) const
 Returns a cxFunction pointer for a key, casted to a cxFunction0.
 
std::shared_ptr< cxFunction2getKeyFunctionAsFunction2 (int pKey) const
 Returns a cxFunction pointer for a key, casted to a cxFunction2.
 
std::shared_ptr< cxFunction4getKeyFunctionAsFunction4 (int pKey) const
 Returns a cxFunction pointer for a key, casted to a cxFunction4.
 
bool mouseEvtWasButtonEvt () const
 Returns whether or not the mouse event read in mMouse was.
 
bool mouseButton1Pressed () const
 Returns whether or not the first mouse button was pressed.
 
bool mouseButton1Released () const
 Returns whether or not the first mouse button was released.
 
bool mouseButton1Clicked () const
 Returns whether or not the first mouse button was clicked.
 
bool mouseButton1DoubleClicked () const
 Returns whether or not the first mouse button was double-clicked.
 
bool mouseButton2Clicked () const
 Returns whether or not the second mouse button was clicked.
 
bool mouseButton2DoubleClicked () const
 Returns whether or not the second mouse button was double-clicked.
 
bool mouseButton3Clicked () const
 Returns whether or not the second mouse button was clicked.
 
virtual void mouseButton1Click (int pY, int pX)
 Tells the window that mouse button 1 was clicked at a certain.
 
virtual void mouseButton2Click (int pY, int pX)
 Tells the window that mouse button 2 was clicked at a certain.
 
virtual void mouseButton3Click (int pY, int pX)
 Tells the window that mouse button 3 was clicked at a certain.
 
std::string getString (int pRow, int pCol, int pNumber)
 Get the contents of a portion of the window. (for debugging/testing)
 
void info ()
 Display information about a window (for debugging/testing)
 
virtual void toggleBorderTop (bool pToggle)
 Sets whether or not to display the top border.
 
virtual void toggleBorderBottom (bool pToggle)
 Sets whether or not to display the bottom border.
 
virtual void toggleBorderLeft (bool pToggle)
 Sets whether or not to display the left border.
 
virtual void toggleBorderRight (bool pToggle)
 Sets whether or not to display the right border.
 
virtual void addSpecialChar (int pY, int pX, chtype pChar, attr_t pAttr=A_NORMAL)
 Adds a character to be written somewhere in the window. These.
 
virtual void removeSpecialChar (int pY, int pX)
 Removes a character from the set of special characters (by.
 
virtual void clearSpecialChars ()
 Clears the collection of special characters.
 
virtual bool functionExistsForLastMouseState () const
 Returns whether an external function pointer exists for the.
 
int getMouseState () const
 Returns the current mouse state as it was last captured by the.
 
std::string getMouseStateStr () const
 Returns a string version of the current mouse state as it was.
 
virtual e_cxColors getItemColor (e_WidgetItems pItem) const
 Returns the color of one of the items in a window.
 
- Public Member Functions inherited from cx::cxObject
 cxObject ()
 
virtual ~cxObject ()
 
virtual void beep ()
 

Protected Member Functions

virtual void reCreatePanel ()
 Creates mPanel (by calling new_panel()), then sets up.
 
void freeWindow ()
 Frees the memory used by the ncurses window and.
 
virtual void init (int pRow, int pCol, int pHeight, int pWidth, const std::string &pTitle, const std::string &pMessage, const std::string &pStatus, cxWindow *pParentWindow=nullptr, bool pResizeVertically=true)
 Initializes the window parameters and sets up the internal.
 
virtual void removeAllSubwindows ()
 Removes all subwindow pointers.
 
virtual void addSubwindow (cxWindow *pSubWindow)
 Adds a subwindow to the window. Subwindows of a.
 
virtual void removeSubWindow (const cxWindow *pSubWindow)
 Removes a window from the subwindow list.
 
virtual void setElementColor (short &pColorPair, attr_t &pElementAttr, e_cxColors pColor)
 Sets the color (and attribute, if necessary) of a color element.
 
virtual void enableAttrs (WINDOW *pWin, e_WidgetItems pItem)
 Enables the attributes for one of the m*Attrs sets for an ncurses window.
 
virtual void disableAttrs (WINDOW *pWin, e_WidgetItems pItem)
 Disables the attributes for one of the m*Attrs sets for an ncurses window.
 
virtual void writeWithHighlighting (WINDOW *pWindow, const std::string &pText, const int &pY, const int &pStartX, const int &pEndX, int pNormalTextItem=-1)
 Writes text to an ncurses WINDOW, highlighting any characters.
 
virtual void copyCxWinStuff (const cxWindow *pThatWindow, bool pRecreateWin=true)
 Makes a copy of a cxWindow's member variables.
 
virtual void getRowColBasedOn (cxWindow *pParentWindow, eHPosition pPosition, const std::string &pTitle, const std::string &pStatus, const std::string &pMessage, int &pRow, int &pCol)
 Figures out how to align text based on a title & message.
 
virtual bool handleFunctionForLastKey (bool *pFunctionExists=nullptr, bool *pRunOnLeaveFunction=nullptr)
 Looks for a function tied to the last keypress and.
 
virtual bool handleFunctionForLastMouseState (bool *pFunctionExists=nullptr, bool *pRunOnLeaveFunction=nullptr)
 Looks for a function tied to the last mouse state captured.
 
virtual void draw ()
 Fills the member ncurses window structure with the current.
 
void setKeyFunctions (const cxWindow &pWindow)
 Returns whether or not a mouse event location is within.
 
void setFocusFunctions (const cxWindow &pWindow)
 Re-sets the onFocus and onLeave functions from another.
 
bool parentIsCxPanel () const
 Returns whether or not the parent window, if there is one, is.
 
bool parentIsCxForm () const
 Returns whether or not the parent window, if there is one, is.
 
bool parentIsCxNotebook () const
 Returns whether or not the parent window, if there is one, is.
 
cxWindowPtrContainer::const_iterator subWindows_begin () const
 Returns a const iterator to the first subwindow.
 
cxWindowPtrContainer::const_iterator subWindows_end () const
 Returns a const iterator to the one past the last subwindow.
 
cxWindowPtrContainer::const_reverse_iterator subWindows_rbegin () const
 Returns a const reverse begin iterator for the subwindow collection.
 
cxWindowPtrContainer::const_reverse_iterator subWindows_rend () const
 Returns a const reverse end iterator for the subwindow collection.
 
bool onFocusFunctionIsSet () const
 Returns whether or not the onFocus function is set (if.
 
bool onLeaveFunctionIsSet () const
 Returns whether or not the onLeave function is set (if.
 

Protected Attributes

WINDOW * mWindow = nullptr
 Everything in the window is written here; this is an nCurses window structure.
 
messageLineContainer mMessageLines
 Contains the text to be shown inside the window (note: the.
 
std::map< std::pair< int, int >, chtype > mSpecialChars
 Contains "special" characters which are added to the window.
 
std::set< attr_t > mMessageAttrs
 Message attributes.
 
std::set< attr_t > mTitleAttrs
 Title attributes.
 
std::set< attr_t > mStatusAttrs
 Status attributes.
 
std::set< attr_t > mBorderAttrs
 Border attributes.
 
std::set< attr_t > mHotkeyAttrs
 Hotkey attributes.
 
std::map< std::pair< int, int >, attr_t > mSpecialCharAttrs
 Attributes for the "special" characters (which are added to.
 
short mMessageColorPair = eWHITE_BLUE
 
short mTitleColorPair = eGRAY_BLUE
 
short mStatusColorPair = eBROWN_BLUE
 
short mBorderColorPair = eGRAY_BLUE
 
eHPosition mHorizTitleAlignment = eHP_LEFT
 
eHPosition mHorizMessageAlignment = eHP_LEFT
 
eHPosition mHorizStatusAlignment = eHP_LEFT
 
eVPosition mVerticalMessageAlignment = eVP_TOP
 
bool mDrawMessage = true
 
bool mDrawTitle = true
 
bool mDrawStatus = true
 
bool mDrawSpecialChars = true
 
std::shared_ptr< cxFunctionmOnFocusFunction = nullptr
 
std::shared_ptr< cxFunctionmOnLeaveFunction = nullptr
 
bool mIsModal = false
 
bool mLeaveNow = false
 
std::map< int, std::shared_ptr< cxFunction > > mKeyFunctions
 
std::map< int, std::shared_ptr< cxFunction > > mMouseFunctions
 
std::map< int, bool > mQuitKeys
 
std::map< int, bool > mExitKeys
 
bool mHotkeyHighlighting
 

Additional Inherited Members

- Static Public Member Functions inherited from cx::cxObject
static bool UseColors ()
 
static void UseColors (bool useIt)
 
static bool UseBeeps ()
 
static void UseBeeps (bool useIt)
 
- Static Protected Attributes inherited from cx::cxObject
static bool useColors
 Whether or not to use colors.
 
static bool useBeeps
 Whether or not to enable beeping.
 

Detailed Description

Represents a 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:

Note: When deriving a window from cxWindow (or other cxWindow-derived window classes) that contain other other windows or controls, one method that's important to override is move(), so that the "child" windows move properly, in addition to the main window. You do not normally need to override centerHoriz(), centerVert(), or center() however, because these methods end up calling move() anyway.
Also, if you are overriding show() and/or showModal(), it is important to honor isEnabled() (for consistency) unless you have a good reason to do otherwise. show() and showModal() in all the windows in the cxWindows API will do nothing if they are not enabled (more specifically, they will make sure that the window remains hidden).
In the cxWindow-based classes in the cxWidgets library, by the time the onLeave function is called, the window will no longer be modal (i.e., a call to isModal() will return false).
A cxWindow can also be enabled or disabled with a call brief to setEnabled(). When a cxWindow is disabled, it will hide and remain hidden (even with a call to show() or unhide()) until it is enabled again. Also, a cxWindow that is hidden won't process user input.
Note that when deriving a class from cxWindow, the ncurses WINDOW structure mWindow is available to derived classes, in case derived classes need to do any special drawing with it or anything special (i.e., setting up a derived window for scrolling). Note also that a cxWindow also has a data member of type PANEL, which comes from the panel library and is used to manage stacked windows. This member is not available to derived classes, however. If you derive a class from cxWindow and need to re-create mWindow and the panel, you may re-create the window by first calling the ncurses function delwin() with mWindow as the parameter and then re-creating it with newwin. The panel must be re-created, however, by calling reCreatePanel(), which is a protected member method in this class.
The constructors of this class will throw a cxWidgetsException if the underlying ncurses window cannot be created. So, at the very least, your main program should include its code in a try/catch and should catch a const cxWidgetsException&. The error message can be retreived via the getErrorMsg() method.
Note: If a cxWindow or any of its child classes are located on a cxPanel, you can get a pointer to the cxPanel by using getParent() and casting the return value to a cxPanel pointer if you are 100% sure it's a cxPanel. If you are unsure, the best way to determine the parent window type is by calling cxTypeStr(), as folows:

   cxWindow *parent = getParent();
   if (parent != nullptr) {
      if (parent->cxTypeStr() == "cxPanel") {
         // The parent is a cxPanel
      }
   }

Normally, when showModal() is called, a cxWindow will show itself and wait for the user to press a key. To provide an additional clue that the window has focus, you can call setChangeColorsOnFocus() and pass it true.
The clear() method will likely need to be implemented in derived classes that need special behavior.

Another thing that cxWindow and cxWindow-derived classes do is maintain sets of attributes for various elements of a cxWindow. Some maintain different sets than others. Methods dealing with adding, setting, and removing attributes include:

There is an enumeration for item types, defined in cxWidgetItems.h, which defines these item types:

Constructor & Destructor Documentation

◆ cxWindow() [1/9]

cx::cxWindow::cxWindow ( cxWindow pParentWindow = nullptr,
int  pRow = 0,
int  pCol = 0,
int  pHeight = DEFAULT_HEIGHT,
int  pWidth = DEFAULT_WIDTH,
const std::string &  pTitle = "",
const std::string &  pMessage = "",
const std::string &  pStatus = "",
eBorderStyle  pBorderStyle = eBS_SINGLE_LINE,
cxWindow pExtTitleWindow = nullptr,
cxWindow pExtStatusWindow = nullptr,
bool  pHotkeyHighlighting = false 
)
explicit

Default constructor.

Parameters
pParentWindowA pointer to the parent window.
pRowThe row of the upper-left corner.
pColThe column of the upper-left corner.
pHeightThe height of the window.
pWidthThe width of the window.
pTitleThe window title (appears in the top border).
pMessageThe message to appear in the window.
pStatusThe status (appears in the bottom border).
pBorderStyleThe border style - can be eBS_SINGLE_LINE for a single-line border or eBS_NOBORDER for no border.
pExtTitleWindowA pointer to another cxWindow in which to display the window title.
pExtStatusWindowA pointer to another cxWindow in which to display the status.
pHotkeyHighlightingWhether or not to recognize & use underline characters when displaying the message text.

◆ cxWindow() [2/9]

cx::cxWindow::cxWindow ( cxWindow pParentWindow,
int  pRow,
int  pCol,
const std::string &  pTitle,
const std::string &  pMessage,
const std::string &  pStatus,
cxWindow pExtTitleWindow = nullptr,
cxWindow pExtStatusWindow = nullptr,
bool  pHotkeyHighlighting = false 
)

Overloaded constructor.

Parameters
pParentWindowA pointer to the parent window.
pRowThe row of the upper-left corner.
pColThe column of the upper-left corner.
pTitleThe title to appear at the top of the window.
pMessageThe message to appear in the window.
pStatusThe status to display on the bottom row of the window.
pExtTitleWindowA pointer to another cxWindow in which to display the window title.
pExtStatusWindowA pointer to another cxWindow to use as an external status window.
pHotkeyHighlightingWhether or not to recognize & use underline characters when displaying the message text.

◆ cxWindow() [3/9]

cx::cxWindow::cxWindow ( cxWindow pParentWindow,
const std::string &  pTitle,
const std::string &  pMessage,
const std::string &  pStatus,
cxWindow pExtTitleWindow = nullptr,
cxWindow pExtStatusWindow = nullptr,
bool  pHotkeyHighlighting = false 
)

Overloaded constructor - Centers the window in the middle of the screen.

Parameters
pParentWindowA pointer to the parent window.
pTitleThe title to appear at the top of the window.
pMessageThe message to appear in the window.
pStatusThe status to display on the bottom row of the window.
pExtTitleWindowA pointer to another cxWindow in which to display the window title.
pExtStatusWindowA pointer to another cxWindow to use as an external status window.
pHotkeyHighlightingWhether or not to recognize & use underline characters when displaying the message text.

◆ cxWindow() [4/9]

cx::cxWindow::cxWindow ( cxWindow pParentWindow,
const std::string &  pTitle,
const std::string &  pMessage,
const std::string &  pStatus,
int  pHeight,
int  pWidth,
cxWindow pExtTitleWindow = nullptr,
cxWindow pExtStatusWindow = nullptr,
bool  pHotkeyHighlighting = false 
)

Overloaded constructor - Centers the window in the middle of the screen.

Parameters
pParentWindowA pointer to the parent window.
pTitleThe title to appear at the top of the window.
pMessageThe message to appear in the window.
pHeightThe height for the window
pWidthThe width for the window
pStatusThe status to display on the bottom row of the window.
pExtTitleWindowA pointer to another cxWindow in which to display the window title.
pExtStatusWindowA pointer to another cxWindow to use as an external status window.
pHotkeyHighlightingWhether or not to recognize & use underline characters when displaying the message text.

◆ cxWindow() [5/9]

cx::cxWindow::cxWindow ( cxWindow pParentWindow,
const std::string &  pMessage,
const std::string &  pStatus,
cxWindow pExtTitleWindow = nullptr,
cxWindow pExtStatusWindow = nullptr,
bool  pHotkeyHighlighting = false 
)

Overloaded constructor - Centers the window in the middle of the screen.

Parameters
pParentWindowA pointer to the parent window.
pMessageThe message to appear in the window.
pStatusThe status to display on the bottom row of the window.
pExtTitleWindowA pointer to another cxWindow in which to display the window title.
pExtStatusWindowA pointer to another cxWindow to use as an external status window.
pHotkeyHighlightingWhether or not to recognize & use underline characters when displaying the message text.

◆ cxWindow() [6/9]

cx::cxWindow::cxWindow ( cxWindow pParentWindow,
const std::string &  pMessage,
const std::string &  pStatus,
int  pHeight,
int  pWidth,
cxWindow pExtTitleWindow = nullptr,
cxWindow pExtStatusWindow = nullptr,
bool  pHotkeyHighlighting = false 
)

Overloaded constructor - Centers the window in the middle of the screen.

Parameters
pParentWindowA pointer to the parent window.
pMessageThe message to appear in the window.
pStatusThe status to display on the bottom row of the window.
pHeightThe height for the window
pWidthThe width for the window
pExtTitleWindowA pointer to another cxWindow in which to display the window title.
pExtStatusWindowA pointer to another cxWindow to use as an external status window.
pHotkeyHighlightingWhether or not to recognize & use underline characters when displaying the message text.

◆ cxWindow() [7/9]

cx::cxWindow::cxWindow ( cxWindow pParentWindow,
const std::string &  pMessage,
cxWindow pExtTitleWindow = nullptr,
cxWindow pExtStatusWindow = nullptr,
bool  pHotkeyHighlighting = false 
)

Overloaded constructor - Centers the window in the middle of the screen.

Parameters
pParentWindowA pointer to the parent window.
pMessageThe message to appear in the window.
pExtTitleWindowA pointer to another cxWindow in which to display the window title.
pExtStatusWindowA pointer to another cxWindow to use as an external status window.
pHotkeyHighlightingWhether or not to recognize & use underline characters when displaying the message text.

◆ cxWindow() [8/9]

cx::cxWindow::cxWindow ( cxWindow pParentWindow,
eHPosition  pHPosition,
const std::string &  pTitle,
const std::string &  pMessage,
const std::string &  pStatus,
cxWindow pExtTitleWindow = nullptr,
cxWindow pExtStatusWindow = nullptr,
bool  pHotkeyHighlighting = false 
)

Overloaded constructor - Lets you specify the horizontal position.

Parameters
pParentWindowA pointer to the parent window.
pHPositionThe horizontal position of the window - eHP_CENTER, eHP_LEFT, or eHP_RIGHT
pTitleThe title to appear at the top of the window.
pMessageThe message to appear in the window.
pStatusThe status to display on the bottom row of the window.
pExtTitleWindowA pointer to another cxWindow in which to display the window title.
pExtStatusWindowA pointer to another cxWindow to use as an external status window.
pHotkeyHighlightingWhether or not to recognize & use underline characters when displaying the message text.

◆ cxWindow() [9/9]

cx::cxWindow::cxWindow ( const cxWindow pThatWindow)

Copy constructor.

Parameters
pThatWindowAnother cxWindow object to be copied

References addSubwindow(), height(), hide(), isHidden(), left(), mWindow, reCreatePanel(), top(), and width().

◆ ~cxWindow()

cx::cxWindow::~cxWindow ( )
virtual

Member Function Documentation

◆ addAttr()

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

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

window (see the e_WidgetItems enumeration).

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

Reimplemented in cx::cxForm, cx::cxGrid, cx::cxInput, cx::cxMenu, cx::cxMenuBar, and cx::cxMultiLineInput.

References cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, mBorderAttrs, mHotkeyAttrs, mMessageAttrs, mStatusAttrs, and mTitleAttrs.

Referenced by cx::cxForm::addAttr(), cx::cxGrid::addAttr(), cx::cxInput::addAttr(), cx::cxMenu::addAttr(), cx::cxMenuBar::addAttr(), setFocusColors(), setFocusColors(), setMessageColor(), setTitleColor(), and cx::cxButton::showModal().

◆ addExitKey()

bool cx::cxWindow::addExitKey ( int  pKey,
bool  pRunOnLeaveFunction = true,
bool  pOverride = false 
)
virtual

Adds a key that will cause the window to quit its input loop.

and return cxID_EXIT. Normally, if the key already exists

as a function key, it will not be added as an exit key.

Parameters
pKeyThe key to add
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits. Defaults to true.
pOverrideIf true, then the key will be added as an exit key regardless if the key exists as a function key. This defaults to false.
Returns
Whether or not the key was added

Reimplemented in cx::cxForm, cx::cxMultiForm, cx::cxMultiLineInput, and cx::cxPanel.

References hasKeyFunction(), mExitKeys, and mQuitKeys.

Referenced by cx::cxForm::addExitKey(), cx::cxMultiLineInput::addExitKey(), clearKeyFunction(), and clearKeyFunctions().

◆ addMessageLineAbove()

void cx::cxWindow::addMessageLineAbove ( const std::string &  pLine)
virtual

Adds a line to the message to be displayed in the window,.

above the current message text.

Parameters
pLineThe line to add

References mMessageLines.

Referenced by cxWindowAddMessageLinesAbove().

◆ addMessageLineBelow()

void cx::cxWindow::addMessageLineBelow ( const std::string &  pLine)
virtual

Adds a line to the message to be displayed in the window,.

below the current message text.

Parameters
pLineThe line to add

References mMessageLines.

Referenced by addMessageLine(), info(), and itemSales().

◆ addMessageLinesAbove() [1/3]

virtual void cx::cxWindow::addMessageLinesAbove ( const std::deque< std::string > &  pLines)
virtual

Adds lines to the message above the current message text.

Parameters
pLinesThe lines to add

◆ addMessageLinesAbove() [2/3]

virtual void cx::cxWindow::addMessageLinesAbove ( const std::list< std::string > &  pLines)
virtual

Adds lines to the message above the current message text.

Parameters
pLinesThe lines to add

◆ addMessageLinesAbove() [3/3]

virtual void cx::cxWindow::addMessageLinesAbove ( const std::vector< std::string > &  pLines)
virtual

Adds lines to the message above the current message text.

Parameters
pLinesThe lines to add

Referenced by cxWindowAddMessageLinesAbove().

◆ addMessageLinesBelow() [1/3]

virtual void cx::cxWindow::addMessageLinesBelow ( const std::deque< std::string > &  pLines)
virtual

Adds lines to the message below the current message text.

Parameters
pLinesThe lines to add

◆ addMessageLinesBelow() [2/3]

virtual void cx::cxWindow::addMessageLinesBelow ( const std::list< std::string > &  pLines)
virtual

Adds lines to the message below the current message text.

Parameters
pLinesThe lines to add

◆ addMessageLinesBelow() [3/3]

virtual void cx::cxWindow::addMessageLinesBelow ( const std::vector< std::string > &  pLines)
virtual

Adds lines to the message below the current message text.

Parameters
pLinesThe lines to add

◆ addQuitKey()

bool cx::cxWindow::addQuitKey ( int  pKey,
bool  pRunOnLeaveFunction = true,
bool  pOverride = false 
)
virtual

Adds a key that will cause the window to quit its input loop.

and return cxID_QUIT. Normally, if the key already exists

as a function key, it will not be added as an exit key.

Parameters
pKeyThe key to add
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits. Defaults to true.
pOverrideIf true, then the key will be added as an exit key regardless if the key exists as a function key. This defaults to false.
Returns
Whether or not the key was added

Reimplemented in cx::cxForm, cx::cxMultiForm, cx::cxMultiLineInput, and cx::cxPanel.

References hasKeyFunction(), mExitKeys, and mQuitKeys.

Referenced by cx::cxForm::addQuitKey(), cx::cxMultiLineInput::addQuitKey(), and SpreadsheetApp::run().

◆ addSpecialChar()

void cx::cxWindow::addSpecialChar ( int  pY,
int  pX,
chtype  pChar,
attr_t  pAttr = A_NORMAL 
)
virtual

Adds a character to be written somewhere in the window. These.

characters are written after everything else.

Parameters
pYThe vertical location in the window
pXThe horizontal location in the window
pCharThe character to add. This is a chtype, which is used by ncurses. This can be any regular character, as well as ncurses defined characters (see the man page for addch for a list of ncurses defined characters).
pAttrAn ncurses attribute to apply to the character. See the man page for attron for a list of ncurses attributes. This defaults to A_NORMAL.

References mSpecialCharAttrs, and mSpecialChars.

◆ addStatusString()

bool cx::cxWindow::addStatusString ( int  pHPos,
const std::string &  pStr,
bool  pRefreshStatus = false 
)
virtual

Adds/sets a string to appear in the status line at.

a given horizontal position in the bottom row.

If there is already a string set at the given

horizontal position, it will be changed to

the new string passed in. Also, the string will

be truncated to fit within the bottom row, if needed.

Parameters
pHPosThe horizontal position for the string. This must be within the borders (>= 1 and less than width()).
pStrThe string to use in the bottom row
pRefreshStatusWhether or not to refresh the status line (defaults to false)
Returns
True if pStr was added or false if not.

References drawStatus(), and width().

Referenced by cx::cxFileViewer::cxFileViewer(), and cxWindowWithMultipleStatusStrings().

◆ addSubwindow()

void cx::cxWindow::addSubwindow ( cxWindow pSubWindow)
protectedvirtual

Adds a subwindow to the window. Subwindows of a.

will be displayed when a window is displayed.

Parameters
pSubWindowA pointer to another cxWindow to be added as a subwindow.

Referenced by cxWindow(), and setParent().

◆ addTitleString()

bool cx::cxWindow::addTitleString ( int  pHPos,
const std::string &  pStr,
bool  pRefreshTitle = false 
)
virtual

Adds/sets a string to appear in the title at.

a given horizontal position in the top row.

If there is already a string set at the given

horizontal position, it will be changed to

the new string passed in. Also, the string will

be truncated to fit within the top row, if needed.

Parameters
pHPosThe horizontal position for the string. This must be within the borders (>= 1 and less than width()).
pStrThe string to use in the top row
pRefreshTitleWhether or not to refresh the title line (defaults to false)
Returns
True if pStr was added or false if not.

References drawTitle(), and width().

Referenced by cxWindowWithMultipleTitleStrings().

◆ alignHoriz()

void cx::cxWindow::alignHoriz ( eHPosition  pPosition,
bool  pRefresh = true 
)
virtual

Aligns the window horizontally on the screen.

Parameters
pPositionThe alignment (e.g. eHP_CENTER, eHP_LEFT, or eHP_RIGHT)
pRefreshWhether or not to refresh the window (defaults to true)

References cx::centerCol(), centerCol(), cx::eHP_CENTER, cx::eHP_LEFT, cx::eHP_RIGHT, cx::left(), left(), move(), cx::right(), right(), top(), and width().

Referenced by center(), centerHoriz(), and cxWindowAlignTest().

◆ alignVert()

void cx::cxWindow::alignVert ( eVPosition  pPosition,
bool  pRefresh = true 
)
virtual

Aligns the window vertically on the screen.

Parameters
pPositionThe alignment (e.g. eVP_CENTER, eVP_TOP, eVP_BOTTOM)
pRefreshWhether or not to refresh the window (defaults to true)

References cx::bottom(), bottom(), cx::centerRow(), centerRow(), cx::eVP_BOTTOM, cx::eVP_CENTER, cx::eVP_TOP, height(), left(), move(), cx::top(), and top().

Referenced by center(), centerVert(), and cxWindowAlignTest().

◆ bottom()

int cx::cxWindow::bottom ( ) const
virtual

◆ bringToBottom()

void cx::cxWindow::bringToBottom ( bool  pRefresh = false)
virtual

Puts the window on the bottom of all other windows.

Parameters
pRefreshWhether to refresh the screen (defaults to false)

References cx::updateWindows().

Referenced by demoPanels().

◆ bringToTop()

void cx::cxWindow::bringToTop ( bool  pRefresh = true)
virtual

Brings the window to the top.

Parameters
pRefreshWhether to refresh the screen (defaults to true)

Reimplemented in cx::cxForm, cx::cxGrid, cx::cxMenuBar, and cx::cxMultiLineInput.

References cx::updateWindows().

Referenced by cx::cxForm::bringToTop(), cx::cxGrid::bringToTop(), cx::cxMenuBar::bringToTop(), cx::cxMultiLineInput::bringToTop(), demoPanels(), and cx::cxScrolledWindow::show().

◆ center()

void cx::cxWindow::center ( bool  pRefresh = true)
virtual

Centers the window on the screen.

Parameters
pRefreshWhether or not to refresh the window (defaults to true)

References alignHoriz(), alignVert(), cx::eHP_CENTER, and cx::eVP_CENTER.

Referenced by CentipedeGame::CentipedeGame(), cxFormAppendPair(), cxGridTest(), cxNotebookTest2(), cxWindowAlignTest(), cxWindowBorderTest(), FlashcardApp::FlashcardApp(), info(), simpleForm1(), and SnakeGame::SnakeGame().

◆ centerCol()

int cx::cxWindow::centerCol ( ) const
virtual

Returns the center column of the window.

Returns
The center column of window

References left(), and right().

Referenced by alignHoriz(), main(), and wInfo().

◆ centerHoriz()

void cx::cxWindow::centerHoriz ( bool  pRefresh = true)
virtual

Centers the window horizontally on the screen.

Parameters
pRefreshWhether or not to refresh the window (defaults to true)

References alignHoriz(), and cx::eHP_CENTER.

◆ centerRow()

int cx::cxWindow::centerRow ( ) const
virtual

Returns the center row of the window.

Returns
The center row of the window

References bottom(), and top().

Referenced by alignVert(), getRowColBasedOn(), main(), and wInfo().

◆ centerVert()

void cx::cxWindow::centerVert ( bool  pRefresh = true)
virtual

Centers the window vertically on the screen.

Parameters
pRefreshWhether or not to refresh the window (defaults to true)

References alignVert(), and cx::eVP_CENTER.

◆ clear()

void cx::cxWindow::clear ( bool  pRefresh = false)
virtual

Clears the text from the window.

Parameters
pRefreshWhether or not to refresh the window after clearing it (defaults to false)

Reimplemented in cx::cxGrid, cx::cxInput, cx::cxLabel, cx::cxMenu, cx::cxMenuBar, cx::cxMultiForm, cx::cxMultiLineInput, and cx::cxPanel.

References setMessage(), and show().

Referenced by cx::cxGrid::clear(), cx::cxLabel::clear(), cx::cxMenuBar::clear(), and cx::cxMultiForm::clear().

◆ clearKeyFunction()

void cx::cxWindow::clearKeyFunction ( int  pKey)
virtual

◆ clearKeyFunctionByPtr() [1/3]

void cx::cxWindow::clearKeyFunctionByPtr ( funcPtr0  pFunction)
virtual

Removes a keypress function pointer.

Parameters
pFunctionA pointer to the function to be removed

References clearKeyFunction(), and mKeyFunctions.

◆ clearKeyFunctionByPtr() [2/3]

void cx::cxWindow::clearKeyFunctionByPtr ( funcPtr2  pFunction)
virtual

Removes a keypress function pointer.

Parameters
pFunctionA pointer to the function to be removed

References clearKeyFunction(), and mKeyFunctions.

◆ clearKeyFunctionByPtr() [3/3]

void cx::cxWindow::clearKeyFunctionByPtr ( funcPtr4  pFunction)
virtual

Removes a keypress function pointer.

Parameters
pFunctionA pointer to the function to be removed

References clearKeyFunction(), and mKeyFunctions.

◆ clearKeyFunctions()

void cx::cxWindow::clearKeyFunctions ( )
virtual

◆ clearMouseFunction()

void cx::cxWindow::clearMouseFunction ( int  pMouseState)
virtual

Removes a function pointer for a mouse event so that it will.

no longer fire a function.

Parameters
pMouseStateThe mouse state for the function to remove

References mMouseFunctions.

Referenced by setMouseFunction(), setMouseFunction(), and setMouseFunction().

◆ clearMouseFunctions()

void cx::cxWindow::clearMouseFunctions ( )
virtual

Clears the list of external functions fired by mouse events.

References mMouseFunctions.

Referenced by ~cxWindow().

◆ clearSpecialChars()

void cx::cxWindow::clearSpecialChars ( )
virtual

Clears the collection of special characters.

References mSpecialCharAttrs, and mSpecialChars.

◆ copyCxWinStuff()

void cx::cxWindow::copyCxWinStuff ( const cxWindow pThatWindow,
bool  pRecreateWin = true 
)
protectedvirtual

◆ cxTypeStr()

string cx::cxWindow::cxTypeStr ( ) const
overridevirtual

Returns the name of the cxWidgets class. This is overridden.

in cxWindow-based classes. This can be used to determine

the type of cxWidgets object that deriving classes derive from

in applications.

Returns
The name of the cxWidgets class.

Reimplemented from cx::cxObject.

Reimplemented in cx::cxButton, cx::cxComboBox, cx::cxDatePicker, cx::cxDialog, cx::cxFileViewer, cx::cxForm, cx::cxFrame, cx::cxGrid, cx::cxInput, cx::cxLabel, cx::cxMenu, cx::cxMenuBar, cx::cxMessageDialog, cx::cxMultiForm, cx::cxMultiLineInput, cx::cxNotebook, cx::cxOpenFileDialog, cx::cxPanel, cx::cxScrolledWindow, and cx::cxSearchPanel.

Referenced by clearKeyFunction(), clearKeyFunctions(), parentIsCxForm(), parentIsCxNotebook(), parentIsCxPanel(), setParent(), showModal(), cx::cxNotebook::showModal(), and ~cxWindow().

◆ disableAttrs()

void cx::cxWindow::disableAttrs ( WINDOW *  pWin,
e_WidgetItems  pItem 
)
protectedvirtual

Disables the attributes for one of the m*Attrs sets for an ncurses window.

If the m*Attrs collection is empty, this will disable the cxBase attributes

instead.

Parameters
pWinA pointer to the ncurses window for which to disable the attributes (will usually be mWindow).
pItemThe item type to retrieve attributes for - see the e_cxWidgetItems enumeration (defined in cxWidgetItems.h).

Reimplemented in cx::cxGrid, cx::cxInput, cx::cxMenu, cx::cxMenuBar, and cx::cxMultiLineInput.

References cx::disableAttrs(), cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, mBorderAttrs, mHotkeyAttrs, mMessageAttrs, mStatusAttrs, and mTitleAttrs.

Referenced by cx::cxGrid::disableAttrs(), cx::cxInput::disableAttrs(), cx::cxMenu::disableAttrs(), cx::cxMenuBar::disableAttrs(), cx::cxScrolledWindow::drawBorder(), drawBorder(), drawMessage(), cx::cxScrolledWindow::drawMessage(), writeText(), and writeWithHighlighting().

◆ doMouseBehavior() [1/2]

void cx::cxWindow::doMouseBehavior ( )
virtual

Triggers the window's mouse event behavior. This method can.

be overridden in deriving classes to deal with mouse behavior.

Reimplemented in cx::cxButton.

Referenced by doMouseBehavior().

◆ doMouseBehavior() [2/2]

void cx::cxWindow::doMouseBehavior ( int  pMouseY,
int  pMouseX 
)
virtual

Triggers the window's mouse event behavior. Also sets the.

member mouse location. In most cases, this method shouldn't

need to be overridden in deriving classes - The other

doMouseBehavior() method (with no parameters) should be

overridden instead, since this method calls that version after

setting the mouse coordinates.

Parameters
pMouseYThe vertical mouse location
pMouseXThe horizontal mouse location

References doMouseBehavior().

◆ draw()

void cx::cxWindow::draw ( )
protectedvirtual

Fills the member ncurses window structure with the current.

window text, but does not actually show it on the screen.

This is useful for optimization purposes.

Reimplemented in CentipedeGame, FlashcardApp, SnakeGame, cx::cxDatePicker, cx::cxGrid, cx::cxLabel, cx::cxMenuBar, and cx::cxOpenFileDialog.

References drawBorder(), drawMessage(), drawSpecialChars(), drawStatus(), drawTitle(), hasBorder(), mDrawMessage, mDrawSpecialChars, mDrawStatus, mDrawTitle, and mWindow.

Referenced by CentipedeGame::draw(), FlashcardApp::draw(), SnakeGame::draw(), cx::cxDatePicker::draw(), cx::cxGrid::draw(), cx::cxLabel::draw(), cx::cxOpenFileDialog::draw(), and show().

◆ drawBorder() [1/3]

void cx::cxWindow::drawBorder ( )
virtual

◆ drawBorder() [2/3]

void cx::cxWindow::drawBorder ( int  pHeight,
int  pWidth 
)
virtual

Draws a box in the window.

Parameters
pHeightThe height of the window.
pWidthThe width of the window.

References drawBorder().

◆ drawBorder() [3/3]

void cx::cxWindow::drawBorder ( int  pRow,
int  pCol,
int  pHeight,
int  pWidth,
bool  pTop = true,
bool  pBottom = true,
bool  pLeft = true,
bool  pRight = true 
)
virtual

Draws the border (based on the border style)

Parameters
pRowThe row of the upper-left corner.
pColThe column of the upper-left corner.
pHeightThe height of the window.
pWidthThe width of the window.
pTopdraw the top border
pBottomdraw the bottom border
pLeftdraw the left border
pRightdraw the right border

References disableAttrs(), cx::eBORDER, cx::eBS_DOUBLE_LINE, cx::eBS_DOUBLE_TOP_SINGLE_SIDES, cx::eBS_SINGLE_LINE, cx::eBS_SINGLE_TOP_DOUBLE_SIDES, cx::eBS_SPACE, enableAttrs(), hasBorder(), mBorderColorPair, mWindow, and cx::cxObject::useColors.

◆ drawMessage()

void cx::cxWindow::drawMessage ( )
virtual

◆ drawSpecialChars()

void cx::cxWindow::drawSpecialChars ( )
virtual

Writes the set of "special" characters to the window.

References mMessageColorPair, mSpecialCharAttrs, mSpecialChars, mWindow, and cx::cxObject::useColors.

Referenced by draw().

◆ drawStatus()

void cx::cxWindow::drawStatus ( )
virtual

◆ drawTitle()

void cx::cxWindow::drawTitle ( )
virtual

◆ dump()

void cx::cxWindow::dump ( std::string &  pResult)
virtual

Returns a string containing all the characters.

contained in this window. The resulting window

dump will be placed into pResult. Note that

each line is separated by a '\n' character.

Parameters
pResultThis string will contain all characters contained in the window.

References bottom(), getStatus(), getTitle(), hasBorder(), mWindow, right(), top(), and width().

◆ enableAttrs()

void cx::cxWindow::enableAttrs ( WINDOW *  pWin,
e_WidgetItems  pItem 
)
protectedvirtual

Enables the attributes for one of the m*Attrs sets for an ncurses window.

If the m*Attrs collection is empty, this will enable the cxBase attributes

instead.

Parameters
pWinA pointer to the ncurses window for which to enable the attributes (will usually be mWindow).
pItemThe item type to retrieve attributes for - see the e_cxWidgetItems enumeration (defined in cxWidgetItems.h).

Reimplemented in cx::cxGrid, cx::cxInput, cx::cxMenu, cx::cxMenuBar, and cx::cxMultiLineInput.

References cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::enableAttrs(), cx::eSTATUS, cx::eTITLE, mBorderAttrs, mHotkeyAttrs, mMessageAttrs, mStatusAttrs, and mTitleAttrs.

Referenced by cx::cxScrolledWindow::drawBorder(), drawBorder(), drawMessage(), cx::cxScrolledWindow::drawMessage(), cx::cxGrid::enableAttrs(), cx::cxInput::enableAttrs(), cx::cxMenu::enableAttrs(), cx::cxMenuBar::enableAttrs(), writeText(), and writeWithHighlighting().

◆ erase()

void cx::cxWindow::erase ( bool  pEraseSubwindows = true)
virtual

Erases the window.

Parameters
pEraseSubwindowsWhether or not to erase the subwindows (defaults to true)

Reimplemented in cx::cxComboBox, cx::cxGrid, cx::cxMenu, cx::cxMenuBar, and cx::cxMultiLineInput.

References mWindow, and cx::updateWindows().

Referenced by cx::cxGrid::erase(), cx::cxMenu::erase(), cx::cxMenuBar::erase(), and cx::cxMultiLineInput::erase().

◆ exitNow()

void cx::cxWindow::exitNow ( )
virtual

This is mainly for deriving classes. It tells the object.

to stop its input loop with a code of cxID_EXIT.

Reimplemented in cx::cxForm, cx::cxGrid, cx::cxMenuBar, cx::cxMultiLineInput, and cx::cxPanel.

References cx::cxID_EXIT, isModal(), and mLeaveNow.

Referenced by cx::cxForm::exitNow(), cx::cxGrid::exitNow(), cx::cxMenuBar::exitNow(), and cx::cxMultiLineInput::exitNow().

◆ freeWindow()

void cx::cxWindow::freeWindow ( )
protected

◆ functionExistsForLastMouseState()

bool cx::cxWindow::functionExistsForLastMouseState ( ) const
virtual

Returns whether an external function pointer exists for the.

the last mouse state captured by the window.

Returns
true if one exists, or false if not

References mMouseFunctions.

Referenced by handleFunctionForLastMouseState().

◆ getAttrs()

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

Returns the set of ncurses attributes for a given item.

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

Reimplemented in cx::cxForm, cx::cxGrid, cx::cxInput, cx::cxMenu, cx::cxMenuBar, and cx::cxMultiLineInput.

References cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, mBorderAttrs, mHotkeyAttrs, mMessageAttrs, mStatusAttrs, and mTitleAttrs.

Referenced by cx::cxForm::getAttrs(), cx::cxGrid::getAttrs(), cx::cxInput::getAttrs(), cx::cxMenu::getAttrs(), cx::cxMenuBar::getAttrs(), and hasAttr().

◆ getBorderStyle()

eBorderStyle cx::cxWindow::getBorderStyle ( ) const

◆ getChangeColorsOnFocus()

bool cx::cxWindow::getChangeColorsOnFocus ( ) const
virtual

Returns whether the window will change.

colors when focus is set.

Returns
Whether or not the window will change colors when focus is set.

◆ getDisableCursorOnShow()

bool cx::cxWindow::getDisableCursorOnShow ( ) const
virtual

Returns whether or not the window will disable.

the cursor when shown.

Returns
Whether or not the window will disable the cursor when shown

◆ getExitKeyListString()

string cx::cxWindow::getExitKeyListString ( ) const
virtual

Returns a string containing a comma-separated list of the.

exit keys for the window.

Returns
A string containing a comma-separated list of the exit keys for the window.

References cx::getKeyStr(), and mExitKeys.

◆ getExitKeys()

map< int, bool > cx::cxWindow::getExitKeys ( ) const
virtual

Returns the keys that will make the window exit is input.

loop.

Returns
A map containing all the keys that will make the window exit its input loop. The boolean for each key specifies whether the onLeave function will be run for that key.

References mExitKeys.

◆ getExitKeyStrings()

void cx::cxWindow::getExitKeyStrings ( std::vector< std::string > &  pKeys) const
virtual

Populates a collection of strings representing the keys.

that will make the window exit its input loop.

Parameters
pKeysA collection that will contain strings representing the keys that will make the window quit its input loop

References cx::getKeyStr(), and mExitKeys.

◆ getExitOnMouseOutside()

bool cx::cxWindow::getExitOnMouseOutside ( ) const
virtual

Returns whether the window exits its modal input loop when.

a mouse click occurs outside the window.

Returns
true if the window exits on outside mouse clicks

Reimplemented in cx::cxInput.

Referenced by cx::cxButton::showModal().

◆ getExtStatusWindow()

cxWindow * cx::cxWindow::getExtStatusWindow ( ) const

Accessor for the external status window pointer.

Returns
The external status window pointer

Referenced by cx::cxForm::copyCxFormStuff(), and cx::cxSearchPanel::copyCxSearchPanelStuff().

◆ getExtTitleWindow()

cxWindow * cx::cxWindow::getExtTitleWindow ( ) const

Accessor for the external title window pointer.

Returns
The external title window pointer

Referenced by cx::cxForm::copyCxFormStuff(), and cx::cxSearchPanel::copyCxSearchPanelStuff().

◆ getFunctionKeys()

void cx::cxWindow::getFunctionKeys ( std::vector< int > &  pKeys) const
virtual

Populates a collection with integers representing the keys.

that are tied to function pointers.

Parameters
pKeysA collection that will contain integers representing the keys that are associated with functions.

References mKeyFunctions.

Referenced by clearKeyFunctions().

◆ getFunctionKeyStrings()

void cx::cxWindow::getFunctionKeyStrings ( std::vector< std::string > &  pKeys) const
virtual

Populates a collection of strings representing the keys.

that are tied to function pointers.

Parameters
pKeysA collection that will contain strings representing the keys that are associated with functions (i.e., F1-F12 for function keys, individual characters representing different keys, etc.).

References cx::getKeyStr(), and mKeyFunctions.

Referenced by getFormKeys().

◆ getHorizMessageAlignment()

eHPosition cx::cxWindow::getHorizMessageAlignment ( ) const

Accessor for the horizontal message text alignment.

Returns
The horizontal message alignment - Can be eHP_CENTER, eHP_LEFT, or eHP_RIGHT

References mHorizMessageAlignment.

Referenced by setExtTitleWindow().

◆ getHorizStatusAlignment()

eHPosition cx::cxWindow::getHorizStatusAlignment ( ) const

Accessor for the horizontal status text alignment.

Returns
The horizontal status alignment - Can be eHP_CENTER, eHP_LEFT, or eHP_RIGHT

References mHorizMessageAlignment, and mHorizStatusAlignment.

◆ getHorizTitleAlignment()

eHPosition cx::cxWindow::getHorizTitleAlignment ( ) const

Accessor for the title text alignment.

Returns
The horizontal title alignment - Can be eHP_CENTER, eHP_LEFT, or eHP_RIGHT

References mHorizMessageAlignment, and mHorizTitleAlignment.

◆ getHotkeyHighlighting()

bool cx::cxWindow::getHotkeyHighlighting ( ) const

Returns whether hotkey attributes are used when writing the message.

Returns
Whether or not hotkey attributes are used when writing the message.

References mHotkeyHighlighting.

Referenced by cx::cxMenu::copyCxMenuStuff(), and cx::cxSearchPanel::copyCxSearchPanelStuff().

◆ getItemColor()

e_cxColors cx::cxWindow::getItemColor ( e_WidgetItems  pItem) const
virtual

◆ getKeyFunction()

shared_ptr< cxFunction > cx::cxWindow::getKeyFunction ( int  pKey) const

Returns a cxFunction pointer for a key.

If the key does not exist in mKeyFunctions, or if the

pointer is not a cxFunction2 pointer (i.e., its cxTypeStr()

doesn't return "cxFunction2"),, this will return nullptr.

Parameters
pKeyThe key to look for in mKeyFunctions
Returns
A cxFunction2 pointer for the key, or nullptr if there is no function for the key.

References mKeyFunctions.

Referenced by getKeyFunctionAsFunction0(), getKeyFunctionAsFunction2(), and getKeyFunctionAsFunction4().

◆ getKeyFunctionAsFunction0()

shared_ptr< cxFunction0 > cx::cxWindow::getKeyFunctionAsFunction0 ( int  pKey) const

Returns a cxFunction pointer for a key, casted to a cxFunction0.

pointer. If the key does not exist in mKeyFunctions, or if the

pointer is not a cxFunction2 pointer (i.e., its cxTypeStr()

doesn't return "cxFunction2"),, this will return nullptr.

Parameters
pKeyThe key to look for in mKeyFunctions
Returns
A cxFunction2 pointer for the key, or nullptr if there is no cxFunction2 for the key.

References getKeyFunction().

◆ getKeyFunctionAsFunction2()

std::shared_ptr< cxFunction2 > cx::cxWindow::getKeyFunctionAsFunction2 ( int  pKey) const

Returns a cxFunction pointer for a key, casted to a cxFunction2.

pointer. If the key does not exist in mKeyFunctions, or if the

pointer is not a cxFunction2 pointer (i.e., its cxTypeStr()

doesn't return "cxFunction2"),, this will return nullptr.

Parameters
pKeyThe key to look for in mKeyFunctions
Returns
A cxFunction2 pointer for the key, or nullptr if there is no cxFunction2 for the key.

References getKeyFunction().

◆ getKeyFunctionAsFunction4()

std::shared_ptr< cxFunction4 > cx::cxWindow::getKeyFunctionAsFunction4 ( int  pKey) const

Returns a cxFunction pointer for a key, casted to a cxFunction4.

pointer. If the key does not exist in mKeyFunctions, or if the

pointer is not a cxFunction4 pointer (i.e., its cxTypeStr()

doesn't return "cxFunction4"),, this will return nullptr.

Parameters
pKeyThe key to look for in mKeyFunctions
Returns
A cxFunction4 pointer for the key, or nullptr if there is no cxFunction4 for the key.

References getKeyFunction().

◆ getLastKey()

int cx::cxWindow::getLastKey ( ) const
virtual

◆ getLastMouseEvtCoords()

void cx::cxWindow::getLastMouseEvtCoords ( int &  pY,
int &  pX 
)
virtual

Returns the coordinates of the last mouse event in the window.

If there has not yet been a mouse event or if the mouse is not

supported by the computer's version of ncurses, this will

return (0, 0).

Parameters
pY(OUT) The vertical coordinate
pX(OUT) The horizontal coordinate

Referenced by SpreadsheetApp::run().

◆ getLeaveNow()

bool cx::cxWindow::getLeaveNow ( ) const

◆ getMessage()

string cx::cxWindow::getMessage ( ) const

Returns the message that appears in the window, concatenating all message lines together.

Returns
The message that appears in the window.

References mMessageLines.

Referenced by cx::cxForm::copyCxFormStuff(), cx::cxSearchPanel::copyCxSearchPanelStuff(), cx::cxScrolledWindow::cxScrolledWindow(), getStatus(), getTitle(), main(), cx::cxScrolledWindow::resize(), setExtStatusWindow(), and setExtTitleWindow().

◆ getMouseState()

int cx::cxWindow::getMouseState ( ) const

Returns the current mouse state as it was last captured by the.

window. If the version of ncurses used when compiling

cxWidgets doesn't support the mouse, this will return 0.

Returns
The mouse state last captured by the window

References mMouseFunctions.

◆ getMouseStateStr()

string cx::cxWindow::getMouseStateStr ( ) const

Returns a string version of the current mouse state as it was.

last captured by the window. If the version of ncurses used

when compiling cxWidgets doesn't support the mouse, this will

return a blank string.

Returns
A string version of the mouse state last captured by the window

References cx::getMouseStateStr().

Referenced by mouseFunction().

◆ getName()

string cx::cxWindow::getName ( ) const

Accessor for the name for this input

Returns
The alternate label for this input

Referenced by sayHello(), and sayHello2().

◆ getOnFocusFunction()

const shared_ptr< cxFunction > & cx::cxWindow::getOnFocusFunction ( ) const
virtual

Accessor for the onFocus function.

Returns
The onFocus function

References mOnFocusFunction.

◆ getOnLeaveFunction()

const shared_ptr< cxFunction > & cx::cxWindow::getOnLeaveFunction ( ) const
virtual

Accessor for the onLeave function.

Returns
The onLeave function

References mOnLeaveFunction.

◆ getParent()

cxWindow * cx::cxWindow::getParent ( ) const
virtual

◆ getQuitKeyListString()

string cx::cxWindow::getQuitKeyListString ( ) const
virtual

Returns a string containing a comma-separated list of the.

quit keys for the window.

Returns
A string containing a comma-separated list of the quit keys for the window.

References cx::getKeyStr(), and mQuitKeys.

◆ getQuitKeys()

map< int, bool > cx::cxWindow::getQuitKeys ( ) const
virtual

Returns the keys that will make the window quit its input.

loop.

Returns
A map containing all the keys that will make the window quit its input loop. The boolean for each key specifies whether the onLeave function will be run for that key.

References mQuitKeys.

◆ getQuitKeyStrings()

void cx::cxWindow::getQuitKeyStrings ( std::vector< std::string > &  pKeys) const
virtual

Populates a collection of strings representing the keys.

that will make the window quit its input loop.

Parameters
pKeysA collection that will contain strings representing the keys that will make the window quit its input loop

References cx::getKeyStr(), and mQuitKeys.

◆ getRect()

void cx::cxWindow::getRect ( int &  pTop,
int &  pLeft,
int &  pBottom,
int &  pRight 
)
virtual

Returns the coordinates of the rectangle defining the window.

Parameters
pTop(OUT) The top row
pLeft(OUT) The left column
pBottom(OUT) The bottom row
pRight(OUT) The right column

References bottom(), left(), right(), and top().

◆ getReturnCode()

long cx::cxWindow::getReturnCode ( ) const
virtual

Returns the return code set by the last call to.

showModal() based on the user's interaction. The

return code is set to cxID_EXIT by default before

the first call to showModal().

Returns
The return code set by the last call to showModal()

Reimplemented in cx::cxMenu.

Referenced by cx::cxMultiLineInput::doInputLoop(), cx::cxMenu::getReturnCode(), cx::cxForm::showModal(), cx::cxMultiForm::showModal(), cx::cxInput::showModal(), cx::cxMultiLineInput::showModal(), cx::cxScrolledWindow::showModal(), cx::cxButton::showModal(), cx::cxComboBox::showModal(), cx::cxGrid::showModal(), cx::cxMessageDialog::showModal(), and cx::cxNotebook::showModal().

◆ getRowColBasedOn()

void cx::cxWindow::getRowColBasedOn ( cxWindow pParentWindow,
eHPosition  pPosition,
const std::string &  pTitle,
const std::string &  pStatus,
const std::string &  pMessage,
int &  pRow,
int &  pCol 
)
protectedvirtual

Figures out how to align text based on a title & message.

Parameters
pParentWindowA pointer to the parent window
pPositionThe horizontal positioning
pTitleThe title text
pStatusThe status text
pMessageThe message text
pRowThe topmost row
pColThe leftmost column

References cx::centerRow(), centerRow(), cx::eHP_CENTER, cx::eHP_LEFT, cx::eHP_RIGHT, hasBorder(), cx::right(), right(), cx::width(), and width().

◆ getShowSelfBeforeSubwins()

bool cx::cxWindow::getShowSelfBeforeSubwins ( ) const
virtual

Returns whether or not the window will show itself before.

showing its subwindows.

Returns
Whether or not the window will show itself before showing its subwindows

Referenced by cx::cxMultiLineInput::show(), cx::cxForm::show(), cx::cxMultiForm::show(), and cx::cxNotebook::show().

◆ getShowSubwinsForward()

bool cx::cxWindow::getShowSubwinsForward ( ) const
virtual

Returns whether or not the subwindows will be shown.

forward (if false, that means the subwindows will

be shown in reverse order).

Returns
Whether or not the subwindows will be shown in forward order

Referenced by cx::cxNotebook::showSubwindows().

◆ getSize()

void cx::cxWindow::getSize ( int &  pHeight,
int &  pWidth 
)
virtual

Returns the height & width of the window.

Parameters
pHeight(OUT) The window's height
pWidth(OUT) The window's width

References height(), and width().

◆ getStatus()

string cx::cxWindow::getStatus ( ) const

Accessor for the status line text.

Returns
The status line from the bottom row of window

References getMessage(), and getStatusString().

Referenced by cx::cxSearchPanel::copyCxSearchPanelStuff(), cx::cxScrolledWindow::cxScrolledWindow(), dump(), cx::cxForm::getName(), main(), cx::cxMenu::resize(), cx::cxScrolledWindow::resize(), resize(), and setMessage().

◆ getStatusString()

string cx::cxWindow::getStatusString ( int  pHPos) const
virtual

Returns the status string set at a given horizontal position.

Will return a blank string if there is no string at the given

horizontal position.

Parameters
pHPosThe horizontal position of the status string. Note that the main status string is at position 1 (not 0) because it is positioned to fit within the borders.
Returns
The status string at that position, or a blank string if there is no string there.

Referenced by getStatus().

◆ getStatusStrings() [1/2]

map< int, string > cx::cxWindow::getStatusStrings ( ) const
virtual

Returns the map of status strings for the window.

The key is the horizontal position in the title line,

and the value is the string at that location.

Returns
The map of status strings for the window

◆ getStatusStrings() [2/2]

virtual void cx::cxWindow::getStatusStrings ( std::map< int, std::string > &  pStatusStrings) const
virtual

Returns the map of status strings for the window (using an.

out parameter rather than the return value). The key is the

horizontal position in the title line, and the value is the

string at that location.

Parameters
pStatusStrings(OUT) This will contain the status strings.

◆ getString()

string cx::cxWindow::getString ( int  pRow,
int  pCol,
int  pNumber 
)

Get the contents of a portion of the window. (for debugging/testing)

Parameters
pRowthe starting row
pColthe starting column
pNumbernumber of characters to get
Returns
the "string" value of the

References cx::getString(), and mWindow.

◆ getTitle()

string cx::cxWindow::getTitle ( ) const
virtual

Accessor for title text - Returns the first string in the.

set of title strings.

Returns
The first string in the set of title strings

References getMessage(), and getTitleString().

Referenced by cx::cxForm::copyCxFormStuff(), cx::cxSearchPanel::copyCxSearchPanelStuff(), cx::cxScrolledWindow::cxScrolledWindow(), dump(), cx::cxForm::getName(), main(), mouseFunction(), onFocusWinForCxPanelGetLastPage(), cx::cxMenu::resize(), cx::cxScrolledWindow::resize(), resize(), and setMessage().

◆ getTitleString()

string cx::cxWindow::getTitleString ( int  pHPos) const
virtual

Returns the title string set at a given horizontal position.

Will return a blank string if there is no title string

at the given horizontal position.

Parameters
pHPosThe horizontal position of the title string. Note that the main title string is at position 1 (not 0) because it is positioned to fit within the borders.
Returns
The title string at that position, or a blank string if there is no string there.

Referenced by getTitle().

◆ getTitleStrings() [1/2]

map< int, string > cx::cxWindow::getTitleStrings ( ) const
virtual

Returns the map of title strings for the window.

The key is the horizontal position in the title line,

and the value is the string at that location.

Returns
The map of title strings for the window

◆ getTitleStrings() [2/2]

virtual void cx::cxWindow::getTitleStrings ( std::map< int, std::string > &  pTitleStrings) const
virtual

Returns the map of title strings for the window (using an.

out parameter rather than the return value). The key is the

horizontal position in the title line, and the value is the

string at that location.

Parameters
pTitleStrings(OUT) This will contain the title strings.

◆ getVerticalMessageAlignment()

eVPosition cx::cxWindow::getVerticalMessageAlignment ( ) const

Accessor for the vertical message text alignment.

Returns
The vertical message alignment - Can be eVP_CENTER, eVP_TOP, or eVP_BOTTOM

References mVerticalMessageAlignment.

◆ handleFunctionForLastKey()

bool cx::cxWindow::handleFunctionForLastKey ( bool *  pFunctionExists = nullptr,
bool *  pRunOnLeaveFunction = nullptr 
)
protectedvirtual

Looks for a function tied to the last keypress and.

runs it, if one exists.

Parameters
pFunctionExistsA pointer to a bool: If non-null, it will store whether or not a function existed for the last keypress. Defaults to nullptr.
pRunOnLeaveFunctionA pointer to a bool: If non-NUL, it will store whether or not to run the onLeave function when the window exits (this is an option for cxFunction).
Returns
Whether or not the input loop should continue

Reimplemented in cx::cxInput, and cx::cxMultiLineInput.

References getLastKey(), and mKeyFunctions.

Referenced by cx::cxForm::doCurrentInput(), cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), and showModal().

◆ handleFunctionForLastMouseState()

bool cx::cxWindow::handleFunctionForLastMouseState ( bool *  pFunctionExists = nullptr,
bool *  pRunOnLeaveFunction = nullptr 
)
protectedvirtual

Looks for a function tied to the last mouse state captured.

by the window and runs it, if one exists.

Parameters
pFunctionExistsA pointer to a bool: If non-null, it will store whether or not a function existed for the last mouse event. Defaults to nullptr.
pRunOnLeaveFunctionA pointer to a bool: If non-NUL, it will store whether or not to run the onLeave function when the window exits (this is an option for cxFunction).
Returns
Whether or not the input loop should continue

References functionExistsForLastMouseState(), and mMouseFunctions.

Referenced by cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxMultiForm::doInputLoop(), showModal(), and cx::cxButton::showModal().

◆ hasAttr()

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

Returns whether an attribute is set for a widget item.

Parameters
pItemThe item type to check (see the e_WidgetItems enumeration)
pAttrThe ncurses attribute to check
Returns
Whether or not the attribute is set for the given widget item.

References getAttrs().

◆ hasBorder()

bool cx::cxWindow::hasBorder ( ) const

◆ hasExitKey()

bool cx::cxWindow::hasExitKey ( int  pKey) const
virtual

Returns whether or not a key exists in the.

set of exit keys for the window.

Parameters
pKeyThe key to look for in the set of exit keys
Returns
Whether or not the key exists in the set of exit keys for the window

References mExitKeys.

Referenced by cx::cxForm::doCurrentInput(), cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxComboBox::doInputLoop(), and cx::cxInput::showModal().

◆ hasFocus()

bool cx::cxWindow::hasFocus ( ) const
virtual

Returns true if window has focus, false otherwise.

Returns
A bool indicating whether or not the window has focus

Reimplemented in cx::cxGrid, cx::cxInput, cx::cxMenuBar, and cx::cxMultiLineInput.

◆ hasKeyFunction()

bool cx::cxWindow::hasKeyFunction ( int  pKey) const
virtual

Returns whether an external function exists for a keypress.

Parameters
pKeyThe key to look for
Returns
Whether or not the window has an external function pointer set up for the key

References mKeyFunctions.

Referenced by addExitKey(), addQuitKey(), clearKeyFunction(), cx::cxMultiLineInput::searchParentFormsForFKey(), setKeyFunction(), setKeyFunction(), and setKeyFunction().

◆ hasMouseFunction()

bool cx::cxWindow::hasMouseFunction ( int  pMouseState) const
virtual

Returns whether an external function exists for a mouse event.

Parameters
pMouseStateA mouse state t o look for
Returns
Whethre or not the window has an external function pointer set up for the mouse event

References mMouseFunctions.

Referenced by setMouseFunction(), setMouseFunction(), and setMouseFunction().

◆ hasQuitKey()

bool cx::cxWindow::hasQuitKey ( int  pKey) const
virtual

Returns whether or not a key exists in the.

set of quit keys for the window.

Parameters
pKeyThe key to look for in the set of quit keys
Returns
Whether or not the key exists in the set of quit keys for the window

References mQuitKeys.

Referenced by cx::cxForm::doCurrentInput(), cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxComboBox::doInputLoop(), and showModal().

◆ height() [1/2]

int cx::cxWindow::height ( ) const
virtual

◆ height() [2/2]

int cx::cxWindow::height ( int  pHeight)
virtual

Changes the height of the window.

Parameters
pHeightThe new height for the window
Returns
The nCurses return/error code as a result of changing the window size

References mWindow, and width().

Referenced by cx::cxSearchPanel::copyCxSearchPanelStuff(), copyCxWinStuff(), cxPanelTest2(), cx::cxScrolledWindow::cxScrolledWindow(), cxWindow(), cx::cxComboBox::height(), main(), cx::cxComboBox::menuHeight(), cx::cxComboBox::toggleMenu(), and wInfo().

◆ hide()

void cx::cxWindow::hide ( bool  pHideSubwindows = true)
virtual

◆ info()

void cx::cxWindow::info ( )

Display information about a window (for debugging/testing)

Returns
information about a window

References addMessageLineBelow(), cx::bottom(), bottom(), center(), hasBorder(), cx::height(), height(), hide(), cx::left(), left(), cx::right(), right(), showModal(), cx::top(), top(), cx::width(), and width().

Referenced by cxWindowAlignTest().

◆ init()

void cx::cxWindow::init ( int  pRow,
int  pCol,
int  pHeight,
int  pWidth,
const std::string &  pTitle,
const std::string &  pMessage,
const std::string &  pStatus,
cxWindow pParentWindow = nullptr,
bool  pResizeVertically = true 
)
protectedvirtual

Initializes the window parameters and sets up the internal.

data members.

Parameters
pRowThe topmost row of the window
pColThe leftmost column of the window
pHeightThe height of the window
pWidthThe width of the window
pTitleThe title to use for the window
pMessageThe message to display inside the window
pStatusThe status text to use
pParentWindowA pointer to the parent cxWindow (defaults to nullptr)
pResizeVerticallyWhether or not to resize vertically so that all the message text shows (defaults to true).

Reimplemented in cx::cxScrolledWindow.

References freeWindow(), cx::getDefaultBorderColor(), cx::getDefaultMessageColor(), cx::getDefaultStatusColor(), cx::getDefaultTitleColor(), hasBorder(), cx::height(), hide(), mHotkeyHighlighting, mMessageLines, mWindow, reCreatePanel(), setBorderColor(), setMessageColor(), setStatus(), setStatusColor(), setTitle(), setTitleColor(), cxStringUtils::SplitStringRegex(), cxStringUtils::toString(), cx::visualStrLen(), and cx::width().

Referenced by cx::cxForm::getName(), cx::cxScrolledWindow::init(), resize(), and setMessage().

◆ isAbove()

bool cx::cxWindow::isAbove ( const cxWindow pThatWindow) const
virtual

Returns whether the window is above another window.

Parameters
pThatWindowThe other window
Returns
True if the window is above pThatWindow; false if the window is below pThatWindow.

Reimplemented in cx::cxMultiLineInput.

Referenced by demoPanels(), cx::cxForm::doCurrentInput(), cx::cxMultiLineInput::isAbove(), cx::cxForm::refreshInput(), cx::cxForm::setInputOption(), and cx::cxForm::showAllInputs().

◆ isBelow()

bool cx::cxWindow::isBelow ( const cxWindow pThatWindow) const
virtual

Returns whether a window is below another window.

Parameters
pThatWindowThe other window
Returns
True if the window is below pThatWindow; false if the window is above pThatWindow.

Reimplemented in cx::cxMultiLineInput.

Referenced by demoPanels(), cx::cxMultiLineInput::isBelow(), and cx::cxMultiForm::showAllSubforms().

◆ isEnabled()

bool cx::cxWindow::isEnabled ( ) const
virtual

◆ isHidden()

bool cx::cxWindow::isHidden ( ) const

Returns whether or not the window is hidden.

Returns
Whether or not the window is hidden.

Referenced by copyCxWinStuff(), cxWindow(), setExtStatusWindow(), setExtTitleWindow(), setStatus(), setTitle(), cx::cxForm::useInputStatus(), and ~cxWindow().

◆ isModal()

bool cx::cxWindow::isModal ( ) const
virtual

Returns whether or not the window is currently.

being shown modally.

Returns
Whether or not the window is currently being shown modally

References mIsModal.

Referenced by cx::cxMultiLineInput::addValidOption(), cx::cxMultiLineInput::addValidOptions(), exitNow(), cx::cxComboBox::menuIsModal(), quitNow(), and cx::cxMenu::setItemTextByReturnCode().

◆ isOnBottom()

bool cx::cxWindow::isOnBottom ( ) const
virtual

Returns whether the window is on the bottom of all other windows.

Returns
True if the window is on the bottom of all other windows, or false if not.

Referenced by demoPanels().

◆ isOnTop()

bool cx::cxWindow::isOnTop ( ) const
virtual

Returns whether the window is on top of all other windows.

Returns
True if the window is on top of all other windows, or false if not.

Referenced by demoPanels(), and show().

◆ keyFunctions_begin()

map< int, shared_ptr< cxFunction > >::iterator cx::cxWindow::keyFunctions_begin ( )

Returns a begin iterator to the map of cxFunction pointers.

The map key is the keypress, and the value is a pointer to

a cxFunction, which calls an external function. The object

pointed to will actually be either a cxFunction2 or a

cxFunction4.

Returns
A begin iterator to the map of key functions

References mKeyFunctions.

◆ keyFunctions_end()

map< int, shared_ptr< cxFunction > >::iterator cx::cxWindow::keyFunctions_end ( )

Returns an end iterator to the map of cxFunction pointers.

The map key is the keypress, and the value is a pointer to

a cxFunction, which calls an external function. The object

pointed to will actually be either a cxFunction2 or a

cxFunction4.

Returns
An end iterator to the map of key functions

References mKeyFunctions.

◆ lastKeyWasMouseEvt()

bool cx::cxWindow::lastKeyWasMouseEvt ( ) const
virtual

Returns whether or not the last keypress was a mouse event.

Returns
Boolean: true if the last keypress was a mouse event, or false if not.

Referenced by cx::cxMenu::itemWasSelected(), cx::cxMultiLineInput::showModal(), and cx::cxComboBox::showModal().

◆ left()

int cx::cxWindow::left ( ) const
virtual

◆ messageWillDraw()

bool cx::cxWindow::messageWillDraw ( ) const

Returns whether the message will draw or not.

Returns
true if the message will draw, or false if not

References mDrawMessage.

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

◆ modalGetsKeypress()

bool cx::cxWindow::modalGetsKeypress ( ) const
virtual

Returns whether or not a call to showModal() will wait for a.

keypress from the user. (Some windows may be set not do wait

for a keypress in some situations).

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

Reimplemented in cx::cxForm, cx::cxGrid, cx::cxInput, cx::cxLabel, cx::cxMenu, cx::cxMenuBar, and cx::cxMultiLineInput.

References isEnabled().

◆ mouseButton1Click()

void cx::cxWindow::mouseButton1Click ( int  pY,
int  pX 
)
virtual

Tells the window that mouse button 1 was clicked at a certain.

location. The window can then react to the correct information

in its doMouseBehavior() function.

Parameters
pYThe vertical mouse location
pXThe horizontal mouse location

References BUTTON1_CLICKED.

◆ mouseButton1Clicked()

bool cx::cxWindow::mouseButton1Clicked ( ) const

Returns whether or not the first mouse button was clicked.

according to the internal mouse data structure.

Returns
true if the first mouse button was clicked, or false if not.

References BUTTON1_CLICKED.

Referenced by cx::cxForm::doInputLoop(), cx::cxMultiForm::doInputLoop(), cx::cxButton::doMouseBehavior(), and cx::cxMenu::itemWasSelected().

◆ mouseButton1DoubleClicked()

bool cx::cxWindow::mouseButton1DoubleClicked ( ) const

Returns whether or not the first mouse button was double-clicked.

according to the internal mouse data structure.

Returns
true if the first mouse button was clicked, or false if not.

References BUTTON1_DOUBLE_CLICKED.

Referenced by cx::cxMenu::itemWasSelected().

◆ mouseButton1Pressed()

bool cx::cxWindow::mouseButton1Pressed ( ) const

Returns whether or not the first mouse button was pressed.

and held down, according to the internal mouse data structure.

NOTE: pressed != clicked

Returns
true if the first mouse button was pressed, or false if not.

References BUTTON1_PRESSED.

Referenced by cx::cxForm::doInputLoop(), and showModal().

◆ mouseButton1Released()

bool cx::cxWindow::mouseButton1Released ( ) const

Returns whether or not the first mouse button was released.

according to the internal mouse data structure.

NOTE: Typically what happens after the user releases the

button after a 'pressed' event.

Returns
true if the first mouse button was pressed, or false if not.

References BUTTON1_RELEASED.

Referenced by cx::cxForm::doInputLoop(), and showModal().

◆ mouseButton2Click()

void cx::cxWindow::mouseButton2Click ( int  pY,
int  pX 
)
virtual

Tells the window that mouse button 2 was clicked at a certain.

location. The window can then react to the correct information

in its doMouseBehavior() function.

Parameters
pYThe vertical mouse location
pXThe horizontal mouse location

References BUTTON2_CLICKED.

◆ mouseButton2Clicked()

bool cx::cxWindow::mouseButton2Clicked ( ) const

Returns whether or not the second mouse button was clicked.

according to the internal mouse data structure.

Returns
true if the second mouse button was clicked, or false if not.

References BUTTON2_CLICKED.

◆ mouseButton2DoubleClicked()

bool cx::cxWindow::mouseButton2DoubleClicked ( ) const

Returns whether or not the second mouse button was double-clicked.

according to the internal mouse data structure.

Returns
true if the second mouse button was clicked, or false if not.

References BUTTON2_DOUBLE_CLICKED.

◆ mouseButton3Click()

void cx::cxWindow::mouseButton3Click ( int  pY,
int  pX 
)
virtual

Tells the window that mouse button 3 was clicked at a certain.

location. The window can then react to the correct information

in its doMouseBehavior() function.

Parameters
pYThe vertical mouse location
pXThe horizontal mouse location

References BUTTON3_CLICKED.

◆ mouseButton3Clicked()

bool cx::cxWindow::mouseButton3Clicked ( ) const

Returns whether or not the second mouse button was clicked.

according to the internal mouse data structure.

Returns
true if the second mouse button was clicked, or false if not.

References BUTTON3_CLICKED.

◆ mouseEvtWasButtonEvt()

bool cx::cxWindow::mouseEvtWasButtonEvt ( ) const

◆ mouseEvtWasInTitle()

bool cx::cxWindow::mouseEvtWasInTitle ( ) const
virtual

Returns whether the current mouse information stored in the.

cxWindow has coordinates within the window's title.

For developers: This is affected by a call to getmouse()

(i.e., getmouse(&mMouse)).

Returns
Whether or not the last mouse event (stored in mMouse) occurred within the window's boundaries (true/false).

Reimplemented in cx::cxNotebook.

References hasBorder(), left(), right(), and top().

Referenced by cx::cxMessageDialog::doInputLoop(), cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), and showModal().

◆ mouseEvtWasInWindow()

bool cx::cxWindow::mouseEvtWasInWindow ( ) const

Returns whether the current mouse information stored in the.

cxWindow has coordinates within the window's boundaries.

For developers: This is affected by a call to getmouse()

(i.e., getmouse(&mMouse)).

Returns
Whether or not the last mouse event (stored in mMouse) occurred within the window's boundaries (true/false).

References bottom(), left(), right(), and top().

Referenced by cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxComboBox::doInputLoop(), cx::cxMultiForm::doInputLoop(), cx::cxButton::doMouseBehavior(), cx::cxMenu::itemWasSelected(), cx::cxMenu::mouseEvtWasInItemArea(), cx::cxMultiLineInput::showModal(), cx::cxButton::showModal(), and cx::cxComboBox::showModal().

◆ move()

bool cx::cxWindow::move ( int  pNewRow,
int  pNewCol,
bool  pRefresh = true 
)
virtual

Changes the window's position, based on a new upper-left corner.

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

Reimplemented in cx::cxComboBox, cx::cxDatePicker, cx::cxForm, cx::cxGrid, cx::cxInput, cx::cxLabel, cx::cxMenu, cx::cxMenuBar, cx::cxMessageDialog, cx::cxMultiForm, cx::cxMultiLineInput, cx::cxNotebook, cx::cxOpenFileDialog, cx::cxPanel, and cx::cxScrolledWindow.

References show().

Referenced by alignHoriz(), alignVert(), demoPanels(), cx::cxDatePicker::move(), cx::cxForm::move(), cx::cxGrid::move(), cx::cxInput::move(), cx::cxLabel::move(), cx::cxMenu::move(), cx::cxMenuBar::move(), cx::cxMessageDialog::move(), cx::cxMultiLineInput::move(), cx::cxOpenFileDialog::move(), cx::cxScrolledWindow::move(), and moveRelative().

◆ moveRelative()

bool cx::cxWindow::moveRelative ( int  pVerticalOffset,
int  pHorizOffset,
bool  pRefresh = true 
)
virtual

Changes the window's position via vertical & horizontal offsets.

Note that this method doesn't need to be overriden in deriving classes,

since it calls move() with the proper values; thus, for moving, it is

only important that move() be overridden in derived classes if anything

special needs to be done when moving the window.

Parameters
pVerticalOffsetThe vertical offset by which to move the window
pHorizOffsetThe horizontal offset by which to move the window
pRefreshWhether or not to refresh the window (defaults to true)
Returns
Whether or not the move succeeded or not (true/false)

References left(), move(), and top().

Referenced by cxWindowMoveRelative(), cx::cxMessageDialog::doInputLoop(), cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), and showModal().

◆ numSubWindows()

unsigned cx::cxWindow::numSubWindows ( )

Returns the number of subwindows in this window.

Returns
An unsigned int representing the number of subwindows

Referenced by testMenu1().

◆ onFocusFunctionEnabled()

bool cx::cxWindow::onFocusFunctionEnabled ( ) const
virtual

Returns whether or not the onFocus function is set to run.

Returns
Whether or nto the onFocus function is set to run

◆ onFocusFunctionIsSet()

bool cx::cxWindow::onFocusFunctionIsSet ( ) const
protected

Returns whether or not the onFocus function is set (if.

mOnFocusFunction is not nullptr and if its function pointer is

set)

Returns
true if the onFocus function is set, or false if not

References mOnFocusFunction.

Referenced by runOnFocusFunction(), cx::cxInput::runOnFocusFunction(), and cx::cxMultiLineInput::runOnFocusFunction().

◆ onLeaveFunctionEnabled()

bool cx::cxWindow::onLeaveFunctionEnabled ( ) const
virtual

Returns whether or not the onLeave function is set to run.

Returns
Whether or nto the onLeave function is set to run

◆ onLeaveFunctionIsSet()

bool cx::cxWindow::onLeaveFunctionIsSet ( ) const
protected

Returns whether or not the onLeave function is set (if.

mOnLeaveFunction is not nullptr and if its function pointer is

set)

Returns
true if the onLeave function is set, or false if not

References mOnLeaveFunction.

Referenced by showModal().

◆ operator=()

cxWindow & cx::cxWindow::operator= ( const cxWindow pThatWindow)

Assignment operator.

Parameters
pThatWindowAnother cxWindow to be copied
Returns
The current window

References copyCxWinStuff().

◆ parentIsCxForm()

bool cx::cxWindow::parentIsCxForm ( ) const
protected

Returns whether or not the parent window, if there is one, is.

a cxForm.

Returns
true if the parent window is a cxForm, or false if not.

References cxTypeStr().

◆ parentIsCxNotebook()

bool cx::cxWindow::parentIsCxNotebook ( ) const
protected

Returns whether or not the parent window, if there is one, is.

a cxNotebook.

Returns
true if the parent window is a cxNotebook, or false if not.

References cxTypeStr().

◆ parentIsCxPanel()

bool cx::cxWindow::parentIsCxPanel ( ) const
protected

Returns whether or not the parent window, if there is one, is.

a cxPanel.

Returns
true if the parent window is a cxPanel, or false if not.

References cxTypeStr().

Referenced by cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxMultiForm::doInputLoop(), showModal(), and cx::cxButton::showModal().

◆ pointIsInTitle()

bool cx::cxWindow::pointIsInTitle ( int  pY,
int  pX 
) const
virtual

Returns whether a screen location is in the title of the window.

Parameters
pYA vertical character position
pXA horizontal character position
Returns
true if the coordinate is in the title of a window, or false if not.

References hasBorder(), left(), right(), and top().

◆ pointIsInWindow()

bool cx::cxWindow::pointIsInWindow ( int  pY,
int  pX 
) const
virtual

Returns whether a screen location is in the window (including.

the borders).

Parameters
pYA vertical character position
pXA horizontal character position
Returns
true if the coordinate is in the window, or false if not.

References bottom(), left(), right(), and top().

Referenced by cx::cxForm::doInputLoop(), cx::cxMultiLineInput::showModal(), showModal(), and cx::cxComboBox::showModal().

◆ quitNow()

void cx::cxWindow::quitNow ( )
virtual

This is mainly for deriving classes. This causes the object.

to stop its input loop with a code of cxID_QUIT.

Reimplemented in cx::cxForm, cx::cxGrid, cx::cxMenuBar, cx::cxMultiLineInput, and cx::cxPanel.

References cx::cxID_QUIT, isModal(), and mLeaveNow.

Referenced by cx::cxForm::quitNow(), cx::cxGrid::quitNow(), cx::cxMenuBar::quitNow(), and cx::cxMultiLineInput::quitNow().

◆ reCreatePanel()

void cx::cxWindow::reCreatePanel ( )
protectedvirtual

Creates mPanel (by calling new_panel()), then sets up.

the panel's user pointer to point to the cxWindow. The

panel's user pointer needs to point to the cxWindow in

order for isAbove() and isBelow() to work properly. So,

in any derived classes, if you need to re-create the

panel, this function should be used.

References mWindow.

Referenced by copyCxWinStuff(), cxWindow(), init(), and cx::cxMenu::resize().

◆ removeAllSubwindows()

void cx::cxWindow::removeAllSubwindows ( )
protectedvirtual

Removes all subwindow pointers.

◆ removeAttr()

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

◆ removeAttrs()

void cx::cxWindow::removeAttrs ( e_WidgetItems  pItem)
virtual

◆ removeExitKey()

void cx::cxWindow::removeExitKey ( int  pKey)
virtual

◆ removeExitKeys()

void cx::cxWindow::removeExitKeys ( )
virtual

Removes all exit keys.

References mExitKeys.

◆ removeMessageLine()

void cx::cxWindow::removeMessageLine ( unsigned  pIndex)
virtual

Removes a line from the text inside the window (by index).

Parameters
pIndexThe index of the line to remove

References mMessageLines.

Referenced by addMessageLine().

◆ removeQuitKey()

void cx::cxWindow::removeQuitKey ( int  pKey)
virtual

◆ removeQuitKeys()

void cx::cxWindow::removeQuitKeys ( )
virtual

Removes all quit keys.

References mQuitKeys.

◆ removeSpecialChar()

void cx::cxWindow::removeSpecialChar ( int  pY,
int  pX 
)
virtual

Removes a character from the set of special characters (by.

location).

Parameters
pYVertical position of the character
pXHorizontal position of the character

References mSpecialCharAttrs, and mSpecialChars.

◆ removeStatusString()

void cx::cxWindow::removeStatusString ( int  pHPos)
virtual

Removes a status string at a given horizontal position.

Parameters
pHPosThe horizontal position of the status string to remove

◆ removeStatusStrings()

void cx::cxWindow::removeStatusStrings ( )
virtual

Removes all status strings.

◆ removeSubWindow()

void cx::cxWindow::removeSubWindow ( const cxWindow pSubWindow)
protectedvirtual

Removes a window from the subwindow list.

Parameters
pSubWindowA pointer to the window to remove

Referenced by setParent(), and ~cxWindow().

◆ removeTitleString()

void cx::cxWindow::removeTitleString ( int  pHPos)
virtual

Removes a title string at a given horizontal position.

Parameters
pHPosThe horizontal position of the title string to remove

◆ removeTitleStrings()

void cx::cxWindow::removeTitleStrings ( )
virtual

Removes all title strings.

◆ resize()

void cx::cxWindow::resize ( int  pNewHeight,
int  pNewWidth,
bool  pRefresh = true 
)
virtual

Changes the window's width and height. The window's upper-left.

coordinate stays the same.

Parameters
pNewHeightThe new height
pNewWidthThe new width
pRefreshWhether or not to refresh the window (defaults to true)

Reimplemented in cx::cxMenu, cx::cxScrolledWindow, cx::cxComboBox, cx::cxGrid, cx::cxInput, cx::cxLabel, cx::cxMenuBar, cx::cxMultiLineInput, and cx::cxSearchPanel.

References getStatus(), getTitle(), cx::height(), height(), init(), left(), show(), top(), cx::width(), and width().

Referenced by cx::cxMessageDialog::cxMessageDialog(), cx::cxScrolledWindow::resize(), cx::cxGrid::resize(), cx::cxInput::resize(), cx::cxLabel::resize(), cx::cxMenuBar::resize(), cx::cxMultiLineInput::resize(), cx::cxSearchPanel::resize(), and cx::cxMultiLineInput::setBorderStyle().

◆ right()

int cx::cxWindow::right ( ) const
virtual

◆ runOnFocusFunction()

bool cx::cxWindow::runOnFocusFunction ( std::string *  pFunctionRetval = nullptr)
virtual

Runs the onFocus function, if it's set.

Parameters
pFunctionRetvalIf not nullptr, the string that this points to will contain the return value of the onFocus function. Defaults to nullptr.
Returns
Whether the input loop should exit (returns the value of the onFocus function's mExitAfterRun, or false if the onFocus function isn't set).

Reimplemented in cx::cxInput, and cx::cxMultiLineInput.

References mOnFocusFunction, and onFocusFunctionIsSet().

Referenced by cx::cxMultiForm::doInputLoop(), cx::cxForm::showModal(), cx::cxMultiForm::showModal(), cx::cxScrolledWindow::showModal(), showModal(), cx::cxButton::showModal(), cx::cxDatePicker::showModal(), cx::cxGrid::showModal(), cx::cxMenu::showModal(), cx::cxMessageDialog::showModal(), cx::cxNotebook::showModal(), and cx::cxOpenFileDialog::showModal().

◆ runOnLeaveFunction()

bool cx::cxWindow::runOnLeaveFunction ( std::string *  pFunctionRetval = nullptr)
virtual

Runs the onLeave function, if it's set. However, if the last.

keypress is in mExitKeys or mQuitKeys and the boolean for that

key is false, the onLeave function won't be run.

Parameters
pFunctionRetvalIf not nullptr, the string that this points to will contain the return value of the onLeave function. Defaults to nullptr.
Returns
Whether the input loop should exit (returns the value of the onLeave function's mExitAfterRun, or false if the onLeave function isn't set).

References getLastKey(), mExitKeys, mKeyFunctions, mOnLeaveFunction, and mQuitKeys.

Referenced by cx::cxForm::showModal(), cx::cxMultiForm::showModal(), cx::cxInput::showModal(), cx::cxMultiLineInput::showModal(), cx::cxScrolledWindow::showModal(), cx::cxComboBox::showModal(), cx::cxDatePicker::showModal(), cx::cxGrid::showModal(), cx::cxMenu::showModal(), cx::cxMessageDialog::showModal(), cx::cxNotebook::showModal(), and cx::cxOpenFileDialog::showModal().

◆ setAttr()

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

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

Reimplemented in cx::cxForm, cx::cxGrid, cx::cxInput, cx::cxMenu, cx::cxMenuBar, and cx::cxMultiLineInput.

References cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, mBorderAttrs, mHotkeyAttrs, mMessageAttrs, mStatusAttrs, and mTitleAttrs.

Referenced by attributesSetter(), cxWindowAttributesTest(), cx::cxForm::setAttr(), cx::cxGrid::setAttr(), cx::cxInput::setAttr(), cx::cxMenu::setAttr(), cx::cxMenuBar::setAttr(), and setBorderColor().

◆ setBorderColor()

void cx::cxWindow::setBorderColor ( e_cxColors  pColor)
virtual

Sets the color of the window border.

Parameters
pColorA cxWidgets color - See cxColors.h

References cx::eBORDER, mBorderColorPair, setAttr(), and setElementColor().

Referenced by init(), and setColor().

◆ setBorderStyle()

void cx::cxWindow::setBorderStyle ( eBorderStyle  pBorderStyle)
virtual

Sets the border style.

Parameters
pBorderStyleA eBorderStyle enumeration value (defined in cxBorderStyles.h):
eBS_NOBORDER: No border
eBS_SINGLE_LINE: Single line
eBS_DOUBLE_LINE: Double line (only supported on terminals that support high ASCII/Codepage 437)
eBS_SPACE: Spaces

Reimplemented in cx::cxGrid, cx::cxInput, cx::cxMenu, cx::cxMenuBar, and cx::cxMultiLineInput.

Referenced by cx::cxForm::copyCxFormStuff(), cx::cxSearchPanel::copyCxSearchPanelStuff(), cx::cxGrid::setBorderStyle(), cx::cxInput::setBorderStyle(), cx::cxMenu::setBorderStyle(), cx::cxMenuBar::setBorderStyle(), and cx::cxMultiLineInput::setBorderStyle().

◆ setChangeColorsOnFocus()

void cx::cxWindow::setChangeColorsOnFocus ( bool  pChangeColorsOnFocus)
virtual

Sets whether colors should change when focus.

is set via showModal() (to visually show

that focus is set). The default behavior is

false.

Parameters
pChangeColorsOnFocusWhether or not the window's colors should change when focus is set.

◆ setColor()

void cx::cxWindow::setColor ( e_WidgetItems  pItem,
e_cxColors  pColor 
)
virtual

Sets the color of one of the window items.

Parameters
pItemThe item to set the color of (see the e_WidgetItems enumeration in cxWidgetItems.h).
pColorThe color to set the item to (see the e_cxColors enumeration in cxColors.h)

Reimplemented in cx::cxForm, cx::cxGrid, cx::cxInput, cx::cxMenuBar, cx::cxMultiLineInput, and cx::cxPanel.

References cx::eBORDER, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, setBorderColor(), setMessageColor(), setStatusColor(), and setTitleColor().

Referenced by cx::cxForm::setColor(), cx::cxGrid::setColor(), cx::cxInput::setColor(), and cx::cxMenuBar::setColor().

◆ setDisableCursorOnShow()

void cx::cxWindow::setDisableCursorOnShow ( bool  pDisableCursorOnShow)
virtual

Sets whether the window should disable the cursor.

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

Parameters
pDisableCursorOnShowWhether or not to disable the cursor when shown

Reimplemented in cx::cxForm, cx::cxGrid, cx::cxMenuBar, cx::cxMultiForm, and cx::cxMultiLineInput.

Referenced by cx::cxForm::setDisableCursorOnShow(), cx::cxGrid::setDisableCursorOnShow(), cx::cxMenuBar::setDisableCursorOnShow(), and cx::cxMultiLineInput::setDisableCursorOnShow().

◆ setElementColor()

void cx::cxWindow::setElementColor ( short &  pColorPair,
attr_t &  pElementAttr,
e_cxColors  pColor 
)
protectedvirtual

Sets the color (and attribute, if necessary) of a color element.

Parameters
pColorPair(OUT) This will be set to the correct ncurses color pair to use.
pElementAttr(OUT) This will be set to the correct ncurses element to use.
pColorThe color to set - See the e_cxColors enumeration (defined in cxColors.h)

References cx::colorIsBright().

Referenced by setBorderColor(), setMessageColor(), setStatusColor(), setTitleColor(), and cx::cxInput::setValueColor().

◆ setEnabled()

void cx::cxWindow::setEnabled ( bool  pEnabled)
virtual

Enables or disables the window. If the window is.

disabled, it won't show or process input (it will

remain hidden, even after a call to show() or

unhide()). Note that if you are deriving a class

from cxWindow, the 'enabled'-ness should be

honored if the class has any methods that process

user input (i.e., showModal() or setFocus()).

Parameters
pEnabledWhether the window should be enabled or not (true/false)

Reimplemented in cx::cxForm, cx::cxGrid, cx::cxMenuBar, cx::cxMultiForm, cx::cxMultiLineInput, cx::cxNotebook, and cx::cxPanel.

References hide().

Referenced by cx::cxForm::setEnabled(), cx::cxGrid::setEnabled(), cx::cxMenuBar::setEnabled(), cx::cxMultiLineInput::setEnabled(), and cx::cxComboBox::toggleMenu().

◆ setExitOnMouseOutside()

void cx::cxWindow::setExitOnMouseOutside ( bool  pExitOnMouseOutside)
virtual

Sets whether the window should exit its modal input loop.

when a mouse click occurs outside the window. Useful for

container widgets like cxGrid that manage focus across

multiple child widgets.

Parameters
pExitOnMouseOutsideWhether to exit on outside mouse clicks

Reimplemented in cx::cxInput.

◆ setExtStatusWindow()

void cx::cxWindow::setExtStatusWindow ( cxWindow pWindow,
bool  pRefreshStatus = true 
)

Sets an external cxWindow object to be used for status, rather.

than the status line of the window.

Parameters
pWindowA pointer to the external window to use for status.
pRefreshStatusWhether or not to refresh the status (defsults to true)

References drawStatus(), cx::eBS_NOBORDER, getBorderStyle(), getMessage(), isHidden(), setMessage(), setStatus(), show(), and width().

Referenced by cx::cxForm::copyCxFormStuff(), cx::cxSearchPanel::copyCxSearchPanelStuff(), and externalStatusWindow().

◆ setExtTitleWindow()

void cx::cxWindow::setExtTitleWindow ( cxWindow pWindow,
bool  pRefreshTitle = true 
)

Sets an external cxWindow object to be used for the title, rather.

than the title line of the window.

Parameters
pWindowA pointer to the external window to use for the title.
pRefreshTitleWhether or not to refresh the title (defsults to true)

References drawTitle(), cx::eBS_NOBORDER, getBorderStyle(), getHorizMessageAlignment(), getMessage(), isHidden(), mHorizTitleAlignment, setMessage(), setTitle(), show(), and width().

Referenced by cx::cxForm::copyCxFormStuff(), cx::cxSearchPanel::copyCxSearchPanelStuff(), and externalTitleWindow().

◆ setFocus()

long cx::cxWindow::setFocus ( bool  pShowSelf = true,
bool  pBringToTop = true,
bool  pShowSubwindows = true 
)
virtual

Alias for showModal()

Parameters
pShowSelfWhether or not to show the window before running the input loop. Defaults to true.
pBringToTopWhether or not to bring the window to the top. Defaults to true.
pShowSubwindowsWhether or not to show sub-windows also. Defaults to true.
Returns
See showModal()

Reimplemented in cx::cxMessageDialog.

References showModal().

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

◆ setFocusColors() [1/2]

void cx::cxWindow::setFocusColors ( )
virtual

Turns on the ncurses attribute A_REVERSE for the window to.

make things stand out.

References addAttr(), and cx::eMESSAGE.

Referenced by showModal().

◆ setFocusColors() [2/2]

void cx::cxWindow::setFocusColors ( attr_t  pAttr)
virtual

Turns on the ncurses attribute pAttr for the window to.

make things stand out.

References addAttr(), and cx::eMESSAGE.

◆ setFocusFunctions()

void cx::cxWindow::setFocusFunctions ( const cxWindow pWindow)
protected

Re-sets the onFocus and onLeave functions from another.

cxWindow. This is a helper for copying windows.

Parameters
pWindowAnother cxWindow

References mOnFocusFunction, mOnLeaveFunction, setOnFocusFunction(), and setOnLeaveFunction().

Referenced by copyCxWinStuff().

◆ setHorizMessageAlignment()

void cx::cxWindow::setHorizMessageAlignment ( eHPosition  pHAlignment)

Sets the horizontal alignment of the message text.

Parameters
pHAlignmentThe horizontal alignment - Can be eHP_CENTER, eHP_LEFT, or eHP_RIGHT

References mHorizMessageAlignment.

Referenced by FlashcardApp::FlashcardApp(), setHorizStatusAlignment(), and setHorizTitleAlignment().

◆ setHorizStatusAlignment()

void cx::cxWindow::setHorizStatusAlignment ( eHPosition  pHAlignment)

Sets the horizontal alignment of the status text.

Parameters
pHAlignmentThe horizontal alignment - Can be eHP_CENTER, eHP_LEFT, or eHP_RIGHT

References mHorizStatusAlignment, and setHorizMessageAlignment().

Referenced by statusAlignment().

◆ setHorizTitleAlignment()

void cx::cxWindow::setHorizTitleAlignment ( eHPosition  pHAlignment)

Sets the horizontal alignment of the title text.

Note: This may be deprecated due to cxWindow's

more recent feature of being able to set strings

to display at different points in the titlebar.

Parameters
pHAlignmentThe horizontal alignment - Can be eHP_CENTER, eHP_LEFT, or eHP_RIGHT

References mHorizTitleAlignment, and setHorizMessageAlignment().

Referenced by cxMenuAssignment(), and titleAlignment().

◆ setHotkeyHighlighting()

void cx::cxWindow::setHotkeyHighlighting ( bool  pHotkeyHighlighting)
virtual

Enables/disables the use of hotkey attributes when writing the message.

If true, wherever there's an ampersand (&) before a character in

the message, that character will be underlined. Otherwise, the

message will be written verbatim.

Parameters
pHotkeyHighlightingWhether or not to use hotkey attributes when writing the message.

Reimplemented in cx::cxMenu.

References mHotkeyHighlighting.

Referenced by cx::cxSearchPanel::copyCxSearchPanelStuff().

◆ setKeyFunction() [1/4]

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

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

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

Reimplemented in cx::cxForm, cx::cxGrid, cx::cxMenuBar, cx::cxMultiLineInput, and cx::cxPanel.

Referenced by cxMenuNoMoreSelectableItemsWhileModal(), cxWindowWithFunctionKeys(), cx::cxGrid::setKeyFunction(), cx::cxMenuBar::setKeyFunction(), cx::cxForm::setKeyFunction(), cx::cxMultiLineInput::setKeyFunction(), cx::cxForm::setKeyFunction(), cx::cxMultiLineInput::setKeyFunction(), cx::cxForm::setKeyFunction(), cx::cxMultiLineInput::setKeyFunction(), setKeyFunctions(), and windowFunctionKeyNoOnLeave().

◆ setKeyFunction() [2/4]

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

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

one uses a function that takes no parameters and returns

a string, as in the following signature:

string someFunc()

Parameters
pKeyThe key to use for the function
pFunctionThe function to call
pUseReturnValWhether or not to use the function's return value (not used by cxWindow, but could be useful for deriving classes).
pExitAfterRunWhether or not to exit the input loop after the function is run (not used by cxWindow, but could be useful for deriving classes).
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
Returns
True if the key & function was added or false if not

Reimplemented in cx::cxForm, cx::cxMultiForm, cx::cxPanel, and cx::cxMultiLineInput.

References clearKeyFunction(), hasKeyFunction(), mKeyFunctions, removeExitKey(), and removeQuitKey().

◆ setKeyFunction() [3/4]

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

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

Parameters
pKeyThe key to use for the function
pFunctionThe function to call
p1The 1st parameter to the function (pointer)
p2The 2nd parameter to the function (pointer)
pUseReturnValWhether or not to use the function's return value (not used by cxWindow, but could be useful for deriving classes).
pExitAfterRunWhether or not to exit the input loop after the function is run (not used by cxWindow, but could be useful for deriving classes).
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
Returns
True if the key & function was added or false if not

Reimplemented in cx::cxForm, cx::cxMultiForm, cx::cxPanel, and cx::cxMultiLineInput.

References clearKeyFunction(), hasKeyFunction(), mKeyFunctions, removeExitKey(), and removeQuitKey().

◆ setKeyFunction() [4/4]

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

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

Parameters
pKeyThe key to use for the function
pFunctionThe function to call
p1The 1st parameter to the function (pointer)
p2The 2nd parameter to the function (pointer)
p3The 3rd parameter to the function (pointer)
p4The 4th parameter to the function (pointer)
pUseReturnValWhether or not to use the function's return value (not used by cxWindow, but could be useful for deriving classes).
pExitAfterRunWhether or not to exit the input loop after the function is run (not used by cxWindow, but could be useful for deriving classes).
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
Returns
True if the key & function was added or false if not

Reimplemented in cx::cxForm, cx::cxMultiForm, cx::cxPanel, and cx::cxMultiLineInput.

References clearKeyFunction(), hasKeyFunction(), mKeyFunctions, removeExitKey(), and removeQuitKey().

◆ setKeyFunctions()

void cx::cxWindow::setKeyFunctions ( const cxWindow pWindow)
protected

Returns whether or not a mouse event location is within.

a window.

Parameters
pMouseThe mouse event object
pTopThe window's top row
pLeftThe window's left side
pBottomThe window's bottom row
pRightThe window's right side
Returns
Whether or not the mouse event is within the given window boundaries (true/false).

Re-sets the key functions from another cxWindow. This is

a helper for copying windows.

Parameters
pWindowAnother cxWindow

References mKeyFunctions, mMouseFunctions, setKeyFunction(), and setMouseFunction().

Referenced by copyCxWinStuff().

◆ setLastKey()

void cx::cxWindow::setLastKey ( int  pLastKey)
virtual

◆ setMessage()

void cx::cxWindow::setMessage ( const std::string &  pMessage)
virtual

◆ setMessageColor()

void cx::cxWindow::setMessageColor ( e_cxColors  pColor)
virtual

Returns the message color.

Parameters
pColorA cxWidgets color - See cxColors.h

References addAttr(), cx::eMESSAGE, mMessageColorPair, and setElementColor().

Referenced by init(), setColor(), and cx::cxInput::setLabelColor().

◆ setMessageLine()

void cx::cxWindow::setMessageLine ( unsigned  pIndex,
const std::string &  pLine 
)
virtual

Modifies one of the lines displayed in the window.

Parameters
pIndexThe index of the line
pLineThe new line text

References mMessageLines.

◆ setMessageLines() [1/3]

virtual void cx::cxWindow::setMessageLines ( const std::deque< std::string > &  pLines)
virtual

Sets the message lines in the window.

Parameters
pLinesA collection of message lines

◆ setMessageLines() [2/3]

virtual void cx::cxWindow::setMessageLines ( const std::list< std::string > &  pLines)
virtual

Sets the message lines in the window.

Parameters
pLinesA collection of message lines

◆ setMessageLines() [3/3]

virtual void cx::cxWindow::setMessageLines ( const std::vector< std::string > &  pLines)
virtual

Sets the message lines in the window.

Parameters
pLinesA collection of message lines

◆ setMouseFunction() [1/4]

virtual bool cx::cxWindow::setMouseFunction ( int  pMouseState,
const std::shared_ptr< cxFunction > &  pFunction 
)
virtual

Sets a function to be called for a certain mouse state.

Parameters
pMouseStateThe mouse state to fire the function. This is a list of mouse states:
BUTTON1_PRESSED Mouse button 1 down
BUTTON1_RELEASED Mouse button 1 up
BUTTON1_CLICKED Mouse button 1 clicked
BUTTON1_DOUBLE_CLICKED Mouse button 1 double clicked
BUTTON1_TRIPLE_CLICKED Mouse button 1 triple clicked
BUTTON2_PRESSED Mouse button 2 down
BUTTON2_RELEASED Mouse button 2 up
BUTTON2_CLICKED Mouse button 2 clicked
BUTTON2_DOUBLE_CLICKED Mouse button 2 double clicked
BUTTON2_TRIPLE_CLICKED Mouse button 2 triple clicked
BUTTON3_PRESSED Mouse button 3 down
BUTTON3_RELEASED Mouse button 3 up
BUTTON3_CLICKED Mouse button 3 clicked
BUTTON3_DOUBLE_CLICKED Mouse button 3 double clicked
BUTTON3_TRIPLE_CLICKED Mouse button 3 triple clicked
BUTTON4_PRESSED Mouse button 4 down
BUTTON4_RELEASED Mouse button 4 up
BUTTON4_CLICKED Mouse button 4 clicked
BUTTON4_DOUBLE_CLICKED Mouse button 4 double clicked
BUTTON4_TRIPLE_CLICKED Mouse button 4 triple clicked
pFunctionThe function to call. This can be an instance of one of the derived cxFunction classes as well.
Returns
True if the key & function was added or false if not

Referenced by cxFormMouseFunctionTest(), cxMenuMouseFunctionTest(), cxWindowMouseFunctionTest(), and setKeyFunctions().

◆ setMouseFunction() [2/4]

bool cx::cxWindow::setMouseFunction ( int  pMouseState,
funcPtr0  pFunction,
bool  pUseReturnVal = false,
bool  pExitAfterRun = false,
bool  pRunOnLeaveFunction = true 
)
virtual

Sets a function to be called for a certain mouse state. This.

one uses a function that takes no parameters and returns a

string.

Parameters
pMouseStateThe mouse state to fire the function. This is a list of mouse states:
BUTTON1_PRESSED Mouse button 1 down
BUTTON1_RELEASED Mouse button 1 up
BUTTON1_CLICKED Mouse button 1 clicked
BUTTON1_DOUBLE_CLICKED Mouse button 1 double clicked
BUTTON1_TRIPLE_CLICKED Mouse button 1 triple clicked
BUTTON2_PRESSED Mouse button 2 down
BUTTON2_RELEASED Mouse button 2 up
BUTTON2_CLICKED Mouse button 2 clicked
BUTTON2_DOUBLE_CLICKED Mouse button 2 double clicked
BUTTON2_TRIPLE_CLICKED Mouse button 2 triple clicked
BUTTON3_PRESSED Mouse button 3 down
BUTTON3_RELEASED Mouse button 3 up
BUTTON3_CLICKED Mouse button 3 clicked
BUTTON3_DOUBLE_CLICKED Mouse button 3 double clicked
BUTTON3_TRIPLE_CLICKED Mouse button 3 triple clicked
BUTTON4_PRESSED Mouse button 4 down
BUTTON4_RELEASED Mouse button 4 up
BUTTON4_CLICKED Mouse button 4 clicked
BUTTON4_DOUBLE_CLICKED Mouse button 4 double clicked
BUTTON4_TRIPLE_CLICKED Mouse button 4 triple clicked
pMouseStateThe mouse state to fire the function
pFunctionThe function to call
p1The 1st parameter to the function (pointer)
p2The 2nd parameter to the function (pointer)
pUseReturnValWhether or not to use the function's return value (not used by cxWindow, but could be useful for deriving classes).
pExitAfterRunWhether or not to exit the input loop after the function is run (not used by cxWindow, but could be useful for deriving classes).
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
Returns
True if the key & function was added or false if not

References clearMouseFunction(), hasMouseFunction(), and mMouseFunctions.

◆ setMouseFunction() [3/4]

bool cx::cxWindow::setMouseFunction ( int  pMouseState,
funcPtr2  pFunction,
void *  p1,
void *  p2,
bool  pUseReturnVal = false,
bool  pExitAfterRun = false,
bool  pRunOnLeaveFunction = true 
)
virtual

Sets a function to be called for a certain mouse state.

Parameters
pMouseStateThe mouse state to fire the function. This is a list of mouse states:
BUTTON1_PRESSED Mouse button 1 down
BUTTON1_RELEASED Mouse button 1 up
BUTTON1_CLICKED Mouse button 1 clicked
BUTTON1_DOUBLE_CLICKED Mouse button 1 double clicked
BUTTON1_TRIPLE_CLICKED Mouse button 1 triple clicked
BUTTON2_PRESSED Mouse button 2 down
BUTTON2_RELEASED Mouse button 2 up
BUTTON2_CLICKED Mouse button 2 clicked
BUTTON2_DOUBLE_CLICKED Mouse button 2 double clicked
BUTTON2_TRIPLE_CLICKED Mouse button 2 triple clicked
BUTTON3_PRESSED Mouse button 3 down
BUTTON3_RELEASED Mouse button 3 up
BUTTON3_CLICKED Mouse button 3 clicked
BUTTON3_DOUBLE_CLICKED Mouse button 3 double clicked
BUTTON3_TRIPLE_CLICKED Mouse button 3 triple clicked
BUTTON4_PRESSED Mouse button 4 down
BUTTON4_RELEASED Mouse button 4 up
BUTTON4_CLICKED Mouse button 4 clicked
BUTTON4_DOUBLE_CLICKED Mouse button 4 double clicked
BUTTON4_TRIPLE_CLICKED Mouse button 4 triple clicked
pMouseStateThe mouse state to fire the function
pFunctionThe function to call
p1The 1st parameter to the function (pointer)
p2The 2nd parameter to the function (pointer)
pUseReturnValWhether or not to use the function's return value (not used by cxWindow, but could be useful for deriving classes).
pExitAfterRunWhether or not to exit the input loop after the function is run (not used by cxWindow, but could be useful for deriving classes).
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
Returns
True if the key & function was added or false if not

References clearMouseFunction(), hasMouseFunction(), and mMouseFunctions.

◆ setMouseFunction() [4/4]

bool cx::cxWindow::setMouseFunction ( int  pMouseState,
funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4,
bool  pUseReturnVal = false,
bool  pExitAfterRun = false,
bool  pRunOnLeaveFunction = true 
)
virtual

Sets a function to be called for a certain mouse state.

Parameters
pMouseStateThe mouse state to fire the function. This is a list of mouse states:
BUTTON1_PRESSED Mouse button 1 down
BUTTON1_RELEASED Mouse button 1 up
BUTTON1_CLICKED Mouse button 1 clicked
BUTTON1_DOUBLE_CLICKED Mouse button 1 double clicked
BUTTON1_TRIPLE_CLICKED Mouse button 1 triple clicked
BUTTON2_PRESSED Mouse button 2 down
BUTTON2_RELEASED Mouse button 2 up
BUTTON2_CLICKED Mouse button 2 clicked
BUTTON2_DOUBLE_CLICKED Mouse button 2 double clicked
BUTTON2_TRIPLE_CLICKED Mouse button 2 triple clicked
BUTTON3_PRESSED Mouse button 3 down
BUTTON3_RELEASED Mouse button 3 up
BUTTON3_CLICKED Mouse button 3 clicked
BUTTON3_DOUBLE_CLICKED Mouse button 3 double clicked
BUTTON3_TRIPLE_CLICKED Mouse button 3 triple clicked
BUTTON4_PRESSED Mouse button 4 down
BUTTON4_RELEASED Mouse button 4 up
BUTTON4_CLICKED Mouse button 4 clicked
BUTTON4_DOUBLE_CLICKED Mouse button 4 double clicked
BUTTON4_TRIPLE_CLICKED Mouse button 4 triple clicked
pFunctionThe function to call
p1The 1st parameter to the function (pointer)
p2The 2nd parameter to the function (pointer)
p3The 3rd parameter to the function (pointer)
p4The 4th parameter to the function (pointer)
pUseReturnValWhether or not to use the function's return value (not used by cxWindow, but could be useful for deriving classes).
pExitAfterRunWhether or not to exit the input loop after the function is run (not used by cxWindow, but could be useful for deriving classes).
pRunOnLeaveFunctionWhether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true.
Returns
True if the key & function was added or false if not

References clearMouseFunction(), hasMouseFunction(), and mMouseFunctions.

◆ setName()

void cx::cxWindow::setName ( const std::string &  pName)
virtual

Sets the name of the window. The name is an alternative means.

of identifying the window.

Parameters
pNameThe new name for the window

Reimplemented in cx::cxPanel.

◆ setOnFocusFunction() [1/4]

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

Sets the window's "on focus" function.

Parameters
pFunctionThe function to be run

Reimplemented in cx::cxForm.

References mOnFocusFunction.

Referenced by cxMenuFocusFunctions(), cxSearchPanelTest(), setFocusFunctions(), cx::cxForm::setOnFocusFunction(), cx::cxForm::setOnFocusFunction(), and cx::cxForm::setOnFocusFunction().

◆ setOnFocusFunction() [2/4]

void cx::cxWindow::setOnFocusFunction ( funcPtr0  pFunction,
bool  pUseVal = false,
bool  pExitAfterRun = false 
)
virtual

Sets the "on focus" function pointer.

The function must have this signature: string func().

Parameters
pFunctionThe function to be run - Must have this signature: string func()
pUseValWhether or not the function's return value should be used. This can be useful in some deriving classes.
pExitAfterRunWhether or not to exit after the function finishes running (defaults to false).

Reimplemented in cx::cxForm.

References mOnFocusFunction.

◆ setOnFocusFunction() [3/4]

void cx::cxWindow::setOnFocusFunction ( funcPtr2  pFunction,
void *  p1,
void *  p2,
bool  pUseVal = false,
bool  pExitAfterRun = false 
)
virtual

Sets the "on focus" function pointer.

The function must have this signature: string func(void*, void*).

Parameters
pFunctionThe function to be run - Must have this signature: string func(void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
pUseValWhether or not the function's return value should be used. This can be useful in some deriving classes.
pExitAfterRunWhether or not to exit after the function finishes running (defaults to false).

Reimplemented in cx::cxForm.

References mOnFocusFunction.

◆ setOnFocusFunction() [4/4]

void cx::cxWindow::setOnFocusFunction ( funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4,
bool  pUseVal = false,
bool  pExitAfterRun = false 
)
virtual

Sets the "on focus" function pointer.

The function must have this signature: string func(void*, void*, void*, void*).

Parameters
pFunctionThe function to be run - Must have this signature: string func(void*, void*, void*, void*)
p1Pointer to the first parameter to be used for the function
p2Pointer to the second parameter to be used for the function
p3Pointer to the 3rd parameter to be used for the function
p4Pointer to the 4th parameter to be used for the function
pUseValWhether or not the function's return value should be used. This can be useful in some deriving classes.
pExitAfterRunWhether or not to exit after the function finishes running (defaults to false).

Reimplemented in cx::cxForm.

References mOnFocusFunction.

◆ setOnLeaveFunction() [1/4]

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

Sets the window's "on leave" function.

Parameters
pFunctionThe function to be run

Reimplemented in cx::cxForm.

References mOnLeaveFunction.

Referenced by cxMenuFocusFunctions(), setFocusFunctions(), cx::cxForm::setOnLeaveFunction(), cx::cxForm::setOnLeaveFunction(), cx::cxForm::setOnLeaveFunction(), and windowFunctionKeyNoOnLeave().

◆ setOnLeaveFunction() [2/4]

void cx::cxWindow::setOnLeaveFunction ( funcPtr0  pFunction)
virtual

Sets the "on focus" function pointer.

The function must have this signature: string func().

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

Reimplemented in cx::cxForm.

References mOnLeaveFunction.

◆ setOnLeaveFunction() [3/4]

void cx::cxWindow::setOnLeaveFunction ( funcPtr2  pFunction,
void *  p1,
void *  p2 
)
virtual

Sets the "on focus" function pointer.

The function must have this signature: string func(void*, void*).

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

Reimplemented in cx::cxForm.

References mOnLeaveFunction.

◆ setOnLeaveFunction() [4/4]

void cx::cxWindow::setOnLeaveFunction ( funcPtr4  pFunction,
void *  p1,
void *  p2,
void *  p3,
void *  p4 
)
virtual

Sets the "on leave" function pointer.

The function must have this signature: string func(void*, void*, void*, void*).

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

Reimplemented in cx::cxForm.

References mOnLeaveFunction.

◆ setParent()

void cx::cxWindow::setParent ( cxWindow pNewParent)

Changes the pointer to the parent window; changes the parent window.

Parameters
pNewParentPointer to the new parent window

References addSubwindow(), cxTypeStr(), cx::cxPanel::mWindows, and removeSubWindow().

◆ setReturnCode()

void cx::cxWindow::setReturnCode ( const long &  pReturnCode)
virtual

◆ setShowSelfBeforeSubwins()

void cx::cxWindow::setShowSelfBeforeSubwins ( bool  pShowSelfBeforeSubwins)
virtual

Sets whether the window will show itself before.

showing its subwindows.

Parameters
pShowSelfBeforeSubwinsIf true, the window will show itself before showing its subwindows. If false, the window will show itself after showing its subwindows.

◆ setShowSubwinsForward()

void cx::cxWindow::setShowSubwinsForward ( bool  pShowSubwinsForward)
virtual

Toggles the order in which subwindows will be shown.

Parameters
pShowSubwinsForwardIf true, the subwindows will be shown in forward order. If false, the subwindows will be shown in reverse order.

◆ setStatus()

void cx::cxWindow::setStatus ( const std::string &  pStatus,
bool  pRefreshStatus = true 
)
virtual

◆ setStatusColor()

void cx::cxWindow::setStatusColor ( e_cxColors  pColor)
virtual

Sets the color of the status line at bottom of window.

Parameters
pColorA cxWidgets color - See cxColors.h

References cx::addAttr(), cx::eSTATUS, mStatusColorPair, and setElementColor().

Referenced by init(), and setColor().

◆ setStatusStrings()

void cx::cxWindow::setStatusStrings ( const std::map< int, std::string > &  pStatusStrings)
virtual

Sets all the status strings via a map of horizontal.

locations and strings.

Parameters
pStatusStringsA map containing the status strings with the horizontal position as the key.

◆ setSubWinMessage() [1/2]

void cx::cxWindow::setSubWinMessage ( const std::string &  pTitle,
const std::string &  pMessage 
)

Sets the message of one of the subwindows (by title).

Parameters
pTitleThe title of the subwindow
pMessageThe new message to set in the subwindow

◆ setSubWinMessage() [2/2]

void cx::cxWindow::setSubWinMessage ( unsigned  pIndex,
const std::string &  pMessage 
)

Sets the message of one of the subwindows (by index).

Parameters
pIndexThe index of the subwindow
pMessageThe new message to set in the subwindow

◆ setTitle()

void cx::cxWindow::setTitle ( const std::string &  pTitle,
bool  pRefreshTitle = true 
)
virtual

Setter for the title text - This sets the first string in the.

set of title strings.

Parameters
pTitleThe new title for the window
pRefreshTitleWhether or not to refresh the title area (defaults to true)

References drawTitle(), cx::eBS_NOBORDER, hasBorder(), isHidden(), setMessage(), show(), width(), and width().

Referenced by CentipedeGame::CentipedeGame(), cx::cxForm::copyCxFormStuff(), cx::cxSearchPanel::copyCxSearchPanelStuff(), cxNotebookTest2(), cxPanelDelAllWindowsTest(), cxPanelTest(), cxWindowAttributesTest(), FlashcardApp::FlashcardApp(), init(), setExtTitleWindow(), SnakeGame::SnakeGame(), and titleAlignment().

◆ setTitleColor()

void cx::cxWindow::setTitleColor ( e_cxColors  pColor)
virtual

Sets the title color.

Parameters
pColorA cxWidgets color - See cxColors.h

References addAttr(), cx::eTITLE, mTitleColorPair, and setElementColor().

Referenced by init(), and setColor().

◆ setTitleStrings()

void cx::cxWindow::setTitleStrings ( const std::map< int, std::string > &  pTitleStrings)
virtual

Sets all the title strings via a map of horizontal.

locations and strings.

Parameters
pTitleStringsA map containing the title strings with the horizontal position as the key.

◆ setVerticalMessageAlignment()

void cx::cxWindow::setVerticalMessageAlignment ( eVPosition  pVAlignment)

Sets the vertical alignment of the message text.

Parameters
pVAlignmentThe vertical alignment - Can be eVP_CENTER, eVP_TOP, or eVP_BOTTOM

References mVerticalMessageAlignment.

Referenced by FlashcardApp::draw(), and FlashcardApp::FlashcardApp().

◆ show()

long cx::cxWindow::show ( bool  pBringToTop = false,
bool  pShowSubwindows = true 
)
virtual

◆ showModal()

long cx::cxWindow::showModal ( bool  pShowSelf = true,
bool  pBringToTop = true,
bool  pShowSubwindows = true 
)
virtual

◆ showSubwindows()

void cx::cxWindow::showSubwindows ( bool  pBringToTop = true,
bool  pShowSubwindows = true 
)
virtual

Shows the subwindows for the window.

Parameters
pBringToTopWhether or not to bring the subwindow to the top. Defaults to true.
pShowSubwindowsWhether or not to show the subwindows for the subwindows. Defaults to true.

Reimplemented in cx::cxNotebook.

Referenced by cx::cxMultiLineInput::show(), and show().

◆ specialCharsWillDraw()

bool cx::cxWindow::specialCharsWillDraw ( ) const

Returns whether the "special" characters will be drawn or.

not. (They are written to the window after everything else

is written.)

Returns
true if the special characters will draw, or false if not

References mDrawSpecialChars.

◆ statusWillDraw()

bool cx::cxWindow::statusWillDraw ( ) const

Returns whether the status line will draw or not.

Returns
true if the status line will draw, or false if not

References mDrawStatus.

◆ subWindows_begin()

cxWindowPtrContainer::const_iterator cx::cxWindow::subWindows_begin ( ) const
protected

Returns a const iterator to the first subwindow.

Returns
A const iterator to the first subwindow.

Referenced by cx::cxNotebook::showSubwindows().

◆ subWindows_end()

cxWindowPtrContainer::const_iterator cx::cxWindow::subWindows_end ( ) const
protected

Returns a const iterator to the one past the last subwindow.

Returns
A const iterator to one past the last subwindow.

Referenced by cx::cxNotebook::showSubwindows().

◆ subWindows_rbegin()

cxWindowPtrContainer::const_reverse_iterator cx::cxWindow::subWindows_rbegin ( ) const
protected

Returns a const reverse begin iterator for the subwindow collection.

Returns
A const reverse begin iterator for the subwindow collection

Referenced by cx::cxNotebook::showSubwindows().

◆ subWindows_rend()

cxWindowPtrContainer::const_reverse_iterator cx::cxWindow::subWindows_rend ( ) const
protected

Returns a const reverse end iterator for the subwindow collection.

Returns
A const reverse end iterator for the subwindow collection

Referenced by cx::cxNotebook::showSubwindows().

◆ titleWillDraw()

bool cx::cxWindow::titleWillDraw ( ) const

Returns whether the title will draw or not.

Returns
true if the title will draw, or false if not

References mDrawTitle.

◆ toggleBorderBottom()

void cx::cxWindow::toggleBorderBottom ( bool  pToggle)
virtual

Sets whether or not to display the bottom border.

(Note: Only applicable if mBorderStyle != eBS_NOBORDER.)

Parameters
pToggleIf true, then the bottom border will be displayed

Referenced by cxWindowBorderTest().

◆ toggleBorderLeft()

void cx::cxWindow::toggleBorderLeft ( bool  pToggle)
virtual

Sets whether or not to display the left border.

(Note: Only applicable if mBorderStyle != eBS_NOBORDER.)

Parameters
pToggleIf true, then the left border will be displayed

Referenced by cxWindowBorderTest().

◆ toggleBorderRight()

void cx::cxWindow::toggleBorderRight ( bool  pToggle)
virtual

Sets whether or not to display the right border.

(Note: Only applicable if mBorderStyle != eBS_NOBORDER.)

Parameters
pToggleIf true, then the right border will be displayed

Referenced by cxWindowBorderTest().

◆ toggleBorderTop()

void cx::cxWindow::toggleBorderTop ( bool  pToggle)
virtual

Sets whether or not to display the top border.

(Note: Only applicable if mBorderStyle != eBS_NOBORDER.)

Parameters
pToggleIf true, then the top border will be displayed

Referenced by cxWindowBorderTest().

◆ toggleMessage()

void cx::cxWindow::toggleMessage ( bool  pDrawMessage)

Sets whether or not to draw the message area (the area within.

the borders)

Parameters
pDrawMessageWhether or not to draw the message area

References mDrawMessage.

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

◆ toggleOnFocusFunction()

void cx::cxWindow::toggleOnFocusFunction ( bool  pRunOnFocus)
virtual

Sets whether or not the onFocus function should run.

Parameters
pRunOnFocusIf true, the onFocus function will run when the window gains focus; if false, it won't run.

◆ toggleOnLeaveFunction()

void cx::cxWindow::toggleOnLeaveFunction ( bool  pRunOnLeave)
virtual

Sets whether or not the onLeave function should run.

Parameters
pRunOnFocusIf true, the onLeave function will run when the window loses focus; if false, it won't run.

◆ toggleSpecialChars()

void cx::cxWindow::toggleSpecialChars ( bool  pDrawSpecialChars)

Sets whether or not to draw the "special" characters (these are.

written to the window after everything else is written).

Parameters
pDrawSpecialCharsWhether or not to draw the "special" characters

References mDrawSpecialChars.

◆ toggleStatus()

void cx::cxWindow::toggleStatus ( bool  pDrawStatus)

Sets whether or not to draw the status line.

Parameters
pDrawStatusWhether or not to draw the status line

References mDrawStatus.

◆ toggleTitle()

void cx::cxWindow::toggleTitle ( bool  pDrawTitle)

Sets whether or not to draw the title.

Parameters
pDrawTitleWhether or not to draw the title

References mDrawTitle.

◆ top()

int cx::cxWindow::top ( ) const
virtual

◆ touchWindow()

void cx::cxWindow::touchWindow ( )
inline

Marks the window's entire content as dirty so that the next.

call to wnoutrefresh() (e.g., via update_panels()) will

re-composite the full window content onto the virtual screen.

Useful when another window's wnoutrefresh() may have

overwritten this window's area in the virtual screen.

References mWindow.

◆ unhide()

void cx::cxWindow::unhide ( bool  pUnhideSubwindows = true)
virtual

◆ unSetFocusColors() [1/2]

void cx::cxWindow::unSetFocusColors ( )
virtual

Disables focus for this window and unhighlights the message.

References cx::eMESSAGE, and removeAttr().

Referenced by showModal().

◆ unSetFocusColors() [2/2]

void cx::cxWindow::unSetFocusColors ( attr_t  pAttr)
virtual

Disables focus for this window and un-highlights the message (using pAttr)

References cx::eMESSAGE, and removeAttr().

◆ width() [1/2]

int cx::cxWindow::width ( ) const
virtual

◆ width() [2/2]

int cx::cxWindow::width ( int  pWidth)
virtual

◆ writeText()

void cx::cxWindow::writeText ( int  pRow,
int  pCol,
const std::string &  pText,
bool  pRefresh = true 
)
virtual

Writes text on the window. Note that the text is not permanant, so.

any subsequent calls to show() or setFocus() will draw over the

text written with this method.

Also, for the text to show up, this method should be called after

a call to show().

Parameters
pRowThe row in the window at which to write the text
pColThe column in the window at which to write the text
pTextThe text to write in the window
pRefreshWhether or not to refresh the window after writing the text

References disableAttrs(), cx::eMESSAGE, enableAttrs(), and mWindow.

Referenced by CentipedeGame::draw(), FlashcardApp::draw(), SnakeGame::draw(), and windowWriteText().

◆ writeWithHighlighting()

void cx::cxWindow::writeWithHighlighting ( WINDOW *  pWindow,
const std::string &  pText,
const int &  pY,
const int &  pStartX,
const int &  pEndX,
int  pNormalTextItem = -1 
)
protectedvirtual

Writes text to an ncurses WINDOW, highlighting any characters.

preceeded by ampersands (&).

Parameters
pWindowA pointer to the ncurses WINDOW object in which to write text
pTextThe text to write
pYThe vertical position of the text
pStartXThe starting horizontal position of the text
pEndXThe ending boundary for text (one location past the last character to be written)
pNormalTextItemA value from the e_WidgetItems enumeration (see cxWidgetItems.h) representing the attributes to use for the normal text. If -1, this won't be used. This was added for situations where an attribute for normal text is also a hotkey attribute (used for highlighted text). In that case, the attribute would be disabled for normal text when it shouldn't.

References disableAttrs(), cx::eHOTKEY, cx::eMESSAGE, enableAttrs(), HOTKEY_CHAR, and mHotkeyHighlighting.

Referenced by drawMessage().

Member Data Documentation

◆ mBorderAttrs

std::set<attr_t> cx::cxWindow::mBorderAttrs
protected

◆ mBorderColorPair

short cx::cxWindow::mBorderColorPair = eGRAY_BLUE
protected

◆ mDrawMessage

bool cx::cxWindow::mDrawMessage = true
protected

◆ mDrawSpecialChars

bool cx::cxWindow::mDrawSpecialChars = true
protected

◆ mDrawStatus

bool cx::cxWindow::mDrawStatus = true
protected

Referenced by draw(), statusWillDraw(), and toggleStatus().

◆ mDrawTitle

bool cx::cxWindow::mDrawTitle = true
protected

Referenced by draw(), titleWillDraw(), and toggleTitle().

◆ mExitKeys

std::map<int, bool> cx::cxWindow::mExitKeys
protected

◆ mHorizMessageAlignment

eHPosition cx::cxWindow::mHorizMessageAlignment = eHP_LEFT
protected

◆ mHorizStatusAlignment

eHPosition cx::cxWindow::mHorizStatusAlignment = eHP_LEFT
protected

◆ mHorizTitleAlignment

eHPosition cx::cxWindow::mHorizTitleAlignment = eHP_LEFT
protected

◆ mHotkeyAttrs

std::set<attr_t> cx::cxWindow::mHotkeyAttrs
protected

◆ mHotkeyHighlighting

bool cx::cxWindow::mHotkeyHighlighting
protected

◆ mIsModal

bool cx::cxWindow::mIsModal = false
protected

◆ mKeyFunctions

std::map<int, std::shared_ptr<cxFunction> > cx::cxWindow::mKeyFunctions
protected

◆ mLeaveNow

bool cx::cxWindow::mLeaveNow = false
protected

◆ mMessageAttrs

std::set<attr_t> cx::cxWindow::mMessageAttrs
protected

◆ mMessageColorPair

short cx::cxWindow::mMessageColorPair = eWHITE_BLUE
protected

◆ mMessageLines

messageLineContainer cx::cxWindow::mMessageLines
protected

◆ mMouseFunctions

std::map<int, std::shared_ptr<cxFunction> > cx::cxWindow::mMouseFunctions
protected

◆ mOnFocusFunction

std::shared_ptr<cxFunction> cx::cxWindow::mOnFocusFunction = nullptr
protected

◆ mOnLeaveFunction

std::shared_ptr<cxFunction> cx::cxWindow::mOnLeaveFunction = nullptr
protected

◆ mQuitKeys

std::map<int, bool> cx::cxWindow::mQuitKeys
protected

◆ mSpecialCharAttrs

std::map<std::pair<int, int>, attr_t> cx::cxWindow::mSpecialCharAttrs
protected

Attributes for the "special" characters (which are added to.

the window after all other stuff is added). The key is a pair

of integers for the location (Y, X), and the value is the

attribute to apply for the special character.

Referenced by addSpecialChar(), clearSpecialChars(), copyCxWinStuff(), drawSpecialChars(), and removeSpecialChar().

◆ mSpecialChars

std::map<std::pair<int, int>, chtype> cx::cxWindow::mSpecialChars
protected

Contains "special" characters which are added to the window.

after all other stuff is added. The key is a pair of

integers for the location (Y, X), and the value is the

character to add at that location.

Referenced by addSpecialChar(), clearSpecialChars(), copyCxWinStuff(), drawSpecialChars(), and removeSpecialChar().

◆ mStatusAttrs

std::set<attr_t> cx::cxWindow::mStatusAttrs
protected

◆ mStatusColorPair

short cx::cxWindow::mStatusColorPair = eBROWN_BLUE
protected

◆ mTitleAttrs

std::set<attr_t> cx::cxWindow::mTitleAttrs
protected

◆ mTitleColorPair

short cx::cxWindow::mTitleColorPair = eGRAY_BLUE
protected

◆ mVerticalMessageAlignment

eVPosition cx::cxWindow::mVerticalMessageAlignment = eVP_TOP
protected

◆ mWindow

WINDOW* cx::cxWindow::mWindow = nullptr
protected

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