Vadim Zeitlin [Sat, 8 Dec 2012 00:37:13 +0000 (00:37 +0000)]
Strip EOL characters from wxStyledTextCtrl::GetLineText() return value.
For consistency with all the other wxTextCtrl-like classes, the value returned
by this method must not include line terminator characters (like '\n'). Notice
that Scintilla-specific GetLine() does still include them, for consistency
with the Scintilla API itself.
Vadim Zeitlin [Tue, 4 Dec 2012 00:39:37 +0000 (00:39 +0000)]
Explicitly set margins for single line text controls in wxMSW.
The margin used by them was inconsistent and depended on the initial size the
control was created with for some reason. Call EM_SETMARGINS explicitly to
ensure consistent appearance in all cases.
Vadim Zeitlin [Tue, 4 Dec 2012 00:39:33 +0000 (00:39 +0000)]
Add missing critical section locking before accessing shared variable.
WinThreadStart() in wxMSW wxThread implementation accessed the variable
containing the thread state without locking which was wrong, do it only inside
the critical section.
Notice that there is still an unavoidable race condition between exiting the
thread and starting it, so it's not clear at all if we should try to avoid
calling DoThreadStart() here.
Vadim Zeitlin [Tue, 4 Dec 2012 00:39:29 +0000 (00:39 +0000)]
Open debugger at the location of failing assert, if possible.
Break into the debugger in the function containing the assert that failed
instead of inside wxWidgets assert handler which is several (~8) levels below
the last line of the user code. This is much more useful in practice and also
less confusing.
Currently this only works for MSVC as the other compilers don't have any
__debugbreak intrinsice equivalent.
Also update the except sample to test wxTrap() directly too.
Paul Cornett [Mon, 3 Dec 2012 18:14:55 +0000 (18:14 +0000)]
Remove SashHitTest() "tolerance" parameter
Mouse events (LeftDown in particular) will only occur if the mouse is over the
sash, so it does not make sense to have a fudge factor
Paul Cornett [Mon, 3 Dec 2012 18:04:46 +0000 (18:04 +0000)]
Avoid setting sash resize cursor when mouse is still over border of second pane with wxGTK
This made it possible to have the resize cursor, but not be able to drag the
sash, and happened because wxGTK sends a leave event when mouse leaves client
area instead of outer border of window. Setting the useless SashHitTest()
"tolerance" parameter to zero avoids the problem.
Fixes #1397
Vadim Zeitlin [Sun, 2 Dec 2012 23:50:33 +0000 (23:50 +0000)]
Correct lookup of Explorer-specific file association information.
The code added in r52154 never worked because it was looking for the Progid
value in a wrong place, look for it under UserChoice subkey where it really
is.
Also add a way to look up the command to open files with the given extension
to the exec sample.
Vadim Zeitlin [Sun, 2 Dec 2012 23:50:10 +0000 (23:50 +0000)]
No changes, just reorganize the menu slightly in the exec sample.
Move all file association related commands under "File" menu from the "Exec"
one, having them there makes more sense and "Exec" menu is already quite big.
Vadim Zeitlin [Sun, 2 Dec 2012 23:49:25 +0000 (23:49 +0000)]
Make wxChoice and wxComboBox behaviour same as in native controls in wxMSW.
Keep the item selected from the drop down using keyboard when switching away
from the control by pressing TAB: although this generates CBN_SELENDCANCEL
notification, the selection is actually kept by the native controls in this
case, so don't reset it ourselves -- even though it makes sense, it makes wx
applications behave differently from the native ones.
Reuse the same event generation code for wxChoice in wxMSW, wxGTK and wxOSX
and also wxComboBox in wxMSW and wxGTK instead of duplicating it (incompletely
and so partially incorrectly in wxOSX case).
This is just a refactoring so no changes in behaviour.
Vadim Zeitlin [Sun, 2 Dec 2012 23:48:36 +0000 (23:48 +0000)]
Avoid using "do { ... } while ( wxFalse )" pseudo-loop.
This loop can't be optimized away by the compiler because wxFalse is an extern
variable which can't be known to be always false. Additionally, this creates
many false positives from Coverity as it assumes that the loop can be executed
more than once.
Define wxSTATEMENT_MACRO_BEGIN/END macros abstracting the exact solution used
and replace wxFalse with "(void)0, 0" for now as this seems to placate MSVC
(which warns about using a bare "0" as a condition) while still allowing the
loop to be completely optimized away.
Vadim Zeitlin [Sun, 2 Dec 2012 20:24:38 +0000 (20:24 +0000)]
Warn, don't assert, about unexpected inotify events.
In practice we seem to be getting some unexpected inotify() events during
heavy IO activity. This shouldn't happen but it does, so at least don't
prevent the program from running by popping up the assertion dialog when it
happens.
Paul Cornett [Sun, 2 Dec 2012 05:11:25 +0000 (05:11 +0000)]
clean up wxCairoRenderer initialization mess
Remove unused Unload(), wxCairoCleanUp(), m_loaded and gCairoRenderer, and redundant Load()
and EnsureIsLoaded(). Just call wxCairoInit() directly, and for GTK do nothing at all.
Vadim Zeitlin [Sat, 1 Dec 2012 00:14:07 +0000 (00:14 +0000)]
Fix premature truncation of brief descriptions in Doxygen comments.
Don't end the brief description at the first period if it's a period which is
part of "i.e." or "e.g.": escape the space following it to prevent Doxygen
from recognizing it as an end of sentence.
Vadim Zeitlin [Wed, 28 Nov 2012 23:56:38 +0000 (23:56 +0000)]
Fix bezel used for bitmap buttons in wxOSX/Cocoa.
Don't use NSRoundedBezelStyle for bitmap buttons as this bezel has fixed
height. Instead, use NSRegularSquareBezelStyle which can used with buttons of
any size and is the correct bezel to use for the buttons mostly identified by
their icon according to Apple docs.
Notice that we still use the standard bezel for the "small" (where "small" is
arbitrarily defined by the hard coded 20 pixels height) icons as those are
usually used in addition to the text and not replacing it and so it makes more
sense to use the same bezel as for the normal buttons for them.
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.