Commit Graph

58711 Commits

Author SHA1 Message Date
Paul Cornett
e61b4f2a8a avoid double-to-float conversion warnings in headers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76288 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-05 17:13:46 +00:00
Vadim Zeitlin
7d0e6b3c8a Don't use %i format specifier for size_t values.
In 64 bit build, size_t can be 64 bits while %i expects a 32 bit value.
Fix this by just avoiding the unnecessary use of size_t, the number of entries
in the index is not going to be greater than 2^32.

Closes #16163.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76285 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-05 10:44:31 +00:00
Vadim Zeitlin
ada789fa57 Fix warning about %lu being used with an int in 32 bit wxOSX build.
NSUInteger is unsigned long in 64 bit builds, but unsigned int in 32 bits, so
case it to long explicitly to avoid warnings about using it with %lu format
specifier.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-05 10:44:27 +00:00
Paul Cornett
4da2b51526 avoid preprocessor directives inside macro invocation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-04 16:55:28 +00:00
Paul Cornett
09419dbd52 assertion messages don't need to be translated
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-04 16:00:03 +00:00
Paul Cornett
ea613544d5 remove redundant assertion messages, wxLogError has already been called
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-04 15:56:29 +00:00
Vadim Zeitlin
de052ac604 Document wxRibbonDisplayMode enum.
See #16133.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76274 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-04 15:28:15 +00:00
Paul Cornett
13d31bf1f5 fix typo in size 2530 --> 3530
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76273 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-04 15:26:09 +00:00
Paul Cornett
96daef8a32 fix some asserts that were clearly meant to be wxFAIL_MSG
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-04 15:09:15 +00:00
Paul Cornett
535c8b1b99 fix more memory leaks
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-04 06:45:27 +00:00
Paul Cornett
39c6581f56 Improve conversion between wxPaperSize and GtkPaperSize
Eliminates many "Gtk-WARNING **: Unknown paper size", and the occasional
"GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed".
And fixes approximately one zillion memory leaks.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-04 06:41:53 +00:00
Julian Smart
701a428363 Removed unnecessary list renumbering
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76266 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-03 13:53:58 +00:00
Vadim Zeitlin
c654c7c20d Fix return value of wxRichMessageDialog with only an "OK" button.
Apply the same workaround as was applied in r67771 to wxMessageDialog to
wxRichMessageDialog and map IDCANCEL returned from it to IDOK if "Cancel" is
the only button in the dialog -- as in this case it's really just a renamed
(for convenience of allowing the user to use "Esc" to close it) "OK".

Closes #16153.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-02 22:38:36 +00:00
Paul Cornett
c3c9097afa Fix invalid use of g_object_get_property()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76252 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-01 17:45:01 +00:00
Julian Smart
0f67675d40 Use style sheet when copying to the clipboard if available
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-31 16:46:36 +00:00
Paul Cornett
36745ddfb5 use wxDialog::ShowModal() rather than gtk_dialog_run()
so all the things wxDialog::ShowModal() does are not bypassed


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-31 02:16:01 +00:00
Paul Cornett
0dd37e577a Prevent dialog widget from being destroyed during ShowModal()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-30 19:23:07 +00:00
Paul Cornett
fa10b28e50 use "new" wx-prefixed macros in samples
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-30 07:07:55 +00:00
Paul Cornett
a1cb57f549 adjust size hints when decor size changes, to prevent changing a set client size during initial show
closes #15794


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76221 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-30 01:52:11 +00:00
Vadim Zeitlin
b805e8bdde 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/branches/WX_3_0_BRANCH@76214 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 16:53:05 +00:00
Vadim Zeitlin
92205c3308 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/branches/WX_3_0_BRANCH@76213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 16:52:59 +00:00
Vadim Zeitlin
35bd8dbde8 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/branches/WX_3_0_BRANCH@76212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 16:52:54 +00:00
Vadim Zeitlin
d274b4a5cf 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/branches/WX_3_0_BRANCH@76211 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 16:52:48 +00:00
Václav Slavík
24feb2e1b5 Revert "Don't emit wxEVT_TEXT in wxMSW's wxTextCtrl::SetFont()."
This reverts accidentally committed r76207.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76209 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 13:04:27 +00:00
Václav Slavík
aa603a2e16 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/branches/WX_3_0_BRANCH@76208 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 13:03:12 +00:00
Václav Slavík
67dc9f5fb1 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/branches/WX_3_0_BRANCH@76207 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-29 13:03:09 +00:00
Vadim Zeitlin
69e20dfc0f 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/branches/WX_3_0_BRANCH@76199 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-26 23:41:51 +00:00
Vadim Zeitlin
3768c2cb7f Fix reentrancy issues in wxMSW wxTextCtrl max length handling code.
The changes of r75936 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.

