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.
Vadim Zeitlin [Sun, 20 May 2012 20:29:35 +0000 (20:29 +0000)]
Improve check for OS X version in Cocoa wxFileDialog implementation.
A library using wxWidgets linked with 10.6 SDK might be loaded into an
application loading 10.5 version of AppKit in which case 10.6-specific
functions shouldn't be used. Check for the AppKit version effectively in use
instead of just checking for the system version.
Vadim Zeitlin [Sun, 20 May 2012 20:29:29 +0000 (20:29 +0000)]
Reset wxDialog::m_modality sooner in wxOSX.
Change the internal flag to wxDIALOG_MODALITY_NONE before sending
wxEVT_WINDOW_MODAL_DIALOG_CLOSED event. This ensures that if the dialog is
shown again from this event handler it works correctly.
Julian Smart [Sun, 20 May 2012 12:25:22 +0000 (12:25 +0000)]
Added pixel size capability to wxTextAttr and wxRichTextCtrl.
Fixed composite object positioning in centred and right-aligned
paragraphs.
Added field example to sample, and enabled pixel font size selection.
Added custom text and dimension scaling.
Vadim Zeitlin [Thu, 17 May 2012 16:10:19 +0000 (16:10 +0000)]
Fix wrong format specifiers in the samples.
Use "%ld" instead of "%d" to format long values, using "%d" results in an
assert failure under LP64 systems as int and long have different sizes there.
Paul Cornett [Thu, 17 May 2012 15:29:50 +0000 (15:29 +0000)]
Remove use of "size-request" signal for wxWindow sizing.
This signal has been removed from GTK3. Instead have wxPizza keep track of child
size, and use gtk_widget_set_size_request() for wxWindows in native containers.
Vadim Zeitlin [Wed, 16 May 2012 15:10:05 +0000 (15:10 +0000)]
Make variable containing port number an ushort in the sockets sample.
A port number is an unsigned short, not long, so don't make it long just
because wxCmdLineParser doesn't provide a convenient way to get the value of
an unsigned short option (it would be nice if it did...).
This fixes the problem with using "%d" format specifier with a long variable
as this resulted in an assert under LP64 systems.
Vadim Zeitlin [Wed, 16 May 2012 15:10:01 +0000 (15:10 +0000)]
Fix wxWakeUpIdle() in Unix console application broken by r71089.
Initialize m_pipeIsEmpty to true as we don't have anything in the pipe
initially and if this variable was false, nothing was ever written to the wake
up pipe and it was never set to true as nothing was read from it neither.