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.
Vadim Zeitlin [Tue, 15 May 2012 10:04:01 +0000 (10:04 +0000)]
Enable variadic macros for VC9 and later.
VC9 and 10 support variadic macros so define HAVE_VARIADIC_MACROS for them
too. This currently only affects wxLog{Debug,Trace} definitions in wx/log.h.
Vadim Zeitlin [Tue, 15 May 2012 10:03:57 +0000 (10:03 +0000)]
Fix keyboard navigation in wx{List,Choice,Tree,Tool}book controls.
Inherit from wxNavigationEnabled<wxBookCtrlBase> instead of just
wxBookCtrlBase to ensure that the keyboard navigation works correctly for
these controls.
The toolbar in wxToolbook still doesn't accept focus from keyboard but at
least the pages can be TAB-bed too and from. And the rest of the controls
are now fully accessible using only the keyboard.
Don't try to process any remaining pending events in ProcessEvents() itself as
this was inconsistent: we only processed low-level toolkit pending events in
the main event loop itself if the loop was exited from a normal event handler
but only processed the wxApp-level pending events if it was exited from a
pending event handler. It also required more code than the new version that
simply processes all the remaining pending events, of both kinds, after the
main event loop termination.
This corrects changes of r71304 and replaces those of r71329.
Vadim Zeitlin [Sun, 13 May 2012 21:37:25 +0000 (21:37 +0000)]
Don't return a dangling pointer from wxDateTime::ParseXXX(wxCStrData).
We don't have any sufficiently long-lived pointer to return from this
overload, so don't return anything from it -- it's better to break the
compilation of the existing code rather than make it crash during run-time.
Vadim Zeitlin [Sun, 13 May 2012 21:37:23 +0000 (21:37 +0000)]
No changes, just simplify the code using wx2stc() a little.
Assign wx2stc() return value to a suitably const variable instead of using
ugly casts to get rid of constness.
Also use wxCharBuffer/char* explicitly inside explicit wxUSE_UNICODE checks,
using wxWX2MBbuf here doesn't gain us anything and just confuses the reader of
this code.
Vadim Zeitlin [Sun, 13 May 2012 21:37:18 +0000 (21:37 +0000)]
Fix wxStyledTextCtrl compilation in non-Unicode build.
The value returned by wx2stc() in non-Unicode build is a simple "char*" and we
can't call length() method on it, add a helper wx2stclen() function to get the
length from the original wxString itself in this case.