Commit Graph

69101 Commits

Author SHA1 Message Date
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
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
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
Vadim Zeitlin
c346fd0321 Show scale factor in the display sample too
Show it for consistency with all the other wxDisplay accessors and to
make it simpler to test its return value.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
434faa39e6 Remove unused wxDisplayImpl::GetSizeMM()
This is not needed any longer after the changes of the last commit.

Note that the (still existent) public wxGetDisplaySizeMM() didn't use
this function, but used PPI instead.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
bcb101b9e9 Simplify PPI and scale factor handling in wxDisplay
Don't try computing the PPI ourselves from the physical size and the
number of pixels, this doesn't work and nobody else does it like this.

Just assume that we're using standard PPI by default and use
toolkit-specific functions for the platforms with support for high DPI.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
4e6df3f7b2 Implement GetDPIScaleFactor() more directly for wxMSW too
Use the existing GetDPI() implementation instead of forwarding to
wxDisplay.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
6a820a8f9a Implement GetDPIScaleFactor() more efficiently in wxGTK
Don't pass via wxDisplay, but use gtk_widget_get_scale_factor() (almost)
directly instead.
2020-08-15 00:28:32 +02:00
Stefan Csomor
99f7c8f3a4 using common method for determining scale from displayID 2020-08-15 00:28:32 +02:00
Stefan Csomor
7dc67a1f9f making GetDPIScaleFactor virtual, adding macOS direct impl 2020-08-15 00:28:32 +02:00
Stefan Csomor
8bad3b5e80 macOS clientRect implementation for non-primary displays 2020-08-15 00:28:32 +02:00
Stefan Csomor
d5180d3604 add a GetFromWindow implementation to wxDisplayFactory
on displays with different resolutions we must make sure we pick one that matches the frame’s contentScale
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
f04c904b60 Improve wxTaskBarIcon::Create/GetPopupMenu() documentation
Try to make the text more clear and prescriptive.

Also add a "@since" tag.
2020-08-14 19:48:29 +02:00
Vadim Zeitlin
c5161f6296 Get rid of an unnecessary local variable
No real changes, just simplify the code a bit more.
2020-08-14 19:43:00 +02:00