Replace a few __WXMSW__ tests with __WINDOWS__ as the former is not
defined any longer (since r73290) when compiling with wxUSE_GUI set to 0.
Tested changes with both wxGTK and wxMSW builds under Cygwin.
Closes#14382.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't offset the returned values by the parent window origin unnecessarily: as
popup windows are created as children of the desktop window in wxMSW, their
coordinates are already expressed in screen coordinate system (which is
exactly the same as display window coordinate system) and we must not try to
translate them to it once again, this is completely wrong and was probably a
left over from earlier wxPopupWindow implementation in which it wasn't created
as a child of desktop.
In 3.0 branch we still need to continue overriding virtual DoGetPosition() for
ABI reasons, but don't do anything in it any more.
Closes#4440.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
When using wxPGEditor_Choice colour property, cancelling the choice of the
custom colour reset the previously selected custom colour.
Fix this by correcting the test for the custom colour which didn't work
before.
Closes#15542.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76627 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't optimize the returned length for surrogate-less case, this does save a
pass of the string but at the price of returning a wrong result, which is not
worth it, just compute the really required length exactly.
Closes#16298.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76618 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Selecting "Custom" in a colour property cell resulted in the colour selection
dialog being shown twice if it was cancelled the first time.
Fix this by using wxPG_PROPERTY_SPECIFIC to indicate that the value is just
being queried and the user shouldn't be asked to enter it, as it is already in
the other places.
Closes#15543.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Using negative column widths used for hidden columns when updating the column
positions after dragging one of them to a new position totally broke their
display. Fix this by ignoring the hidden columns.
Closes#16110.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76445 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Remove or reset the corresponding bitmap if the provided one is invalid
instead of asserting, this is what wxGTK does and this behaviour seems to be
more useful.
Also document this behaviour as it's now implemented in both wxMSW and wxGTK.
Closes#13569.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
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
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
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
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
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
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
These functions only worked if called at the beginning, before showing the
parent window containing the children whose TAB order was being adjusted,
because it didn't refresh the GTK+ TAB order on the correct window: we need to
do it for the parent of the window being moved, not this window itself.
Closes#16032.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76100 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Not adding the controls to vertical toolbar is not enough, we also need to
hide them to prevent them from being shown as independent floating windows.
And we also need to add separators instead of the controls themselves to keep
the indices the same as in the horizontal case.
Closes#11821.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76098 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Not doing this prevented the default handling from taking place resulting in
internal confusion in GtkNotebook when wxTreeCtrl was placed inside it: the
code there set the button being held by user in its mouse press event handler
and reset it in its mouse release event handler which was never called because
we didn't skip the event, resulting in ignoring the next mouse press in the
notebook.
Closes#16055.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We wrongly pretended to accept the data in formats which we didn't actually
accept and showed misleading cursors to the user.
Fix this by partially reverting some of the changes of r72668 (see #14697).
Closes#16042.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76076 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The size of the buffer used for the data currently needs to include an extra
byte for the trailing NUL. This is wrong, as it means that GetDataSize() and
GetDataHere() behaviour is not consistent, but at least avoid overrunning the
buffer for now.
Also use wxCharBuffer instead of raw char array to make the code safer (both
because it releases the memory automatically and because it also adds an extra
byte for the trailing NUL automatically as well, making such bugs impossible).
See #15914.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The native LoadImage() function used by wxBMPFileHandler only supports the
standard bottom to top BMPs, fall back to our own implementation in wxImage
wxBMPHandler if it fails to also support the top to bottom ones.
Closes#13650.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76041 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use the width of the largest toolbar item as the toolbar width, not the width
of the first one. The implicit assumption that all items had the same width
was wrong and resulted in items wider than the first one being truncated.
Closes#3788.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76034 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
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