Vadim Zeitlin [Fri, 28 Dec 2012 16:02:04 +0000 (16:02 +0000)]
Use a single taskbar icon for all notifications in wxMSW.
Allocating a new icon for every notification could result in showing many
identical icons in the taskbar notification area if several notification
messages were generated which looked like a bug to the user. It was also
inconsistent with the behaviour in the case when UseTaskBarIcon() was called.
Always behave as in the latter case now, i.e. any subsequent notification
replaces the previous one instead of being shown in addition to it.
Vadim Zeitlin [Fri, 28 Dec 2012 00:44:13 +0000 (00:44 +0000)]
Fix regression with wxHTML table elements background handling.
Wrong background was used for the text inside HTML tables since r72589, fix
this by setting the correct background before processing the table elements
and restoring it after doing it.
Vadim Zeitlin [Fri, 28 Dec 2012 00:44:09 +0000 (00:44 +0000)]
Ensure that client display rectangle is always less than its total area.
Under Unix we could return client display rectangle that was bigger than the
entire display size as it corresponded to the total screen size when
_NET_WORKAREA was not supported or was not correctly implemented by the WM.
Fix this by explicitly intersecting the client rect with the total one.
Vadim Zeitlin [Fri, 28 Dec 2012 00:44:05 +0000 (00:44 +0000)]
Document wxListBox and wxChoice as inheriting from wxItemContainer.
Due to an apparent Doxygen bug, methods inherited from wxItemContainer via
wxControlWithItems didn't appear in the documentation, so work around this by
using wxItemContainer as a direct base class.
Vadim Zeitlin [Fri, 28 Dec 2012 00:44:01 +0000 (00:44 +0000)]
Add wxGCC_WARNING_{SUPPRESS,RESTORE} macros and use them for -Wfloat-equal.
Suppress the warnings about comparing floating point values for equality in
wxWidgets headers when the user code is compiled with -Wfloat-equal (at least
when using g++ 4.6 or later).
Vadim Zeitlin [Sat, 22 Dec 2012 02:34:07 +0000 (02:34 +0000)]
No changes, just improve wxScrolled::EnableScrolling() documentation.
Explain that, in spite of its name, this function doesn't disable scrolling
when called with false argument but just changes the mechanism used to
implement it.
Paul Cornett [Thu, 20 Dec 2012 18:46:58 +0000 (18:46 +0000)]
Use client size determined by size-allocate when possible
Our client size calculation can be wrong for reasons beyond our control,
notably on Ubuntu 12.04 with overlay scrollbars where the GtkScrolledWindow
"scrollbar-spacing" is wrong. By using the true size from size-allocate
when it becomes available, we can recover from an earlier incorrect client
size calculation. See #14871
Paul Cornett [Sun, 16 Dec 2012 07:14:40 +0000 (07:14 +0000)]
Fix for toolbars and menus not being disabled on Ubuntu
Ubuntu overlay scrollbar changes the GtkWindowGroup for its toplevel, which is
disastrous for modal windows. Put in a hack to detect and undo this.
Fixes #14855
Vadim Zeitlin [Fri, 14 Dec 2012 12:29:07 +0000 (12:29 +0000)]
Fix libtiff compilation with MinGW.
At least some versions of MinGW don't define 64 bit integer types resulting in
errors when they're used in libtiff code, so explicitly include basetyps.h to
make sure these types are defined.
Paul Cornett [Fri, 14 Dec 2012 06:25:00 +0000 (06:25 +0000)]
Get DC size from GDK window if possible, client size can unfortunately be wrong
This should fix wxDC::Clear() not clearing the whole window on Ubuntu 12.04 with overlay scrollbars
see #14871
Vadim Zeitlin [Mon, 10 Dec 2012 14:41:31 +0000 (14:41 +0000)]
Use wxSetWorkingDirectory() instead of chdir().
This fixes compilation of wxGTK under Windows after the changes of r72779 and
r72780, where _wchdir() would need to be used but we don't currently have a
wxChdir() CRT function wrapper so use wxSetWorkingDirectory() instead.
Vadim Zeitlin [Sat, 8 Dec 2012 13:22:28 +0000 (13:22 +0000)]
Document wxWindow::Get{Min,Max}{Width,Height}().
These methods were not documented and somehow inherited the description of the
first method of the group they were in, which didn't make any sense for them.
Vadim Zeitlin [Sat, 8 Dec 2012 00:37:38 +0000 (00:37 +0000)]
Don't test for key code being valid unnecessarily.
The key code was already found to be valid just above, so suppress Coverity
warning about an always true test by not checking it again. This also makes
the code more clear.
Vadim Zeitlin [Sat, 8 Dec 2012 00:37:36 +0000 (00:37 +0000)]
Remove unnecessary default from a switch statement.
Don't check for impossible enum element value, it's better to not have the
default clause at all to get a warning from g++ if this enum ever changes
later. And for now the presence of default results in a warning from Coverity
about unreachable code.
Vadim Zeitlin [Sat, 8 Dec 2012 00:37:25 +0000 (00:37 +0000)]
Check wxDir::GetNext() return value in wxFindNextFile().
This doesn't really change anything as the returned value would be empty
anyhow in case of an error, but suppresses Coverity warning about not checking
the return value of a function whose return value is checked in other places.
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.