Commit Graph

69162 Commits

Author SHA1 Message Date
Ilya Sinitsyn
0e8ca0c8f9 Fix the cursor mode switching in wxGrid mouse move event handler
Allow switching between row and column resizing modes in mouse move event
handler.
2020-08-24 02:09:01 +02:00
Ilya Sinitsyn
5d3d376766 Remove unused wxGrid function 2020-08-24 02:09:01 +02:00
Ilya Sinitsyn
d6aec06150 Process the wxGrid mouse click depending on the current mode
Simplify the code of wxGrid::DoGridCellLeftDown() and make it more
correct by using m_cursorMode instead of duplicating (not 100%
correctly) the logic used to set it in DoGridMouseMoveEvent().

If the assumption that m_cursorMode is already set by the time
DoGridCellLeftDown() is called turns out to be wrong, e.g. when wxGrid
is used on touch screens, we would need to refactor these functions to
extract the code determining m_cursorMode from the mouse location into a
separate function that would be called from both.

Note that this commit is best viewed with "git diff -w" to see how little
has really changed.
2020-08-24 02:08:54 +02:00
Vadim Zeitlin
c1d3e65ac4 Merge branch 'wine-heap-fix'
Wine heap fix and other global memory-related cleanup.

See https://github.com/wxWidgets/wxWidgets/pull/2030
2020-08-24 00:18:57 +02:00
Vadim Zeitlin
3df9d772a4 Merge branch 'display-ppi-from-scaling-factor'
Determine display DPI from scaling factor instead of trying to compute
it from the physical display dimensions.

See https://github.com/wxWidgets/wxWidgets/pull/2015

Closes #18855.
2020-08-24 00:14:27 +02:00
Vadim Zeitlin
1bf76ee594 Add a safety check for the buffer size in wxIDataObject
Avoid size overflow if the offset value is greater than it.
2020-08-22 23:48:58 +02:00
Paul Cornett
3f9884817d Allow wxButton to show explicitly set bitmaps regardless of theme setting with GTK3
See #18874
2020-08-22 11:18:48 -07:00
Vadim Zeitlin
75ad798d8b Use GlobalPtrLock instead of manual GlobalUnlock() calls
Make the code safer and shorter by using RAII wrapper instead of manual
Global{Lock,Unlock}() calls.

No real changes.
2020-08-22 19:45:19 +02:00
Vadim Zeitlin
0d7be7c189 Use GlobalPtrLock instead of manual Global{Lock,Unlock}() calls
Also add GlobalPtrLock::GetSize() and use it instead of calling
GetSizeFromBuffer() as it's more direct and doesn't require the use of
::GlobalHandle().
2020-08-22 19:45:19 +02:00
Vadim Zeitlin
aadfaada7a Fix crash when using custom DnD formats under Wine
Using ::HeapSize() on a global pointer is wrong, and even though it
somehow still works under "genuine" MSW, it crashes under Wine.

Fix this by using ::GlobalSize() instead, which is the right function to
use with this kind of pointer.

