// common clean up
wxWindowBase::~wxWindowBase()
{
+ wxASSERT_MSG( GetCapture() != this, wxT("attempt to destroy window with mouse capture") );
+
// FIXME if these 2 cases result from programming errors in the user code
// we should probably assert here instead of silently fixing them
return handlerA;
}
+bool wxWindowBase::RemoveEventHandler(wxEvtHandler *handler)
+{
+ wxCHECK_MSG( handler, FALSE, _T("RemoveEventHandler(NULL) called") );
+
+ wxEvtHandler *handlerPrev = NULL,
+ *handlerCur = GetEventHandler();
+ while ( handlerCur )
+ {
+ wxEvtHandler *handlerNext = handlerCur->GetNextHandler();
+
+ if ( handlerCur == handler )
+ {
+ if ( handlerPrev )
+ {
+ handlerPrev->SetNextHandler(handlerNext);
+ }
+ else
+ {
+ SetEventHandler(handlerNext);
+ }
+
+ handler->SetNextHandler(NULL);
+
+ return TRUE;
+ }
+
+ handlerPrev = handlerCur;
+ handlerCur = handlerNext;
+ }
+
+ wxFAIL_MSG( _T("where has the event handler gone?") );
+
+ return FALSE;
+}
+
// ----------------------------------------------------------------------------
// cursors, fonts &c
// ----------------------------------------------------------------------------
{
// don't translate these strings
wxString port;
+
+#ifdef __WXUNIVERSAL__
+ port = _T("Univ/");
+#endif // __WXUNIVERSAL__
+
switch ( wxGetOsVersion() )
{
case wxMOTIF_X: port = _T("Motif"); break;
wxMessageBox(wxString::Format(
_T(
- " wxWindows Library (%s port)\nVersion %u.%u.%u%s, compiled at %s %s\n Copyright (c) 1995-2001 wxWindows team"
+ " wxWindows Library (%s port)\nVersion %u.%u.%u%s, compiled at %s %s\n Copyright (c) 1995-2002 wxWindows team"
),
port.c_str(),
wxMAJOR_VERSION,
{
wxWindow *win;
wxWindowNext *next;
-} *wxWindow::ms_winCaptureNext = NULL;
+} *wxWindowBase::ms_winCaptureNext = NULL;
void wxWindowBase::CaptureMouse()
{
wxLogTrace(_T("mousecapture"), _T("CaptureMouse(0x%08x)"), this);
-
+
wxWindow *winOld = GetCapture();
if ( winOld )
{
void wxWindowBase::ReleaseMouse()
{
+ wxLogTrace(_T("mousecapture"), _T("ReleaseMouse(0x%08x)"), this);
+
+ wxASSERT_MSG( GetCapture() == this, wxT("attempt to release mouse, but this window hasn't captured it") )
+
DoReleaseMouse();
if ( ms_winCaptureNext )