Vadim Zeitlin [Sun, 10 Jun 2012 11:57:20 +0000 (11:57 +0000)]
Fix wxHTMLDataObject compilation and memory leaks.
Use wxString::FromUTF8() and utf8_str() instead of directly using wxConvUTF8
as this is simpler and also works correctly in non-Unicode build (and more
efficiently in UTF-8 build as no conversion is done there).
Do not allocate -- and leak -- buffer in wxHTMLDataObject::GetDataHere(),
we're supposed to be putting data into the caller-provided buffer instead of
using our own.
Robin Dunn [Fri, 8 Jun 2012 19:26:19 +0000 (19:26 +0000)]
Keep track of the area intended to be buffered, and use that in UnMask instead of defaulting to the buffer size. Only clip to the DC size if wxBUFFER_VIRTUAL_AREA is not set. This fixes the issue where buffering the full virtual area in a wxScrolledWindow would only draw an area the physical size of the window. Fixes #11612.
Vadim Zeitlin [Fri, 8 Jun 2012 18:44:18 +0000 (18:44 +0000)]
Fix wxWindow::IsDescendant() to work with argument equal to this window.
Passing the window itself as IsDescendant() argument for a top level window
resulted in a NULL pointer dereference. Fix this and also simplify the
function code by not using the parent window before checking it's !NULL.
Vadim Zeitlin [Fri, 8 Jun 2012 18:44:14 +0000 (18:44 +0000)]
Use wxString::Clone() instead of c_str() in wxThreadEvent copy ctor.
Creating a new wxString from c_str() of the old one resulted in dropping all
string data after the first embedded NUL. Fix this by using Clone() method
that exists specifically for this purpose. It also makes the code more clear.
Vadim Zeitlin [Fri, 8 Jun 2012 18:44:10 +0000 (18:44 +0000)]
Use PLATFORM checks in bakefiles instead of TOOLKIT checks.
No real changes as the output is currently the same for all supported
PLATFORM/TOOLKIT combinations anyhow but prefer checking for PLATFORM to
prepare for the support of GTK toolkit under MSW platform.
Paul Cornett [Tue, 5 Jun 2012 16:49:28 +0000 (16:49 +0000)]
Workaround for Ubuntu 12.04 run time warning
"LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent."
Avoid calling gtk_widget_destroy() on a wxMenuBar attached to a frame
Fixes #14292
Paul Cornett [Mon, 4 Jun 2012 17:36:51 +0000 (17:36 +0000)]
Fix layout of wxStaticText, and possibly other controls.
GtkLabel perversely does not use its actual size to do layout, but will use its
size request. So restore calling gtk_widget_set_size_request() for all widgets,
which was removed in r71465. See #14374
Vadim Zeitlin [Sun, 3 Jun 2012 19:16:59 +0000 (19:16 +0000)]
Use wxString::t_str() in calls to Windows API functions in wxMSW.
Use t_str() instead of wx_str() to make the code work correctly in UTF-8 build
in which wx_str() returns a pointer to UTF-8 buffer while we need a wchar_t
pointer for Windows.
Steve Lamerton [Sun, 3 Jun 2012 17:41:32 +0000 (17:41 +0000)]
Use wxCOMPtr throughout wxWebViewIE to simplify the code and reduce the chance of memory leaks. Also mark PPV_ARGS_CHECK as inline so it can be used from multiple libraries.
Vadim Zeitlin [Fri, 1 Jun 2012 22:34:17 +0000 (22:34 +0000)]
Clear old selection when wxListBox becomes empty.
When UpdateOldSelections() is called from wxListBox::DoClear(), it must clear
the old selections array even for single selection list boxes, but it didn't
do this under non-MSW platforms.
Specifically check for the case of an empty listbox now and just forget the
old selections then. This fixes the problem of keeping stale old selections
and is also more efficient as we avoid the unnecessary GetSelections() call.
Vadim Zeitlin [Fri, 1 Jun 2012 16:21:08 +0000 (16:21 +0000)]
Disable wxUIActionSimulator wxGrid tests using mouse under wxGTK.
Something is seriously wrong with simulated mouse events and wxGrid under
wxGTK, they seem to simply disappear sometimes. This results in unit tests
suite failure, so disable these tests for the next release as I just don't
understand how to fix them.
Vadim Zeitlin [Fri, 1 Jun 2012 16:21:03 +0000 (16:21 +0000)]
Use printf() instead of wxPrintf() in cppunit details listener.
Wide char output from wxPrintf() didn't appear at all under Linux because
stdout was switched into narrow stream mode by GNU libc due to initial use of
cout in the test.
Use printf() instead of wxPrintf() as we are only printing ASCII strings
anyhow. Of course, this is not a real fix but at least we can see the tests
results like this.
Vadim Zeitlin [Fri, 1 Jun 2012 11:01:34 +0000 (11:01 +0000)]
Use float instead of double division in wxHashMap code.
We don't need double precision for determining the hash table fill rate and
using double constant also results in float-to-double promotion warnings from
gcc 4.7.
Vadim Zeitlin [Fri, 1 Jun 2012 11:01:28 +0000 (11:01 +0000)]
Update old selections after clearing wxListBox in wxGTK.
Don't keep stale selected item indices in m_oldSelections after clearing the
listbox, call UpdateOldSelections() from DoClear() in wxGTK just as we do in
the other ports.
Vadim Zeitlin [Fri, 1 Jun 2012 11:01:18 +0000 (11:01 +0000)]
Use wxDynamicCast() instead of IsKindOf() checks.
wxDynamicCast() is less verbose (due to the absence of "CLASSINFO") and more
compatible with the standard dynamic_cast<>, so prefer to use it when possible.
Vadim Zeitlin [Fri, 1 Jun 2012 11:01:09 +0000 (11:01 +0000)]
Remove unnecessary dynamic cast in wxComboPopupWindow.
Objects of this type are either always of wxPopupTransientWindow type, in
which case just a static_cast<> is enough and we don't need a dynamic one, or
is never of its type in which case this code shouldn't be compiled and if it
is, then static_cast<> will correctly fail preventing it from compiling.
Vadim Zeitlin [Fri, 1 Jun 2012 11:01:05 +0000 (11:01 +0000)]
Don't reset previous window event handler in PopEventHandler().
This is harmless but also useless as the previous event handler of a wxWindow
is always NULL anyhow, so simply don't do this. This is consistent with
PushEventHandler() which doesn't call SetPreviousHandler() for the window
itself neither.
Robin Dunn [Wed, 30 May 2012 03:13:35 +0000 (03:13 +0000)]
Adjust the client area origin and the client size of the MSW wxStaticBox according to the guidelines on http://msdn.microsoft.com/en-us/library/aa511279.aspx. This is so widgets that are children of the static box will not overlap the label or box borders.
Vadim Zeitlin [Sun, 27 May 2012 13:00:04 +0000 (13:00 +0000)]
Fix memory leaks in wxAutomationObject::Invoke().
Use wxVector<>, wxBasicString and wxOleVariantArg instead of raw arrays, BSTR
and VARIANT to ensure that different objects allocated by this function are
always freed when it exits.
Vadim Zeitlin [Sat, 26 May 2012 12:29:54 +0000 (12:29 +0000)]
Fix bug with unloading wxPluginLibrary objects in "wrong" order.
wxPluginLibrary objects had to be unloaded in exactly the reverse order to
which they were loaded in. This was not documented and was a serious
limitation for any realistic use of plugins anyhow, so fix it and allow
unloading them in any order now.
Instead of keeping a pointer to the last wxClassInfo not created by this
plugin, now keep a pointer to the first wxClassInfo that was created by it.
This makes the code slightly more complex but this pointer, unlike the old
one, remains valid even if another plugin was unloaded.
Vadim Zeitlin [Sat, 26 May 2012 12:29:46 +0000 (12:29 +0000)]
Fix DrawChoice() behaviour in wxRendererXP.
The implementation of wxRendererXP::DrawChoice() inadvertently used
wxRendererMSW::DrawComboBoxDropButton() and so drew the button in the classic
and not themed style.
Fix this by defining DrawChoice() in the base wxRendererMSWBase class and
reusing it in wxRendererXP via inheritance and not composition.
Vadim Zeitlin [Sat, 26 May 2012 12:29:39 +0000 (12:29 +0000)]
Move include/wx/osx/private/objcid.h to include/wx/osx/core.
This header is used by public headers and hence is not really private, move it
to a better place and add it to the list of OSX headers in the bakefile.
Vadim Zeitlin [Fri, 25 May 2012 17:02:31 +0000 (17:02 +0000)]
Use wxUIntPtr instead of wxClientData in wxDataViewListCtrl.
Do not delete the client data in wxDataViewListCtrl, this class mainly exists
for compatibility with wxListCtrl and as the latter doesn't delete its client
data, neither should the former.
Vadim Zeitlin [Fri, 25 May 2012 09:48:26 +0000 (09:48 +0000)]
Remove redundant wxAuiNotebook methods already present in wxBookCtrlBase.
wxAuiNotebook already inherits perfectly workable AdvanceSelection() and
GetCurrentPage() methods from wxBookCtrlBase, no need to reimplement them in
it.
Vadim Zeitlin [Fri, 25 May 2012 09:48:22 +0000 (09:48 +0000)]
Don't send a huge number of unneeded wxChildFocusEvents.
wxControlContainer::SetLastFocus() propagated wxChildFocusEvent explicitly to
its parent but this is not needed because wxChildFocusEvents propagate by
default, being derived from wxCommandEvent. And doing it again resulted in the
total number of events increasing exponentially with the depth of the window
hierarchy and real performance problems due to processing all of them.
Vadim Zeitlin [Fri, 25 May 2012 09:48:20 +0000 (09:48 +0000)]
Suppress warnings about gnome_print_dialog_get_range() return type.
This function seems to be declared incorrectly and while it actually does
return the values we compare its return value with, it's prototyped with a
wrong enum as return type, so explicitly cast it to int to avoid warnings
from recent g++ versions.
See http://thread.gmane.org/gmane.comp.lib.wxwidgets.devel/115782/focus=115955
Vadim Zeitlin [Fri, 25 May 2012 09:48:12 +0000 (09:48 +0000)]
Fix calculation of wxStyledTextCtrl selection size in GetSelectedText().
Do the same changes as were done in r71540 to GetSelectedTextRaw() in
GetSelectedText() itself by modifying the code in gen_iface.py that generates
it.
Vadim Zeitlin [Wed, 23 May 2012 21:16:41 +0000 (21:16 +0000)]
Don't use wxCHECK_W32API_VERSION() in #if when it can be undefined.
wxCHECK_W32API_VERSION() is only defined when using MinGW, don't use it an #if
test which is always parsed but only in a separate test inside #ifdef __GNUG__
test which is parsed only when we do use MinGW.
This fixes harmless but annoying warning from MSVC 10.
Vadim Zeitlin [Wed, 23 May 2012 21:16:24 +0000 (21:16 +0000)]
Fix calculation of the wxStyledTextCtrl selection size.
Use SCI_GETSELTEXT to compute the size of the buffer instead of doing it
ourselves, especially as we do it incorrectly in case of rectangular
selection.
Vadim Zeitlin [Sun, 20 May 2012 20:29:56 +0000 (20:29 +0000)]
Fix 62 harmless but annoying Clang warnings in wxOSX build.
Clang warns about using letters and digits in a switch on wxKeyCode enum which
doesn't include them as elements. This is generally useful but really annoying
in this case, especially due to the sheer number of warnings, so disable it
using Clang-specific pragma.
Vadim Zeitlin [Sun, 20 May 2012 20:29:50 +0000 (20:29 +0000)]
Use wxObjCID instead of "struct objc_object*" to fix clang build.
Clang doesn't accept "struct objc_object*" as synonym for "id" in Objective-C
code, so use the real "id" for it while still using the struct pointer for C++
code where "id" is not defined.