Changed event type ids to constants instead of enum, for extensibility.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -222,8 +222,8 @@ bool wxMouseEvent::ButtonIsDown(int but) const
|
||||
// Find the logical position of the event given the DC
|
||||
wxPoint wxMouseEvent::GetLogicalPosition(const wxDC& dc) const
|
||||
{
|
||||
wxPoint pt(dc.DeviceToLogicalX(m_x), dc.DeviceToLogicalY(m_y));
|
||||
return pt;
|
||||
wxPoint pt(dc.DeviceToLogicalX(m_x), dc.DeviceToLogicalY(m_y));
|
||||
return pt;
|
||||
}
|
||||
|
||||
|
||||
@@ -305,14 +305,14 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
|
||||
// chain of event handlers.
|
||||
if (IsKindOf(CLASSINFO(wxWindow)))
|
||||
{
|
||||
wxWindow *win = (wxWindow *)this;
|
||||
wxWindow *win = (wxWindow *)this;
|
||||
|
||||
// Can only use the validator of the window which
|
||||
// is receiving the event
|
||||
if ( (win == event.GetEventObject()) &&
|
||||
win->GetValidator() &&
|
||||
win->GetValidator()->ProcessEvent(event))
|
||||
return TRUE;
|
||||
// Can only use the validator of the window which
|
||||
// is receiving the event
|
||||
if ( (win == event.GetEventObject()) &&
|
||||
win->GetValidator() &&
|
||||
win->GetValidator()->ProcessEvent(event))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Search upwards through the inheritance hierarchy
|
||||
@@ -327,8 +327,8 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
|
||||
// Try going down the event handler chain
|
||||
if ( GetNextHandler() )
|
||||
{
|
||||
if ( GetNextHandler()->ProcessEvent(event) )
|
||||
return TRUE;
|
||||
if ( GetNextHandler()->ProcessEvent(event) )
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Carry on up the parent-child hierarchy,
|
||||
@@ -337,7 +337,7 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
|
||||
if (IsKindOf(CLASSINFO(wxWindow)) && event.IsKindOf(CLASSINFO(wxCommandEvent)))
|
||||
{
|
||||
wxWindow *win = (wxWindow *)this;
|
||||
wxWindow *parent = win->GetParent();
|
||||
wxWindow *parent = win->GetParent();
|
||||
if (parent && !parent->IsBeingDeleted())
|
||||
return win->GetParent()->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
@@ -364,14 +364,14 @@ bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event)
|
||||
(table.entries[i].m_lastId != -1 &&
|
||||
(commandId >= table.entries[i].m_id && commandId <= table.entries[i].m_lastId))))
|
||||
{
|
||||
event.Skip(FALSE);
|
||||
event.Skip(FALSE);
|
||||
event.m_callbackUserData = table.entries[i].m_callbackUserData;
|
||||
|
||||
|
||||
(this->*((wxEventFunction) (table.entries[i].m_fn)))(event);
|
||||
|
||||
if ( event.GetSkipped() )
|
||||
return FALSE;
|
||||
else
|
||||
if ( event.GetSkipped() )
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
i ++;
|
||||
@@ -381,8 +381,8 @@ bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event)
|
||||
|
||||
void wxEvtHandler::Connect( int id, int lastId,
|
||||
int eventType,
|
||||
wxObjectEventFunction func,
|
||||
wxObject *userData )
|
||||
wxObjectEventFunction func,
|
||||
wxObject *userData )
|
||||
{
|
||||
wxEventTableEntry *entry = new wxEventTableEntry;
|
||||
entry->m_id = id;
|
||||
@@ -418,14 +418,14 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event )
|
||||
(entry->m_lastId != -1 &&
|
||||
(commandId >= entry->m_id && commandId <= entry->m_lastId))))
|
||||
{
|
||||
event.Skip(FALSE);
|
||||
event.Skip(FALSE);
|
||||
event.m_callbackUserData = entry->m_callbackUserData;
|
||||
|
||||
|
||||
(this->*((wxEventFunction) (entry->m_fn)))(event);
|
||||
|
||||
if (event.GetSkipped())
|
||||
return FALSE;
|
||||
else
|
||||
if (event.GetSkipped())
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
};
|
||||
|
@@ -476,7 +476,7 @@ int wxToolBarBase::CalcScrollInc(wxScrollEvent& event)
|
||||
int nScrollInc = 0;
|
||||
switch (event.GetEventType())
|
||||
{
|
||||
case wxEVENT_TYPE_SCROLL_TOP:
|
||||
case wxEVT_SCROLL_TOP:
|
||||
{
|
||||
if (orient == wxHORIZONTAL)
|
||||
nScrollInc = - m_xScrollPosition;
|
||||
@@ -484,7 +484,7 @@ int wxToolBarBase::CalcScrollInc(wxScrollEvent& event)
|
||||
nScrollInc = - m_yScrollPosition;
|
||||
break;
|
||||
}
|
||||
case wxEVENT_TYPE_SCROLL_BOTTOM:
|
||||
case wxEVT_SCROLL_BOTTOM:
|
||||
{
|
||||
if (orient == wxHORIZONTAL)
|
||||
nScrollInc = m_xScrollLines - m_xScrollPosition;
|
||||
@@ -492,17 +492,17 @@ int wxToolBarBase::CalcScrollInc(wxScrollEvent& event)
|
||||
nScrollInc = m_yScrollLines - m_yScrollPosition;
|
||||
break;
|
||||
}
|
||||
case wxEVENT_TYPE_SCROLL_LINEUP:
|
||||
case wxEVT_SCROLL_LINEUP:
|
||||
{
|
||||
nScrollInc = -1;
|
||||
break;
|
||||
}
|
||||
case wxEVENT_TYPE_SCROLL_LINEDOWN:
|
||||
case wxEVT_SCROLL_LINEDOWN:
|
||||
{
|
||||
nScrollInc = 1;
|
||||
break;
|
||||
}
|
||||
case wxEVENT_TYPE_SCROLL_PAGEUP:
|
||||
case wxEVT_SCROLL_PAGEUP:
|
||||
{
|
||||
if (orient == wxHORIZONTAL)
|
||||
nScrollInc = -GetScrollPageSize(wxHORIZONTAL);
|
||||
@@ -510,7 +510,7 @@ int wxToolBarBase::CalcScrollInc(wxScrollEvent& event)
|
||||
nScrollInc = -GetScrollPageSize(wxVERTICAL);
|
||||
break;
|
||||
}
|
||||
case wxEVENT_TYPE_SCROLL_PAGEDOWN:
|
||||
case wxEVT_SCROLL_PAGEDOWN:
|
||||
{
|
||||
if (orient == wxHORIZONTAL)
|
||||
nScrollInc = GetScrollPageSize(wxHORIZONTAL);
|
||||
@@ -518,7 +518,7 @@ int wxToolBarBase::CalcScrollInc(wxScrollEvent& event)
|
||||
nScrollInc = GetScrollPageSize(wxVERTICAL);
|
||||
break;
|
||||
}
|
||||
case wxEVENT_TYPE_SCROLL_THUMBTRACK:
|
||||
case wxEVT_SCROLL_THUMBTRACK:
|
||||
{
|
||||
if (orient == wxHORIZONTAL)
|
||||
nScrollInc = pos - m_xScrollPosition;
|
||||
|
@@ -643,6 +643,7 @@ void wxWindow::ScreenToClient(int *x, int *y) const
|
||||
pt.y = *y;
|
||||
::ScreenToClient(hWnd, &pt);
|
||||
|
||||
/*
|
||||
// We may be faking the client origin.
|
||||
// So a window that's really at (0, 30) may appear
|
||||
// (to wxWin apps) to be at (0, 0).
|
||||
@@ -652,6 +653,8 @@ void wxWindow::ScreenToClient(int *x, int *y) const
|
||||
pt.x -= pt1.x;
|
||||
pt.y -= pt1.y;
|
||||
}
|
||||
*/
|
||||
|
||||
*x = pt.x;
|
||||
*y = pt.y;
|
||||
}
|
||||
@@ -663,6 +666,7 @@ void wxWindow::ClientToScreen(int *x, int *y) const
|
||||
pt.x = *x;
|
||||
pt.y = *y;
|
||||
|
||||
/*
|
||||
// We may be faking the client origin.
|
||||
// So a window that's really at (0, 30) may appear
|
||||
// (to wxWin apps) to be at (0, 0).
|
||||
@@ -672,6 +676,7 @@ void wxWindow::ClientToScreen(int *x, int *y) const
|
||||
pt.x += pt1.x;
|
||||
pt.y += pt1.y;
|
||||
}
|
||||
*/
|
||||
|
||||
::ClientToScreen(hWnd, &pt);
|
||||
|
||||
|
Reference in New Issue
Block a user