Vadim Zeitlin [Wed, 28 Nov 2012 14:17:30 +0000 (14:17 +0000)]
Compilation fix for wxDocManager after r73004.
Define GetXXXVector() methods after all the classes are fully declared to
ensure that static_cast<> inside wxList::AsVector() they use compiles with the
OpenVMS compiler.
Vadim Zeitlin [Sun, 25 Nov 2012 23:18:20 +0000 (23:18 +0000)]
Fix wxGenericListCtrl scrolling by not processing the events twice.
Scrolling wxGenericListCtrl was broken since r72939 because its OnScroll()
event handler explicitly called wxScrollHelper::HandleOnScroll() which was
also called by the base class ProcessEvent().
Arguably, wxScrollHelper::ProcessEvent() should be updated to allow handling
events directly like this by not processing it again if the event wasn't
skipped but for now just do skip the event and let the default handling take
place which at least makes wxGenericListCtrl work correctly again.
Vadim Zeitlin [Sun, 25 Nov 2012 23:17:56 +0000 (23:17 +0000)]
Fix TAB navigation in wxGTK broken by r72663.
Don't call SetCanFocus(true) for container windows with focusable children,
this doesn't play well at all with wxGTK focus handling and in particular
totally disabled TAB navigation.
Vadim Zeitlin [Sun, 25 Nov 2012 23:17:33 +0000 (23:17 +0000)]
Restore generic GetPartialTextExtents() version use in wxGTK and wxMSW.
Non-wxWindowDC-derived wxDC classes in wxGTK, such as wxGtkPrinterDCImpl, have
to fall back on the generic implementation of GetPartialTextExtents() as Pango
version can't be used with them.
This fixes a crash due to using NULL Pango layout when printing wxRichTextCtrl
in wxGTK.
Vadim Zeitlin [Sun, 25 Nov 2012 11:51:21 +0000 (11:51 +0000)]
Handle UBUNTU_MENUPROXY=0 as "not using global menu".
Although the correct way to disable the global menu bar under Ubuntu is to
set UBUNTU_MENUPROXY to an empty string, many guides on the web advise setting
it to "0", so handle this special case in wxApp::GTKIsUsingGlobalMenu() too.
Vadim Zeitlin [Sun, 25 Nov 2012 00:15:49 +0000 (00:15 +0000)]
Use idle time menu updating when using global menu bar in wxGTK.
We don't get wxEVT_MENU_OPEN events when using the global menu bar so don't
rely on them for updating the menu items status and fall back to idle time
menu updating if the global menu bar is used.
This required changing wxUSE_IDLEMENUUPDATES tests from compile- to run-time
ones.
Vadim Zeitlin [Sun, 25 Nov 2012 00:15:03 +0000 (00:15 +0000)]
Ignore menu events while modal dialogs are shown in wxGTK.
Normally menus are disabled in this case but not when running under Ubuntu
Unity, so add an explicit test for this to avoid breaking the program expected
flow of control by allowing the user to show the same modal dialog twice, for
example.
This is not ideal, it would be better to visually disable the menu while the
modal dialogs are shown but is better than nothing.
Vadim Zeitlin [Sat, 24 Nov 2012 00:33:44 +0000 (00:33 +0000)]
Use wxBufferedPaintDC for wxStyledTextCtrl drawing in wxGTK.
GTK+ doesn't seem to use double buffering for Scintilla window for some
reason, resulting in bad flicker when it's updated, e.g. when the user types
into it.
Force the use of double buffering at wxWidgets level by using
wxBufferedPaintDC for painting it. This may be inefficient if GTK+ does double
buffer it in some cases but at least it gets rid of the flicker.
Vadim Zeitlin [Sat, 24 Nov 2012 00:33:19 +0000 (00:33 +0000)]
Add check for destroying window with mouse capture in wxGTK.
We already have an assert checking for this at wxWindowBase level but it seems
that it wasn't always triggered somehow (maybe because we crashed before
getting there?), so do it sooner.
Vadim Zeitlin [Tue, 20 Nov 2012 12:49:29 +0000 (12:49 +0000)]
Make wxSpinCtrlGenericBase a wxCompositeWindow.
This takes care of propagating methods setting fonts and colours to the
subwindows automatically, so that setting font for the generic wxSpinCtrl now
works, unlike before.
Vadim Zeitlin [Tue, 20 Nov 2012 12:49:03 +0000 (12:49 +0000)]
Revert all wxNOEXCEPT-related changes.
This reverts r72978, 72984, 72989 and 72992. Do not use wxNOEXCEPT for
wxTextCtrl dtor as this breaks compilation of any user-defined classes
inheriting from it unless they use wxNOEXCEPT as well and the benefits
(fixing a harmless warning for the niche ICC compiler) are just not worth
the compatibility breakage.
Vadim Zeitlin [Mon, 19 Nov 2012 18:01:01 +0000 (18:01 +0000)]
More compilation fixes after wxNOEXCEPT introduction.
This is a temporary change, r72984 and the following changes (see #14826) will
probably be reverted soon anyhow, but for now at least fix wxGTK compilation.
Vadim Zeitlin [Mon, 19 Nov 2012 12:52:18 +0000 (12:52 +0000)]
Add wxFSW_EVENT_UNMOUNT wxFileSystemWatcher flag and implement it for Linux.
This flag generates the corresponding event when the file system containing
the watched directory is unmounted. Currently it is only implemented for
Linux where unmounting now generates this event instead of an error.
Vadim Zeitlin [Mon, 19 Nov 2012 11:53:49 +0000 (11:53 +0000)]
Add wxNOEXCEPT to all wxTextCtrl dtors.
Fix compilation with some compilers after r72978 which added wxNOEXCEPT to
wxTextCtrlBase dtor and wxTextCtrl dtor in wxMSW but not in all the other
ports.
Vadim Zeitlin [Sat, 17 Nov 2012 23:56:23 +0000 (23:56 +0000)]
Add wxNOEXCEPT and use it for std::streambuf-derived classes.
This fixes warnings from Intel compiler about overriding function using a
different exception specification than the base one and also incidentally
provides a handy macro that can be useful in other situations.
Paul Cornett [Fri, 16 Nov 2012 07:24:29 +0000 (07:24 +0000)]
Remove code that has no effect
Adjusting the wxEVT_ENTER_WINDOW mouse position is pointless, execution won't reach that far if
gdk_event->window != gtk_widget_get_window(widget), and GetClientAreaOrigin() always returns (0,0).
Vadim Zeitlin [Wed, 14 Nov 2012 13:48:23 +0000 (13:48 +0000)]
Implement wxComboCtrl::GetSizeFromTextSize().
Improve calculation of wxComboCtrl best size which doesn't work correctly for
non-default fonts as shown by r72935. It is still not perfect but better now.
Vadim Zeitlin [Wed, 14 Nov 2012 13:46:50 +0000 (13:46 +0000)]
Don't call setlocale("") on startup by default any longer.
This undoes the changes of r44773 because calling setlocale() resulted in C
locale being set differently from C++ locale which was confusing and led to
huge slowdowns in any code using std::stream with at least MinGW. And setting
the C++ locale to be the same, as r72719 tried to do, doesn't seem to be
practical as it results in immediate crashes under OS X and MinGW when used
under XP.
Do provide wxApp::SetCLocale() helper to explicitly do what was previously
done implicitly, even though currently it is a trivial wrapper for setlocale()
and we don't even need to call gtk_set_locale() as it has never done anything
else and is deprecated since GTK+ 2.24.
Václav Slavík [Tue, 13 Nov 2012 12:36:32 +0000 (12:36 +0000)]
Fix wxGTK's wxFileDialog:Get/SetFilename() to be in sync.
The m_fileName and m_dir variables, managed by the base class, were out
of sync when the dialog wasn't shown yet, because the wxGTK
implementation didn't always set them. GetFilename() following
SetFilename(x) could return something other than x. Fixed by calling the
base class version.
Vadim Zeitlin [Sat, 10 Nov 2012 12:40:47 +0000 (12:40 +0000)]
Disallow drop downs on AUI check buttons.
This doesn't make much sense and disallowing it makes check items consistent
with radio ones as previously you could set up a dropdown for the former but
not for the latter.
Also update the documentation of the relevant methods.
Vadim Zeitlin [Sat, 10 Nov 2012 12:22:32 +0000 (12:22 +0000)]
Fix crashes after using "wildcard" wxEvtHandler::Disconnect().
When not specifying the function to disconnect, the associated event sink was
destroyed too early resulting in crashes later. Fix this and add unit tests
verifying that things work as expected and at least don't crash.
Vadim Zeitlin [Sat, 10 Nov 2012 00:53:17 +0000 (00:53 +0000)]
Simplify wxEVT_PAINT handling in wxScrollHelperBase.
Just always call the virtual OnDraw() if wxEVT_PAINT wasn't handled. This is
much simpler than connecting our own special handler just to set a flag saying
whether the event was processed which was very complicated and didn't work
anyhow for the statically connected wxEVT_PAINT handlers.
Vadim Zeitlin [Sat, 10 Nov 2012 00:52:54 +0000 (00:52 +0000)]
Cache HDC used for painting for the entire duration of WM_PAINT processing.
This fixes a long standing problem with 2 wxPaintDC created one after another
(and not with nested lifetimes, which was handled by the caching mechanism
previously used) not working correctly. And as this was exactly what happened
when handling wxEVT_PAINT for wxScrolled, it also fixes drawing artefacts when
using scrolled windows.