Commit Graph

58287 Commits

Author SHA1 Message Date
Vadim Zeitlin
ddd7ce624a Avoid overflows when calculating metafile coordinates in wxMSW.
Use MulDiv() instead of naive multiplication followed by division as this
could overflow, and did when large paper sizes were used in print preview.

Closes #16138.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76219 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 16:53:57 +00:00
Vadim Zeitlin
9a5d02f2c3 Another PrepareForItem()-related fix in generic wxDataViewCtrl.
This fix is similar to the previous commit but more speculative, as we
currently don't have a bug scenario for it. Still, it seems to be wrong to
call PrepareForItem() just before GetLineStart() which undoes its effect, so
exchange the order of the calls.

See #16132.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 16:53:51 +00:00
Vadim Zeitlin
607e950899 Fix clicking on activatable toggle column in generic wxDataViewCtrl.
Call PrepareForItem() after calling GetLineStart() as the latter calls
PrepareForItem() for other items internally, undoing the effects of the first
call.

Closes #16132.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76217 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 16:53:46 +00:00
Vadim Zeitlin
c51d3e8f04 Fix use of expander in non left most position in wxDataViewCtrl.
Correct the expander rectangle definition to work when the expander column
left boundary is not 0, i.e. if the expander column is not the left most one.

Closes #16131.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 16:53:40 +00:00
Vadim Zeitlin
68a483a340 Simplify wxMSW wxToolBar controls support implementation.
Rely on being able to set the separator size, which is supported since
comctl32.dll v4.71 (the version distributed with IE 4.0...).

This allows to remove big chunks of code dealing with multiple separators and
simplifies the rest.

Closes #16129.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 16:53:34 +00:00
Václav Slavík
f8e96589d9 Don't emit wxEVT_TEXT in wxMSW's wxTextCtrl::SetFont().
Native text control sends EN_CHANGE when the font changes, producing a
wxEVT_TEXT event as if the user changed the value. This is not the case,
so supress the event.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76210 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 13:06:40 +00:00
Václav Slavík
dab101876e OS X: fix wxFileDialog::SetupExtraControls()'s sandbox test.
OS X 10.9 (possibly earlier) don't have nil contentView in NSSavePanel
anymore, a NSRemoteView instance is used. The wx code that follows this
test still crashes under sandbox, though, so update the check to use the
APP_SANDBOX_CONTAINER_ID environment variable, which is only set when
running under the sandbox.

This is just another quick fix for the existing uncomfortably long-lived
sandbox crash hotfix, not a proper solution.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 13:02:25 +00:00
Vadim Zeitlin
1e0a6af966 Make "NOT the index" in wxListCtrl::SortItems() stand out even more.
Any reasonable person expects the sort callback to receive the indices of the
items, but it doesn't: it's passed the client data associated with them
instead. Make it even more noticeable in the documentation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76205 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-27 22:10:38 +00:00
Julian Smart
9b09ca16a6 Allow derivation from wxRichTextBufferDataObject
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76204 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-27 12:46:37 +00:00
Vadim Zeitlin
b0c057d1da Russian translations update from Pavel Maryanov.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-27 12:05:30 +00:00
Vadim Zeitlin
da319a87cd Make wxMSW owner drawn menu item code more clear and correct.
The user-visible effect of this change is that removing the item from the menu
and adding it back doesn't lose its icon any more.

At the code level, wxMenuItem::SetBitmaps() and related methods are
implemented outside of "#if wxUSE_OWNER_DRAWN" which allows to use them even
in minimalistic library builds. And IsOwnerDrawn() is not used any more to
determine whether the item has bitmaps, just only if it's really owner drawn,
making the code more clear and fixing at least the bug above and possible more.

Closes #13878.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-27 00:02:28 +00:00
Vadim Zeitlin
d94b858bc9 Rename wxMenuItem::MustUseOwnerDrawn() to MSWMustUseOwnerDrawn().
No real changes, just make it clear that this method is MSW-specific and is
about using owner drawn items at MSW level and not wx one.

See #13878.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-27 00:02:22 +00:00
Vadim Zeitlin
d9a5f4a0bb Close monitoring thread handles as soon as possible in wxMSW.
Don't leave the handles of all threads used for monitoring the child processes
open until the main process termination, rather close them as soon as the
monitored process terminates.

This ensures that we don't accumulate potentially unbounded number of open
handles if we keep launching new child processes. An even better idea would be
to actually use a single thread for monitoring all of them, but this fix is
much simpler and should fix the most acute problem for now.

Closes #16123.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-27 00:02:16 +00:00
Vadim Zeitlin
6548217b37 Dutch translations update from Thomas De Rocker.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76198 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-26 13:40:40 +00:00
Vadim Zeitlin
da91677e97 Add missing wxUSE_WXDIB checks.
Fix compilation with wxUSE_WXDIB==0.

