Prepare wxToolBarSimple for event type change.

Make wxGrid use new event types.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2001-01-25 18:27:01 +00:00
parent b578915045
commit 0f442030c4
2 changed files with 63 additions and 55 deletions

View File

@@ -96,6 +96,26 @@ WX_DECLARE_EXPORTED_OBJARRAY(wxGridCellWithAttr, wxGridCellWithAttrArray);
WX_DEFINE_OBJARRAY(wxGridCellCoordsArray) WX_DEFINE_OBJARRAY(wxGridCellCoordsArray)
WX_DEFINE_OBJARRAY(wxGridCellWithAttrArray) 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 // private classes
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -789,63 +789,51 @@ int wxToolBarSimple::CalcScrollInc(wxScrollEvent& event)
int orient = event.GetOrientation(); int orient = event.GetOrientation();
int nScrollInc = 0; int nScrollInc = 0;
switch (event.GetEventType()) if (event.GetEventType() == wxEVT_SCROLL_TOP)
{ {
case wxEVT_SCROLL_TOP: if (orient == wxHORIZONTAL)
{ nScrollInc = - m_xScrollPosition;
if (orient == wxHORIZONTAL) else
nScrollInc = - m_xScrollPosition; nScrollInc = - m_yScrollPosition;
else } else
nScrollInc = - m_yScrollPosition; if (event.GetEventType() == wxEVT_SCROLL_BOTTOM)
break; {
} if (orient == wxHORIZONTAL)
case wxEVT_SCROLL_BOTTOM: nScrollInc = m_xScrollLines - m_xScrollPosition;
{ else
if (orient == wxHORIZONTAL) nScrollInc = m_yScrollLines - m_yScrollPosition;
nScrollInc = m_xScrollLines - m_xScrollPosition; } else
else if (event.GetEventType() == wxEVT_SCROLL_LINEUP)
nScrollInc = m_yScrollLines - m_yScrollPosition; {
break; nScrollInc = -1;
} } else
case wxEVT_SCROLL_LINEUP: if (event.GetEventType() == wxEVT_SCROLL_LINEDOWN)
{ {
nScrollInc = -1; nScrollInc = 1;
break; } else
} if (event.GetEventType() == wxEVT_SCROLL_PAGEUP)
case wxEVT_SCROLL_LINEDOWN: {
{ if (orient == wxHORIZONTAL)
nScrollInc = 1; nScrollInc = -GetScrollPageSize(wxHORIZONTAL);
break; else
} nScrollInc = -GetScrollPageSize(wxVERTICAL);
case wxEVT_SCROLL_PAGEUP: } else
{ if (event.GetEventType() == wxEVT_SCROLL_PAGEDOWN)
if (orient == wxHORIZONTAL) {
nScrollInc = -GetScrollPageSize(wxHORIZONTAL); if (orient == wxHORIZONTAL)
else nScrollInc = GetScrollPageSize(wxHORIZONTAL);
nScrollInc = -GetScrollPageSize(wxVERTICAL); else
break; nScrollInc = GetScrollPageSize(wxVERTICAL);
} } else
case wxEVT_SCROLL_PAGEDOWN: if ((event.GetEventType() == wxEVT_SCROLL_THUMBTRACK) ||
{ (event.GetEventType() == wxEVT_SCROLL_THUMBRELEASE))
if (orient == wxHORIZONTAL) {
nScrollInc = GetScrollPageSize(wxHORIZONTAL); if (orient == wxHORIZONTAL)
else nScrollInc = pos - m_xScrollPosition;
nScrollInc = GetScrollPageSize(wxVERTICAL); else
break; nScrollInc = pos - m_yScrollPosition;
}
case wxEVT_SCROLL_THUMBTRACK:
{
if (orient == wxHORIZONTAL)
nScrollInc = pos - m_xScrollPosition;
else
nScrollInc = pos - m_yScrollPosition;
break;
}
default:
{
break;
}
} }
if (orient == wxHORIZONTAL) if (orient == wxHORIZONTAL)
{ {
int w, h; int w, h;