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.
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.