|
cxWidgets 1.0
|
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>


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. | |
| cxWindow * | getExtTitleWindow () 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. | |
| cxWindow * | getExtStatusWindow () 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 cxWindow * | getParent () 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. | |
| cxWindow & | operator= (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< cxFunction > | getKeyFunction (int pKey) const |
| Returns a cxFunction pointer for a key. | |
| std::shared_ptr< cxFunction0 > | getKeyFunctionAsFunction0 (int pKey) const |
| Returns a cxFunction pointer for a key, casted to a cxFunction0. | |
| std::shared_ptr< cxFunction2 > | getKeyFunctionAsFunction2 (int pKey) const |
| Returns a cxFunction pointer for a key, casted to a cxFunction2. | |
| std::shared_ptr< cxFunction4 > | getKeyFunctionAsFunction4 (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< cxFunction > | mOnFocusFunction = nullptr |
| std::shared_ptr< cxFunction > | mOnLeaveFunction = 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. | |
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:
|
explicit |
Default constructor.
| pParentWindow | A pointer to the parent window. |
| pRow | The row of the upper-left corner. |
| pCol | The column of the upper-left corner. |
| pHeight | The height of the window. |
| pWidth | The width of the window. |
| pTitle | The window title (appears in the top border). |
| pMessage | The message to appear in the window. |
| pStatus | The status (appears in the bottom border). |
| pBorderStyle | The border style - can be eBS_SINGLE_LINE for a single-line border or eBS_NOBORDER for no border. |
| pExtTitleWindow | A pointer to another cxWindow in which to display the window title. |
| pExtStatusWindow | A pointer to another cxWindow in which to display the status. |
| pHotkeyHighlighting | Whether or not to recognize & use underline characters when displaying the message text. |
| 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.
| pParentWindow | A pointer to the parent window. |
| pRow | The row of the upper-left corner. |
| pCol | The column of the upper-left corner. |
| pTitle | The title to appear at the top of the window. |
| pMessage | The message to appear in the window. |
| pStatus | The status to display on the bottom row of the window. |
| pExtTitleWindow | A pointer to another cxWindow in which to display the window title. |
| pExtStatusWindow | A pointer to another cxWindow to use as an external status window. |
| pHotkeyHighlighting | Whether or not to recognize & use underline characters when displaying the message text. |
| 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.
| pParentWindow | A pointer to the parent window. |
| pTitle | The title to appear at the top of the window. |
| pMessage | The message to appear in the window. |
| pStatus | The status to display on the bottom row of the window. |
| pExtTitleWindow | A pointer to another cxWindow in which to display the window title. |
| pExtStatusWindow | A pointer to another cxWindow to use as an external status window. |
| pHotkeyHighlighting | Whether or not to recognize & use underline characters when displaying the message text. |
| 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.
| pParentWindow | A pointer to the parent window. |
| pTitle | The title to appear at the top of the window. |
| pMessage | The message to appear in the window. |
| pHeight | The height for the window |
| pWidth | The width for the window |
| pStatus | The status to display on the bottom row of the window. |
| pExtTitleWindow | A pointer to another cxWindow in which to display the window title. |
| pExtStatusWindow | A pointer to another cxWindow to use as an external status window. |
| pHotkeyHighlighting | Whether or not to recognize & use underline characters when displaying the message text. |
| 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.
| pParentWindow | A pointer to the parent window. |
| pMessage | The message to appear in the window. |
| pStatus | The status to display on the bottom row of the window. |
| pExtTitleWindow | A pointer to another cxWindow in which to display the window title. |
| pExtStatusWindow | A pointer to another cxWindow to use as an external status window. |
| pHotkeyHighlighting | Whether or not to recognize & use underline characters when displaying the message text. |
| 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.
| pParentWindow | A pointer to the parent window. |
| pMessage | The message to appear in the window. |
| pStatus | The status to display on the bottom row of the window. |
| pHeight | The height for the window |
| pWidth | The width for the window |
| pExtTitleWindow | A pointer to another cxWindow in which to display the window title. |
| pExtStatusWindow | A pointer to another cxWindow to use as an external status window. |
| pHotkeyHighlighting | Whether or not to recognize & use underline characters when displaying the message text. |
| 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.
| pParentWindow | A pointer to the parent window. |
| pMessage | The message to appear in the window. |
| pExtTitleWindow | A pointer to another cxWindow in which to display the window title. |
| pExtStatusWindow | A pointer to another cxWindow to use as an external status window. |
| pHotkeyHighlighting | Whether or not to recognize & use underline characters when displaying the message text. |
| 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.
| pParentWindow | A pointer to the parent window. |
| pHPosition | The horizontal position of the window - eHP_CENTER, eHP_LEFT, or eHP_RIGHT |
| pTitle | The title to appear at the top of the window. |
| pMessage | The message to appear in the window. |
| pStatus | The status to display on the bottom row of the window. |
| pExtTitleWindow | A pointer to another cxWindow in which to display the window title. |
| pExtStatusWindow | A pointer to another cxWindow to use as an external status window. |
| pHotkeyHighlighting | Whether or not to recognize & use underline characters when displaying the message text. |
| cx::cxWindow::cxWindow | ( | const cxWindow & | pThatWindow | ) |
Copy constructor.
| pThatWindow | Another cxWindow object to be copied |
References addSubwindow(), height(), hide(), isHidden(), left(), mWindow, reCreatePanel(), top(), and width().
|
virtual |
Destructor
References clearKeyFunctions(), clearMouseFunctions(), cx::cxInitialized(), cxTypeStr(), freeWindow(), hide(), isHidden(), cx::cxPanel::mWindows, removeSubWindow(), setMessage(), and show().
|
virtual |
Adds an ncurses attribute to use for one of the items in the.
window (see the e_WidgetItems enumeration).
| pItem | The item to add the attribute for (see the e_WidgetItems enumeration). |
| pAttr | The 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().
|
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.
| pKey | The key to add |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits. Defaults to true. |
| pOverride | If true, then the key will be added as an exit key regardless if the key exists as a function key. This defaults to false. |
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().
|
virtual |
Adds a line to the message to be displayed in the window,.
above the current message text.
| pLine | The line to add |
References mMessageLines.
Referenced by cxWindowAddMessageLinesAbove().
|
virtual |
Adds a line to the message to be displayed in the window,.
below the current message text.
| pLine | The line to add |
References mMessageLines.
Referenced by addMessageLine(), info(), and itemSales().
|
virtual |
Adds lines to the message above the current message text.
| pLines | The lines to add |
|
virtual |
Adds lines to the message above the current message text.
| pLines | The lines to add |
|
virtual |
Adds lines to the message above the current message text.
| pLines | The lines to add |
Referenced by cxWindowAddMessageLinesAbove().
|
virtual |
Adds lines to the message below the current message text.
| pLines | The lines to add |
|
virtual |
Adds lines to the message below the current message text.
| pLines | The lines to add |
|
virtual |
Adds lines to the message below the current message text.
| pLines | The lines to add |
|
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.
| pKey | The key to add |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits. Defaults to true. |
| pOverride | If true, then the key will be added as an exit key regardless if the key exists as a function key. This defaults to false. |
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().
|
virtual |
Adds a character to be written somewhere in the window. These.
characters are written after everything else.
| pY | The vertical location in the window |
| pX | The horizontal location in the window |
| pChar | The 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). |
| pAttr | An 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.
|
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.
| pHPos | The horizontal position for the string. This must be within the borders (>= 1 and less than width()). |
| pStr | The string to use in the bottom row |
| pRefreshStatus | Whether or not to refresh the status line (defaults to false) |
References drawStatus(), and width().
Referenced by cx::cxFileViewer::cxFileViewer(), and cxWindowWithMultipleStatusStrings().
|
protectedvirtual |
Adds a subwindow to the window. Subwindows of a.
will be displayed when a window is displayed.
| pSubWindow | A pointer to another cxWindow to be added as a subwindow. |
Referenced by cxWindow(), and setParent().
|
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.
| pHPos | The horizontal position for the string. This must be within the borders (>= 1 and less than width()). |
| pStr | The string to use in the top row |
| pRefreshTitle | Whether or not to refresh the title line (defaults to false) |
References drawTitle(), and width().
Referenced by cxWindowWithMultipleTitleStrings().
|
virtual |
Aligns the window horizontally on the screen.
| pPosition | The alignment (e.g. eHP_CENTER, eHP_LEFT, or eHP_RIGHT) |
| pRefresh | Whether 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().
|
virtual |
Aligns the window vertically on the screen.
| pPosition | The alignment (e.g. eVP_CENTER, eVP_TOP, eVP_BOTTOM) |
| pRefresh | Whether 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().
|
virtual |
Returns the bottom row of the window.
Reimplemented in cx::cxPanel.
References height(), and top().
Referenced by alignVert(), centerRow(), cx::cxMenu::doInputLoop(), dump(), getRect(), info(), main(), cx::cxMenu::mouseEvtWasInItemArea(), mouseEvtWasInWindow(), pointIsInWindow(), cx::cxForm::scrollInputs(), cx::cxMenu::scrollItems(), cx::cxForm::showAllInputs(), testFormPos(), testMenu1(), and wInfo().
|
virtual |
Puts the window on the bottom of all other windows.
| pRefresh | Whether to refresh the screen (defaults to false) |
References cx::updateWindows().
Referenced by demoPanels().
|
virtual |
Brings the window to the top.
| pRefresh | Whether 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().
|
virtual |
Centers the window on the screen.
| pRefresh | Whether 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().
|
virtual |
Returns the center column of the window.
References left(), and right().
Referenced by alignHoriz(), main(), and wInfo().
|
virtual |
Centers the window horizontally on the screen.
| pRefresh | Whether or not to refresh the window (defaults to true) |
References alignHoriz(), and cx::eHP_CENTER.
|
virtual |
Returns the center row of the window.
References bottom(), and top().
Referenced by alignVert(), getRowColBasedOn(), main(), and wInfo().
|
virtual |
Centers the window vertically on the screen.
| pRefresh | Whether or not to refresh the window (defaults to true) |
References alignVert(), and cx::eVP_CENTER.
|
virtual |
Clears the text from the window.
| pRefresh | Whether 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().
|
virtual |
Removes a function pointer for a keypress so that it will no.
longer fire a function.
| pKey | The hotkey for the function to remove |
Reimplemented in cx::cxMultiLineInput, cx::cxForm, cx::cxGrid, cx::cxMenuBar, and cx::cxPanel.
References addExitKey(), cxTypeStr(), hasKeyFunction(), and mKeyFunctions.
Referenced by cx::cxMultiLineInput::clearKeyFunction(), cx::cxForm::clearKeyFunction(), cx::cxGrid::clearKeyFunction(), cx::cxMenuBar::clearKeyFunction(), clearKeyFunctionByPtr(), clearKeyFunctionByPtr(), clearKeyFunctionByPtr(), setKeyFunction(), setKeyFunction(), and setKeyFunction().
|
virtual |
Removes a keypress function pointer.
| pFunction | A pointer to the function to be removed |
References clearKeyFunction(), and mKeyFunctions.
|
virtual |
Removes a keypress function pointer.
| pFunction | A pointer to the function to be removed |
References clearKeyFunction(), and mKeyFunctions.
|
virtual |
Removes a keypress function pointer.
| pFunction | A pointer to the function to be removed |
References clearKeyFunction(), and mKeyFunctions.
|
virtual |
Clears the list of external functions fired by hotkeys.
Reimplemented in cx::cxGrid, cx::cxMenuBar, and cx::cxMultiLineInput.
References addExitKey(), cxTypeStr(), getFunctionKeys(), and mKeyFunctions.
Referenced by cx::cxGrid::clearKeyFunctions(), cx::cxMenuBar::clearKeyFunctions(), cx::cxMultiLineInput::clearKeyFunctions(), and ~cxWindow().
|
virtual |
Removes a function pointer for a mouse event so that it will.
no longer fire a function.
| pMouseState | The mouse state for the function to remove |
References mMouseFunctions.
Referenced by setMouseFunction(), setMouseFunction(), and setMouseFunction().
|
virtual |
Clears the list of external functions fired by mouse events.
References mMouseFunctions.
Referenced by ~cxWindow().
|
virtual |
Clears the collection of special characters.
References mSpecialCharAttrs, and mSpecialChars.
|
protectedvirtual |
Makes a copy of a cxWindow's member variables.
| pThatWindow | A pointer to another cxWindow to copy |
| pRecreateWin | If true (default), this will re-create the mWindow member in the size of the other cxWindow. |
References freeWindow(), height(), hide(), isHidden(), left(), mBorderAttrs, mBorderColorPair, mDrawMessage, mDrawSpecialChars, mExitKeys, mHorizMessageAlignment, mHorizStatusAlignment, mHorizTitleAlignment, mHotkeyAttrs, mHotkeyHighlighting, mIsModal, mLeaveNow, mMessageAttrs, mMessageColorPair, mMessageLines, mQuitKeys, mSpecialCharAttrs, mSpecialChars, mStatusAttrs, mTitleColorPair, mWindow, reCreatePanel(), setFocusFunctions(), setKeyFunctions(), top(), and width().
Referenced by cx::cxFileViewer::copyCxFileViewerStuff(), cx::cxForm::copyCxFormStuff(), cx::cxMenu::copyCxMenuStuff(), cx::cxMultiLineInput::copyCxMultiLineInputStuff(), cx::cxScrolledWindow::copyCxScrolledWindowStuff(), cx::cxSearchPanel::copyCxSearchPanelStuff(), cx::cxForm::cxForm(), cx::cxButton::operator=(), and operator=().
|
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.
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().
|
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.
| pWin | A pointer to the ncurses window for which to disable the attributes (will usually be mWindow). |
| pItem | The 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().
|
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().
|
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.
| pMouseY | The vertical mouse location |
| pMouseX | The horizontal mouse location |
References doMouseBehavior().
|
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().
|
virtual |
Draws a box for the window border.
Reimplemented in cx::cxMenu, and cx::cxScrolledWindow.
References drawBorder(), height(), and width().
Referenced by draw(), drawBorder(), cx::cxMenu::drawBorder(), cx::cxScrolledWindow::drawBorder(), drawBorder(), and cx::cxMultiLineInput::show().
|
virtual |
Draws a box in the window.
| pHeight | The height of the window. |
| pWidth | The width of the window. |
References drawBorder().
|
virtual |
Draws the border (based on the border style)
| pRow | The row of the upper-left corner. |
| pCol | The column of the upper-left corner. |
| pHeight | The height of the window. |
| pWidth | The width of the window. |
| pTop | draw the top border |
| pBottom | draw the bottom border |
| pLeft | draw the left border |
| pRight | draw 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.
|
virtual |
Writes the message text (in the area within the borders)
Reimplemented in cx::cxMenu, and cx::cxScrolledWindow.
References disableAttrs(), cx::eHP_CENTER, cx::eHP_LEFT, cx::eHP_RIGHT, cx::eMESSAGE, enableAttrs(), cx::eVP_BOTTOM, cx::eVP_CENTER, cx::eVP_TOP, hasBorder(), height(), mHorizMessageAlignment, mHotkeyHighlighting, mMessageColorPair, mMessageLines, mVerticalMessageAlignment, mWindow, cx::cxObject::useColors, cx::visualStrLen(), width(), and writeWithHighlighting().
Referenced by draw(), and cx::cxButton::showModal().
|
virtual |
Writes the set of "special" characters to the window.
References mMessageColorPair, mSpecialCharAttrs, mSpecialChars, mWindow, and cx::cxObject::useColors.
Referenced by draw().
|
virtual |
Writes the status line.
References cx::eSTATUS, hasBorder(), height(), mStatusColorPair, mWindow, and show().
Referenced by addStatusString(), cx::cxMenu::doInputLoop(), draw(), setExtStatusWindow(), setStatus(), cx::cxMultiLineInput::show(), and cx::cxScrolledWindow::show().
|
virtual |
Writes the title line.
References cx::eTITLE, hasBorder(), mTitleColorPair, mWindow, and show().
Referenced by addTitleString(), draw(), setExtTitleWindow(), setTitle(), cx::cxMultiLineInput::show(), and cx::cxScrolledWindow::show().
|
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.
| pResult | This string will contain all characters contained in the window. |
References bottom(), getStatus(), getTitle(), hasBorder(), mWindow, right(), top(), and width().
|
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.
| pWin | A pointer to the ncurses window for which to enable the attributes (will usually be mWindow). |
| pItem | The 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().
|
virtual |
Erases the window.
| pEraseSubwindows | Whether 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().
|
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().
|
protected |
Frees the memory used by the ncurses window and.
panel used in the cxWindow object.
References mWindow.
Referenced by cx::cxFileViewer::copyCxFileViewerStuff(), cx::cxForm::copyCxFormStuff(), cx::cxMultiForm::copyCxMultiFormStuff(), cx::cxMultiLineInput::copyCxMultiLineInputStuff(), cx::cxScrolledWindow::copyCxScrolledWindowStuff(), copyCxWinStuff(), init(), cx::cxScrolledWindow::reCreateSubWindow(), cx::cxMenu::resize(), and ~cxWindow().
|
virtual |
Returns whether an external function pointer exists for the.
the last mouse state captured by the window.
References mMouseFunctions.
Referenced by handleFunctionForLastMouseState().
|
virtual |
Returns the set of ncurses attributes for a given item.
| pItem | The item to retrieve attributes for (see the e_WidgetItems enumeration). |
| pAttrs | This 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().
| eBorderStyle cx::cxWindow::getBorderStyle | ( | ) | const |
Returns the border style.
Referenced by cx::cxMenuBar::addMenu(), cx::cxMenu::append(), cx::cxForm::copyCxFormStuff(), cx::cxScrolledWindow::copyCxScrolledWindowStuff(), cx::cxSearchPanel::copyCxSearchPanelStuff(), cx::cxMenu::drawMessage(), hasBorder(), cx::cxComboBox::height(), main(), cx::cxMenu::mouseEvtWasInItemArea(), cx::cxComboBox::move(), cx::cxMultiLineInput::move(), cx::cxScrolledWindow::reCreateSubWindow(), cx::cxMenu::remove(), cx::cxMenu::removeAllItems(), cx::cxMenu::resize(), cx::cxComboBox::resize(), cx::cxMultiLineInput::resize(), cx::cxForm::scrollInputs(), cx::cxInput::setBorderStyle(), cx::cxMenu::setBorderStyle(), cx::cxMultiLineInput::setBorderStyle(), setExtStatusWindow(), setExtTitleWindow(), cx::cxMultiLineInput::show(), cx::cxForm::showAllInputs(), cx::cxForm::showInputsOnBorder(), cx::cxComboBox::toggleMenu(), and cx::cxForm::useInputStatus().
|
virtual |
Returns whether the window will change.
colors when focus is set.
|
virtual |
Returns whether or not the window will disable.
the cursor when shown.
|
virtual |
Returns a string containing a comma-separated list of the.
exit keys for the window.
References cx::getKeyStr(), and mExitKeys.
|
virtual |
Returns the keys that will make the window exit is input.
loop.
References mExitKeys.
|
virtual |
Populates a collection of strings representing the keys.
that will make the window exit its input loop.
| pKeys | A collection that will contain strings representing the keys that will make the window quit its input loop |
References cx::getKeyStr(), and mExitKeys.
|
virtual |
Returns whether the window exits its modal input loop when.
a mouse click occurs outside the window.
Reimplemented in cx::cxInput.
Referenced by cx::cxButton::showModal().
| cxWindow * cx::cxWindow::getExtStatusWindow | ( | ) | const |
Accessor for the external status window pointer.
Referenced by cx::cxForm::copyCxFormStuff(), and cx::cxSearchPanel::copyCxSearchPanelStuff().
| cxWindow * cx::cxWindow::getExtTitleWindow | ( | ) | const |
Accessor for the external title window pointer.
Referenced by cx::cxForm::copyCxFormStuff(), and cx::cxSearchPanel::copyCxSearchPanelStuff().
|
virtual |
Populates a collection with integers representing the keys.
that are tied to function pointers.
| pKeys | A collection that will contain integers representing the keys that are associated with functions. |
References mKeyFunctions.
Referenced by clearKeyFunctions().
|
virtual |
Populates a collection of strings representing the keys.
that are tied to function pointers.
| pKeys | A 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().
| eHPosition cx::cxWindow::getHorizMessageAlignment | ( | ) | const |
Accessor for the horizontal message text alignment.
References mHorizMessageAlignment.
Referenced by setExtTitleWindow().
| eHPosition cx::cxWindow::getHorizStatusAlignment | ( | ) | const |
Accessor for the horizontal status text alignment.
References mHorizMessageAlignment, and mHorizStatusAlignment.
| eHPosition cx::cxWindow::getHorizTitleAlignment | ( | ) | const |
Accessor for the title text alignment.
References mHorizMessageAlignment, and mHorizTitleAlignment.
| bool cx::cxWindow::getHotkeyHighlighting | ( | ) | const |
Returns whether hotkey attributes are used when writing the message.
References mHotkeyHighlighting.
Referenced by cx::cxMenu::copyCxMenuStuff(), and cx::cxSearchPanel::copyCxSearchPanelStuff().
|
virtual |
Returns the color of one of the items in a window.
| pItem | The item type (a member of the e_WidgetItems enumeration
|
Reimplemented in cx::cxGrid, cx::cxInput, and cx::cxMenuBar.
References cx::eBORDER, cx::eBROWN_BLACK, cx::eBROWN_BLUE, cx::eDATA, cx::eDATA_EDITABLE, cx::eDATA_READONLY, cx::eDEFAULT, cx::eGRAY_BLACK, cx::eGRAY_BLUE, cx::eHOTKEY, cx::eLABEL, cx::eMENU_SELECTION, cx::eMESSAGE, cx::eSTATUS, cx::eTITLE, cx::eWHITE_BLACK, cx::eWHITE_BLUE, cx::eYELLOW_BLACK, cx::eYELLOW_BLUE, mBorderAttrs, mBorderColorPair, mHotkeyAttrs, mMessageAttrs, mMessageColorPair, mStatusAttrs, mStatusColorPair, mTitleAttrs, and mTitleColorPair.
Referenced by cx::cxGrid::getItemColor(), cx::cxInput::getItemColor(), and cx::cxMenuBar::getItemColor().
| 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.
| pKey | The key to look for in mKeyFunctions |
References mKeyFunctions.
Referenced by getKeyFunctionAsFunction0(), getKeyFunctionAsFunction2(), and getKeyFunctionAsFunction4().
| 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.
| pKey | The key to look for in mKeyFunctions |
References getKeyFunction().
| 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.
| pKey | The key to look for in mKeyFunctions |
References getKeyFunction().
| 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.
| pKey | The key to look for in mKeyFunctions |
References getKeyFunction().
|
virtual |
Returns the last key pressed by the user (for showModal(), etc.)
Reimplemented in cx::cxMultiForm.
Referenced by cx::cxComboBox::copyCxComboBoxStuff(), cx::cxForm::doCurrentInput(), cx::cxForm::doInputLoop(), cx::cxComboBox::doInputLoop(), cxValidators::floatingPtOnKeyValidator(), formUpArrowFunction(), cx::cxMultiForm::getLastKey(), handleFunctionForLastKey(), cx::cxInput::handleFunctionForLastKey(), cx::cxMultiLineInput::handleFunctionForLastKey(), cxValidators::intOnKeyValidator(), cx::cxMenu::itemWasSelected(), SpreadsheetApp::run(), runOnLeaveFunction(), cx::cxInput::showModal(), cx::cxMultiLineInput::showModal(), showModal(), cx::cxButton::showModal(), and cx::cxComboBox::showModal().
|
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).
| pY | (OUT) The vertical coordinate |
| pX | (OUT) The horizontal coordinate |
Referenced by SpreadsheetApp::run().
| bool cx::cxWindow::getLeaveNow | ( | ) | const |
Returns whether or not something told the window to leave now.
If something called exitNow() or quitNow() on the window, this
would be true.
References mLeaveNow.
Referenced by cx::cxMultiLineInput::doInputLoop(), cx::cxForm::showModal(), cx::cxMultiForm::showModal(), cx::cxInput::showModal(), cx::cxMultiLineInput::showModal(), cx::cxScrolledWindow::showModal(), showModal(), cx::cxButton::showModal(), cx::cxComboBox::showModal(), cx::cxDatePicker::showModal(), cx::cxGrid::showModal(), cx::cxMenu::showModal(), cx::cxMessageDialog::showModal(), cx::cxNotebook::showModal(), and cx::cxOpenFileDialog::showModal().
| string cx::cxWindow::getMessage | ( | ) | const |
Returns the message that appears in the window, concatenating all message lines together.
References mMessageLines.
Referenced by cx::cxForm::copyCxFormStuff(), cx::cxSearchPanel::copyCxSearchPanelStuff(), cx::cxScrolledWindow::cxScrolledWindow(), getStatus(), getTitle(), main(), cx::cxScrolledWindow::resize(), setExtStatusWindow(), and setExtTitleWindow().
| 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.
References mMouseFunctions.
| 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.
References cx::getMouseStateStr().
Referenced by mouseFunction().
| string cx::cxWindow::getName | ( | ) | const |
Accessor for the name for this input
Referenced by sayHello(), and sayHello2().
|
virtual |
|
virtual |
|
virtual |
Returns a pointer to the parent window.
Reimplemented in cx::cxForm, cx::cxGrid, cx::cxInput, cx::cxMenuBar, and cx::cxMultiLineInput.
Referenced by cx::cxForm::getName(), cx::cxForm::getParent(), cx::cxGrid::getParent(), cx::cxInput::getParent(), cx::cxMenuBar::getParent(), cx::cxMultiLineInput::getParent(), cx::cxMultiLineInput::searchParentFormsForFKey(), setMessage(), and cx::cxNotebook::showModal().
|
virtual |
Returns a string containing a comma-separated list of the.
quit keys for the window.
References cx::getKeyStr(), and mQuitKeys.
|
virtual |
Returns the keys that will make the window quit its input.
loop.
References mQuitKeys.
|
virtual |
Populates a collection of strings representing the keys.
that will make the window quit its input loop.
| pKeys | A collection that will contain strings representing the keys that will make the window quit its input loop |
References cx::getKeyStr(), and mQuitKeys.
|
virtual |
|
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().
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().
|
protectedvirtual |
Figures out how to align text based on a title & message.
| pParentWindow | A pointer to the parent window |
| pPosition | The horizontal positioning |
| pTitle | The title text |
| pStatus | The status text |
| pMessage | The message text |
| pRow | The topmost row |
| pCol | The leftmost column |
References cx::centerRow(), centerRow(), cx::eHP_CENTER, cx::eHP_LEFT, cx::eHP_RIGHT, hasBorder(), cx::right(), right(), cx::width(), and width().
|
virtual |
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().
|
virtual |
Returns whether or not the subwindows will be shown.
forward (if false, that means the subwindows will
be shown in reverse order).
Referenced by cx::cxNotebook::showSubwindows().
|
virtual |
| string cx::cxWindow::getStatus | ( | ) | const |
Accessor for the status line text.
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().
|
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.
| pHPos | The 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. |
Referenced by getStatus().
|
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.
|
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.
| pStatusStrings | (OUT) This will contain the status strings. |
| string cx::cxWindow::getString | ( | int | pRow, |
| int | pCol, | ||
| int | pNumber | ||
| ) |
Get the contents of a portion of the window. (for debugging/testing)
| pRow | the starting row |
| pCol | the starting column |
| pNumber | number of characters to get |
References cx::getString(), and mWindow.
|
virtual |
Accessor for title text - 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().
|
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.
| pHPos | The 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. |
Referenced by getTitle().
|
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.
|
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.
| pTitleStrings | (OUT) This will contain the title strings. |
| eVPosition cx::cxWindow::getVerticalMessageAlignment | ( | ) | const |
Accessor for the vertical message text alignment.
References mVerticalMessageAlignment.
|
protectedvirtual |
Looks for a function tied to the last keypress and.
runs it, if one exists.
| pFunctionExists | A pointer to a bool: If non-null, it will store whether or not a function existed for the last keypress. Defaults to nullptr. |
| pRunOnLeaveFunction | A 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). |
Reimplemented in cx::cxInput, and cx::cxMultiLineInput.
References getLastKey(), and mKeyFunctions.
Referenced by cx::cxForm::doCurrentInput(), cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), and showModal().
|
protectedvirtual |
Looks for a function tied to the last mouse state captured.
by the window and runs it, if one exists.
| pFunctionExists | A pointer to a bool: If non-null, it will store whether or not a function existed for the last mouse event. Defaults to nullptr. |
| pRunOnLeaveFunction | A 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). |
References functionExistsForLastMouseState(), and mMouseFunctions.
Referenced by cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxMultiForm::doInputLoop(), showModal(), and cx::cxButton::showModal().
|
virtual |
Returns whether an attribute is set for a widget item.
| pItem | The item type to check (see the e_WidgetItems enumeration) |
| pAttr | The ncurses attribute to check |
References getAttrs().
| bool cx::cxWindow::hasBorder | ( | ) | const |
Does this window have a border?
References cx::eBS_NOBORDER, and getBorderStyle().
Referenced by cx::cxMenu::doInputLoop(), draw(), cx::cxMenu::drawBorder(), cx::cxScrolledWindow::drawBorder(), drawBorder(), drawMessage(), drawStatus(), drawTitle(), dump(), getRowColBasedOn(), info(), init(), mouseEvtWasInTitle(), cx::cxMultiLineInput::move(), pointIsInTitle(), cx::cxInput::resize(), cx::cxInput::setBorderStyle(), cx::cxInput::setCursorX(), cx::cxInput::setLabel(), setStatus(), and setTitle().
|
virtual |
Returns whether or not a key exists in the.
set of exit keys for the window.
| pKey | The key to look for in the set of exit keys |
References mExitKeys.
Referenced by cx::cxForm::doCurrentInput(), cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxComboBox::doInputLoop(), and cx::cxInput::showModal().
|
virtual |
Returns true if window has focus, false otherwise.
Reimplemented in cx::cxGrid, cx::cxInput, cx::cxMenuBar, and cx::cxMultiLineInput.
|
virtual |
Returns whether an external function exists for a keypress.
| pKey | The key to look for |
References mKeyFunctions.
Referenced by addExitKey(), addQuitKey(), clearKeyFunction(), cx::cxMultiLineInput::searchParentFormsForFKey(), setKeyFunction(), setKeyFunction(), and setKeyFunction().
|
virtual |
Returns whether an external function exists for a mouse event.
| pMouseState | A mouse state t o look for |
References mMouseFunctions.
Referenced by setMouseFunction(), setMouseFunction(), and setMouseFunction().
|
virtual |
Returns whether or not a key exists in the.
set of quit keys for the window.
| pKey | The key to look for in the set of quit keys |
References mQuitKeys.
Referenced by cx::cxForm::doCurrentInput(), cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxComboBox::doInputLoop(), and showModal().
|
virtual |
Returns the height of the window.
Reimplemented in cx::cxComboBox.
References mWindow.
Referenced by alignVert(), cx::cxMenu::append(), bottom(), cx::cxMenu::doInputLoop(), CentipedeGame::draw(), FlashcardApp::draw(), SnakeGame::draw(), drawBorder(), cx::cxMenu::drawBorder(), cx::cxScrolledWindow::drawBorder(), drawMessage(), cx::cxMenu::drawMessage(), drawStatus(), cx::cxForm::getName(), getSize(), cx::cxComboBox::height(), info(), cx::cxComboBox::inputHeight(), cx::cxMenu::mouseEvtWasInItemArea(), cx::cxScrolledWindow::reCreateSubWindow(), cx::cxForm::remove(), cx::cxForm::remove(), cx::cxMenu::resize(), resize(), cx::cxMultiLineInput::resize(), CentipedeGame::run(), cx::cxMenu::scrollItems(), cx::cxMultiLineInput::setBorderStyle(), setMessage(), SnakeGame::spawnFood(), CentipedeGame::spawnMushroom(), CentipedeGame::update(), SnakeGame::update(), cx::cxForm::useInputStatus(), and width().
|
virtual |
Changes the height of the window.
| pHeight | The new height for the window |
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().
|
virtual |
Hides the window.
| pHideSubwindows | Whether or not to also hide the subwindows (defaults to true) |
Reimplemented in cx::cxMultiLineInput, cx::cxComboBox, cx::cxDatePicker, cx::cxForm, cx::cxGrid, cx::cxMenuBar, cx::cxMessageDialog, cx::cxMultiForm, cx::cxNotebook, cx::cxOpenFileDialog, and cx::cxPanel.
References cx::updateWindows().
Referenced by attributesSetter(), copyCxWinStuff(), cxFormAppendPair(), cxWindow(), cxWindowSizeTest(), demoPanels(), cx::cxMenu::doInputLoop(), doMenu(), cx::cxMultiLineInput::hide(), cx::cxComboBox::hide(), cx::cxDatePicker::hide(), cx::cxForm::hide(), cx::cxGrid::hide(), cx::cxMenuBar::hide(), cx::cxMessageDialog::hide(), cx::cxOpenFileDialog::hide(), cx::cxComboBox::hideMenu(), info(), init(), itemSales(), cx::cxComboBox::removeAllItemsFromMenu(), setEnabled(), cx::cxInput::show(), show(), cx::cxMenu::show(), cx::cxScrolledWindow::show(), cx::cxComboBox::showModal(), cx::cxComboBox::toggleMenu(), and ~cxWindow().
| void cx::cxWindow::info | ( | ) |
Display information about a window (for debugging/testing)
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().
|
protectedvirtual |
Initializes the window parameters and sets up the internal.
data members.
| pRow | The topmost row of the window |
| pCol | The leftmost column of the window |
| pHeight | The height of the window |
| pWidth | The width of the window |
| pTitle | The title to use for the window |
| pMessage | The message to display inside the window |
| pStatus | The status text to use |
| pParentWindow | A pointer to the parent cxWindow (defaults to nullptr) |
| pResizeVertically | Whether 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().
|
virtual |
Returns whether the window is above another window.
| pThatWindow | The other window |
Reimplemented in cx::cxMultiLineInput.
Referenced by demoPanels(), cx::cxForm::doCurrentInput(), cx::cxMultiLineInput::isAbove(), cx::cxForm::refreshInput(), cx::cxForm::setInputOption(), and cx::cxForm::showAllInputs().
|
virtual |
Returns whether a window is below another window.
| pThatWindow | The other window |
Reimplemented in cx::cxMultiLineInput.
Referenced by demoPanels(), cx::cxMultiLineInput::isBelow(), and cx::cxMultiForm::showAllSubforms().
|
virtual |
Returns whether or not the window is enabled.
Referenced by cx::cxComboBox::doInputLoop(), enableDisableForm(), cx::cxComboBox::height(), cx::cxInput::isEditable(), cx::cxMultiLineInput::isEditable(), cx::cxComboBox::menuIsEnabled(), modalGetsKeypress(), cx::cxForm::modalGetsKeypress(), cx::cxInput::modalGetsKeypress(), cx::cxMenu::modalGetsKeypress(), cx::cxMultiLineInput::modalGetsKeypress(), cx::cxComboBox::resize(), cx::cxInput::show(), cx::cxMultiLineInput::show(), cx::cxForm::show(), cx::cxMultiForm::show(), cx::cxNotebook::show(), cx::cxMenu::show(), cx::cxScrolledWindow::show(), cx::cxForm::showModal(), cx::cxMultiForm::showModal(), cx::cxInput::showModal(), cx::cxMultiLineInput::showModal(), cx::cxScrolledWindow::showModal(), cx::cxButton::showModal(), cx::cxComboBox::showModal(), cx::cxDatePicker::showModal(), cx::cxGrid::showModal(), cx::cxMenu::showModal(), cx::cxMessageDialog::showModal(), cx::cxNotebook::showModal(), cx::cxOpenFileDialog::showModal(), cx::cxMultiForm::subformIsEnabled(), cx::cxComboBox::toggleMenu(), cx::cxMultiLineInput::unhide(), cx::cxComboBox::unhide(), cx::cxDatePicker::unhide(), cx::cxForm::unhide(), cx::cxMessageDialog::unhide(), cx::cxMultiForm::unhide(), cx::cxOpenFileDialog::unhide(), and cx::cxForm::useInputStatus().
| bool cx::cxWindow::isHidden | ( | ) | const |
Returns whether or not the window is hidden.
Referenced by copyCxWinStuff(), cxWindow(), setExtStatusWindow(), setExtTitleWindow(), setStatus(), setTitle(), cx::cxForm::useInputStatus(), and ~cxWindow().
|
virtual |
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().
|
virtual |
Returns whether the window is on the bottom of all other windows.
Referenced by demoPanels().
|
virtual |
Returns whether the window is on top of all other windows.
Referenced by demoPanels(), and show().
| 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
References mKeyFunctions.
| 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
References mKeyFunctions.
|
virtual |
Returns whether or not the last keypress was a mouse event.
Referenced by cx::cxMenu::itemWasSelected(), cx::cxMultiLineInput::showModal(), and cx::cxComboBox::showModal().
|
virtual |
Returns the left column of the window.
References mWindow.
Referenced by cx::cxMenuBar::addMenu(), alignHoriz(), alignVert(), centerCol(), cx::cxForm::copyCxFormStuff(), cx::cxMultiLineInput::copyCxMultiLineInputStuff(), cx::cxSearchPanel::copyCxSearchPanelStuff(), copyCxWinStuff(), cx::cxScrolledWindow::cxScrolledWindow(), cxWindow(), cx::cxMenu::doInputLoop(), cx::cxForm::getName(), getRect(), info(), main(), cx::cxMenu::mouseEvtWasInItemArea(), mouseEvtWasInTitle(), mouseEvtWasInWindow(), cx::cxDatePicker::move(), cx::cxForm::move(), cx::cxMenuBar::move(), cx::cxMultiLineInput::move(), cx::cxOpenFileDialog::move(), moveRelative(), pointIsInTitle(), pointIsInWindow(), cx::cxMenu::resize(), cx::cxScrolledWindow::resize(), resize(), cx::cxMultiLineInput::resize(), right(), cx::cxMultiLineInput::setBorderStyle(), setMessage(), cx::cxForm::showAllInputs(), and wInfo().
| bool cx::cxWindow::messageWillDraw | ( | ) | const |
Returns whether the message will draw or not.
References mDrawMessage.
Referenced by cx::cxMultiLineInput::cxMultiLineInput().
|
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).
Reimplemented in cx::cxForm, cx::cxGrid, cx::cxInput, cx::cxLabel, cx::cxMenu, cx::cxMenuBar, and cx::cxMultiLineInput.
References isEnabled().
|
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.
| pY | The vertical mouse location |
| pX | The horizontal mouse location |
References BUTTON1_CLICKED.
| bool cx::cxWindow::mouseButton1Clicked | ( | ) | const |
Returns whether or not the first mouse button was clicked.
according to the internal mouse data structure.
References BUTTON1_CLICKED.
Referenced by cx::cxForm::doInputLoop(), cx::cxMultiForm::doInputLoop(), cx::cxButton::doMouseBehavior(), and cx::cxMenu::itemWasSelected().
| bool cx::cxWindow::mouseButton1DoubleClicked | ( | ) | const |
Returns whether or not the first mouse button was double-clicked.
according to the internal mouse data structure.
References BUTTON1_DOUBLE_CLICKED.
Referenced by cx::cxMenu::itemWasSelected().
| 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
References BUTTON1_PRESSED.
Referenced by cx::cxForm::doInputLoop(), and showModal().
| 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.
References BUTTON1_RELEASED.
Referenced by cx::cxForm::doInputLoop(), and showModal().
|
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.
| pY | The vertical mouse location |
| pX | The horizontal mouse location |
References BUTTON2_CLICKED.
| bool cx::cxWindow::mouseButton2Clicked | ( | ) | const |
Returns whether or not the second mouse button was clicked.
according to the internal mouse data structure.
References BUTTON2_CLICKED.
| bool cx::cxWindow::mouseButton2DoubleClicked | ( | ) | const |
Returns whether or not the second mouse button was double-clicked.
according to the internal mouse data structure.
References BUTTON2_DOUBLE_CLICKED.
|
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.
| pY | The vertical mouse location |
| pX | The horizontal mouse location |
References BUTTON3_CLICKED.
| bool cx::cxWindow::mouseButton3Clicked | ( | ) | const |
Returns whether or not the second mouse button was clicked.
according to the internal mouse data structure.
References BUTTON3_CLICKED.
| bool cx::cxWindow::mouseEvtWasButtonEvt | ( | ) | const |
Returns whether or not the mouse event read in mMouse was.
a button press, click, double click.
References BUTTON1_CLICKED, BUTTON1_DOUBLE_CLICKED, BUTTON1_PRESSED, BUTTON1_RELEASED, BUTTON1_TRIPLE_CLICKED, BUTTON2_CLICKED, BUTTON2_DOUBLE_CLICKED, BUTTON2_PRESSED, BUTTON2_RELEASED, BUTTON2_TRIPLE_CLICKED, BUTTON3_CLICKED, BUTTON3_DOUBLE_CLICKED, BUTTON3_PRESSED, BUTTON3_RELEASED, BUTTON3_TRIPLE_CLICKED, BUTTON4_CLICKED, BUTTON4_DOUBLE_CLICKED, BUTTON4_PRESSED, BUTTON4_RELEASED, and BUTTON4_TRIPLE_CLICKED.
Referenced by cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), and cx::cxMultiLineInput::doInputLoop().
|
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)).
Reimplemented in cx::cxNotebook.
References hasBorder(), left(), right(), and top().
Referenced by cx::cxMessageDialog::doInputLoop(), cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), and showModal().
| 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)).
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().
|
virtual |
Changes the window's position, based on a new upper-left corner.
| pNewRow | The new topmost row of the form |
| pNewCol | The new leftmost column of the form |
| pRefresh | Whether or not to refresh the window (defaults to true) |
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().
|
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.
| pVerticalOffset | The vertical offset by which to move the window |
| pHorizOffset | The horizontal offset by which to move the window |
| pRefresh | Whether or not to refresh the window (defaults to true) |
References left(), move(), and top().
Referenced by cxWindowMoveRelative(), cx::cxMessageDialog::doInputLoop(), cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), and showModal().
| unsigned cx::cxWindow::numSubWindows | ( | ) |
Returns the number of subwindows in this window.
Referenced by testMenu1().
|
virtual |
Returns whether or not the onFocus function is set to run.
|
protected |
Returns whether or not the onFocus function is set (if.
mOnFocusFunction is not nullptr and if its function pointer is
set)
References mOnFocusFunction.
Referenced by runOnFocusFunction(), cx::cxInput::runOnFocusFunction(), and cx::cxMultiLineInput::runOnFocusFunction().
|
virtual |
Returns whether or not the onLeave function is set to run.
|
protected |
Returns whether or not the onLeave function is set (if.
mOnLeaveFunction is not nullptr and if its function pointer is
set)
References mOnLeaveFunction.
Referenced by showModal().
Assignment operator.
| pThatWindow | Another cxWindow to be copied |
References copyCxWinStuff().
|
protected |
Returns whether or not the parent window, if there is one, is.
a cxForm.
References cxTypeStr().
|
protected |
Returns whether or not the parent window, if there is one, is.
a cxNotebook.
References cxTypeStr().
|
protected |
Returns whether or not the parent window, if there is one, is.
a cxPanel.
References cxTypeStr().
Referenced by cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxMultiForm::doInputLoop(), showModal(), and cx::cxButton::showModal().
|
virtual |
Returns whether a screen location is in the title of the window.
| pY | A vertical character position |
| pX | A horizontal character position |
References hasBorder(), left(), right(), and top().
|
virtual |
Returns whether a screen location is in the window (including.
the borders).
| pY | A vertical character position |
| pX | A horizontal character position |
References bottom(), left(), right(), and top().
Referenced by cx::cxForm::doInputLoop(), cx::cxMultiLineInput::showModal(), showModal(), and cx::cxComboBox::showModal().
|
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().
|
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().
|
protectedvirtual |
Removes all subwindow pointers.
|
virtual |
Removes an ncurses attribute from one of the item lists.
| pItem | The item to remove the attribute for (see the e_WidgetItems enumeration). |
| pAttr | The ncurses attribute to remove |
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::removeAttr(), cx::cxGrid::removeAttr(), cx::cxInput::removeAttr(), cx::cxMenu::removeAttr(), cx::cxMenuBar::removeAttr(), cx::cxButton::showModal(), unSetFocusColors(), and unSetFocusColors().
|
virtual |
Removes all attributes for a given window item.
| pItem | The item to remove attributes for (see the e_WidgetItems enumeration). |
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::removeAttrs(), cx::cxGrid::removeAttrs(), cx::cxInput::removeAttrs(), cx::cxMenu::removeAttrs(), and cx::cxMenuBar::removeAttrs().
|
virtual |
Removes an exit key.
| pKey | The key to remove from the list of exit keys |
Reimplemented in cx::cxForm, cx::cxGrid, cx::cxMenuBar, cx::cxMultiForm, cx::cxMultiLineInput, and cx::cxPanel.
References mExitKeys.
Referenced by cx::cxForm::addQuitKey(), cx::cxMultiForm::addQuitKey(), cx::cxGrid::removeExitKey(), cx::cxMenuBar::removeExitKey(), setKeyFunction(), cx::cxMultiLineInput::setKeyFunction(), setKeyFunction(), cx::cxMultiLineInput::setKeyFunction(), setKeyFunction(), and cx::cxMultiLineInput::setKeyFunction().
|
virtual |
Removes all exit keys.
References mExitKeys.
|
virtual |
Removes a line from the text inside the window (by index).
| pIndex | The index of the line to remove |
References mMessageLines.
Referenced by addMessageLine().
|
virtual |
Removes a quit key.
| pKey | The key to remove from the list of quit keys |
Reimplemented in cx::cxForm, cx::cxGrid, cx::cxMenuBar, cx::cxMultiForm, cx::cxMultiLineInput, and cx::cxPanel.
References mQuitKeys.
Referenced by cx::cxForm::addExitKey(), cx::cxMultiForm::addExitKey(), cx::cxGrid::removeQuitKey(), cx::cxMenuBar::removeQuitKey(), setKeyFunction(), cx::cxMultiLineInput::setKeyFunction(), setKeyFunction(), cx::cxMultiLineInput::setKeyFunction(), setKeyFunction(), and cx::cxMultiLineInput::setKeyFunction().
|
virtual |
Removes all quit keys.
References mQuitKeys.
|
virtual |
Removes a character from the set of special characters (by.
location).
| pY | Vertical position of the character |
| pX | Horizontal position of the character |
References mSpecialCharAttrs, and mSpecialChars.
|
virtual |
Removes a status string at a given horizontal position.
| pHPos | The horizontal position of the status string to remove |
|
virtual |
Removes all status strings.
|
protectedvirtual |
Removes a window from the subwindow list.
| pSubWindow | A pointer to the window to remove |
Referenced by setParent(), and ~cxWindow().
|
virtual |
Removes a title string at a given horizontal position.
| pHPos | The horizontal position of the title string to remove |
|
virtual |
Removes all title strings.
|
virtual |
Changes the window's width and height. The window's upper-left.
coordinate stays the same.
| pNewHeight | The new height |
| pNewWidth | The new width |
| pRefresh | Whether 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().
|
virtual |
Returns the right column of the window.
References left(), and width().
Referenced by alignHoriz(), centerCol(), cx::cxMenu::doInputLoop(), dump(), getRect(), getRowColBasedOn(), info(), main(), cx::cxMenu::mouseEvtWasInItemArea(), mouseEvtWasInTitle(), mouseEvtWasInWindow(), cx::cxInput::move(), cx::cxMultiLineInput::move(), pointIsInTitle(), pointIsInWindow(), cx::cxInput::resize(), cx::cxMultiLineInput::setRightLabelOffset(), cx::cxForm::showAllInputs(), testFormPos(), and wInfo().
|
virtual |
Runs the onFocus function, if it's set.
| pFunctionRetval | If not nullptr, the string that this points to will contain the return value of the onFocus function. Defaults to nullptr. |
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().
|
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.
| pFunctionRetval | If not nullptr, the string that this points to will contain the return value of the onLeave function. Defaults to nullptr. |
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().
|
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.
| pItem | The item to apply the attribute for (see the e_WidgetItems enumeration). |
| pAttr | The 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().
|
virtual |
Sets the color of the window border.
| pColor | A cxWidgets color - See cxColors.h |
References cx::eBORDER, mBorderColorPair, setAttr(), and setElementColor().
Referenced by init(), and setColor().
|
virtual |
Sets the border style.
| pBorderStyle | A 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().
|
virtual |
Sets whether colors should change when focus.
is set via showModal() (to visually show
that focus is set). The default behavior is
false.
| pChangeColorsOnFocus | Whether or not the window's colors should change when focus is set. |
|
virtual |
Sets the color of one of the window items.
| pItem | The item to set the color of (see the e_WidgetItems enumeration in cxWidgetItems.h). |
| pColor | The 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().
|
virtual |
Sets whether the window should disable the cursor.
when it's shown (this is the default behavior).
| pDisableCursorOnShow | Whether 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().
|
protectedvirtual |
Sets the color (and attribute, if necessary) of a color element.
| 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. |
| pColor | The 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().
|
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()).
| pEnabled | Whether 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().
|
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.
| pExitOnMouseOutside | Whether to exit on outside mouse clicks |
Reimplemented in cx::cxInput.
| 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.
| pWindow | A pointer to the external window to use for status. |
| pRefreshStatus | Whether 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().
| 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.
| pWindow | A pointer to the external window to use for the title. |
| pRefreshTitle | Whether 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().
|
virtual |
Alias for showModal()
| pShowSelf | Whether or not to show the window before running the input loop. Defaults to true. |
| pBringToTop | Whether or not to bring the window to the top. Defaults to true. |
| pShowSubwindows | Whether or not to show sub-windows also. Defaults to true. |
Reimplemented in cx::cxMessageDialog.
References showModal().
Referenced by cx::cxMessageDialog::setFocus().
|
virtual |
Turns on the ncurses attribute A_REVERSE for the window to.
make things stand out.
References addAttr(), and cx::eMESSAGE.
Referenced by showModal().
|
virtual |
Turns on the ncurses attribute pAttr for the window to.
make things stand out.
References addAttr(), and cx::eMESSAGE.
|
protected |
Re-sets the onFocus and onLeave functions from another.
cxWindow. This is a helper for copying windows.
| pWindow | Another cxWindow |
References mOnFocusFunction, mOnLeaveFunction, setOnFocusFunction(), and setOnLeaveFunction().
Referenced by copyCxWinStuff().
| void cx::cxWindow::setHorizMessageAlignment | ( | eHPosition | pHAlignment | ) |
Sets the horizontal alignment of the message text.
| pHAlignment | The horizontal alignment - Can be eHP_CENTER, eHP_LEFT, or eHP_RIGHT |
References mHorizMessageAlignment.
Referenced by FlashcardApp::FlashcardApp(), setHorizStatusAlignment(), and setHorizTitleAlignment().
| void cx::cxWindow::setHorizStatusAlignment | ( | eHPosition | pHAlignment | ) |
Sets the horizontal alignment of the status text.
| pHAlignment | The horizontal alignment - Can be eHP_CENTER, eHP_LEFT, or eHP_RIGHT |
References mHorizStatusAlignment, and setHorizMessageAlignment().
Referenced by statusAlignment().
| 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.
| pHAlignment | The horizontal alignment - Can be eHP_CENTER, eHP_LEFT, or eHP_RIGHT |
References mHorizTitleAlignment, and setHorizMessageAlignment().
Referenced by cxMenuAssignment(), and titleAlignment().
|
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.
| pHotkeyHighlighting | Whether or not to use hotkey attributes when writing the message. |
Reimplemented in cx::cxMenu.
References mHotkeyHighlighting.
Referenced by cx::cxSearchPanel::copyCxSearchPanelStuff().
|
virtual |
Sets a function to be called when a key is pressed.
| pKey | The key to use for the function |
| pFunction | The function to call. This can be an instance of one of the derived cxFunction classes as well. |
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().
|
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()
| pKey | The key to use for the function |
| pFunction | The function to call |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxWindow, but could be useful for deriving classes). |
| pExitAfterRun | Whether or not to exit the input loop after the function is run (not used by cxWindow, but could be useful for deriving classes). |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
Reimplemented in cx::cxForm, cx::cxMultiForm, cx::cxPanel, and cx::cxMultiLineInput.
References clearKeyFunction(), hasKeyFunction(), mKeyFunctions, removeExitKey(), and removeQuitKey().
|
virtual |
Sets a function to be called when a key is pressed.
| pKey | The key to use for the function |
| pFunction | The function to call |
| p1 | The 1st parameter to the function (pointer) |
| p2 | The 2nd parameter to the function (pointer) |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxWindow, but could be useful for deriving classes). |
| pExitAfterRun | Whether or not to exit the input loop after the function is run (not used by cxWindow, but could be useful for deriving classes). |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
Reimplemented in cx::cxForm, cx::cxMultiForm, cx::cxPanel, and cx::cxMultiLineInput.
References clearKeyFunction(), hasKeyFunction(), mKeyFunctions, removeExitKey(), and removeQuitKey().
|
virtual |
Sets a function to be called when a key is pressed.
| pKey | The key to use for the function |
| pFunction | The function to call |
| p1 | The 1st parameter to the function (pointer) |
| p2 | The 2nd parameter to the function (pointer) |
| p3 | The 3rd parameter to the function (pointer) |
| p4 | The 4th parameter to the function (pointer) |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxWindow, but could be useful for deriving classes). |
| pExitAfterRun | Whether or not to exit the input loop after the function is run (not used by cxWindow, but could be useful for deriving classes). |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
Reimplemented in cx::cxForm, cx::cxMultiForm, cx::cxPanel, and cx::cxMultiLineInput.
References clearKeyFunction(), hasKeyFunction(), mKeyFunctions, removeExitKey(), and removeQuitKey().
|
protected |
Returns whether or not a mouse event location is within.
a window.
| pMouse | The mouse event object |
| pTop | The window's top row |
| pLeft | The window's left side |
| pBottom | The window's bottom row |
| pRight | The window's right side |
Re-sets the key functions from another cxWindow. This is
a helper for copying windows.
| pWindow | Another cxWindow |
References mKeyFunctions, mMouseFunctions, setKeyFunction(), and setMouseFunction().
Referenced by copyCxWinStuff().
|
virtual |
Sets the last keypress.
| pLastKey | A key (represented by an int) |
Reimplemented in cx::cxForm, cx::cxGrid, cx::cxInput, cx::cxMenuBar, and cx::cxMultiLineInput.
References setLastKey().
Referenced by cx::cxMessageDialog::doInputLoop(), cx::cxMenu::doInputLoop(), setLastKey(), cx::cxForm::setLastKey(), cx::cxGrid::setLastKey(), cx::cxInput::setLastKey(), cx::cxMenuBar::setLastKey(), cx::cxMultiLineInput::setLastKey(), and showModal().
|
virtual |
Sets the text that appears within the window.
| pMessage | The new message for the window. |
References cx::eBS_NOBORDER, getParent(), getStatus(), getTitle(), height(), init(), left(), mMessageLines, top(), and width().
Referenced by attributesSetter(), clear(), cx::cxForm::copyCxFormStuff(), cx::cxSearchPanel::copyCxSearchPanelStuff(), cxWindowAlignTest(), cxWindowAttributesTest(), cxWindowBorderTest(), FlashcardApp::draw(), setExtStatusWindow(), setExtTitleWindow(), cx::cxInput::setLabel(), setStatus(), cx::cxLabel::setText(), setTitle(), and ~cxWindow().
|
virtual |
Returns the message color.
| pColor | A cxWidgets color - See cxColors.h |
References addAttr(), cx::eMESSAGE, mMessageColorPair, and setElementColor().
Referenced by init(), setColor(), and cx::cxInput::setLabelColor().
|
virtual |
Modifies one of the lines displayed in the window.
| pIndex | The index of the line |
| pLine | The new line text |
References mMessageLines.
|
virtual |
Sets the message lines in the window.
| pLines | A collection of message lines |
|
virtual |
Sets the message lines in the window.
| pLines | A collection of message lines |
|
virtual |
Sets the message lines in the window.
| pLines | A collection of message lines |
|
virtual |
Sets a function to be called for a certain mouse state.
| pMouseState | The 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 |
| pFunction | The function to call. This can be an instance of one of the derived cxFunction classes as well. |
Referenced by cxFormMouseFunctionTest(), cxMenuMouseFunctionTest(), cxWindowMouseFunctionTest(), and setKeyFunctions().
|
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.
| pMouseState | The 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 |
| pMouseState | The mouse state to fire the function |
| pFunction | The function to call |
| p1 | The 1st parameter to the function (pointer) |
| p2 | The 2nd parameter to the function (pointer) |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxWindow, but could be useful for deriving classes). |
| pExitAfterRun | Whether or not to exit the input loop after the function is run (not used by cxWindow, but could be useful for deriving classes). |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
References clearMouseFunction(), hasMouseFunction(), and mMouseFunctions.
|
virtual |
Sets a function to be called for a certain mouse state.
| pMouseState | The 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 |
| pMouseState | The mouse state to fire the function |
| pFunction | The function to call |
| p1 | The 1st parameter to the function (pointer) |
| p2 | The 2nd parameter to the function (pointer) |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxWindow, but could be useful for deriving classes). |
| pExitAfterRun | Whether or not to exit the input loop after the function is run (not used by cxWindow, but could be useful for deriving classes). |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
References clearMouseFunction(), hasMouseFunction(), and mMouseFunctions.
|
virtual |
Sets a function to be called for a certain mouse state.
| pMouseState | The 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 |
| pFunction | The function to call |
| p1 | The 1st parameter to the function (pointer) |
| p2 | The 2nd parameter to the function (pointer) |
| p3 | The 3rd parameter to the function (pointer) |
| p4 | The 4th parameter to the function (pointer) |
| pUseReturnVal | Whether or not to use the function's return value (not used by cxWindow, but could be useful for deriving classes). |
| pExitAfterRun | Whether or not to exit the input loop after the function is run (not used by cxWindow, but could be useful for deriving classes). |
| pRunOnLeaveFunction | Whether or not to run the onLeave function when the window exits (if pExitAfterRun is true). Defaults to true. |
References clearMouseFunction(), hasMouseFunction(), and mMouseFunctions.
|
virtual |
Sets the name of the window. The name is an alternative means.
of identifying the window.
| pName | The new name for the window |
Reimplemented in cx::cxPanel.
|
virtual |
Sets the window's "on focus" function.
| pFunction | The 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().
|
virtual |
Sets the "on focus" function pointer.
The function must have this signature: string func().
| pFunction | The function to be run - Must have this signature: string func() |
| pUseVal | Whether or not the function's return value should be used. This can be useful in some deriving classes. |
| pExitAfterRun | Whether or not to exit after the function finishes running (defaults to false). |
Reimplemented in cx::cxForm.
References mOnFocusFunction.
|
virtual |
Sets the "on focus" function pointer.
The function must have this signature: string func(void*, void*).
| pFunction | The function to be run - Must have this signature: string func(void*, void*) |
| p1 | Pointer to the first parameter to be used for the function |
| p2 | Pointer to the second parameter to be used for the function |
| pUseVal | Whether or not the function's return value should be used. This can be useful in some deriving classes. |
| pExitAfterRun | Whether or not to exit after the function finishes running (defaults to false). |
Reimplemented in cx::cxForm.
References mOnFocusFunction.
|
virtual |
Sets the "on focus" function pointer.
The function must have this signature: string func(void*, void*, void*, void*).
| pFunction | The function to be run - Must have this signature: string func(void*, void*, void*, void*) |
| p1 | Pointer to the first parameter to be used for the function |
| p2 | Pointer to the second parameter to be used for the function |
| p3 | Pointer to the 3rd parameter to be used for the function |
| p4 | Pointer to the 4th parameter to be used for the function |
| pUseVal | Whether or not the function's return value should be used. This can be useful in some deriving classes. |
| pExitAfterRun | Whether or not to exit after the function finishes running (defaults to false). |
Reimplemented in cx::cxForm.
References mOnFocusFunction.
|
virtual |
Sets the window's "on leave" function.
| pFunction | The 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().
|
virtual |
Sets the "on focus" function pointer.
The function must have this signature: string func().
| pFunction | The function to be run - Must have this signature: string func() |
Reimplemented in cx::cxForm.
References mOnLeaveFunction.
|
virtual |
Sets the "on focus" function pointer.
The function must have this signature: string func(void*, void*).
| pFunction | The function to be run - Must have this signature: string func(void*, void*) |
| p1 | Pointer to the first parameter to be used for the function |
| p2 | Pointer to the second parameter to be used for the function |
Reimplemented in cx::cxForm.
References mOnLeaveFunction.
|
virtual |
Sets the "on leave" function pointer.
The function must have this signature: string func(void*, void*, void*, void*).
| pFunction | The function to be run - Must have this signature: string func(void*, void*, void*, void*) |
| p1 | Pointer to the first parameter to be used for the function |
| p2 | Pointer to the second parameter to be used for the function |
| p3 | Pointer to the 3rd parameter to be used for the function |
| p4 | Pointer to the 4th parameter to be used for the function |
Reimplemented in cx::cxForm.
References mOnLeaveFunction.
| void cx::cxWindow::setParent | ( | cxWindow * | pNewParent | ) |
Changes the pointer to the parent window; changes the parent window.
| pNewParent | Pointer to the new parent window |
References addSubwindow(), cxTypeStr(), cx::cxPanel::mWindows, and removeSubWindow().
|
virtual |
Explicitly sets the member return code for the window.
window (may be useful in some situations).
| pReturnCode | The return code to set |
Referenced by cx::cxMenu::doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxForm::showModal(), cx::cxMultiForm::showModal(), cx::cxInput::showModal(), cx::cxMultiLineInput::showModal(), cx::cxScrolledWindow::showModal(), cx::cxComboBox::showModal(), cx::cxGrid::showModal(), cx::cxMenu::showModal(), cx::cxMessageDialog::showModal(), and cx::cxNotebook::showModal().
|
virtual |
Sets whether the window will show itself before.
showing its subwindows.
| pShowSelfBeforeSubwins | If true, the window will show itself before showing its subwindows. If false, the window will show itself after showing its subwindows. |
|
virtual |
Toggles the order in which subwindows will be shown.
| pShowSubwinsForward | If true, the subwindows will be shown in forward order. If false, the subwindows will be shown in reverse order. |
|
virtual |
Mutator for the status line text.
| pStatus | The new status message for window |
| pRefreshStatus | Whether or not to refresh the status area (defaults to true) |
Reimplemented in cx::cxForm, and cx::cxMenu.
References drawStatus(), cx::eBS_NOBORDER, hasBorder(), isHidden(), setMessage(), show(), and width().
Referenced by attributesSetter(), cx::cxSearchPanel::copyCxSearchPanelStuff(), cxNotebookTest2(), cxWindowAttributesTest(), cx::cxForm::disableCustomStatus(), cx::cxMenu::disableCustomStatus(), CentipedeGame::draw(), SnakeGame::draw(), init(), cx::messageBox(), cx::messageBox(), setExtStatusWindow(), cx::cxForm::setStatus(), cx::cxMenu::setStatus(), statusAlignment(), and FlashcardApp::updateStatus().
|
virtual |
Sets the color of the status line at bottom of window.
| pColor | A cxWidgets color - See cxColors.h |
References cx::addAttr(), cx::eSTATUS, mStatusColorPair, and setElementColor().
Referenced by init(), and setColor().
|
virtual |
Sets all the status strings via a map of horizontal.
locations and strings.
| pStatusStrings | A map containing the status strings with the horizontal position as the key. |
| void cx::cxWindow::setSubWinMessage | ( | const std::string & | pTitle, |
| const std::string & | pMessage | ||
| ) |
Sets the message of one of the subwindows (by title).
| pTitle | The title of the subwindow |
| pMessage | The new message to set in the subwindow |
| void cx::cxWindow::setSubWinMessage | ( | unsigned | pIndex, |
| const std::string & | pMessage | ||
| ) |
Sets the message of one of the subwindows (by index).
| pIndex | The index of the subwindow |
| pMessage | The new message to set in the subwindow |
|
virtual |
Setter for the title text - This sets the first string in the.
set of title strings.
| pTitle | The new title for the window |
| pRefreshTitle | Whether 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().
|
virtual |
Sets the title color.
| pColor | A cxWidgets color - See cxColors.h |
References addAttr(), cx::eTITLE, mTitleColorPair, and setElementColor().
Referenced by init(), and setColor().
|
virtual |
Sets all the title strings via a map of horizontal.
locations and strings.
| pTitleStrings | A map containing the title strings with the horizontal position as the key. |
| void cx::cxWindow::setVerticalMessageAlignment | ( | eVPosition | pVAlignment | ) |
Sets the vertical alignment of the message text.
| pVAlignment | The vertical alignment - Can be eVP_CENTER, eVP_TOP, or eVP_BOTTOM |
References mVerticalMessageAlignment.
Referenced by FlashcardApp::draw(), and FlashcardApp::FlashcardApp().
|
virtual |
Shows the window.
| pBringToTop | Whether or not to bring the window to the top. Defaults to false. |
| pShowSubwindows | Whether or not to show sub-windows also. Defaults to true. |
Reimplemented in cx::cxInput, cx::cxLabel, cx::cxMultiLineInput, cx::cxForm, cx::cxGrid, cx::cxMenuBar, cx::cxMultiForm, cx::cxNotebook, cx::cxOpenFileDialog, cx::cxPanel, cx::cxFileViewer, cx::cxMenu, and cx::cxScrolledWindow.
References cx::cxID_EXIT, draw(), hide(), isOnTop(), mWindow, showSubwindows(), unhide(), and cx::updateWindows().
Referenced by attributesSetter(), cx::bringToTop(), clear(), cxWindowAddMessageLinesAbove(), cxWindowAlignTest(), cxWindowAssignment(), cxWindowAttributesTest(), cxWindowBorderTest(), cxWindowMoveRelative(), cxWindowSizeTest(), demoPanels(), cx::cxMenu::doInputLoop(), drawStatus(), drawTitle(), main(), main(), move(), onFocusMenu(), resize(), setExtStatusWindow(), setExtTitleWindow(), setStatus(), setTitle(), cx::cxInput::show(), cx::cxLabel::show(), cx::cxForm::show(), cx::cxGrid::show(), cx::cxMenuBar::show(), cx::cxMultiForm::show(), cx::cxOpenFileDialog::show(), cx::cxMenu::show(), cx::showAllWindows(), cx::cxLabel::showModal(), showModal(), cx::cxDatePicker::showModal(), cx::cxMessageDialog::showModal(), statusAlignment(), testInput2(), titleAlignment(), window1(), windowWriteText(), and ~cxWindow().
|
virtual |
Shows the window and waits for input.
| pShowSelf | Whether or not to show the window before running the input loop. Defaults to true. |
| pBringToTop | Whether or not to bring the window to the top. Defaults to true. |
| pShowSubwindows | Whether or not to show sub-windows also. Defaults to true. |
Reimplemented in cx::cxForm, cx::cxMultiForm, cx::cxInput, cx::cxLabel, cx::cxMultiLineInput, cx::cxScrolledWindow, cx::cxButton, cx::cxComboBox, cx::cxDatePicker, cx::cxDialog, cx::cxGrid, cx::cxMenu, cx::cxMenuBar, cx::cxMessageDialog, cx::cxNotebook, cx::cxOpenFileDialog, and cx::cxPanel.
References cx::cxID_EXIT, cx::cxID_QUIT, cxTypeStr(), ESC, getLastKey(), getLeaveNow(), handleFunctionForLastKey(), handleFunctionForLastMouseState(), hasQuitKey(), mIsModal, mOnLeaveFunction, mouseButton1Pressed(), mouseButton1Released(), mouseEvtWasInTitle(), moveRelative(), mWindow, NOKEY, onLeaveFunctionIsSet(), parentIsCxPanel(), pointIsInWindow(), runOnFocusFunction(), setFocusColors(), setLastKey(), show(), and unSetFocusColors().
Referenced by addMessageLine(), cxWindowCopyConstructor(), cxWindowMessageNewlines(), cxWindowMouseFunctionTest(), cxWindowWithFunctionKeys(), cxWindowWithMultipleStatusStrings(), cxWindowWithMultipleTitleStrings(), info(), setFocus(), cx::cxButton::showModal(), and windowFunctionKeyNoOnLeave().
|
virtual |
Shows the subwindows for the window.
| pBringToTop | Whether or not to bring the subwindow to the top. Defaults to true. |
| pShowSubwindows | Whether or not to show the subwindows for the subwindows. Defaults to true. |
Reimplemented in cx::cxNotebook.
Referenced by cx::cxMultiLineInput::show(), and show().
| 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.)
References mDrawSpecialChars.
| bool cx::cxWindow::statusWillDraw | ( | ) | const |
Returns whether the status line will draw or not.
References mDrawStatus.
|
protected |
Returns a const iterator to the first subwindow.
Referenced by cx::cxNotebook::showSubwindows().
|
protected |
Returns a const iterator to the one past the last subwindow.
Referenced by cx::cxNotebook::showSubwindows().
|
protected |
Returns a const reverse begin iterator for the subwindow collection.
Referenced by cx::cxNotebook::showSubwindows().
|
protected |
Returns a const reverse end iterator for the subwindow collection.
Referenced by cx::cxNotebook::showSubwindows().
| bool cx::cxWindow::titleWillDraw | ( | ) | const |
Returns whether the title will draw or not.
References mDrawTitle.
|
virtual |
Sets whether or not to display the bottom border.
(Note: Only applicable if mBorderStyle != eBS_NOBORDER.)
| pToggle | If true, then the bottom border will be displayed |
Referenced by cxWindowBorderTest().
|
virtual |
Sets whether or not to display the left border.
(Note: Only applicable if mBorderStyle != eBS_NOBORDER.)
| pToggle | If true, then the left border will be displayed |
Referenced by cxWindowBorderTest().
|
virtual |
Sets whether or not to display the right border.
(Note: Only applicable if mBorderStyle != eBS_NOBORDER.)
| pToggle | If true, then the right border will be displayed |
Referenced by cxWindowBorderTest().
|
virtual |
Sets whether or not to display the top border.
(Note: Only applicable if mBorderStyle != eBS_NOBORDER.)
| pToggle | If true, then the top border will be displayed |
Referenced by cxWindowBorderTest().
| void cx::cxWindow::toggleMessage | ( | bool | pDrawMessage | ) |
Sets whether or not to draw the message area (the area within.
the borders)
| pDrawMessage | Whether or not to draw the message area |
References mDrawMessage.
Referenced by cx::cxMultiLineInput::cxMultiLineInput().
|
virtual |
Sets whether or not the onFocus function should run.
| pRunOnFocus | If true, the onFocus function will run when the window gains focus; if false, it won't run. |
|
virtual |
Sets whether or not the onLeave function should run.
| pRunOnFocus | If true, the onLeave function will run when the window loses focus; if false, it won't run. |
| 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).
| pDrawSpecialChars | Whether or not to draw the "special" characters |
References mDrawSpecialChars.
| void cx::cxWindow::toggleStatus | ( | bool | pDrawStatus | ) |
Sets whether or not to draw the status line.
| pDrawStatus | Whether or not to draw the status line |
References mDrawStatus.
| void cx::cxWindow::toggleTitle | ( | bool | pDrawTitle | ) |
Sets whether or not to draw the title.
| pDrawTitle | Whether or not to draw the title |
References mDrawTitle.
|
virtual |
Returns the top row of the window.
Reimplemented in cx::cxPanel.
References mWindow.
Referenced by alignHoriz(), alignVert(), bottom(), centerRow(), cx::cxForm::copyCxFormStuff(), cx::cxMultiLineInput::copyCxMultiLineInputStuff(), copyCxWinStuff(), cx::cxScrolledWindow::cxScrolledWindow(), cxWindow(), cx::cxMenu::doInputLoop(), dump(), cx::cxForm::getName(), getRect(), info(), main(), cx::cxMenu::mouseEvtWasInItemArea(), mouseEvtWasInTitle(), mouseEvtWasInWindow(), cx::cxDatePicker::move(), cx::cxForm::move(), cx::cxMultiLineInput::move(), cx::cxOpenFileDialog::move(), moveRelative(), pointIsInTitle(), pointIsInWindow(), cx::cxMenu::resize(), cx::cxScrolledWindow::resize(), resize(), cx::cxMultiLineInput::resize(), cx::cxForm::scrollInputs(), cx::cxMultiLineInput::setBorderStyle(), setMessage(), cx::cxForm::showAllInputs(), cx::cxMenuBar::showModalWithClick(), cx::cxComboBox::toggleMenu(), and wInfo().
|
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.
|
virtual |
Un-hides the window.
| pUnhideSubwindows | Whether or not to also unhide the subwindows (defaults to true) |
Reimplemented in cx::cxMultiLineInput, cx::cxComboBox, cx::cxDatePicker, cx::cxForm, cx::cxGrid, cx::cxMenuBar, cx::cxMessageDialog, cx::cxMultiForm, cx::cxNotebook, cx::cxOpenFileDialog, and cx::cxPanel.
References cx::updateWindows().
Referenced by demoPanels(), show(), cx::cxScrolledWindow::show(), cx::cxButton::showModal(), cx::cxMultiLineInput::unhide(), cx::cxDatePicker::unhide(), cx::cxForm::unhide(), cx::cxGrid::unhide(), cx::cxMenuBar::unhide(), cx::cxMessageDialog::unhide(), and cx::cxOpenFileDialog::unhide().
|
virtual |
Disables focus for this window and unhighlights the message.
References cx::eMESSAGE, and removeAttr().
Referenced by showModal().
|
virtual |
Disables focus for this window and un-highlights the message (using pAttr)
References cx::eMESSAGE, and removeAttr().
|
virtual |
Returns the width of the window.
Reimplemented in cx::cxComboBox.
References mWindow.
Referenced by addStatusString(), addTitleString(), alignHoriz(), cx::cxMenu::append(), CentipedeGame::draw(), FlashcardApp::draw(), SnakeGame::draw(), drawBorder(), cx::cxMenu::drawBorder(), cx::cxScrolledWindow::drawBorder(), drawMessage(), dump(), cx::cxForm::getName(), getRowColBasedOn(), getSize(), height(), info(), cx::cxComboBox::inputWidth(), cx::cxScrolledWindow::reCreateSubWindow(), cx::cxMenu::remove(), cx::cxMenu::removeAllItems(), cx::cxMenu::resize(), resize(), cx::cxInput::resize(), cx::cxMultiLineInput::resize(), right(), CentipedeGame::run(), cx::cxInput::setBorderStyle(), cx::cxMultiLineInput::setBorderStyle(), cx::cxInput::setLabel(), setMessage(), setTitle(), CentipedeGame::spawnCentipede(), SnakeGame::spawnFood(), CentipedeGame::spawnMushroom(), CentipedeGame::update(), SnakeGame::update(), cx::cxForm::useInputStatus(), and cx::cxComboBox::width().
|
virtual |
Changes the width of the window.
| pWidth | The new width for the window |
References height(), and mWindow.
Referenced by cx::cxSearchPanel::copyCxSearchPanelStuff(), copyCxWinStuff(), cxNotebookRemoveWindowTest(), cxNotebookSwapTest(), cxNotebookTest1(), cxNotebookTest2(), cxNotebookWithEmptyPanelTest(), cxPanelTest2(), cx::cxScrolledWindow::cxScrolledWindow(), cxWindow(), main(), cx::cxComboBox::menuWidth(), setExtStatusWindow(), setExtTitleWindow(), cx::cxComboBox::setMenuHeight(), setStatus(), setTitle(), and wInfo().
|
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().
| pRow | The row in the window at which to write the text |
| pCol | The column in the window at which to write the text |
| pText | The text to write in the window |
| pRefresh | Whether 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().
|
protectedvirtual |
Writes text to an ncurses WINDOW, highlighting any characters.
preceeded by ampersands (&).
| pWindow | A pointer to the ncurses WINDOW object in which to write text |
| pText | The text to write |
| pY | The vertical position of the text |
| pStartX | The starting horizontal position of the text |
| pEndX | The ending boundary for text (one location past the last character to be written) |
| pNormalTextItem | A 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().
|
protected |
Border attributes.
Referenced by addAttr(), copyCxWinStuff(), disableAttrs(), enableAttrs(), getAttrs(), getItemColor(), removeAttr(), removeAttrs(), and setAttr().
|
protected |
Referenced by copyCxWinStuff(), cx::cxMenu::drawBorder(), cx::cxScrolledWindow::drawBorder(), drawBorder(), getItemColor(), and setBorderColor().
|
protected |
Referenced by copyCxWinStuff(), draw(), messageWillDraw(), and toggleMessage().
|
protected |
Referenced by copyCxWinStuff(), draw(), specialCharsWillDraw(), and toggleSpecialChars().
|
protected |
Referenced by draw(), statusWillDraw(), and toggleStatus().
|
protected |
Referenced by draw(), titleWillDraw(), and toggleTitle().
|
protected |
Referenced by addExitKey(), addQuitKey(), cx::cxForm::append(), copyCxWinStuff(), cx::cxComboBox::doInputLoop(), getExitKeyListString(), getExitKeys(), getExitKeyStrings(), hasExitKey(), removeExitKey(), cx::cxForm::removeExitKey(), cx::cxMultiLineInput::removeExitKey(), removeExitKeys(), runOnLeaveFunction(), and cx::cxMultiLineInput::showModal().
|
protected |
|
protected |
Referenced by copyCxWinStuff(), getHorizStatusAlignment(), and setHorizStatusAlignment().
|
protected |
Referenced by copyCxWinStuff(), getHorizTitleAlignment(), setExtTitleWindow(), and setHorizTitleAlignment().
|
protected |
Hotkey attributes.
Referenced by addAttr(), copyCxWinStuff(), disableAttrs(), enableAttrs(), getAttrs(), getItemColor(), removeAttr(), removeAttrs(), and setAttr().
|
protected |
|
protected |
Referenced by cx::cxMultiLineInput::autoGenerateExtendedHelp(), copyCxWinStuff(), isModal(), cx::cxForm::setCurrentInput(), cx::cxForm::setCurrentInputByPtr(), cx::cxMultiForm::setCurrentSubform(), cx::cxMultiForm::setCurrentSubformByPtr(), cx::cxForm::setIsModal(), cx::cxForm::showModal(), cx::cxMultiForm::showModal(), cx::cxInput::showModal(), cx::cxMultiLineInput::showModal(), cx::cxScrolledWindow::showModal(), showModal(), cx::cxComboBox::showModal(), cx::cxDatePicker::showModal(), cx::cxGrid::showModal(), cx::cxMenu::showModal(), cx::cxMessageDialog::showModal(), cx::cxNotebook::showModal(), and cx::cxOpenFileDialog::showModal().
|
protected |
Referenced by cx::cxForm::addInputJumpKey(), cx::cxForm::append(), clearKeyFunction(), clearKeyFunctionByPtr(), clearKeyFunctionByPtr(), clearKeyFunctionByPtr(), clearKeyFunctions(), cx::cxForm::doCurrentInput(), cx::cxForm::formKeyIsSet(), getFunctionKeys(), getFunctionKeyStrings(), getKeyFunction(), handleFunctionForLastKey(), cx::cxInput::handleFunctionForLastKey(), cx::cxMultiLineInput::handleFunctionForLastKey(), hasKeyFunction(), keyFunctions_begin(), keyFunctions_end(), cx::cxMultiLineInput::runFieldFunction(), runOnLeaveFunction(), setKeyFunction(), setKeyFunction(), setKeyFunction(), and setKeyFunctions().
|
protected |
Referenced by copyCxWinStuff(), cx::cxMessageDialog::doInputLoop(), cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), cx::cxMultiLineInput::doInputLoop(), cx::cxComboBox::doInputLoop(), cx::cxMultiForm::doInputLoop(), exitNow(), getLeaveNow(), quitNow(), cx::cxDatePicker::showModal(), and cx::cxOpenFileDialog::showModal().
|
protected |
Message attributes.
Referenced by addAttr(), copyCxWinStuff(), disableAttrs(), enableAttrs(), getAttrs(), getItemColor(), removeAttr(), removeAttrs(), and setAttr().
|
protected |
|
protected |
Contains the text to be shown inside the window (note: the.
length of each line should be <= the inside width of the
window).
Referenced by addMessageLineAbove(), addMessageLineBelow(), cx::cxMenu::append(), cx::cxMenu::appendWithPopUp(), cx::cxMenu::appendWithPullRight(), copyCxWinStuff(), cx::cxFileViewer::cxFileViewer(), cx::cxMenu::doInputLoop(), drawMessage(), cx::cxMenu::drawMessage(), cx::cxScrolledWindow::drawMessage(), cx::cxMenu::getItemText(), cx::cxInput::getLabel(), getMessage(), TestMessageDialog::getMessageLines(), init(), cx::cxMenu::itemExists(), cx::cxFileViewer::load(), cx::cxMenu::modalGetsKeypress(), cx::cxMenu::numMenuItems(), cx::cxMenu::remove(), cx::cxMenu::removeAllItems(), removeMessageLine(), cx::cxMenu::resize(), cx::cxMenu::scrollItems(), cx::cxScrolledWindow::scrollWin(), cx::cxMenu::setBottomItem(), cx::cxMenu::setCurrentMenuItem(), cx::cxMenu::setItemTextByIndex(), cx::cxMenu::setItemTextByReturnCode(), cx::cxInput::setLabel(), setMessage(), setMessageLine(), cx::cxMenu::setTopItem(), cx::cxMenu::sortByReturnCode(), cx::cxMenu::toggleSelectability(), and cx::cxFileViewer::widestLine().
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by addExitKey(), addQuitKey(), cx::cxForm::append(), copyCxWinStuff(), cx::cxForm::doInputLoop(), cx::cxComboBox::doInputLoop(), getQuitKeyListString(), getQuitKeys(), getQuitKeyStrings(), hasQuitKey(), removeQuitKey(), cx::cxForm::removeQuitKey(), cx::cxMultiLineInput::removeQuitKey(), removeQuitKeys(), runOnLeaveFunction(), and cx::cxMultiLineInput::showModal().
|
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().
|
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().
|
protected |
Status attributes.
Referenced by addAttr(), copyCxWinStuff(), disableAttrs(), enableAttrs(), getAttrs(), getItemColor(), removeAttr(), removeAttrs(), and setAttr().
|
protected |
Referenced by drawStatus(), getItemColor(), and setStatusColor().
|
protected |
Title attributes.
Referenced by addAttr(), disableAttrs(), enableAttrs(), getAttrs(), getItemColor(), removeAttr(), removeAttrs(), and setAttr().
|
protected |
Referenced by copyCxWinStuff(), drawTitle(), getItemColor(), and setTitleColor().
|
protected |
Referenced by drawMessage(), getVerticalMessageAlignment(), and setVerticalMessageAlignment().
|
protected |
Everything in the window is written here; this is an nCurses window structure.
Referenced by cx::cxScrolledWindow::copyCxScrolledWindowStuff(), copyCxWinStuff(), cxWindow(), cx::cxForm::doCurrentInput(), cx::cxMessageDialog::doInputLoop(), cx::cxForm::doInputLoop(), cx::cxMenu::doInputLoop(), cx::cxMultiForm::doInputLoop(), CentipedeGame::draw(), FlashcardApp::draw(), SnakeGame::draw(), draw(), cx::cxDatePicker::draw(), cx::cxOpenFileDialog::draw(), cx::cxMenu::drawBorder(), cx::cxScrolledWindow::drawBorder(), drawBorder(), drawMessage(), drawSpecialChars(), drawStatus(), drawTitle(), dump(), erase(), freeWindow(), getString(), cx::cxInput::handleFunctionForLastKey(), height(), height(), init(), left(), reCreatePanel(), cx::cxScrolledWindow::reCreateSubWindow(), cx::cxInput::refreshValue(), cx::cxMenu::resize(), CentipedeGame::run(), FlashcardApp::run(), SnakeGame::run(), cx::cxInput::setCursorX(), cx::cxMultiLineInput::setInputOption(), show(), cx::cxInput::showModal(), cx::cxMultiLineInput::showModal(), showModal(), top(), touchWindow(), cx::cxForm::useInputStatus(), width(), width(), and writeText().