Closes #16113.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-24 18:46:18 +00:00
Vadim Zeitlin
338cf327b0 Don't change bitmap depth in wxMSW when copying it.
Sometimes, creating a DDB may fail to create the bitmap of the requested
depth and so a copy of wxBitmap could have a different depth than the original
wxBitmap.

Avoid this problem by falling back on using DIB if DDB with the right depth
couldn't be created.

Closes #11640.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76196 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-24 18:46:10 +00:00
Vadim Zeitlin
fee2d299b1 Add "View text" menu item to the webview sample.
Allow to view just the text of the web page.

Closes #16098.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76195 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-24 13:19:38 +00:00
Vadim Zeitlin
907832bd21 Fix reentrancy issues in wxMSW wxTextCtrl max length handling code.
The changes of r75940 didn't work correctly if the handler of wxEVT_TEXT in
some text control modified a (potentially) different text control, as the same
global variable was reused with disastrous results. Avoid this by keeping a
stack of insertion lengths instead.

Using a per-control field would work too, but would be a bit wasteful as the
size of the stack will rarely be more than 1 (and never much more) and this
change can also be applied to 3.0 branch without breaking ABI.

Additionally, fix another problem in r75940 which used 0 as a special marker
for the insertion length, which result in redoing each insertion of empty
string (which is another word for Remove()) twice unnecessarily, by using -1
instead.

Closes #15980.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76193 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-24 13:06:11 +00:00
Vadim Zeitlin
0811259c0d Add files included by richtext library to MSVC1{1,2} projects.
Closes #16104.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76192 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-23 17:54:54 +00:00
Vadim Zeitlin
a3da62503f Fix setting menu item bitmaps after appending them in wxMSW.
Update the bitmap used by Windows when using non-owner-drawn items with
bitmaps.

Closes #9388.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76191 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-23 15:18:37 +00:00
Vadim Zeitlin
67b128e186 Refactor wxMSW: move some code from wxMenu to wxMenuItem.
This will allow reusing it for other wxMenuItem bitmap-related operations.

See #9388.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-23 15:18:31 +00:00
Vadim Zeitlin
c3b5dc5e8f Fix toolbar repainting after deleting a tool in wxMSW.
The toolbar was in an inconsistent state when recalculating the sizes of the
separators used as placeholders for the controls and stretch spacers as the
tool was already deleted from the native toolbar but still present in wx
internal toolbar data and this resulted in discrepancies between the indices
in the native and wx toolbars.

Fix this by specially marking the already deleted but not yet removed tool and
ignoring it during the recalculations.

This makes the old, and only partially successful, attempt to work around this
bug in DoDeleteTool() unnecessary and so the code is actually simplified by
this change.

Closes #16095.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-23 00:57:18 +00:00
Vadim Zeitlin
b5f4eaf6bc Document what wxPrintQuality really is.
Mention that it can be either a predefined constant or a number expressing the
resolution.

See #14085.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-23 00:57:14 +00:00
Vadim Zeitlin
de22d0def4 Fix wxFileSystemWatcher::RemoveAll() to actually work.
We need to call DoRemove() on all watcher objects to really remove them, just
removing our record of them was not enough and e.g. resulted in errors if we
tried to re-add a previously watched path again.

Closes #15531.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-23 00:57:09 +00:00
Vadim Zeitlin
5b43c1858d Fix handling deletion of watched directory in MSW wxFileSystemWatcher.
Don't log an incomprehensible error when the watched directory itself is
deleted, but generate wxFSW_EVENT_DELETE for it. This is consistent with the
behaviour under Unix and generally more useful.

Closes #13294.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76186 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-23 00:57:03 +00:00
Vadim Zeitlin
305e766f0f Small refactoring in wxFileSystemWatcher MSW implementation.
Make wxIOCPService::GetStatus() smarter about its return value, it makes sense
to encapsulate the convention used to indicate the thread exit condition
inside wxIOCPService class itself instead of sharing it between it
wxIOCPThread itself.

It will also make it easier to detect more detailed error conditions in this
code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-23 00:57:00 +00:00
Vadim Zeitlin
62efdabbb8 Disable the use of "override" keyword for MSVC < 11.
While the keyword is indeed supported since MSVC 8, it's only since MSVC 11
that using it doesn't generate C4481 compiler warning ("nonstandard extension
used"), so avoid using it with the earlier versions.

See #16100.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76184 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-23 00:56:55 +00:00
Vadim Zeitlin
cc125e64b3 Handle normalization of directory names correctly in wxFileHistory.
Don't use relative path for the directories, which can also be managed by
wxFileHistory, because they don't have any and the old code resulted in
showing an empty string for them.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-22 22:03:34 +00:00
Vadim Zeitlin
8d808db43f Put a __cplusplus guard around C++-specific tests in wx/defs.h.
This avoids the warning about __cplusplus being undefined in the recently
added wxOVERRIDE logic and make the existing wx_xxx_cast<>s definitions
simpler.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76177 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-20 19:52:45 +00:00
Vadim Zeitlin
6cd13bc22d Mark some deprecated wxGrid methods as deprecated in the documentation.
Point people to the new names of the deprecated methods.

