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 class CellState // Cell states 
    {
        Normal, // Normal 
        Hovered, // Hovered 
        Focused, // Cell is being edited 
        FocusedHovered, // Cell is being edited and mouse pointer is over the cell 
        Selected, // Selected 
        SelectedHovered, // Selected and mouse pointer is over the cell 
        Active, // Cell is active 
        ActiveHovered, // Cell is active and mouse pointer is over the cell 
        ActiveSelected, // Cell is active and selected 
        ActiveSelectedHovered, // Cell is active, and selected, and mouse pointer is over the cell 
        Disabled // Cell is disabled 
    };

    enum class ActiveCellState // Active cell states 
    {
        Normal, // Normal 
        Hovered, // Mouse pointer is over the cell 
        Selected, // Selected 
        SelectedHovered // Selected and mouse pointer is over the cell 
    };
protected:
    void UpdateFromStyle(IStyle *style) override;
    void RenderCell(const int column, const int row, IListItem *item, const Mat4f &matrix, const Block *block) override;
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 } 
    TextAlign getDefaultCellTextAlign() const; // Return cell default text horizontal alignment. Default taLeft 
    VerticalAlign getDefaultCellVerticalAlign() const; // Return cell default vertical alignment. Default VerticalAlign::Middle 
    RectF getDefaultFixedCellPadding() const; // Return fixed cell default padding. Default { 3, 3, 3, 3 } 
    TextAlign getDefaultFixedCellTextAlign() const; // Return fixed cell default text horizontal alignment. Default TextAlign::Center 
    VerticalAlign getDefaultFixedCellVerticalAlign() const; // Return fixed cell default text vertical alignment. Default VerticalAlign::Middle 
    Color getCellBackgroundColor(const CellState state) const; // Return cell background color 
    Color getCellColor(const CellState state) const; // Return cell text color 
    Gradient *getCellBackgroundGradient(const CellState state); // Return cell background gradient 
    Color getActiveCellOutlineColor(const ActiveCellState state) const; // Return active cell outline border color 
    unsigned int getActiveCellOutlineMask(const ActiveCellState 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 TextAlign value); // Set cell default text horizontal alignment 
    bool setDefaultCellVerticalAlign(const VerticalAlign value); // Set cell default vertical alignment 
    bool setDefaultFixedCellPadding(const RectF &value); // Set fixed cell default padding 
    bool setDefaultFixedCellTextAlign(const TextAlign value); // Set fixed cell default text horizontal alignment 
    bool setDefaultFixedCellVerticalAlign(const VerticalAlign value); // Set fixed cell default text vertical alignment 
    bool setCellBackgroundColor(const CellState state, const Color &value); // Set cell background color 
    bool setCellColor(const CellState state, const Color &value); // Set cell text color 
    bool setActiveCellOutlineColor(const ActiveCellState state, const Color &value); // Set active cell outline border color 
    bool setActiveCellOutlineMask(const ActiveCellState state, const unsigned int value); // Set active cell outline mask 
};
Namespace: nitisa::standard
Include: Standard/Controls/StringGrid/CustomStringGrid.h