2. fixed memory leak with wxLogStderr in wxBase
3. updated tmake files/makefiles for wxBase with wxSocket under MSW
4. fixed wxSashWindow cursor bug by allowing SetCursor(wxNullCursor)
5. fixed warning in gsock*.c
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6748
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
\func{virtual void}{SetCursor}{\param{const wxCursor\&}{cursor}}
-Sets the window's cursor. Notice that setting the cursor for this window does
-not set it for its children so you'll need to explicitly call SetCursor() for
-them too if you need it.
+% VZ: the docs are correct, if the code doesn't behave like this, it must be
+% changed
+Sets the window's cursor. Notice that the window cursor also sets it for the
+children of the window implicitly.
+
+The {\it cursor} may be {\tt wxNullCursor} in which case the window cursor will
+be reset back to default.
\wxheading{Parameters}
// continuing to use user defined log target is unsafe from now on because
// some resources may be already unavailable, so replace it by something
// more safe
- wxLog *oldlog = wxLog::SetActiveTarget(new wxLogStderr);
- if ( oldlog )
- delete oldlog;
+ wxLog::DontCreateOnDemand();
+ delete wxLog::SetActiveTarget(new wxLogStderr);
#endif // wxUSE_LOG
wxModule::CleanUpModules();
// delete the application object
delete wxTheApp;
wxTheApp = (wxApp *)NULL;
+
+#if wxUSE_LOG
+ // and now delete the last logger as well
+ delete wxLog::SetActiveTarget(NULL);
+#endif // wxUSE_LOG
}
bool wxWindowBase::SetCursor(const wxCursor& cursor)
{
- // don't try to set invalid cursor, always fall back to the default
- const wxCursor& cursorOk = cursor.Ok() ? cursor : *wxSTANDARD_CURSOR;
-
- if ( (wxCursor&)cursorOk == m_cursor )
+ // setting an invalid cursor is ok, it means that we don't have any special
+ // cursor
+ if ( cursor == m_cursor )
{
// no change
return FALSE;
}
- m_cursor = cursorOk;
+ m_cursor = cursor;
return TRUE;
}
SetCursor(* wxSTANDARD_CURSOR);
#endif
#ifdef __WXMSW__
- SetCursor(wxCursor());
+ SetCursor(wxNullCursor);
#endif
if (event.LeftDown())
}
else
{
- SetCursor(* wxSTANDARD_CURSOR);
+ SetCursor(wxNullCursor);
}
}
else if ( event.Dragging() &&
* PLEASE don't put C++ comments here - this is a C source file.
*/
+/* including rasasync.h (included from windows.h itself included from
+ * wx/setup.h and/or winsock.h results in this warning for
+ * RPCNOTIFICATION_ROUTINE
+ */
+#ifdef _MSC_VER
+# pragma warning(disable:4115) /* named type definition in parentheses */
+#endif
+
#ifndef __GSOCKET_STANDALONE__
#include "wx/setup.h"
#endif
#include <stdlib.h>
#include <stddef.h>
#include <ctype.h>
+
#include <winsock.h>
+#ifdef _MSC_VER
+# pragma warning(default:4115) /* named type definition in parentheses */
+#endif
+
/* if we use configure for MSW SOCKLEN_T will be already defined */
#ifndef SOCKLEN_T
# define SOCKLEN_T int
{
assert(address != NULL);
+ free(address->m_addr);
free(address);
}
* PLEASE don't put C++ comments here - this is a C source file.
*/
+/* including rasasync.h (included from windows.h itself included from
+ * wx/setup.h and/or winsock.h results in this warning for
+ * RPCNOTIFICATION_ROUTINE
+ */
+#ifdef _MSC_VER
+# pragma warning(disable:4115) /* named type definition in parentheses */
+#endif
+
#ifndef __GSOCKET_STANDALONE__
#include "wx/setup.h"
#endif
#include <stdlib.h>
#include <stddef.h>
#include <ctype.h>
+
#include <winsock.h>
+#ifdef _MSC_VER
+# pragma warning(default:4115) /* named type definition in parentheses */
+#endif
+
#define CLASSNAME "_GSocket_Internal_Window_Class"
#define WINDOWNAME "_GSocket_Internal_Window_Name"
return FALSE;
}
- wxASSERT_MSG( m_cursor.Ok(),
- wxT("cursor must be valid after call to the base version"));
-
- HWND hWnd = GetHwnd();
+ if ( m_cursor.Ok() )
+ {
+ HWND hWnd = GetHwnd();
- // Change the cursor NOW if we're within the correct window
- POINT point;
- ::GetCursorPos(&point);
+ // Change the cursor NOW if we're within the correct window
+ POINT point;
+ ::GetCursorPos(&point);
- RECT rect;
- ::GetWindowRect(hWnd, &rect);
+ RECT rect;
+ ::GetWindowRect(hWnd, &rect);
- if ( ::PtInRect(&rect, point) && !wxIsBusy() )
- ::SetCursor(GetHcursorOf(m_cursor));
+ if ( ::PtInRect(&rect, point) && !wxIsBusy() )
+ ::SetCursor(GetHcursorOf(m_cursor));
+ }
return TRUE;
}