WX_DEFINE_OBJARRAY(wxGridCellCoordsArray)
WX_DEFINE_OBJARRAY(wxGridCellWithAttrArray)
+// ----------------------------------------------------------------------------
+// events
+// ----------------------------------------------------------------------------
+
+const int wxEVT_GRID_CELL_LEFT_CLICK = wxNewEventType();
+const int wxEVT_GRID_CELL_RIGHT_CLICK = wxNewEventType();
+const int wxEVT_GRID_CELL_LEFT_DCLICK = wxNewEventType();
+const int wxEVT_GRID_CELL_RIGHT_DCLICK = wxNewEventType();
+const int wxEVT_GRID_LABEL_LEFT_CLICK = wxNewEventType();
+const int wxEVT_GRID_LABEL_RIGHT_CLICK = wxNewEventType();
+const int wxEVT_GRID_LABEL_LEFT_DCLICK = wxNewEventType();
+const int wxEVT_GRID_LABEL_RIGHT_DCLICK = wxNewEventType();
+const int wxEVT_GRID_ROW_SIZE = wxNewEventType();
+const int wxEVT_GRID_COL_SIZE = wxNewEventType();
+const int wxEVT_GRID_RANGE_SELECT = wxNewEventType();
+const int wxEVT_GRID_CELL_CHANGE = wxNewEventType();
+const int wxEVT_GRID_SELECT_CELL = wxNewEventType();
+const int wxEVT_GRID_EDITOR_SHOWN = wxNewEventType();
+const int wxEVT_GRID_EDITOR_HIDDEN = wxNewEventType();
+
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
int orient = event.GetOrientation();
int nScrollInc = 0;
- switch (event.GetEventType())
+ if (event.GetEventType() == wxEVT_SCROLL_TOP)
{
- case wxEVT_SCROLL_TOP:
- {
- if (orient == wxHORIZONTAL)
- nScrollInc = - m_xScrollPosition;
- else
- nScrollInc = - m_yScrollPosition;
- break;
- }
- case wxEVT_SCROLL_BOTTOM:
- {
- if (orient == wxHORIZONTAL)
- nScrollInc = m_xScrollLines - m_xScrollPosition;
- else
- nScrollInc = m_yScrollLines - m_yScrollPosition;
- break;
- }
- case wxEVT_SCROLL_LINEUP:
- {
- nScrollInc = -1;
- break;
- }
- case wxEVT_SCROLL_LINEDOWN:
- {
- nScrollInc = 1;
- break;
- }
- case wxEVT_SCROLL_PAGEUP:
- {
- if (orient == wxHORIZONTAL)
- nScrollInc = -GetScrollPageSize(wxHORIZONTAL);
- else
- nScrollInc = -GetScrollPageSize(wxVERTICAL);
- break;
- }
- case wxEVT_SCROLL_PAGEDOWN:
- {
- if (orient == wxHORIZONTAL)
- nScrollInc = GetScrollPageSize(wxHORIZONTAL);
- else
- nScrollInc = GetScrollPageSize(wxVERTICAL);
- break;
- }
- case wxEVT_SCROLL_THUMBTRACK:
- {
- if (orient == wxHORIZONTAL)
- nScrollInc = pos - m_xScrollPosition;
- else
- nScrollInc = pos - m_yScrollPosition;
- break;
- }
- default:
- {
- break;
- }
+ if (orient == wxHORIZONTAL)
+ nScrollInc = - m_xScrollPosition;
+ else
+ nScrollInc = - m_yScrollPosition;
+ } else
+ if (event.GetEventType() == wxEVT_SCROLL_BOTTOM)
+ {
+ if (orient == wxHORIZONTAL)
+ nScrollInc = m_xScrollLines - m_xScrollPosition;
+ else
+ nScrollInc = m_yScrollLines - m_yScrollPosition;
+ } else
+ if (event.GetEventType() == wxEVT_SCROLL_LINEUP)
+ {
+ nScrollInc = -1;
+ } else
+ if (event.GetEventType() == wxEVT_SCROLL_LINEDOWN)
+ {
+ nScrollInc = 1;
+ } else
+ if (event.GetEventType() == wxEVT_SCROLL_PAGEUP)
+ {
+ if (orient == wxHORIZONTAL)
+ nScrollInc = -GetScrollPageSize(wxHORIZONTAL);
+ else
+ nScrollInc = -GetScrollPageSize(wxVERTICAL);
+ } else
+ if (event.GetEventType() == wxEVT_SCROLL_PAGEDOWN)
+ {
+ if (orient == wxHORIZONTAL)
+ nScrollInc = GetScrollPageSize(wxHORIZONTAL);
+ else
+ nScrollInc = GetScrollPageSize(wxVERTICAL);
+ } else
+ if ((event.GetEventType() == wxEVT_SCROLL_THUMBTRACK) ||
+ (event.GetEventType() == wxEVT_SCROLL_THUMBRELEASE))
+ {
+ if (orient == wxHORIZONTAL)
+ nScrollInc = pos - m_xScrollPosition;
+ else
+ nScrollInc = pos - m_yScrollPosition;
}
+
if (orient == wxHORIZONTAL)
{
int w, h;