Additionally, fix another problem in r75936 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/branches/WX_3_0_BRANCH@76194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-24 13:17:18 +00:00
Vadim Zeitlin
78c7a11877 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/branches/WX_3_0_BRANCH@76183 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-23 00:51:27 +00:00
Vadim Zeitlin
37024c991c 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/branches/WX_3_0_BRANCH@76182 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-23 00:10:36 +00:00
Vadim Zeitlin
ddf01fe77f 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/branches/WX_3_0_BRANCH@76181 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-23 00:10:29 +00:00
Vadim Zeitlin
cf4329e848 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/branches/WX_3_0_BRANCH@76180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-23 00:10:25 +00:00
Vadim Zeitlin
37dd8f5b7b 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/branches/WX_3_0_BRANCH@76157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 17:07:12 +00:00
Vadim Zeitlin
a1ddc1fd60 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/branches/WX_3_0_BRANCH@76155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-18 14:20:31 +00:00
Paul Cornett
b0cf46ef31 update for GTK3
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76153 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-16 16:39:20 +00:00
Vadim Zeitlin
063bb30ec4 Disable the use of new style wxDirDialog under Vista.
IFileDialog-based dialog has a bug making it return a wrong path sometimes
under Vista, disable its use there to avoid it.

Closes #16005.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76151 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-16 13:05:34 +00:00
Paul Cornett
eb789bbf06 build fixes for wxUniversal
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-15 19:34:31 +00:00
Paul Cornett
d737ca76bd for GTK+ 3.6 and later, invalidate cached best size when GTK's style cache is updated, see #16088
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-15 18:44:02 +00:00
Vadim Zeitlin
15d82f05e1 Also free internal handlers when wxMSW wxStaticBitmap is destroyed.
r76141 fixed the resource leak when wxStaticBitmap image was replaced by
another one but the leak still happened at the end, when the wxStaticBitmap
was destroyed.

Fix it there as well in the same way.

Closes #16068.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76145 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-14 19:21:03 +00:00
Vadim Zeitlin
44611572b5 Fix resource leak in wxMSW wxStaticBitmap when using RGBA icons.
Release the old handle if it wasn't freed by STM_SETIMAGE itself.

Closes #16068.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76141 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-13 16:19:55 +00:00
Vadim Zeitlin
3ab8839562 Install wx/preferences.h and wx/testing.h in "make install".
These headers were accidentally forgotten in files.bkl, add them there and
rebake.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76138 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-13 16:12:22 +00:00
Vadim Zeitlin
f428b668b4 Compilation fix to wxScopedArray use.
The ctor taking the number of elements doesn't exist in 3.0, don't use it to
fix compilation after the changes of r76124.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76137 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-13 13:03:50 +00:00
Vadim Zeitlin
1436ac65df Add support for loading icons in PNG format to wxImage.
ICO files can contain data in PNG, as well as BMP, format in recent (i.e. from
this millennium) versions of Windows, so check for this case in wxICOHandler
and load such data using wxPNGHandler.

See #15918.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76127 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-12 22:54:42 +00:00
Vadim Zeitlin
0bc354e2d9 Handle verbosity correctly in wxICOHandler loading code.
Pass on the "verbose" argument to LoadDib() function instead of always being
verbose in it.

Also remove the unused IsBmp variable.

See #15918.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76126 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-12 22:54:37 +00:00
Vadim Zeitlin
5a1c92ea78 Allow loading icons of width 256 from ICO files.
Account for the tweak of ICO file format which uses 0 if the width is 256.

See #15918.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76125 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-12 22:54:32 +00:00
Vadim Zeitlin
b3089993af Fix possible memory leak in wxICOHandler loading code.
Use wxScopedArray<> instead of a raw pointer to ensure that the memory is
always freed, even in case of error return.

See #15918.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76124 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-12 22:54:26 +00:00
Vadim Zeitlin
de20880064 Fix accelerators in appended submenu items in wxGTK.
They were not previously taken into account because we didn't call
gtk_widget_add_accelerator() on the right GtkAccelGroup.

Closes #16050.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76113 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-11 15:20:56 +00:00
Vadim Zeitlin
7f4969c9e2 Fix size calculation for multi-column vertical toolbars in wxMSW.
The width was calculated incorrectly in this case as we simply multiplied the
width of the widest column by their number in this case, but actually each of
them has its own width which needs to be calculated separately.

See #13579.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-09 20:56:03 +00:00
Vadim Zeitlin
01c6b63c3f Fix background painting of multi-row toolbars in wxMSW.
The item rectangle used wrong vertical coordinates which didn't matter (much?)
for the single row toolbars but was completely wrong for toolbars with more
than one row.

Don't always anchor the rectangle at the window top to avoid this.

See #13579.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76105 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-09 20:55:59 +00:00
Vadim Zeitlin
6fa9ffda8e Disable stretchable spaces in multi-row toolbars in wxMSW.
Stretchable separators simply don't work correctly when the space they are
supposed to stretch onto is distributed across several different toolbar rows
or columns, so just disable them for multi-row (or column, for vertical
toolbars) case.

See #13579.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76104 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-09 20:55:54 +00:00