Commit Graph

19203 Commits

Author SHA1 Message Date
Vadim Zeitlin
30b37b610d Revert "Merge branch 'string-art-ids'"
This reverts commit 8c9ba23eae, reversing
changes made to 5192feb38e.

Upcoming commits will try to work around the issues with art IDs related
to wxNO_IMPLICIT_WXSTRING_ENCODING in a different way.
2020-08-24 16:47:37 +02:00
Ilya Sinitsyn
5d3d376766 Remove unused wxGrid function 2020-08-24 02:09:01 +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
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
Václav Slavík
adb7c8a53d cfstring.h compilation fix for ARC builds 2020-08-22 16:46:27 +02: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
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
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
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
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
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
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
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
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
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
7dc67a1f9f making GetDPIScaleFactor virtual, adding macOS direct impl 2020-08-15 00:28:32 +02:00
Vadim Zeitlin
cdd68da370 Use wxScopedPtr<> instead of explicit calls to "delete"
No real changes, but the code is a bit safer and hopefully more clear.
2020-08-14 19:41:53 +02:00
Andreas Falkenhahn
c70a8261cb Add wxTaskBarIcon::GetPopupMenu()
This is similar to CreatePopupMenu(), but the menu pointer returned by
the new function won't be deleted by wxWidgets, allowing it to return
the same pointer every time it is called.

Closes #18886.
2020-08-14 19:33:38 +02:00
Vadim Zeitlin
8e2aad2621 Merge branch 'webview_ie-js' of https://github.com/MaartenBent/wxWidgets
Fix using JavaScript in wxWebViewIE with custom scheme.

This repairs a regression in 3.1.4 due to the changes of 6787b0548b
(Merge branch 'webview-ie-fixes', 2020-07-23).

See https://github.com/wxWidgets/wxWidgets/pull/2004
2020-08-14 19:23:27 +02:00
Teodor Petrov
c924ecb10a Suppress -Wsuggest-override warnings in user code for gcc too
This was already done for clang -Winconsistent-missing-override, but
gcc has a similar warning since 5.1 and, moreover, latest versions of
clang support this gcc warning as well, so add a special macro which
handles both compilers and use it in all wx macros defining virtual
functions instead of just disabling one of the clang warnings.