Thanks to Damjan Jovanovic for the analysis of the problem in Wine
bugzilla (see https://bugs.winehq.org/show_bug.cgi?id=38924#c10).

Closes #18887.
2020-08-22 19:45:19 +02:00
Vadim Zeitlin
93c580ccaf Don't mangle ampersands in wxToolBar tooltips under MSW
Preserve the ampersands in the string, which is consistent with wxGTK
behaviour and less surprising than the default behaviour, which creates
mnemonics in the tooltips that are, of course, perfectly useless, as
they can't be activated from keyboard anyhow.

Turn on TTS_NOPREFIX, which is already used by wxToolTip, to fix this.

Closes #18899.
2020-08-22 18:49:25 +02:00
Václav Slavík
adb7c8a53d cfstring.h compilation fix for ARC builds 2020-08-22 16:46:27 +02:00
Vadim Zeitlin
ff3cb34d18 Add a unit test for using bitmaps with image and empty label
This used to be broken, see #18898, and now that it is fixed by
5a70051c7e (Avoid assertion failure in wxButton with bitmap and empty
label, see #18898, 2020-08-21) add a unit test so that it stays fixed.
2020-08-21 20:21:17 -07:00
Ian McInerney
c0bfaf4104 Use new CanBeToggled function inside wxAuiToolBar where appropriate 2020-08-21 23:29:08 +01:00
Ian McInerney
afbb334a26 Make IsCheckable true by default and switch to explicitly disallowing it
Also add a new accessor to wxAuiToolBarItem to make it easier to
determine when a tool can be checked.
2020-08-21 23:15:38 +01:00
Paul Cornett
5a70051c7e Avoid assertion failure in wxButton with bitmap and empty label, see #18898 2020-08-21 08:43:50 -07:00
Vadim Zeitlin
9765b6d58e Send SELECTING events while selecting rows/columns too
Generalize the changes of 415f080c80 (Split wxGrid RANGE_SELECT event
into SELECTING and SELECTED, 2020-07-27) to the case when the mouse is
dragged over row or column headers: also send SELECTING events while
dragging and a SELECTED event at the end, whether it's due to releasing
the mouse button or losing mouse capture.
2020-08-21 16:10:40 +02:00
Vadim Zeitlin
408ebfd253 Capture mouse while selecting rows/columns too
Change the logic in ChangeCursorMode() to explicitly exclude the modes
for which the mouse should not be captured, as CaptureMouse() should be
called in most cases (and ideally for all of them in the future) and do
capture it for WXGRID_CURSOR_SELECT_{ROW,COL} too, if only to be
notified about mouse capture loss.
2020-08-21 15:54:47 +02:00
Vadim Zeitlin
010007ba17 Fix type of the initial wxGrid selection event when dragging
Pass the same eventType ExtendCurrentBlock() is called with to
SelectBlock() called to perform the initial selection to ensure that
wxEVT_GRID_RANGE_SELECTING is sent while dragging instead of the
unexpected wxEVT_GRID_RANGE_SELECTED (in addition to the expected one
sent at the end when the drag is over).
2020-08-21 11:49:34 +02:00
Vadim Zeitlin
6d6c01ff2a Make wxKeyboardState ctor explicit
Avoid accidental conversions of e.g. int to wxKeyboardState.
2020-08-21 11:49:34 +02:00
Vadim Zeitlin
682cb8355c Replace "sendEvent" parameter in wxGridSelection with "eventType"
Instead of just passing a boolean flag indicating whether
wxEVT_GRID_RANGE_SELECTED should be sent, pass wxEventType to send, with
wxEVT_NULL being interpreted as "don't send anything".

No real changes yet, but this will allow using the existing functions to
send wxEVT_GRID_RANGE_SELECTING and not only SELECTED in the upcoming
commits.
2020-08-21 11:49:34 +02:00
Vadim Zeitlin
767f19cf25 Add menu item to clear log in the grid window
Just make it more convenient to read the logs in it.
2020-08-21 11:49:34 +02:00
Vadim Zeitlin
58456523b5 Merge branch 'dpi-misc' of https://github.com/MaartenBent/wxWidgets
Miscellaneous DPI Improvements.

See https://github.com/wxWidgets/wxWidgets/pull/2025
2020-08-21 02:44:07 +02:00
KT
b50aca9596 Inherit art provider in wxAuiFloatingFrame by default
Use the same art provider for a floating frame detached from an existing
wxAuiManager as was used by the original wxAuiManager itself, to ensure
that the appearance of this frame is consistent with the appearance of
its parent.

Implementing this required adding wxAuiDockArt::Clone() to allow copying
it in the new frame and this patch also adds GetAuiManager() to
wxAuiFloatingFrame, similar to the existing method in wxAuiNotebook, in
order to allow changing the dock art from the application code if
desired.

Closes https://github.com/wxWidgets/wxWidgets/pull/2022

Closes #18882.
2020-08-21 02:43:28 +02:00
Vadim Zeitlin
126c976f5b Merge branch 'taskbar-icon-get-menu'
Add wxTaskBarIcon::GetPopupMenu() allowing to avoid recreating the menu
every time.

See https://github.com/wxWidgets/wxWidgets/pull/2020
2020-08-21 02:42:13 +02:00
Vadim Zeitlin
d8c308a4e0 Merge branch 'wxrc_flavour' of https://github.com/ardovm/wxWidgets
Append WX_FLAVOUR to the name of wxrc executable.

See https://github.com/wxWidgets/wxWidgets/pull/2013
2020-08-21 02:40:55 +02:00
Vadim Zeitlin
8c9ba23eae Merge branch 'string-art-ids'
Make the wxART_* constants const wxStrings to improve compatibility with
pre-3.1.4 code and, in particular, allow taking the address of these
constants.

See https://github.com/wxWidgets/wxWidgets/pull/1996
2020-08-21 02:39:12 +02:00
Ian McInerney
65e124bb64 Add a flag to wxUpdateUIEvent to tell if the item supports the check action
Not all items support check being set in an UpdateUIEvent handler,
so it is nice to provide an API to find out if the item supports it.

Fixes #13369
2020-08-20 23:30:19 +01:00
Vadim Zeitlin
65c27c6a6e Rename wxID_ABOUT menu handler in the grid sample
Use "On" prefix for it for consistency with all the other ones.

No real changes.
2020-08-20 17:08:40 +02:00
Vadim Zeitlin
eb60684ac7 Make log window in the grid sample expand too
It is too small to show more than a few lines of logs otherwise.
2020-08-20 17:06:09 +02:00
Vadim Zeitlin
4b918966f6 Refactor logging of wxGridRangeSelectEvent in the grid sample
Avoid duplicating the complicated logging code twice, when it's exactly
the same for both the SELECTED and SELECTING events. Just use a common
helper function instead.
2020-08-20 16:56:23 +02:00
Vadim Zeitlin
9e27efb2cb Further improve wxEVT_GRID_RANGE_SELECT{ED,ING} documentation
Explain when it is preferable to handle events of each kind.
2020-08-20 16:56:23 +02:00
Vadim Zeitlin
e2f316b19d Mention that wxEVT_GRID_RANGE_SELECT{ED,ING} are new in 3.1.5
Also explained that SELECTED is just the new spelling of SELECT.
2020-08-20 16:56:03 +02:00
Ilya Sinitsyn
39725cabd4 Fix wxGrid selecting mode ending condition 2020-08-20 16:56:03 +02:00
Ilya Sinitsyn
0a2c62fc5c Remove the selecting mode flag from wxGridSelection
Remove m_isSelecting and StartSelecting() from wxGridSelection to avoid
inconsistency of wxGridSelection selecting mode state with wxGrid state,
as wxGrid already has m_isDragging field which tells it if the selection
state is final or not.

Instead, just allow wxGrid to specify the event to send from
ExtendCurrentBlock().

We still need a separate EndSelecting() for sending the final
wxEVT_GRID_RANGE_SELECTED event, but send it only for the last selection
block, and not all the selected blocks, as this makes more sense (there
should be one SELECTED event for each block and it was already sent for
the other blocks before) and is consistent with the events generated
when performing the same actions from keyboard.
2020-08-20 16:56:03 +02:00
Daniel Kulp
decc255846 Update grid sample to show selecting events 2020-08-20 16:56:03 +02:00
Daniel Kulp
415f080c80 Split wxGrid RANGE_SELECT event into SELECTING and SELECTED
This will allow the applications that are only interested in the final
selection to ignore the intermediate SELECTING events, which are now
sent as soon as the selection changes while dragging the mouse, and only
handle the final SELECTED ones, when the drag is over.
2020-08-20 16:56:03 +02:00
Maarten Bent
8cb0d0741c Don't iterate all item of wxListCtrl on DPI change
This can take multiple seconds in big lists, meanwhile the UI is frozen at the
display border. Adjust the font of the attribute to the DPI when it is used for
drawing.
2020-08-19 21:35:49 +02:00
Maarten Bent
c661be4fc9 Make custom renderer in dataview sample DPI Aware 2020-08-19 21:35:49 +02:00
Maarten Bent
6f7f387b1b Use GDI Scaling for dpi-unaware system dialogs
Fall back to system scaling when GDI scaling fails or is unavailable.
2020-08-19 21:35:48 +02:00
Paul Cornett
5192feb38e Fix restoring TLW size when using wxPersistenceManager on GTK
The decoration size must be restored before restoring the window size
See #18863
2020-08-18 08:46:19 -07:00
Arrigo Marchiori
a63ef850fb Also mention --flavour in wx-config script
The parameter is already supported but not documented.
2020-08-18 15:47:33 +02:00
Vadim Zeitlin
d5f5376e95 Remove useless "Modified by:" header line
This is not needed nor used since a long time any longer.
2020-08-17 02:04:59 +02:00
Vadim Zeitlin
8e1f2adc3b Add wx/artids.h to build/files and rerun upmake and bakefile
Finish adding the new file, which was previously added manually to a
couple of files, but not everywhere.
2020-08-17 02:03:45 +02:00
Vadim Zeitlin
21b37aa88e Add ctor to wxArtStockMapping to fix C++98 build
Can't use aggregate initialization without C++11.
2020-08-17 02:01:11 +02:00
Vadim Zeitlin
b6a369bd86 Remove trailing blank line from the new wx/artids.h file
No real changes.
2020-08-17 01:58:45 +02:00
Vadim Zeitlin
ae1bcc5cb2 Show only the first difference when images differ in the tests
The code was supposed to do this, but didn't, as "break" only broke from
the inner loop, but not the outer one, so replace it with "return".
2020-08-15 16:16:45 +02:00
Vadim Zeitlin
5324b9f184 Update libtiff and expat to allow using them with CMake
These changes are required in order to use the built-in versions of
these libraries with CMake.
2020-08-15 15:42:25 +02:00
Vadim Zeitlin
41142dff20 Make a minor optimization in Mac wxDisplay::GetFromWindow()
Call GetContentScaleFactor() only once, which doesn't cost anything and
could be minutely faster on systems with multiple displays.
2020-08-15 00:28:32 +02:00
Stefan Csomor
08a63c3b49 use common contentScaleFactor also for DPI on macOS
and give a reasonable default for missing tlw
2020-08-15 00:28:32 +02:00