Vadim Zeitlin [Tue, 26 Mar 2013 00:59:27 +0000 (00:59 +0000)]
Use wxCONTROL_PRESSED instead of wxCONTROL_SELECTED in wxOSX renderer code.
wxCONTROL_SELECTED is supposed to only apply to the selected items in a
listbox and similar cases whereas the buttons use wxCONTROL_PRESSED flag to
indicate whether they are toggled.
Correct the code in wxRendererMac to use the latter, for consistency with the
other platforms.
Vadim Zeitlin [Thu, 21 Mar 2013 22:37:06 +0000 (22:37 +0000)]
Allow using either single or multi line wxTextCtrl in keyboard sample.
These controls are implemented quite differently in wxGTK, so it's convenient
to be able to test both of them in the sample to check that they both behave
correctly.
Vadim Zeitlin [Thu, 21 Mar 2013 22:37:01 +0000 (22:37 +0000)]
Refactor wxGTK IM-related code to allow future modifications.
No real changes, just make it possible to use a different IM than the one
allocated in wxWindow for input handling. This will be used in the upcoming
changes to wxTextEntry and the related classes.
Vadim Zeitlin [Thu, 21 Mar 2013 22:36:57 +0000 (22:36 +0000)]
Tweak wxGTK keyboard handling to allow accelerators to work again.
Accelerators were broken by the changes of r72640 which were done to ensure
that the focused window gets the keyboard event first, before its top level
parent. Fix them now by still passing the events to the focused window first
but also passing them to the parent top level if it hasn't been handled by the
focused child.
Unfortunately this is still not fully compatible with wxMSW because in wxGTK
wxEVT_CHAR handler must skip the event in order to allow the accelerator using
the same key to work, while in wxMSW the accelerator can only be suppressed by
overriding wxWindow::MSWShouldPreProcessMessage(). We will need to make the
two ports behave in the same way when the event is not skipped in the future.
But for now, at least make them both behave correctly when the handler does
skip the event.
Vadim Zeitlin [Thu, 21 Mar 2013 22:36:52 +0000 (22:36 +0000)]
Use flat generic status bar by default and add wxSB_SUNKEN.
GTK+ applications don't use sunken status bars since many years, do don't do
it in wxWidgets neither by default any more. Add wxSB_SUNKEN style that can be
explicitly used if the old appearance is desired.
Vadim Zeitlin [Thu, 21 Mar 2013 22:36:46 +0000 (22:36 +0000)]
Disable Unity global menu while native modal dialogs are shown in wxGTK.
We need to use wxOpenModalDialogLocker even with native GTK+ dialogs to
prevent the menu commands from being available while they're shown, so do it
in wxMessageDialog and wxColourDialog which call gtk_dialog_run().
Vadim Zeitlin [Tue, 19 Mar 2013 02:58:33 +0000 (02:58 +0000)]
Fix WM_UNINITMENUPOPUP missing definition for VC6.
The previous workaround of defining it explicitly if it's not defined was left
in src/msw/frame.cpp while the code using WM_UNINITMENUPOPUP was moved to
src/msw/toplevel.cpp in r73562. Move the fallback definition there too.
Vadim Zeitlin [Wed, 13 Mar 2013 13:47:38 +0000 (13:47 +0000)]
Remove obsolete parts of autoconf_inc.m4.
This file has accumulated a lot of condition checks which were not relevant
any more, remove and recreate it (by running bakefile_gen) to get rid of them.
Vadim Zeitlin [Sun, 10 Mar 2013 01:09:41 +0000 (01:09 +0000)]
Disable sorting of generic wxDataViewCtrl while it is frozen.
Don't sort the contents of wxDataViewCtrl while it is frozen and resort it
only when it is thawed. This dramatically speeds up adding items to the
control when sorting is used as we only sort it once now instead of doing it
after adding every item.
Vadim Zeitlin [Sun, 10 Mar 2013 01:09:37 +0000 (01:09 +0000)]
Use symbolic constants instead of magic numbers in wxDataViewCtrl code.
No real changes, just add SortColumn_XXX symbolic constants which are somewhat
more clear than -1 and -2 used before. Although the code based on the global
variables remains as bad as before.
Vadim Zeitlin [Sat, 9 Mar 2013 15:08:31 +0000 (15:08 +0000)]
Use generic spin control itself as parent for its children.
This fixes a problem with using wxSpinCtrlGeneric in toolbars under wxOSX,
using the toolbar itself (i.e. the parent of the spin control) as parent for
the children didn't work there and no windows were visible at all.
Also use wxNavigationEnabled as base class of wxSpinCtrlGeneric to fix
keyboard navigation.
And override SetBackgroundColour() to set it for the text control part of the
spin control only.
Vadim Zeitlin [Sat, 9 Mar 2013 15:08:13 +0000 (15:08 +0000)]
Fix compilation for MinGW with wxUSE_IPV6==1.
MinGW doesn't provide wspiapi.h header, so only include it when using MSVC and
include ws2tcpip.h which directly declares the functions used for the other
compilers.
This doesn't have quite the same semantics but it's better than failing to
compile at all.
Vadim Zeitlin [Sat, 9 Mar 2013 15:08:09 +0000 (15:08 +0000)]
Don't cache HDC used by wxPaintDCEx in wxMSW.
This avoids the problem with mistakenly using wrong HDC in wxBitmapComboBox
code which was due to assuming that we can only ever have one paint HDC for
the given window -- while in wxBitmapComboBox case we are passed different
HDCs for the same window via WM_DRAWITEM.
Instead of fixing the cache, just don't use it at all for wxPaintDCEx as we
don't gain anything from doing it anyhow.
Vadim Zeitlin [Sat, 9 Mar 2013 15:08:00 +0000 (15:08 +0000)]
Don't set cell value in wxDataViewEvent in one place only.
We should either set the cell value in the event object everywhere or not do
it anywhere and as currently the native GTK and OS X versions don't do it at
all and the generic version only does it for ITEM_CONTEXT_MENU events, it's
easier to not do it at all.
This method couldn't be overridden by the classes deriving from wxLogWindow
because it was called (indirectly) from wxLogWindow ctor itself and so was
completely useless. Just remove it to avoid confusion.
Vadim Zeitlin [Mon, 4 Mar 2013 18:19:41 +0000 (18:19 +0000)]
Unselect all wxDataViewCtrl items when clicking outside of the item area.
This is consistent with Windows behaviour and as the generic wxDataViewCtrl is
mostly used under Windows, it makes sense to follow Windows convention in it.
Vadim Zeitlin [Sun, 3 Mar 2013 22:44:17 +0000 (22:44 +0000)]
Fix handling of wxST_NO_AUTORESIZE in wxOSX.
We do need to set the size of wxStaticText initially even when this style is
specified, it only tells us to not update it later. Otherwise even the initial
label was never shown in full.
Vadim Zeitlin [Sat, 2 Mar 2013 12:11:53 +0000 (12:11 +0000)]
Reset accelerator table after removing last accelerator in wxMSW wxMenuBar.
We didn't update the accelerator table if no more accelerators were left in it
but we still need to do it to stop handling the previously active accelerators.
Vadim Zeitlin [Sat, 2 Mar 2013 12:11:40 +0000 (12:11 +0000)]
Don't give error message for non-existent paths in wxFileSystemWatcher.
The file we're trying to watch might have been just deleted, this is an
unavoidable (and not only in theory but also in practice when watching busy
directories) race condition so don't give an error message if this does happen
but simply return false from Add().
Vadim Zeitlin [Thu, 28 Feb 2013 20:41:14 +0000 (20:41 +0000)]
Use thread ID and not thread handle in the error messages in wxMSW.
The ID is in general more useful than the handle and this also fixes an assert
failure due to mismatch between the HANLDE type and "%x" format specifier.
Václav Slavík [Thu, 28 Feb 2013 16:29:05 +0000 (16:29 +0000)]
Add wxPreferencesEditor class.
Implements native UI for preferences editing. In particular, the API
handles the differences between modal (Windows) and non-modal (OS X) preferences windows and provides platform's native look.
Currently implemented natively for wxOSX/Cocoa, wxGTK and Windows (the latter is used as a fallback generic implementation as well).
Václav Slavík [Thu, 28 Feb 2013 13:31:58 +0000 (13:31 +0000)]
Don't include Common-Controls manifest in wxBase apps.
If only the non-GUI portions of wxWidgets are used, the dependency on
Microsoft.Windows.Common-Controls assembly shouldn't be automatically
added to Visual C++. Only do it when compiling GUI code.
Vadim Zeitlin [Sun, 24 Feb 2013 13:48:57 +0000 (13:48 +0000)]
Fix, or at least make less common, deadlock in the thread sample.
Don't always deadlock when "Stop the last spawned thread" menu command is
selected. There is still a problem with a race condition which could result in
a crash when dereferencing an invalid pointer, but at least this doesn't
happen all the time, unlike the current bug.
Of course, the real solution would be to properly rewrite the sample to show
how thread deletion should be handled correctly...
Vadim Zeitlin [Thu, 21 Feb 2013 14:32:04 +0000 (14:32 +0000)]
Fix crash when drawing bitmaps with mask in wxGTK with GTK+ < 2.20.
r73386 introduced a crash in wxGTK drawing code when using old GTK+ versions
by releasing the mask pixmap prematurely. Apparently GTK+ itself was fixed at
some time in 2.19.x time frame but work around the bug for the sake of older
GTK+ versions in wxGTK itself by simply releasing the pixmap at the end of
DoDrawBitmap(), as pre-r73386 code did.