Closes #16103.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-20 19:45:53 +00:00
Vadim Zeitlin
d1c6d8baf9 Use Doxygen @deprecated tags for deprecated methods.
Instead of just mentioning that the methods are deprecated in the
documentation text, use the @deprecated tag for them to make it possible to
detect it in documentation-processing tools too.

Closes #16102.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-20 19:45:48 +00:00
Vadim Zeitlin
78de4fe291 Remove configure test for override keyword.
Detect its support in the code by testing __cplusplus value and using specific
checks for MSVC and Clang as configure detects it as being available when
using recent g++ versions in non-C++11 mode, which do support this keyword but
warn when it is used without -std={gnu,c}++11 option, which makes actually
using it a bad idea in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-20 15:49:07 +00:00
Vadim Zeitlin
33ad33d447 Add wxOVERRIDE and use it in common and wxOSX code.
Make overriding virtual methods more explicit and enable additional checks
provided by C++11 compilers when "override" is used.

Closes #16100.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-20 13:26:28 +00:00
Vadim Zeitlin
34e4f66d6a Compilation fix in wchar_t build after r76171.
Don't concatenate narrow wxLongLongFmtSpec with wide strings, just don't use
wxT() at all.

Closes #14685.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-20 13:26:01 +00:00
Vadim Zeitlin
8c4b1dcbd0 Add wxInt64 support to wxText{Input,Output}Stream.
Add explicit Read64[S]() and Write64() methods.

Closes #14685.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-19 22:57:44 +00:00
Vadim Zeitlin
89bf39314f Use "virtual" keyword with overridden methods.
No real changes, just make the code more clear by explicitly using "virtual".

Closes #16097.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-19 18:06:29 +00:00
Vadim Zeitlin
7f48a077ab Remove more unnecessary headers from drawing test.
Don't include GUI headers in non-GUI code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76169 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-19 18:01:15 +00:00
Vadim Zeitlin
b9a09f5e87 Fix WX_ASSERT_SAME_AS_FILE() definition in the new drawing test.
This macro should use AreFilesContentsEqual(), not
AreImagesFilesContentsEqual(), used by WX_ASSERT_SAME_AS_IMAGE_FILE().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76168 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-19 17:59:32 +00:00
Vadim Zeitlin
3f29a21d3e Don't include apparently unnecessary headers in drawing test.
wx/window.h shouldn't be needed in this non-GUI test.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 20:12:32 +00:00
Vadim Zeitlin
7e049a9692 Remove redundant forward declaration of wxCursor from wx/window.h.
We include wx/cursor.h from wx/window.h anyhow (and can't avoid it as we have
a member of wxCursor type in wxWindowBase).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76165 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 20:10:11 +00:00
Vadim Zeitlin
a4568e7c85 Add a new test checking wxGraphicsContext implementation correctness.
This test verifies that the output of wxGraphicsContext on the current system
matches the pregenerated reference output.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 19:31:21 +00:00
Vadim Zeitlin
1eb17f24f0 Include the individual headers that we really need instead.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76163 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 19:28:50 +00:00
Vadim Zeitlin
8b777c1aa8 Don't include wx/dc.h from wx/graphics.h.
This is not necessary and prevents compilation of this header in wxUSE_GUI=0
case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76162 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 19:28:47 +00:00
Vadim Zeitlin
ce47b38a84 Don't include wx/cursor.h from wx/dc.h.
This is simply not needed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 19:28:41 +00:00
Vadim Zeitlin
399371921f Add font colour support to wxFontPickerCtrl.
Currently this is only really implemented under Windows, just as the colour
support in wxFontDialog, but make the API available under all platforms for
consistency.

Closes #11614.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 17:23:13 +00:00
Vadim Zeitlin
9e7dbef726 Use helper GetPickerWidget() function in wxFontPickerCtrl.
No real changes, just use a helper function instead of an ugly M_PICKER macro.

See #11614.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76159 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 17:23:06 +00:00
Vadim Zeitlin
2d39af0bbe Use "MultiProcessorCompilation" instead of explicit /MP in MSVS projects.
Use the user-visible option instead of the command line option which is now
hidden in the IDE.

Closes #16093.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76158 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 17:08:16 +00:00
Vadim Zeitlin
09eebae182 Add margin to the right of the message in wxGenericProgressDialog.
For some reason the border was used only on the left side but not on the right
one, resulting in the ugly looking label flush to the right dialog border if
it was long enough.

Closes #16094.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76156 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 14:21:51 +00:00
Julian Smart
b4d02eafa3 Improved calculation of spanning column widths.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 09:14:42 +00:00
Paul Cornett
0236c59057 update for GTK3
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76153 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-16 16:39:20 +00:00