Commit Graph

58711 Commits

Author SHA1 Message Date
Vadim Zeitlin
ab4699b3f4 Use correct column type when adding columns to wxDataViewListCtrl.
Using base class methods such as AppendBitmapColumn() resulted in
wxDataViewListCtrl::AppendColumn() being called but this function always
assumed the column was of "string" variant type -- which was, of course, false
for bitmap columns and so resulted in heap corruption (thanks to the
wonderfully type unsafe code using wxVariant) and a crash.

Get the correct type to use from the column itself now to fix this.

Closes #16008.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-20 13:05:21 +00:00
Vadim Zeitlin
12231256e4 Fix wxCmdLineParser::Found(name) for options with values.
Calling Found() without providing the second "value" argument started
generating an assert since introduction of the negated options as it reused
FoundSwitch() which can only be used for switches, i.e. options without
values.

Fix this to revert a regression since 2.8 and also add unit tests for the
different Found() overloads.

Closes #15986, #16001.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-20 00:31:49 +00:00
Vadim Zeitlin
b01c48a842 Reduce code duplication in wxCmdLineParser implementation.
No real changes, just extract the code for finding options from their names
into a separate function instead of repeating it 4 (and 5, after the next
commit changes) times.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75938 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-20 00:31:46 +00:00
Vadim Zeitlin
aaa52a40ee Don't use invalid pointer in file dialog hook procedure in wxMSW.
We can receive WM_NOTIFY for other than CDN_XXX messages if we have a native
control as our immediate child (which can happen with "extra" controls) and
the LPARAM is not a pointer to OFNOTIFY at all in this case, so don't try to
use it as such.

This fixes a crash when adding a "bare" extra control, see #16003.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75937 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-20 00:31:42 +00:00
Vadim Zeitlin
4c711c8002 Fix wxTextCtrl contents corruption with long strings in wxMSW.
wxMSW automatically extended wxTextCtrl length limit beyond the tiny standard
32KB when it was exceeded, but part of the text being appended into the
control was lost when doing it.

Fix this by retrying insertion after extending the limit.

Closes #15980.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75936 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-20 00:31:35 +00:00
Stefan Csomor
ed55d49aa2 backport of r75934, misplaced the orderOut: , see #15998, #15902
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-19 20:38:51 +00:00
Vadim Zeitlin
afdec07df2 Set model pointer in wxDataViewEvents generated under wxOSX.
Add missing SetModel() calls.

Closes #16004.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75932 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-19 14:51:58 +00:00
Vadim Zeitlin
3965bf4fd6 Move DSS_HIDEPREFIX fallback definition to the central header.
Do it only once now that it's used in 3 different places (it recently started
to be used in src/msw/anybutton.cpp as well) instead of defining it thrice.

This also fixes MinGW build.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75929 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-18 23:36:00 +00:00
Stefan Csomor
98dc6aa95c backport of r15902
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-18 17:47:59 +00:00
Vadim Zeitlin
6e277a8848 Mention the addition of VC{11,12} solution files in the change log.
This is an important thing for a lot of people.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75927 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-18 15:44:35 +00:00
Vadim Zeitlin
de5ae5495e Add projects for MSVC 11 and 12 (MSVS 2012 and 2013).
Add manually created projects for now, as it looks that we are not going to
have bakefile-generated ones any time soon.

Closes #15780.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75925 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-18 15:40:45 +00:00
Vadim Zeitlin
2410fdb89d Fix transparency in toolbar buttons when not using comctl32.dll v6.
Old versions of comctl32.dll don't support alpha in the toolbar image list, so
use the masks only for them.

This is a backport of r75785, r75794 and r75923 from trunk.

Closes #2609.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75924 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-18 15:14:34 +00:00
Vadim Zeitlin
b9fdc86b9a Don't delete child controls when deleting wxStaticBoxSizer.
This is an incompatible change compared to 2.8 which can make the existing
code crash and it also goes against the usual rule that the windows are never
owned by sizers, only other windows.

Closes #15698.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-18 15:09:23 +00:00
Stefan Csomor
18b677c807 backport of r75899
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-18 13:13:07 +00:00
Vadim Zeitlin
ff55622b69 Add missing bounding box calculations in wxMSW wxDC code.
Update the bounding box when drawing bitmaps (in one of several possible ways)
and gradients.

Closes #2132.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75917 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-17 23:55:32 +00:00
Vadim Zeitlin
7910de5248 Improve disabled buttons appearance in wxMSW when not using themes.
Owner drawn buttons were not drawn in the same way as normal ones when they
were disabled, use Win32 DrawState() to do it now to achieve the correct
appearance.