Closes https://github.com/wxWidgets/wxWidgets/pull/2000
2020-08-14 19:15:03 +02:00
Vadim Zeitlin
19fd0fcfd7 Add wxDisplay::GetScaleFactor()
This is conceptually the same as the ratio of the current DPI to the
standard one, but can be implemented more directly for wxGTK3 and wxOSX
(although the latter doesn't implement it yet).
2020-08-14 16:09:27 +02:00
Vadim Zeitlin
52b25211c8 Add wxDisplay::GetStdPPIValue() and GetStdPPI()
Provide public way to access the default platform DPI, which was
previously a constant private to src/common/wincmn.cpp.
2020-08-14 16:09:27 +02:00
Vadim Zeitlin
c80e529021 Fix crash when destroying wxPopupWindow without hiding it first
The global wxCurrentPopupWindow used by wxMSW wasn't reset in this case
and resulted in a crash during the next mouse or focus event.

Do it in wxPopupWindow dtor now, and not just when the popup is hidden.
2020-08-14 13:15:49 +02:00
Stefan Brüns
128e3ff123 Make the wxART_* constants const wxStrings with static storage duration
The pre-3.1.4 definitions of the constants were just string literals,
while the type were wxString typedefs. To avoid implicit conversion
these were converted to actual wxStrings.

While the interface now matched the implementation, this has several
drawbacks:
- every use of the "constant" now is a string construction at runtime
- the constant now is an rvalue, i.e. it is impossible to take its
  address.

The latter breaks its use from wxPython.

The IDs are moved to a separate file which can be included multiple
times, once from the header to have the declarations in place, and once
to instantiate the wxStrings. Using a common file avoids the declaration
and definition going out of sync.
2020-08-06 12:31:37 +02:00
Vadim Zeitlin
aa2d159e8c Use more reasonable length for wxSlider in wxGTK by default
Use the same 100 DIPs as in wxMSW, to make the default behaviour more
useful.

Also update documentation to explain which size component should, and
should not, be specified when creating the slider.

Closes https://github.com/wxWidgets/wxWidgets/pull/2012
2020-08-05 00:01:50 +02:00
Maarten Bent
590e32c60b Fix building with wxUSE_STL enabled in VS2019 16.6
Exporting standard C++ library types is not allowed any more, see

https://developercommunity.visualstudio.com/content/problem/1042081/142628801includexhash201332-error-c2338-this-funct.html

so don't use DLL export declarations for wxHash{Map,Set} classes, which
derive from std::{map,set}.

Since the classes are header-only, this should have no direct
consequences. Only classes that extend wxHashMap or wxHashSet, like
wxImageHistogram, have to be made header only as well.

Remove the wxLogError message in wxImageHistogram::FindFirstUnusedColour, so
log.h and translation.h do not have to be included in the header.

Closes https://github.com/wxWidgets/wxWidgets/pull/2009
2020-08-03 12:54:35 +02:00
Maarten Bent
b10ba803f5 Make wxGenericColourDialog DPI aware 2020-07-31 22:25:10 +02:00
Maarten Bent
9e2615ac06 Move creating custom bitmaps of wxGenericColourDialog into separate function 2020-07-31 22:25:08 +02:00
Maarten Bent
a54b4073f9 Remove unused members from wxGenericColourDialog 2020-07-31 22:25:04 +02:00
Maarten Bent
4f09f83597 Make wxGenericColourButton DPI aware 2020-07-31 22:25:02 +02:00
Maarten Bent
300fe1a6f9 Add option to wxWebViewHandler to set a custom security URL
This will be used by wxWebViewIE to modify the security URL and domain when
parsing a URL.
2020-07-28 21:22:21 +02:00
Stefan Csomor
bb40699675 macOS bugfix: overrelease in wxGetAvailableDrives
as these strings are NSStrings retrieved by autoreleasing methods, they must be retained first
2020-07-26 11:37:55 +02:00
Maarten Bent
ea102bb272 Add missing wxOVERRIDE to wxNonOwnedWindow::Reparent 2020-07-23 22:55:10 +02:00
Vadim Zeitlin
6787b0548b Merge branch 'webview-ie-fixes'
IE-based xwWebView improvements.

See https://github.com/wxWidgets/wxWidgets/pull/1987
2020-07-23 16:39:13 +02:00
atbara46
bfee44de18 Fix wrongly detecting FIFOs as directories in wxFileName
The constants for wxFILE_EXISTS_FIFO and wxFILE_EXISTS_SOCKET were
wrongly defined, mixing up their decimal and hexadecimal values,
resulting in wxFILE_EXISTS_FIFO & wxFILE_EXISTS_DIR being wrongly non
zero.

Fix this by redefining these bit masks correctly to avoid overlapping
the other values.

Closes #18846.
2020-07-23 16:30:16 +02:00
Vadim Zeitlin
d1aa3d5663 Update the version to 3.1.5
This was done by running misc/scripts/inc_release, bakefile_gen and
autoconf.
2020-07-23 16:25:39 +02:00
Vadim Zeitlin
cd2cd6a617 Avoid using IE-related symbols not present in old MinGW headers
Define INET_E_DEFAULT_ACTION ourselves and provide stand-ins for the
enums not present in MinGW SDK.

See #17893.
2020-07-21 22:44:49 +02:00
Vadim Zeitlin
a8bb796f8c Add OSXMakeDPIFromScaleFactor() helper
No real changes, just avoid repeating wxRound(scaleFactor*72) in several
places and do it in this single function instead.
2020-07-21 17:16:15 +02:00
Stefan Csomor
1deb003a7c Propagate wxEVT_DPI_CHANGED to child windows in wxOSX too 2020-07-21 17:16:15 +02:00
Stefan Csomor
668f0e7c54 Implement wxWindow::GetDPI() on macOS and iOS 2020-07-21 17:16:15 +02:00
Vadim Zeitlin
8a81391cf4 Make wx/htmllbox.h self-contained again
Fix problem with wxUSE_HTML added in 05cce8d89d (Add wxUSE_HTML check to
wxHtmlListBox header, 2020-05-28) not being defined when this header is
the first one to be included.
2020-07-20 21:09:43 +02:00