From: John L. <jr...@us...> - 2007-08-07 03:06:18
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2700/wxLua/modules/wxlua/src Modified Files: wxlcallb.cpp Log Message: Make sure that we differentiate between wxScrollEvents and wxSpinEvents for wxEVT_SCROLLXXX Index: wxlcallb.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlcallb.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** wxlcallb.cpp 6 Aug 2007 22:00:34 -0000 1.39 --- wxlcallb.cpp 7 Aug 2007 03:06:12 -0000 1.40 *************** *** 82,91 **** return; ! wxlState.SetInEventType(event.GetEventType()); theCallback->CallFunction(&event); // we want the wxLuaWinDestroyCallback to get this too ! if (event.GetEventType() == wxEVT_DESTROY) event.Skip(); --- 82,93 ---- return; ! wxEventType evtType = event.GetEventType(); ! ! wxlState.SetInEventType(evtType); theCallback->CallFunction(&event); // we want the wxLuaWinDestroyCallback to get this too ! if (evtType == wxEVT_DESTROY) event.Skip(); *************** *** 108,112 **** --- 110,129 ---- // If !m_wxlBindEvent, we would have errored in the constructor, but... if (m_wxlBindEvent != NULL) + { event_tag = *m_wxlBindEvent->class_tag; + + // These wxEventTypes can be wxScrollEvents or wxSpinEvents + // wxEVT_SCROLL_LINEUP, wxEVT_SCROLL_LINEDOWN, wxEVT_SCROLL_THUMBTRACK + + if ((strcmp(m_wxlBindEvent->name, "wxScrollEvent") == 0) && + (event->GetClassInfo()->GetClassName() == wxString(wxT("wxSpinEvent")))) + { + const wxLuaBindClass *wxlClass = wxlState.GetLuaClass("wxSpinEvent"); + if (wxlClass != NULL) + event_tag = *wxlClass->class_tag; + else + event_tag = g_wxluatag_wxEvent; // get the s_wxluatag_wxEvent + } + } else event_tag = g_wxluatag_wxEvent; // get the s_wxluatag_wxEvent |