Closes #11746.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-17 23:55:28 +00:00
Vadim Zeitlin
79542a7196 Fix crash in wxMSW wxFileSystemWatcher when removing the same path twice.
Starting to watch a path, stopping to watch it, starting to watch it again and
stopping again resulted in a crash in wxMSW wxFileSystemWatcher implementation
because the watcher object wasn't kept artificially kept alive when it was
stopped for the second time. This happened because our way of keeping it alive
was to store it in a hash map indexed by path, but if a watcher for the same
path (added there when this path was first unwatched) was already present in
the map, the watcher wasn't added to it and not kept alive.

Fix this by using a vector instead of a map. We obviously sacrifice quick
access to it by path but at least this doesn't crash any more. And we could
actually still use a map, just indexed by the (unique) pointer to the object
stored inside wxSharedPtr itself, and not its path. But a vector might be a
more efficient data structure in practice, if we keep it from becoming too big
as we should try to do by triggering artificial port completions when a watch
is removed.

At any rate, at least the crash is fixed for now.

Closes #15995.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75915 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-17 23:55:22 +00:00
Vadim Zeitlin
e354c7a59a Allow waiting for thread termination even without wxTheApp in wxMSW.
Attempts to wait for thread termination after wxTheApp was destroyed resulted
in an error in wxMSW since 2.9.something whereas it used to work in 2.8 and
also generally makes sense to be allowed. So do make this work again by
falling back to the simple non-interruptible wait for thread if we don't have
the application object any more.

Closes #13391.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-17 23:55:17 +00:00
Vadim Zeitlin
302af8f3b3 Fix handling of wxTEXT_ATTR_EFFECT_SMALL_CAPITALS in wxRichTextFontPage.
Due to a typo when copy-and-pasting code wrong control was being updated.

It would be better to have a function updating the given control from the
given flag, of course, but for now just fix the bug.

Closes #15990.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-17 23:55:13 +00:00
Vadim Zeitlin
cdcb63bf18 Fix fallback format index in wxPropertyGetter wxUIntProperty code.
Don't crash by accessing an out of bands array element if the format string
index had been set to an invalid value, just use the default (decimal) format
in this case.

Closes #15984.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-17 23:55:08 +00:00
Vadim Zeitlin
9ff8e5534b Use symbolic constants in wxPropertyGrid wxUIntProperty code.
No real changes, just use symbolic constants instead of hard coded magical
constants. The code is still difficult to understand but slightly better than
before.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-17 23:55:05 +00:00
Paul Cornett
5563023022 avoid potential NULL pointer dereference, closes #15993
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75898 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-17 16:25:22 +00:00
Paul Cornett
942bddf464 fix ordering of function parameters, closes #15985
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75897 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-17 16:25:08 +00:00
Julian Smart
88bc9481c9 Fixed floating object layout when there is only a short text string in the paragraph
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-17 14:54:28 +00:00
Julian Smart
3dc3652c8c Removed rounding that didn't work for negative numbers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75894 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-16 20:05:37 +00:00
Paul Cornett
3d4213b512 mimic wxMSW wxSetCursorEvent propagation behavior, closes #15801
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75888 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-15 18:14:48 +00:00
Václav Slavík
8d3b203286 OS X: fix startup sequence when restoring session on >=10.7.
Make sure that OnInit() is called before MacReopenApp(). This is
normally the case, but it is possible for it to be called as the first
thing.  This can happen when OS X restores running apps when starting a
new user session. Apps that were hidden (dock only) when the previous
session terminated are only restored in a limited, resources-saving way
- the event loop is running, but didn't call anything in the app
delegate yet.  When the user clicks the icon,
applicationShouldHandleReopen: is called, but we didn't call OnInit()
yet. In this case, we shouldn't call MacReopenApp(), but should proceed
with normal initialization.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-15 16:59:30 +00:00
Paul Cornett
2ddcf0e76e avoid setting negative window size, see #15976
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75883 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-13 16:47:17 +00:00
Paul Cornett
3354ddc8f9 avoid forcing a paint on a window with zero size, see #15976
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75882 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-13 16:46:57 +00:00
Julian Smart
cbda10a5c0 Corrected wxTextBoxAttr::IsDefault() implementation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-13 12:01:08 +00:00
Julian Smart
5366d4bd97 Fixed a bug that prevented floating objects from being updated correctly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75877 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-13 11:47:13 +00:00
Paul Cornett
ee1621a9c8 finish setting size before sending wxMoveEvent
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75867 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-10 17:32:42 +00:00
Paul Cornett
5c8ad94705 add missing GTK3 implementations of GTKGetWindow()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75864 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-09 19:53:17 +00:00
Paul Cornett
01ee6284c9 emit signal by id instead of name
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75863 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-09 18:36:15 +00:00
Paul Cornett
fe0cad0804 get non-default wxTextCtrl cursors working with GTK3
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75862 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-09 18:15:03 +00:00
Paul Cornett
d4329a4390 Use "state-flags-changed" signal with GTK3, deprecated "state-changed" is ignored.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75861 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-09 16:49:35 +00:00
Vadim Zeitlin
cc8b8a6e3c Fix build under OS X with --disable-xrc.
Don't try to change the install names in non-existent (in this case) wxrc.

