|
cxWidgets 1.0
|
This is a class representing a grid of data, similar to a spreadsheet, with rows & columns of cells where data can be entered. More...
#include <cxGrid.h>


Public Member Functions | |
| cxGrid (cxWindow *pParentWindow=nullptr, int pRow=0, int pCol=0, int pHeight=DEFAULT_HEIGHT, int pWidth=DEFAULT_WIDTH, int pNumRows=10, int pNumCols=5, int pDefaultColWidth=12, const std::string &pTitle="", eBorderStyle pBorderStyle=eBS_SINGLE_LINE) | |
| Constructor. | |
| cxGrid (const cxGrid &pThatGrid) | |
| Copy constructor. | |
| virtual | ~cxGrid () |
| Destructor. | |
| virtual long | show (bool pBringToTop=false, bool pShowSubwindows=true) override |
| Shows the window. | |
| virtual long | showModal (bool pShowSelf=true, bool pBringToTop=true, bool pShowSubwindows=true) override |
| Shows the window and waits for input. | |
| virtual bool | modalGetsKeypress () const override |
| Returns whether or not a call to showModal() will wait for a. | |
| virtual void | draw () override |
| Fills the member ncurses window structure with the current. | |
| virtual void | hide (bool pHideSubwindows=true) override |
| Hides the window. | |
| virtual void | unhide (bool pUnhideSubwindows=true) override |
| Un-hides the window. | |
| virtual void | erase (bool pEraseSubwindows=true) override |
| Erases the window. | |
| virtual bool | move (int pNewRow, int pNewCol, bool pRefresh=true) override |
| Changes the window's position, based on a new upper-left corner. | |
| virtual void | resize (int pNewHeight, int pNewWidth, bool pRefresh=true) override |
| Changes the window's width and height. The window's upper-left. | |
| virtual void | clear (bool pRefresh=false) override |
| Clears the text from the window. | |
| virtual void | bringToTop (bool pRefresh=true) override |
| Brings the window to the top. | |
| virtual bool | hasFocus () const override |
| Returns true if window has focus, false otherwise. | |
| virtual void | setColor (e_WidgetItems pItem, e_cxColors pColor) override |
| Sets the color of one of the window items. | |
| virtual void | setBorderStyle (eBorderStyle pBorderStyle) override |
| Sets the border style. | |
| virtual void | setLastKey (int pLastKey) override |
| Sets the last keypress. | |
| virtual void | quitNow () override |
| This is mainly for deriving classes. This causes the object. | |
| virtual void | exitNow () override |
| This is mainly for deriving classes. It tells the object. | |
| virtual bool | setKeyFunction (int pKey, const std::shared_ptr< cxFunction > &pFunction) override |
| Sets a function to be called when a key is pressed. | |
| virtual void | clearKeyFunction (int pKey) override |
| Removes a function pointer for a keypress so that it will no. | |
| virtual void | clearKeyFunctions () override |
| Clears the list of external functions fired by hotkeys. | |
| virtual void | removeQuitKey (int pKey) override |
| Removes a quit key. | |
| virtual void | removeExitKey (int pKey) override |
| Removes an exit key. | |
| virtual void | setEnabled (bool pEnabled) override |
| Enables or disables the window. If the window is. | |
| virtual void | setDisableCursorOnShow (bool pDisableCursorOnShow) override |
| Sets whether the window should disable the cursor. | |
| virtual std::string | cxTypeStr () const override |
| Returns the name of the cxWidgets class. This is overridden. | |
| virtual cxWindow * | getParent () const override |
| Returns a pointer to the parent window. | |
| virtual void | addAttr (e_WidgetItems pItem, attr_t pAttr) override |
| Adds an ncurses attribute to use for one of the items in the. | |
| virtual void | setAttr (e_WidgetItems pItem, attr_t pAttr) override |
| Sets the ncurses attribute to use for one of the items in the. | |
| virtual void | removeAttr (e_WidgetItems pItem, attr_t pAttr) override |
| Removes an ncurses attribute from one of the item lists. | |
| virtual void | removeAttrs (e_WidgetItems pItem) override |
| Removes all attributes for a given window item. | |
| virtual void | getAttrs (e_WidgetItems pItem, std::set< attr_t > &pAttrs) const override |
| Returns the set of ncurses attributes for a given item. | |
| virtual void | enableAttrs (WINDOW *pWin, e_WidgetItems pItem) override |
| Enables the attributes for one of the m*Attrs sets for an ncurses window. | |
| virtual void | disableAttrs (WINDOW *pWin, e_WidgetItems pItem) override |
| Disables the attributes for one of the m*Attrs sets for an ncurses window. | |
| virtual e_cxColors | getItemColor (e_WidgetItems pItem) const override |
| Returns the color of one of the items in a window. | |
| virtual long | showModal (int pFocusRow, int pFocusCol, bool pShowSelf=true, bool pBringToTop=true, bool pShowSubwindows=true) |
| Sets cell focus, then shows the grid modally to allow user interaction. | |
| int | getNumRows () const |
| Returns the number of data rows in the grid. | |
| int | getNumCols () const |
| Returns the number of data columns in the grid. | |
| void | setNumRows (int pNumRows) |
| Sets the number of rows in the grid. Adds or removes rows as needed. | |
| void | setNumCols (int pNumCols) |
| Sets the number of columns in the grid. Adds or removes columns as needed. | |
| std::shared_ptr< cxWindow > | getCell (int pRow, int pCol) const |
| Gets the cell widget at the specified row and column. | |
| bool | setCell (int pRow, int pCol, const std::shared_ptr< cxWindow > &pWidget) |
| Sets (adds/replaces) the cell widget at the specified row and column. | |
| std::string | getCellValue (int pRow, int pCol) const |
| Gets the value of a cell (as a string). Works for cxInput cells. | |
| bool | setCellValue (int pRow, int pCol, const std::string &pValue) |
| Sets the value of a cell (as a string). Works for cxInput cells. | |
| void | setColLabel (int pCol, const std::string &pLabel) |
| Sets a column header label. | |
| std::string | getColLabel (int pCol) const |
| Gets a column header label. | |
| void | setRowLabel (int pRow, const std::string &pLabel) |
| Sets a row header label. | |
| std::string | getRowLabel (int pRow) const |
| Gets a row header label. | |
| void | setColWidth (int pCol, int pWidth) |
| Sets the width of a specific column. | |
| int | getColWidth (int pCol) const |
| Gets the width of a specific column. | |
| void | setRowHeaderWidth (int pWidth) |
| Sets the width of the row header column. | |
| int | getRowHeaderWidth () const |
| Gets the width of the row header column. | |
| int | getFocusRow () const |
| Gets the currently focused cell row. | |
| int | getFocusCol () const |
| Gets the currently focused cell column. | |
| void | setFocusCell (int pRow, int pCol) |
| Sets the focus to a specific cell. | |
| void | setHeaderColor (e_cxColors pColor) |
| Sets the color for the column/row header labels. | |
| void | setGridLineColor (e_cxColors pColor) |
| Sets the color for the grid lines/separators. | |
| void | showColHeaders (bool pShow) |
| Toggles whether column headers are displayed. | |
| bool | getShowColHeaders () const |
| Returns whether column headers are displayed. | |
| void | showRowHeaders (bool pShow) |
| Toggles whether row headers are displayed. | |
| bool | getShowRowHeaders () const |
| Returns whether row headers are displayed. | |
Public Member Functions inherited from cx::cxWindow | |
| cxWindow (cxWindow *pParentWindow=nullptr, int pRow=0, int pCol=0, int pHeight=DEFAULT_HEIGHT, int pWidth=DEFAULT_WIDTH, const std::string &pTitle="", const std::string &pMessage="", const std::string &pStatus="", eBorderStyle pBorderStyle=eBS_SINGLE_LINE, cxWindow *pExtTitleWindow=nullptr, cxWindow *pExtStatusWindow=nullptr, bool pHotkeyHighlighting=false) | |
| 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 | 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 | 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. | |
| 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 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). | |
| eBorderStyle | getBorderStyle () const |
| Returns the border style. | |
| bool | hasBorder () const |
| Does this window have a border? | |
| 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 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 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, 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 | 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 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 | 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 | 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 | 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 bool | hasAttr (e_WidgetItems pItem, attr_t pAttr) |
| Returns whether an attribute is set for a widget item. | |
| 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. | |
Public Member Functions inherited from cx::cxObject | |
| cxObject () | |
| virtual | ~cxObject () |
| virtual void | beep () |
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) |
Protected Member Functions inherited from cx::cxWindow | |
| 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 | 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. | |
| 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 inherited from cx::cxWindow | |
| 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 |
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. | |
This is a class representing a grid of data, similar to a spreadsheet, with rows & columns of cells where data can be entered.
|
explicit |
Constructor.
| pParentWindow | A pointer to the parent window (can be nullptr) |
| pRow | The top row position on the screen |
| pCol | The left column position on the screen |
| pHeight | The height of the grid widget (including border and headers) |
| pWidth | The width of the grid widget (including border and headers) |
| pNumRows | The number of data rows in the grid |
| pNumCols | The number of data columns in the grid |
| pDefaultColWidth | The default width of each column (in characters) |
| pTitle | The title for the grid window |
| pBorderStyle | The border style for the outer grid window |
| cx::cxGrid::cxGrid | ( | const cxGrid & | pThatGrid | ) |
Copy constructor.
References cx::height(), cx::left(), cx::top(), and cx::width().
|
virtual |
Destructor.
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::addAttr().
|
overridevirtual |
Brings the window to the top.
| pRefresh | Whether to refresh the screen (defaults to true) |
Reimplemented from cx::cxWindow.
References cx::cxWindow::bringToTop(), and cx::updateWindows().
|
overridevirtual |
Clears the text from the window.
| pRefresh | Whether or not to refresh the window after clearing it (defaults to false) |
Reimplemented from cx::cxWindow.
References cx::cxWindow::clear().
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::clearKeyFunction().
|
overridevirtual |
Clears the list of external functions fired by hotkeys.
Reimplemented from cx::cxWindow.
References cx::cxWindow::clearKeyFunctions().
|
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::cxWindow.
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::disableAttrs().
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::draw().
Referenced by show().
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::enableAttrs().
|
overridevirtual |
Erases the window.
| pEraseSubwindows | Whether or not to erase the subwindows (defaults to true) |
Reimplemented from cx::cxWindow.
References cx::cxWindow::erase().
|
overridevirtual |
This is mainly for deriving classes. It tells the object.
to stop its input loop with a code of cxID_EXIT.
Reimplemented from cx::cxWindow.
References cx::cxWindow::exitNow().
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::getAttrs().
| shared_ptr< cxWindow > cx::cxGrid::getCell | ( | int | pRow, |
| int | pCol | ||
| ) | const |
Gets the cell widget at the specified row and column.
| pRow | Row index (0-based) |
| pCol | Column index (0-based) |
Referenced by SpreadsheetApp::run().
| string cx::cxGrid::getCellValue | ( | int | pRow, |
| int | pCol | ||
| ) | const |
Gets the value of a cell (as a string). Works for cxInput cells.
| pRow | Row index (0-based) |
| pCol | Column index (0-based) |
References cx::cxInput::getValue().
Referenced by collectValues(), evaluateFormula(), getCellNumericValue(), and saveToFile().
| string cx::cxGrid::getColLabel | ( | int | pCol | ) | const |
Gets a column header label.
| pCol | Column index (0-based) |
| int cx::cxGrid::getColWidth | ( | int | pCol | ) | const |
Gets the width of a specific column.
| pCol | Column index (0-based) |
Referenced by cxGridTest().
| int cx::cxGrid::getFocusCol | ( | ) | const |
Gets the currently focused cell column.
Referenced by SpreadsheetApp::run().
| int cx::cxGrid::getFocusRow | ( | ) | const |
Gets the currently focused cell row.
Referenced by SpreadsheetApp::run().
|
overridevirtual |
Returns the color of one of the items in a window.
| pItem | The item type (a member of the e_WidgetItems enumeration
|
Reimplemented from cx::cxWindow.
References cx::cxWindow::getItemColor().
| int cx::cxGrid::getNumCols | ( | ) | const |
Returns the number of data columns in the grid.
Referenced by getCellNumericValue(), loadFromFile(), and saveToFile().
| int cx::cxGrid::getNumRows | ( | ) | const |
Returns the number of data rows in the grid.
Referenced by getCellNumericValue(), loadFromFile(), and saveToFile().
|
overridevirtual |
Returns a pointer to the parent window.
Reimplemented from cx::cxWindow.
References cx::cxWindow::getParent().
| int cx::cxGrid::getRowHeaderWidth | ( | ) | const |
Gets the width of the row header column.
| string cx::cxGrid::getRowLabel | ( | int | pRow | ) | const |
Gets a row header label.
| pRow | Row index (0-based) |
| bool cx::cxGrid::getShowColHeaders | ( | ) | const |
Returns whether column headers are displayed.
| bool cx::cxGrid::getShowRowHeaders | ( | ) | const |
Returns whether row headers are displayed.
|
overridevirtual |
Returns true if window has focus, false otherwise.
Reimplemented from cx::cxWindow.
|
overridevirtual |
Hides the window.
| pHideSubwindows | Whether or not to also hide the subwindows (defaults to true) |
Reimplemented from cx::cxWindow.
References cx::cxWindow::hide().
|
overridevirtual |
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 from cx::cxWindow.
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::move().
|
overridevirtual |
This is mainly for deriving classes. This causes the object.
to stop its input loop with a code of cxID_QUIT.
Reimplemented from cx::cxWindow.
References cx::cxWindow::quitNow().
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::removeAttr().
|
overridevirtual |
Removes all attributes for a given window item.
| pItem | The item to remove attributes for (see the e_WidgetItems enumeration). |
Reimplemented from cx::cxWindow.
References cx::cxWindow::removeAttrs().
|
overridevirtual |
Removes an exit key.
| pKey | The key to remove from the list of exit keys |
Reimplemented from cx::cxWindow.
References cx::cxWindow::removeExitKey().
|
overridevirtual |
Removes a quit key.
| pKey | The key to remove from the list of quit keys |
Reimplemented from cx::cxWindow.
References cx::cxWindow::removeQuitKey().
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::resize().
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::setAttr().
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::setBorderStyle().
| bool cx::cxGrid::setCell | ( | int | pRow, |
| int | pCol, | ||
| const std::shared_ptr< cxWindow > & | pWidget | ||
| ) |
Sets (adds/replaces) the cell widget at the specified row and column.
| pRow | Row index (0-based) |
| pCol | Column index (0-based) |
| pWidget | A shared_ptr to the cxWindow to place in the cell |
Referenced by cxGridTest().
| bool cx::cxGrid::setCellValue | ( | int | pRow, |
| int | pCol, | ||
| const std::string & | pValue | ||
| ) |
Sets the value of a cell (as a string). Works for cxInput cells.
| pRow | Row index (0-based) |
| pCol | Column index (0-based) |
| pValue | The value to set |
References cx::cxInput::setValue().
Referenced by loadFromFile().
| void cx::cxGrid::setColLabel | ( | int | pCol, |
| const std::string & | pLabel | ||
| ) |
Sets a column header label.
| pCol | Column index (0-based) |
| pLabel | The label text |
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::setColor().
| void cx::cxGrid::setColWidth | ( | int | pCol, |
| int | pWidth | ||
| ) |
Sets the width of a specific column.
| pCol | Column index (0-based) |
| pWidth | The new column width |
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::setDisableCursorOnShow().
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::setEnabled().
| void cx::cxGrid::setFocusCell | ( | int | pRow, |
| int | pCol | ||
| ) |
Sets the focus to a specific cell.
| pRow | Row index (0-based) |
| pCol | Column index (0-based) |
Referenced by showModal().
| void cx::cxGrid::setGridLineColor | ( | e_cxColors | pColor | ) |
Sets the color for the grid lines/separators.
| pColor | The color to use |
| void cx::cxGrid::setHeaderColor | ( | e_cxColors | pColor | ) |
Sets the color for the column/row header labels.
| pColor | The color to use |
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxWindow::setKeyFunction().
|
overridevirtual |
Sets the last keypress.
| pLastKey | A key (represented by an int) |
Reimplemented from cx::cxWindow.
References cx::cxWindow::setLastKey().
| void cx::cxGrid::setNumCols | ( | int | pNumCols | ) |
Sets the number of columns in the grid. Adds or removes columns as needed.
| pNumCols | The new number of columns |
Referenced by loadFromFile().
| void cx::cxGrid::setNumRows | ( | int | pNumRows | ) |
Sets the number of rows in the grid. Adds or removes rows as needed.
| pNumRows | The new number of rows |
Referenced by loadFromFile().
| void cx::cxGrid::setRowHeaderWidth | ( | int | pWidth | ) |
Sets the width of the row header column.
| pWidth | The width for row headers |
| void cx::cxGrid::setRowLabel | ( | int | pRow, |
| const std::string & | pLabel | ||
| ) |
Sets a row header label.
| pRow | Row index (0-based) |
| pLabel | The label text |
|
overridevirtual |
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 from cx::cxWindow.
References draw(), cx::cxWindow::show(), and cx::updateWindows().
Referenced by SpreadsheetApp::run(), and showModal().
| void cx::cxGrid::showColHeaders | ( | bool | pShow | ) |
Toggles whether column headers are displayed.
| pShow | true to show column headers |
Referenced by SpreadsheetApp::run().
|
overridevirtual |
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 from cx::cxWindow.
References cx::cxID_EXIT, cx::cxWindow::getLeaveNow(), cx::cxWindow::getReturnCode(), cx::cxWindow::isEnabled(), cx::cxWindow::mIsModal, cx::cxWindow::runOnFocusFunction(), cx::cxWindow::runOnLeaveFunction(), cx::cxWindow::setReturnCode(), and show().
Referenced by cxGridTest(), SpreadsheetApp::run(), and showModal().
|
virtual |
Sets cell focus, then shows the grid modally to allow user interaction.
| pFocusRow | Row index (0-based) for the cell to set focus to |
| pFocusCol | Column index (0-based) for the cell to set focus to |
| 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. |
References setFocusCell(), and showModal().
| void cx::cxGrid::showRowHeaders | ( | bool | pShow | ) |
Toggles whether row headers are displayed.
| pShow | true to show row headers |
Referenced by SpreadsheetApp::run().
|
overridevirtual |
Un-hides the window.
| pUnhideSubwindows | Whether or not to also unhide the subwindows (defaults to true) |
Reimplemented from cx::cxWindow.
References cx::cxWindow::unhide().