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:
parent
b578915045
commit
0f442030c4
@ -96,6 +96,26 @@ WX_DECLARE_EXPORTED_OBJARRAY(wxGridCellWithAttr, wxGridCellWithAttrArray);
|
||||
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
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -789,63 +789,51 @@ int wxToolBarSimple::CalcScrollInc(wxScrollEvent& event)
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user