Closes #15946.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-08 14:04:12 +00:00
Julian Smart
c3d2dbb92e Return true from GetRangeSize or partial extents will be incorrectly filled in
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-08 11:55:22 +00:00
Vadim Zeitlin
be3af02d3a Don't show "deleted stale lock file" message by default.
The user typically can't do anything about this error anyhow, so don't show it
by default. Still do show it when running in the verbose mode as this might
add diagnosing the problem when something goes unexpectedly wrong.

Closes #15944.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75838 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-08 00:46:48 +00:00
Vadim Zeitlin
886647602e Don't use try/catch if exceptions support is disabled.
Closes #15954.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75836 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-08 00:41:09 +00:00
Vadim Zeitlin
696e4323aa Don't log error from wxMSW wxWakeUpIdle().
This is not necessary as there is nothing that can be done about this error
anyhow and the function still "works" even if it occurs (it doesn't wake up
anything but it is not necessary to do it if the message queue is already
full) and, worse, results in a crash due to stack overflow.

Closes #15951.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-07 15:02:23 +00:00
Vadim Zeitlin
0dd099f3c5 Avoid crashes when deleting owned top level windows.
Don't delay the TLW destruction if it has a parent and its parent is already
being deleted: we can't delay the inevitable in this case and only succeed in
making the program crash if we try.

Closes #15743.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-07 14:35:48 +00:00
Vadim Zeitlin
7e1a702bc7 Fix exit on last TLW logic after the change of r75630.
The changes in this revision meant to prevent the closure of transient dialogs
from quitting the application (see #15880) prevented any application using AUI,
including the aui sample, from exiting as the AUI utility frames deleted
during the main frame destruction were returning false from their
IsLastBeforeExit() now.

Fix this by relaxing the check and ignoring the parent if it is already being
deleted anyhow -- in this case there is no danger of closing it accidentally.

Closes #15894.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75832 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-07 14:35:41 +00:00
Paul Cornett
e64d851a83 Don't update position variables from window dragging code.
Let "configure-event" handler do it so it can also generate proper move events.
closes #15904


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75826 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-06 17:27:25 +00:00
Vadim Zeitlin
b1f088b60d Revert "Add XRC handler file to MSVC 10 project."
This reverts r75789 which shouldn't have been applied to 3.0 branch as the
files added to the project don't exist in it.

Closes #15942.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-06 15:10:50 +00:00
Václav Slavík
000fd8868c Fix failing TextFileTestCase::ReadMixedWithFuzzing().
The test failed with 33% probability because it didn't account for
trailing non-newline character.  Fixed and also changed the test to
repeat itself a hundred times, to increase the probability of catching
problems like this.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75824 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-06 10:15:48 +00:00
Paul Cornett
2fe16c1aad Fix wxSetCursorEvent handling
For compatibility with wxMSW, send event up the parent chain.
Properly handle setting the cursor for a wxSetCursorEvent, and don't overwrite the window cursor.
see #15801


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75821 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-06 08:54:17 +00:00
Paul Cornett
6d9817ea26 Different fix for cursor inheritance and busy cursor/global cursor.
Previous work was not compatible with GTK < 2.18 and did not properly handle some cases
see #15801


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75807 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-06 04:43:46 +00:00
Václav Slavík
f6b9932195 Add line-endings fuzzing test to TextFileTestCase.
Stress-test wxTextFile's handling of unusual CR,LF characters.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75804 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-05 18:29:47 +00:00
Václav Slavík
1932f47930 Rewrite wxTextFile's newlines parsing to fix multiple bugs.
Remove the complicated parsing state machine that contained bugs with
unexpected inputs and was very hard to modify correctly.  Replace it
with much simpler code that looks ahead, instead of deducing line
endings from past characters.

The new code never looses lines with data and calls AddLine() on the
first newline character it encounters, peeking ahead to determine the
line ending type.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75803 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-05 18:29:43 +00:00