wxGridCellCoords coords;
wxGridCellAttr *attr;
+
+// Cannot do this:
+// DECLARE_NO_COPY_CLASS(wxGridCellWithAttr)
+// without rewriting the macros, which require a public copy constructor.
};
WX_DECLARE_EXPORTED_OBJARRAY(wxGridCellWithAttr, wxGridCellWithAttrArray);
DECLARE_DYNAMIC_CLASS(wxGridRowLabelWindow)
DECLARE_EVENT_TABLE()
+ DECLARE_NO_COPY_CLASS(wxGridRowLabelWindow)
};
DECLARE_DYNAMIC_CLASS(wxGridColLabelWindow)
DECLARE_EVENT_TABLE()
+ DECLARE_NO_COPY_CLASS(wxGridColLabelWindow)
};
DECLARE_DYNAMIC_CLASS(wxGridCornerLabelWindow)
DECLARE_EVENT_TABLE()
+ DECLARE_NO_COPY_CLASS(wxGridCornerLabelWindow)
};
class WXDLLEXPORT wxGridWindow : public wxWindow
DECLARE_DYNAMIC_CLASS(wxGridWindow)
DECLARE_EVENT_TABLE()
+ DECLARE_NO_COPY_CLASS(wxGridWindow)
};
wxGridCellEditor* m_editor;
DECLARE_DYNAMIC_CLASS(wxGridCellEditorEvtHandler)
DECLARE_EVENT_TABLE()
+ DECLARE_NO_COPY_CLASS(wxGridCellEditorEvtHandler)
};
wxString m_typeName;
wxGridCellRenderer* m_renderer;
wxGridCellEditor* m_editor;
+
+ DECLARE_NO_COPY_CLASS(wxGridDataTypeInfo)
};
{
if ( !HasRange() )
{
- int keycode = (int) event.KeyCode();
+ int keycode = event.GetKeyCode();
if ( isdigit(keycode) || keycode == '+' || keycode == '-'
|| keycode == WXK_NUMPAD0
|| keycode == WXK_NUMPAD1
void wxGridCellFloatEditor::StartingKey(wxKeyEvent& event)
{
- int keycode = (int)event.KeyCode();
+ int keycode = event.GetKeyCode();
if ( isdigit(keycode) || keycode == '+' || keycode == '-' || keycode == '.'
|| keycode == WXK_NUMPAD0
|| keycode == WXK_NUMPAD1
int vAlign = wxALIGN_CENTRE;
if (GetCellAttr())
GetCellAttr()->GetAlignment(& hAlign, & vAlign);
-
+
int x = 0, y = 0;
if (hAlign == wxALIGN_LEFT)
{
x = r.x + 2;
#ifdef __WXMSW__
x += 2;
-#endif
+#endif
y = r.y + r.height/2 - size.y/2;
}
else if (hAlign == wxALIGN_RIGHT)
x = r.x + r.width/2 - size.x/2;
y = r.y + r.height/2 - size.y/2;
}
-
+
m_control->Move(x, y);
}
void wxGridCellEditorEvtHandler::OnKeyDown(wxKeyEvent& event)
{
- switch ( event.KeyCode() )
+ switch ( event.GetKeyCode() )
{
case WXK_ESCAPE:
m_editor->Reset();
void wxGridCellEditorEvtHandler::OnChar(wxKeyEvent& event)
{
- switch ( event.KeyCode() )
+ switch ( event.GetKeyCode() )
{
case WXK_ESCAPE:
case WXK_TAB:
{
dc.SetBrush( wxBrush(attr.GetBackgroundColour(), wxSOLID) );
}
- }
+ }
else
{
dc.SetBrush(wxBrush(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE), wxSOLID));
// draw a border around checkmark
int vAlign, hAlign;
attr.GetAlignment(& hAlign, &vAlign);
-
+
wxRect rectBorder;
if (hAlign == wxALIGN_CENTRE)
{
rectBorder.x = rect.x + 2;
rectBorder.y = rect.y + rect.height/2 - size.y/2;
rectBorder.width = size.x;
- rectBorder.height = size.y;
+ rectBorder.height = size.y;
}
else if (hAlign == wxALIGN_RIGHT)
{
rectBorder.x = rect.x + rect.width - size.x - 2;
rectBorder.y = rect.y + rect.height/2 - size.y/2;
rectBorder.width = size.x;
- rectBorder.height = size.y;
+ rectBorder.height = size.y;
}
bool value;
// TODO: something better than this ?
//
m_labelFont = this->GetFont();
-// m_labelFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
-// m_labelFont.SetWeight( m_labelFont.GetWeight() + 2 );
+ m_labelFont.SetWeight( wxBOLD );
m_rowLabelHorizAlign = wxALIGN_CENTRE;
m_rowLabelVertAlign = wxALIGN_CENTRE;
m_selectingBottomRight = wxGridNoCellCoords;
// m_selectionBackground = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
// m_selectionForeground = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
- m_selectionBackground = *wxBLACK;
- m_selectionForeground = *wxWHITE;
+ m_selectionBackground = *wxBLACK;
+ m_selectionForeground = *wxWHITE;
m_editable = TRUE; // default for whole grid
// try local handlers
//
- switch ( event.KeyCode() )
+ switch ( event.GetKeyCode() )
{
case WXK_UP:
if ( event.ControlDown() )
// <F2> is special and will always start editing, for
// other keys - ask the editor itself
- if ( (event.KeyCode() == WXK_F2 && !event.HasModifiers())
+ if ( (event.GetKeyCode() == WXK_F2 && !event.HasModifiers())
|| editor->IsAcceptedKey(event) )
{
// ensure cell is visble
{
// try local handlers
//
- if ( event.KeyCode() == WXK_SHIFT )
+ if ( event.GetKeyCode() == WXK_SHIFT )
{
if ( m_selectingTopLeft != wxGridNoCellCoords &&
m_selectingBottomRight != wxGridNoCellCoords )