CCustomStringGrid



This class implements StringGrid complete functionality. But it is meant to be used as base class and thus it doesn't have standard constructors and doesn't set any default for the control properties.

You can find more information in comments below. Overrided methods can be found in corresponding base classes and interfaces.

class CCustomStringGrid :public virtual IStringGrid, public CCustomDrawGrid
{
public:
    enum CELL_STATE // Cell states 
    {
        cstNormal, // Normal 
        cstHovered, // Hovered 
        cstFocused, // Cell is being edited 
        cstFocusedHovered, // Cell is being edited and mouse pointer is over the cell 
        cstSelected, // Selected 
        cstSelectedHovered, // Selected and mouse pointer is over the cell 
        cstActive, // Cell is active 
        cstActiveHovered, // Cell is active and mouse pointer is over the cell 
        cstActiveSelected, // Cell is active and selected 
        cstActiveSelectedHovered, // Cell is active, and selected, and mouse pointer is over the cell 
        cstDisabled // Cell is disabled 
    };

    enum ACTIVE_CELL_STATE // Active cell states 
    {
        acstNormal, // Normal 
        acstHovered, // Mouse pointer is over the cell 
        acstSelected, // Selected 
        acstSelectedHovered // Selected and mouse pointer is over the cell 
    };
public:
    // IControl setters 
    bool setDPI(const Point &value) override;

    // IControl methods 
    void Refresh(const bool refresh_children) override;

    // ICustomGrid setters 
    bool setColumns(const int value) override;
    bool setRows(const int value) override;

    // ICustomGrid methods 
    bool DeleteColumn(const int index) override;
    bool DeleteRow(const int index) override;

    // IStringGrid getters 
    bool isCellEditable(const int column, const int row) override;
    bool isCellFocused(const int column, const int row) override;
    String getCell(const int column, const int row) override;

    // IStringGrid setters 
    bool setCellEditable(const int column, const int row, const bool value) override;
    bool setCellFocused(const int column, const int row, const bool value) override;
    bool setCell(const int column, const int row, const String &value) override;

    CCustomStringGrid(const String &class_name);
    ~CCustomStringGrid() override;

    IBuiltInTextInput *getTextInput(); // Return text input 
    bool isActiveCellDotted() const; // Return whether active cell should have dotted border. Default true 
    bool isDefaultCellEditable() const; // Return whether a cell is editable by default. Default true 
    RectF getDefaultCellPadding() const; // Return cell default padding. Default { 3, 3, 3, 3 } 
    TEXT_ALIGN getDefaultCellTextAlign() const; // Return cell default text horizontal alignment. Default taLeft 
    VERTICAL_ALIGN getDefaultCellVerticalAlign() const; // Return cell default vertical alignment. Default vaMiddle 
    RectF getDefaultFixedCellPadding() const; // Return fixed cell default padding. Default { 3, 3, 3, 3 } 
    TEXT_ALIGN getDefaultFixedCellTextAlign() const; // Return fixed cell default text horizontal alignment. Default taCenter 
    VERTICAL_ALIGN getDefaultFixedCellVerticalAlign() const; // Return fixed cell default text vertical alignment. Default vaMiddle 
    Color getCellBackgroundColor(const CELL_STATE state) const; // Return cell background color 
    Color getCellColor(const CELL_STATE state) const; // Return cell text color 
    Gradient *getCellBackgroundGradient(const CELL_STATE state); // Return cell background gradient 
    Color getActiveCellOutlineColor(const ACTIVE_CELL_STATE state) const; // Return active cell outline border color 
    unsigned int getActiveCellOutlineMask(const ACTIVE_CELL_STATE state) const; // Return active cell outline mask 

    bool setTextInput(IBuiltInTextInput *value); // Set new text input 
    bool setActiveCellDotted(const bool value); // Set whether active cell should have dotted border 
    bool setDefaultCellEditable(const bool value); // Set whether a cell is editable by default 
    bool setDefaultCellPadding(const RectF &value); // Set cell default padding 
    bool setDefaultCellTextAlign(const TEXT_ALIGN value); // Set cell default text horizontal alignment 
    bool setDefaultCellVerticalAlign(const VERTICAL_ALIGN value); // Set cell default vertical alignment 
    bool setDefaultFixedCellPadding(const RectF &value); // Set fixed cell default padding 
    bool setDefaultFixedCellTextAlign(const TEXT_ALIGN value); // Set fixed cell default text horizontal alignment 
    bool setDefaultFixedCellVerticalAlign(const VERTICAL_ALIGN value); // Set fixed cell default text vertical alignment 
    bool setCellBackgroundColor(const CELL_STATE state, const Color &value); // Set cell background color 
    bool setCellColor(const CELL_STATE state, const Color &value); // Set cell text color 
    bool setActiveCellOutlineColor(const ACTIVE_CELL_STATE state, const Color &value); // Set active cell outline border color 
    bool setActiveCellOutlineMask(const ACTIVE_CELL_STATE state, const unsigned int value); // Set active cell outline mask 
};
Namespace: nitisa::standard
Include: Standard/Controls/StringGrid/CustomStringGrid.h