#include "wx/defs.h"
-#if !defined(wxUSE_NEW_GRID) || !(wxUSE_NEW_GRID)
-#include "wx/generic/gridg.h"
-#else
-
#ifndef __WXGRID_H__
#define __WXGRID_H__
m_vAlign = vAlign;
}
void SetSize(int num_rows, int num_cols);
- void SetOverflow( bool allow ) { m_overflow = allow; }
+ void SetOverflow(bool allow = TRUE)
+ { m_overflow = allow ? Overflow : SingleCell; }
void SetReadOnly(bool isReadOnly = TRUE)
{ m_isReadOnly = isReadOnly ? ReadOnly : ReadWrite; }
bool HasRenderer() const { return m_renderer != NULL; }
bool HasEditor() const { return m_editor != NULL; }
bool HasReadWriteMode() const { return m_isReadOnly != Unset; }
+ bool HasOverflowMode() const { return m_overflow != UnsetOverflow; }
const wxColour& GetTextColour() const;
const wxColour& GetBackgroundColour() const;
const wxFont& GetFont() const;
void GetAlignment(int *hAlign, int *vAlign) const;
void GetSize(int *num_rows, int *num_cols) const;
- bool GetOverflow() const { return m_overflow; }
+ bool GetOverflow() const
+ { return m_overflow != SingleCell; }
wxGridCellRenderer *GetRenderer(wxGrid* grid, int row, int col) const;
wxGridCellEditor *GetEditor(wxGrid* grid, int row, int col) const;
ReadOnly
};
+ enum wxAttrOverflowMode
+ {
+ UnsetOverflow = -1,
+ Overflow,
+ SingleCell
+ };
+
// the common part of all ctors
void Init(wxGridCellAttr *attrDefault = NULL);
m_vAlign;
int m_sizeRows,
m_sizeCols;
- bool m_overflow;
+
+ wxAttrOverflowMode m_overflow;
wxGridCellRenderer* m_renderer;
wxGridCellEditor* m_editor;
void SetColMinimalWidth( int col, int width );
void SetRowMinimalHeight( int row, int width );
+ /* These members can be used to query and modify the minimal
+ * acceptable size of grid rows and columns. Call this function in
+ * your code which creates the grid if you want to display cells
+ * with a size smaller than the default acceptable minimum size.
+ * Like the members SetColMinimalWidth and SetRowMinimalWidth,
+ * the existing rows or columns will not be checked/resized.
+ */
+ void SetColMinimalAcceptableWidth( int width );
+ void SetRowMinimalAcceptableHeight( int width );
+ int GetColMinimalAcceptableWidth() const;
+ int GetRowMinimalAcceptableHeight() const;
+
void SetDefaultCellBackgroundColour( const wxColour& );
void SetCellBackgroundColour( int row, int col, const wxColour& );
void SetDefaultCellTextColour( const wxColour& );
void InitRowHeights();
int m_defaultRowHeight;
+ int m_minAcceptableRowHeight;
wxArrayInt m_rowHeights;
wxArrayInt m_rowBottoms;
void InitColWidths();
int m_defaultColWidth;
+ int m_minAcceptableColWidth;
wxArrayInt m_colWidths;
wxArrayInt m_colRights;
DECLARE_NO_COPY_CLASS(wxGrid)
};
+
// ----------------------------------------------------------------------------
// Grid event class and event types
// ----------------------------------------------------------------------------
#endif
-#endif // #ifndef __WXGRID_H__
+#endif // ifndef wxUSE_GRID
-#endif // ifndef wxUSE_NEW_GRID