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.
Vadim Zeitlin [Tue, 6 Nov 2012 23:57:06 +0000 (23:57 +0000)]
Don't leave orphan taskbar icon window alive if setting it up fails.
This fixes a rare bug which happens when we fail to install the task bar icon
under MSW for whatever reason (the only known way to reproduce it is to try to
do it very quickly after resume from suspend but there might be other
situations in which this happens). In this case we must delete the icon as we
are not going to get any timeout expiration notifications for it and so if we
don't delete it immediately, it would remain alive forever, preventing the
application from exiting as it counts as a top level window.
Vadim Zeitlin [Tue, 6 Nov 2012 23:54:47 +0000 (23:54 +0000)]
Fix regression with wxAuiToolBar gripper and overflow members initialization.
The changes of r72785 moved m_gripperVisible and m_overflowVisible
initialization to Init() but this was too early as these fields depend on the
window style only set when it's really created, so re-initialize them to their
proper values in Create().
Vadim Zeitlin [Tue, 6 Nov 2012 23:53:17 +0000 (23:53 +0000)]
Add wxUSE_{BASE,GUI} checks to interface headers.
This allows to define just one of them to run some tool, e.g. SWIG, on only
the classes defined in the base or in the core library (both are defined by
default for Doxygen itself).
Vadim Zeitlin [Tue, 6 Nov 2012 16:50:56 +0000 (16:50 +0000)]
Never collapse invisible root item in generic wxDataViewCtrl.
Since the changes of r72325, the root item could be collapsed and marked as
not having any children but this was wrong because no items could be added to
it after this.
Vadim Zeitlin [Sun, 4 Nov 2012 23:55:22 +0000 (23:55 +0000)]
Slightly improve the date/time dialogs in the calendar sample.
Use CreateStdDialogButtonSizer() instead of constructing
wxStdDialogButtonSizer directly, not only this is shorter but it also makes
the "OK" button default correctly.
Also initialize the labels instead of leaving them initially empty.
Vadim Zeitlin [Sun, 4 Nov 2012 23:54:37 +0000 (23:54 +0000)]
Make hack for button creation in wxOSX more robust.
Don't crash when creating a plain wxButton with wxBU_NOTEXT style. This
happened because we skipped creating the peer (real implementation) in this
case entirely on the assumption that we were creating a wxBitmapButton, but
this is not necessarily the case. So now test that the creation of the peer is
really disabled before skipping it (this required adding ShouldCreatePeer()
accessor).
Merging wxWidgetImpl::CreateButton() and CreateBitmapButton() (and the same
thing for toggle buttons) would still be a better solution but while it's
trivial to do for Cocoa, it isn't for Carbon. And we can't use a single
function for Cocoa but different functions for Carbon, so for now just
continue to use this hack.
Vadim Zeitlin [Sun, 4 Nov 2012 23:54:15 +0000 (23:54 +0000)]
Ensure that paths used inside wxOSX are always in NFC form.
OSX uses NFKD but this is unexpected for wx applications, so normalize the
string to use the composed form whenever we receive a file system path from OS
X.
Vadim Zeitlin [Sun, 4 Nov 2012 23:53:06 +0000 (23:53 +0000)]
Implement setting default wxTextCtrl style in wxOSX.
Use NSTextView setTypingAttributes to change the attributes used for the new
text by default as setting them for the selected region didn't do anything
useful under OS X (and did nothing at all when there was no selection).