Commit Graph

18832 Commits

Author SHA1 Message Date
Ilya Sinitsyn
a40acbb28e Add CanOverflow function to wxGridCellAttr
Add function to determine whether the cell will draw the overflowed text
to neighbour cells. Note that only left aligned cells currently can overflow.
2020-02-07 19:34:50 +01:00
Vadim Zeitlin
10c49631a3 Store any number of image lists in wxRibbonBar, not just two
The same wxRibbonBar can use multiple button bars with different icon
sizes, so 2 image lists are not enough. But OTOH there is no need to
distinguish between small and large images neither, so 2 may be also 1
too many.

Instead, use however many image lists we need, depending on the size.
For now, just store them in a vector and use linear search in it,
instead of using a map or, maybe, sorted vector, as we suppose there are
never going to be more than a couple of elements in this vector anyhow.
2020-02-07 19:21:33 +01:00
Vadim Zeitlin
5a30886696 Move bitmap-related functions to wxRibbonButtonBarButtonBase
Improve encapsulation by making the function setting the members of a
class a member of the same class, instead of doing it outside of it.
2020-02-07 18:11:47 +01:00
Vadim Zeitlin
557843c504 Remove wxRibbonButtonBar::m_ownerRibbonBar
There is already a function returning the containing ribbon bar, so just
use it instead.
2020-02-07 17:47:15 +01:00
Vadim Zeitlin
884c3a2dc2 Use wxImageList in wxRibbonBar unconditionally
There shouldn't be any reason not to do it other than possible bugs in
wxImageList itself, that should be fixed there.
2020-02-07 17:44:08 +01:00
Vadim Zeitlin
714fefb3e5 Use DLL export macro in wxImageList forward declaration
Do it if only for consistency.
2020-02-07 17:30:28 +01:00
wxBen
23ebbb139d Optionally support using wxImageList in wxRibbonBar
This allows to avoid consuming too many bitmap resources.

Closes #18657.
2020-02-07 17:25:34 +01:00
Kvaz1r
5663157674 Fix link between flags and buttons in wxAuiManager
Don't store the buttons used by a pane separately, but take them
directly from the flags, as this ensures that updating the pane flags,
e.g. by calling CloseButton(false), really removes the corresponding
button.

This also makes wxAuiPaneButton helper completely unnecessary, so just
remove it to simplify the code.

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

Closes #18223.
2020-02-05 16:02:51 +01:00
Vadim Zeitlin
b7547dbd27 Don't use Hungarian notation for variables
Rename a variable to remove the ugly "sz" prefix.

Also don't use "s_" prefix for non-static variables.
2020-02-05 15:37:27 +01:00
nns52k
24c56a413b Fix string escaping in JS code in wxWebView
For example, a newline was escaped to be a backslash followed by a
newline, but it actually shall be a backslash followed by a character
'n'. It seemed okay with most of codes until in the case that C++ style
comments, i.e. single line comments, in the JavaScript codes. If the
newline characters are not escaped correctly, the JavaScript interpreter
will ignore everything that goes after the single line comments because
the interpreter obviously cannot find the newline where it's supposed to
stop treating codes as comments.
2020-02-05 15:35:17 +01:00
Vadim Zeitlin
4526765f8f Remove extra semicolons to avoid gcc -Wpedantic warnings
Another fix after 00cdab77c5
2020-02-05 15:20:26 +01:00
Vadim Zeitlin
3f49942051 Fully qualify std::nullptr_t
Fix a stupid mistake from 00cdab77c5
2020-02-05 15:19:33 +01:00
Vadim Zeitlin
00cdab77c5 Define wxStrtox() overloads taking nullptr
Instead of specializing wxStrtoxCharType and then testing whether endptr
is null, just define separate, and simpler, overloads of wxStrtox()
functions taking nullptr_t -- we can avoid the unnecessary test
completely in this case, as nullptr is, by definition, always null
anyhow.

Also add a test of using wxStrtol() with nullptr too.

This should fix the build with older gcc and MSVS versions.
2020-02-05 03:54:25 +01:00
Vadim Zeitlin
25e256a0f5 Merge branch 'osx_icns_imagehandler' of https://github.com/TcT2k/wxWidgets
Add handler for ICNS files (wxBITMAP_TYPE_ICON).

Also remove some old unused Carbon files.

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

Closes #18647.
2020-02-04 02:26:42 +01:00
Vadim Zeitlin
0cb0367fce Merge branch 'd2d-gradient' of https://github.com/MaartenBent/wxWidgets
Fix reference count in D2D renderer gradient brushes.

See https://github.com/wxWidgets/wxWidgets/pull/1724
2020-02-04 02:16:19 +01:00
Vadim Zeitlin
e171757160 Merge branch 'grid-selecting'
Fix several problems related to selecting cells from keyboard in wxGrid.

Closes https://github.com/wxWidgets/wxWidgets/pull/1719
2020-02-04 02:13:20 +01:00
Paul Cornett
1a9da25c33 STL build fix for MSVS after 948ddc6e0f 2020-02-03 09:33:09 -08:00
Paul Cornett
f4299c3c01 Eliminate a couple more -Wcast-qual warnings 2020-02-03 09:02:14 -08:00
Paul Cornett
0ca45d1a59 Remove redundant checks for NULL before calling delete 2020-02-02 23:51:39 -08:00
Paul Cornett
05183b7099 Eliminate -Wzero-as-null-pointer-constant warnings in the headers 2020-02-02 23:40:01 -08:00
Paul Cornett
948ddc6e0f Eliminate -Wcast-qual warnings with GCC and Clang
Use const_cast, mutable, and various other changes to avoid -Wcast-qual
2020-02-02 22:50:32 -08:00
Maarten Bent
8e2f674c0b Remove trailing whitespace 2020-02-02 14:50:57 +01:00
Vadim Zeitlin
6724f8c052 Work around MSVS 2012 bug with handling of nullptr
Avoid error C2180 given by this compiler for if statements with
controlling expression of type nullptr_t.
2020-02-02 01:12:28 +01:00
Ilya Sinitsyn
d455c5b99e Fix making the wrong wxGrid cell visible when selecting
We should make visible the cell of the corner of the current selected block.

Also fix names of the wxGrid::UpdateBlockBeingSelected parameters because
actually passed сщщквы are of any opposite selection block corners.
2020-02-01 01:53:59 +01:00
Vadim Zeitlin
55efc9e607 Allow using wxStrtox() functions with nullptr with MSVS too
Add a unit test checking that it compiles (and works).

This extends the changes of 63b1f00eb8 to
cover MSVS as well.
2020-01-31 17:13:06 +01:00
Vadim Zeitlin
7969f3f81c Define wxHAS_NULLPTR_T if nullptr is supported
This is necessary because MSVS versions as old as 2010 support it, even
if they don't have full C++11 support and so don't define __cplusplus
appropriately.

Extract the existing check for nullptr from wx/strvararg.h to wx/defs.h
in order to allow reusing it.
2020-01-31 17:11:50 +01:00
Paul Cornett
63b1f00eb8 Allow wxStrto... functions to accept nullptr 2020-01-27 11:33:05 -08:00
Paul Cornett
26f58bdf78 Fix base class call of virtual SetFont() in wxGenericListCtrl
Hard-coding 'wxWindow' improperly bypasses an override in wxControl on GTK3
2020-01-27 11:27:39 -08:00
Tobias Taschner
c9c2d1fba4
Remove unused carbon files
These files where no longer referenced by any build system
and where probably left overs from before carbon was removed.
2020-01-23 21:13:11 +01:00
Vadim Zeitlin
767c07c040 Merge branch 'webview-edge'
Add support for (optionally) using Edge-based wxWebView.

See https://github.com/wxWidgets/wxWidgets/pull/1700
2020-01-22 03:38:00 +01:00
Vadim Zeitlin
68d7cb5082 Merge branch 'msw-fix-radiobtn-and-initial-focus'
Fix problems with focus due to the pending focus mechanism used by
wxRadioButton in wxMSW.

See https://github.com/wxWidgets/wxWidgets/pull/1713
2020-01-20 20:51:59 +01:00
Václav Slavík
7a5618df77 Silence Xcode 11 warnings about shadowing read() 2020-01-20 19:19:40 +01:00
Vadim Zeitlin
ec07635801 Don't recurse upwards when updating pending focus in wxMSW
This is unnecessary, we only need to update the pending focus in the
immediate parent window to prevent a wrong radio button from being
focused (and hence selected) when it regains focus, there is no good
reason at all to interfere with the focus in the grandparent (and
higher) windows.

Doing this was not only useless, but actually harmful, as it overrode
explicit calls to SetFocus() in the user code, so just stop doing it.
This also allows to avoid having 2 functions related to this and keep
just a single virtual WXSetPendingFocus() one.

Closes #18653.
2020-01-20 13:16:41 +01:00
Tobias Taschner
caf9285609
Improved JSON string parsing 2020-01-19 21:32:11 +01:00
Vadim Zeitlin
b9038a1e8c Merge branch 'msw-headerctrl' of https://github.com/MaartenBent/wxWidgets
Fix applying style of MSW wxHeaderCtrl and add tests for doing it to the
widgets sample.

See https://github.com/wxWidgets/wxWidgets/pull/1710
2020-01-19 17:49:40 +01:00
Maarten Bent
fd9df06d35 Fix applying header style of wxMSWHeaderCtrl
Call SetWindowStyleFlag when creating the control. Apply wxHD_BITMAP_ON_RIGHT
style. Get rid of the helper function.
2020-01-19 14:55:39 +01:00
Vadim Zeitlin
b02fbafb96 Don't update wxDataViewColumn after it was resized interactively
Previously, the column was updated, i.e. wxHeaderCtrl::UpdateColumn()
was called, after the column width was changed interactively by the
user. This was unnecessary and actually harmful as it resulted in
recursion and display corruption.

Stop doing this by adding yet another width-related function to the
generic wxDataViewColumn called WXOnResize(), which just updates the
main window display, but doesn't update the header at all, and calling
it instead of SetWidth(), which does both, when the column is resized.

Closes #18245.
2020-01-19 03:28:13 +01:00
Tobias Taschner
26c82d43d1
Decode strings returned by ExecuteScript()
ExecuteScript returns strings as fully
quoted JSON strings so they have to be decoded
to a binary string.
2020-01-17 21:11:26 +01:00
Maarten Bent
ce968d0ecb
Enable building without wxUSE_WEBVIEW_IE 2020-01-17 09:37:12 +01:00
Tobias Taschner
bb508dc347
Implement text selection in wxWebViewEdge
Text selection/copy/paste etc implemented via javascript
2020-01-16 20:50:26 +01:00
Tobias Taschner
048c1c4321
Fix javascript return values
Return values where wrapped by quotes because of
wrapper code used for IE compatibility.
2020-01-16 20:49:00 +01:00
Tobias Taschner
1a72654d69
Send wxEVT_WEBVIEW_LOADED 2020-01-16 19:59:37 +01:00
Tobias Taschner
a19270df8f
Implement title changed event 2020-01-16 10:26:14 +01:00
Tobias Taschner
41f4a21736
Apply suggestions from code review
Co-Authored-By: Maarten <MaartenBent@users.noreply.github.com>
2020-01-16 10:15:11 +01:00
Tobias Taschner
9f11abd8fc
Rename wxWebView::EnableDevTools() to EnableAccessToDevTools() 2020-01-16 09:38:35 +01:00
Tobias Taschner
964992e7ff
Move WebView2 event handling from lambdas to functions 2020-01-15 21:51:58 +01:00
Tobias Taschner
bbde6e2e88
Move wxWebViewEdge implementation to private header 2020-01-15 21:23:37 +01:00
Tobias Taschner
bf6b51e702
Various small code fixups 2020-01-15 17:05:27 +01:00
Tobias Taschner
bce0e65a80
Rename wxWebView::IsDevToolsEnabled() to IsAccessToDevToolsEnabled() 2020-01-15 16:22:43 +01:00
Tobias Taschner
21cc8a4e49
Update setup.h files 2020-01-15 15:58:30 +01:00
Tobias Taschner
c3f0b7a6cb
Apply suggestions from code review
Co-Authored-By: VZ <vz-github@zeitlins.org>
2020-01-15 15:55:49 +01:00
Lauri Nurmi
e8b8b0288f Make wxNewId() and others return/take wxWindowID rather than int
wxWindowID is a typedef of int, so nothing should really change, except
for the improved readability.

Closes https://github.com/wxWidgets/wxWidgets/pull/1682
2020-01-15 14:28:33 +01:00
Tobias Taschner
e365fbbac8
Update include guards
Co-Authored-By: PB <PBforDev@gmail.com>
2020-01-12 20:05:47 +01:00
Vadim Zeitlin
2c26830991 Fix closing minimized top level windows under Windows 10
Minimized windows don't seem to get any events after "Close" menu item
is selected from the system menu, so they were never actually destroyed
when closing them in this way.

Fix this by explicitly waking up the message loop after deleting the
window to ensure that the delayed destruction does happen.

Closes #18622.

See https://github.com/wxWidgets/wxWidgets/pull/1690
2020-01-11 23:14:10 +01:00
Vadim Zeitlin
13752968ea Fix closing minimized top level windows under Windows 10
Minimized windows don't seem to get any events after "Close" menu item
is selected from the system menu, so they were never actually destroyed
when closing them in this way.

Fix this by explicitly waking up the message loop after deleting the
window to ensure that the delayed destruction does happen.

Closes #18622.

See https://github.com/wxWidgets/wxWidgets/pull/1690
2020-01-11 23:13:03 +01:00
Vadim Zeitlin
46042843e8 Implement support for ellipsization mode in wxGrid
Add another wxGrid::DrawTextRectangle() overload, taking wxGridCellAttr
and ellipsizing the string if necessary, i.e. if the fitting mode of
this attribute indicates that we should do it.

Switch the code of all renderers for which it makes sense to use
ellipsization to use the new overload.
2020-01-11 19:15:15 +01:00
Vadim Zeitlin
41dcd9ecdb Add API for ellipsization support to wxGrid
This API is not implemented yet, i.e. ellipsization mode is not
respected for now. This commit just adds the API, documents it and adds
an example of using it in the sample.
2020-01-11 19:14:23 +01:00
Vadim Zeitlin
f13085441c Add wxGridFitMode and functions working with it
Replace "bool overflow" flag with a class allowing to specify the same
overflow/clipping behaviour currently, but also allowing to extend it,
notable to add ellipsization support, in the future.

Preserve the existing API by reimplementing it in terms of the new one.

Also update the same to demonstrate a cell which always overflows,
independently of the default cell behaviour.
2020-01-11 18:02:12 +01:00
Tobias Taschner
f919b6e2f5
Rename from webview_edgec to webview_edge 2020-01-11 14:47:47 +01:00
Vadim Zeitlin
325408f062 Make wxGridCellAttr ctor taking a single argument explicit
There doesn't seem to be any reason for allowing to implicitly convert
wxGridCellAttr pointer to wxGridCellAttr object.
2020-01-11 14:05:09 +01:00
Tobias Taschner
d72e5874eb
Add wxWebView methods to enable dev tools
Currently only implemented for the Edge (Chromium) backend.
2020-01-10 22:27:36 +01:00
Tobias Taschner
6750d30102
Load WebView2Loader.dll dynamically 2020-01-10 22:22:29 +01:00
Markus Pingel
6a99e7e273
Add wxWebView Edge (Chromium) implementation
This backend requires WebView2 SDK and enables usage of Edge (Chromium)
on Windows 7 and newer
2020-01-10 22:22:28 +01:00
Tobias Taschner
1afeaa324d
Added new build option wxUSE_WEBVIEW_EDGE 2020-01-10 21:42:18 +01:00
Vadim Zeitlin
7dd0ad9a0d Merge branch 'composite-contextmenu-event'
Fix event object and ID of wxEVT_CONTEXT_MENU sent from parts of a
composite control.

See https://github.com/wxWidgets/wxWidgets/pull/1698
2020-01-09 23:27:17 +01:00
Vadim Zeitlin
52ae67ef86 Replace dynamic casts with virtual wxWindow::WXGetTextEntry()
Instead of checking for all text-like controls one by one in
wxCommandEvent::GetString(), call a virtual function checking for this.

This is simpler, less error-prone and faster -- at the cost of
increasing the vtbl size of all wxWindow-derived classes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1696
2020-01-09 23:25:49 +01:00
Mitrik Sicilian
20ecab6268 Remove redundant const from Mac wxDataFormat methods return type
No real changes, but useless top-level const in the return type resulted
in -Wignored-qualifiers warning (if it was enabled).

Closes #18646.
2020-01-09 22:43:12 +01:00
Tobias Taschner
095a93e0c0
Add wxWebView::IsBackendAvailable()
This allows to check if a specified backend has been registered before creation of a new instance
2020-01-09 13:44:06 +01:00
Vadim Zeitlin
52416931a4 Send wxEVT_CONTEXT_MENU to the main window of composite controls
This is important to allow catching the context menu events from the
composite control children at the main window level using the main
window ID: previously, these events used the (typically auto-generated
internally) ID of the child window, which was an implementation detail
and prevented the code binding to these events using the ID of e.g.
wxListCtrl itself from working under the other platforms, where
wxListCtrl is a generic composite window, even if it worked under MSW,
where wxListCtrl is native.
2020-01-07 18:22:09 +01:00
Vadim Zeitlin
3a09975465 Create WXSendContextMenuEvent() helper function
Put common code from all the different ports into it.

This is not very useful right now, but it will allow to change this
function once, instead of applying the same change to all ports, in the
upcoming commit.
2020-01-07 18:22:09 +01:00
Vadim Zeitlin
826cc882dc Merge branch 'gtk-srchctrl'
Add native wxSearchCtrl implementation for wxGTK.

Closes https://github.com/wxWidgets/wxWidgets/pull/1688
2020-01-07 03:16:02 +01:00
ali kettab
020b6ebcb8 Derive from wxTextEntry instead of wxTextCtrlBase 2020-01-07 03:15:39 +01:00
AliKet
c09db9c23d Add native wxSearchCtrl for GTK+ port 2020-01-07 03:15:35 +01:00
Vadim Zeitlin
89be9ac316 Fix comment for wxUSE_NATIVE_DATAVIEWCTRL in setup.h
The values of the option in the comment were inversed when it was added
in 028afa194a, fix this now.
2020-01-03 18:05:02 +01:00
Paul Cornett
8db62d179c Move code for creating a disabled bitmap to wxBitmap
To allow using it from multiple places
2019-12-29 09:08:40 -08:00
Lauri Nurmi
84f7e925e5 Fix wxThread::SetPriority() documentation
The documentation's notes about MSW limitations about setting priority
before creating the thread do not appear to be true (anymore). Thread
priority is already set by Create() if SetPriority() was called earlier.
Setting it immediately just failed, because the thread did not exist
yet, but this was fixed by the previous commit.
2019-12-28 00:06:28 +01:00
Vadim Zeitlin
00d113c341 Fix wxSocketImplUnix compilation under OpenVMS
Don't pass "const void*" pointer to ioctl(), it seems to be declared as
taking "void*" on this platform and so doesn't accept it.
2019-12-19 18:36:22 +01:00
Jouk
d90953d8c6 wxGTK1 : change type of wxMask.GetBitmap() from GdkBitmap* to wxBitmap 2019-12-19 09:20:36 +01:00
Vadim Zeitlin
24042b2a2a Fix build with generic wxDataViewCtrl under Mac
Generic wxDataViewCheckIconTextRenderer is needed under Mac too if the
generic version of wxDVC is used.

Closes #18632.
2019-12-15 16:44:42 +01:00
Vadim Zeitlin
028afa194a Add wxUSE_NATIVE_DATAVIEWCTRL build option
It defaults to 1, but can be set to 0 to force using the generic version
of the control even under GTK or Mac, where the native version is used
by default.

This can, unfortunately, be useful to work around various but multiple
native control limitations.
2019-12-15 16:23:47 +01:00
Vadim Zeitlin
f3217573d7 Merge branch 'rc-manifest' of https://github.com/MaartenBent/wxWidgets
Fix using manifest from rc file with VC compiler.

See https://github.com/wxWidgets/wxWidgets/pull/1678
2019-12-15 03:44:39 +01:00
Maarten Bent
cd1d15351c Fix concatenating manifest name in resource file 2019-12-13 22:21:40 +01:00
Maarten Bent
083f4b3c32 Rename manifests to use underscores 2019-12-13 21:44:26 +01:00
Vadim Zeitlin
7b8cdd441d Return (0, 0) from wxMDIChildFrame::GetPosition() in wxGTK
This makes more sense for a page of a GtkNotebook, which is always
positioned at (0, 0) relative to its client area, and is also more
compatible with wxMSW.

Closes #18548.

Closes https://github.com/wxWidgets/wxWidgets/pull/1670
2019-12-10 22:42:00 +01:00
Ian McInerney
b17aa08c26 Allow automatic OS-provided tabbing to be disabled in wxOSX
macOS 10.12+ implements automatic tabbing in the OS. This adds
entries to the menus and also adds a tab bar. Some applications
might want to disable this, so provide an interface for doing this.

Closes https://github.com/wxWidgets/wxWidgets/pull/1674
2019-12-09 22:46:04 +01:00
Ian McInerney
540fed9216 Implement background color attribute for wxDataViewCtrl in wxOSX
Add support for this attribute for text-like cells to the native macOS
version too, to bring it up to parity with the generic and GTK ones.

Closes https://github.com/wxWidgets/wxWidgets/pull/1673
2019-12-09 22:45:06 +01:00
Paul Kulchenko
1c754fe71c Make wxAuiNotebook wxAuiTabCtrl-related methods public
Allow retrieving the active tab control or tab at the given position.

Closes #16262.
2019-12-07 15:13:06 +01:00
Artur Wieczorek
389944a116 wxOSX: Implement function to retrieve pattern image for non-solid colour
Under wxOSX non-solid wxColour with NSColor backend is represented by
pattern image and it would be useful to have ability to get it e.g. to help
dealing with non-solid wxColours by frameworks not supporting such colours,
like e.g. Cairo.
2019-12-06 20:33:35 +01:00
Stefan Csomor
31c7073571 macOS: silence warning in non-ARC build
see f1aa3c1c9a
2019-12-05 20:36:29 +01:00
Vadim Zeitlin
462e7b7732 Avoid using invalid index in wxDisplayFactory under Mac
Partially work around currently unimplemented cache invalidation in
wxMac and do it on the fly if an invalid index is passed to
GetDisplay() to at least avoid crashing, even if this doesn't fully
solve the problem, e.g. we still can use stale information.

Closes #18607.
2019-12-04 19:22:07 +01:00
Vadim Zeitlin
7849d231d9 Merge branch 'build-option-fixes' of https://github.com/MaartenBent/wxWidgets
Miscellaneous build options fixes.

See https://github.com/wxWidgets/wxWidgets/pull/1661
2019-12-03 02:27:52 +01:00
Vadim Zeitlin
00a56a28b6 Merge branch 'sock-event-fix'
Fix unwanted (and sometimes fatal) socket events for blocking sockets
under Unix.

See https://github.com/wxWidgets/wxWidgets/pull/1658
2019-12-03 02:25:18 +01:00
Vadim Zeitlin
14cfc2c2b2 Avoid clang -Wnon-virtual-dtor without triggering MSVC warnings
The change of 4990515aba resulted in
(disabled by default, but which may be enabled when building
applications using wxWidgets) MSVS 2017 warning C4265 ('class' : class
has virtual functions, but destructor is not virtual), so test for clang
explicitly instead of just testing for non-gcc.
2019-12-02 22:35:36 +01:00
Vadim Zeitlin
36546b6f3f Merge branch 'grid-editors-placement'
Fix positions of the checkboxes drawn by wxGridCellBoolRenderer and
shown by wxGridCellBoolEditor so that there is no jump when starting or
stopping to edit grid cells with boolean values.

See https://github.com/wxWidgets/wxWidgets/pull/1662
2019-11-29 16:24:07 +01:00
Vadim Zeitlin
abc8841f0b Use default wxCheckBox size in wxGridCellBoolEditor
Using wxRendererNative::GetCheckBoxSize() as the size of wxCheckBox just
doesn't work with GTK 3, as the control has additional padding between
its actual contents and the focus rectangle, which means that its actual
size must be greater than the size to be passed to DrawCheckBox() in
order to draw a checkbox of the same size.

However it isn't really necessary to resize wxCheckBox at all, it's
enough for DrawCheckBox() to produce a check mark of the same size as
that shown in a default-sized wxCheckBox and this does work in wxGTK.

So keep the default size of wxCheckBox to make everything work.

This means wxGetGridCheckBoxRect() is not useful any more, so replace it
with wxGetContentRect() which just positions a rectangle of the given
size inside another one (this should probably be moved somewhere else,
as it's more general than wxGrid).
2019-11-29 04:57:59 +01:00
Maarten Bent
51254a148e Make wxSVGFileDC an abstract class 2019-11-29 01:10:43 +01:00
Maarten Bent
c6ce2a77bf Fix wxEditorDialogProperty type declaration 2019-11-29 00:23:26 +01:00
Vadim Zeitlin
2eb312b5f9 Avoid changing checkbox background in wxGrid under non-MSW
Doing this makes the checkbox unusable with the default GTK 3 theme as
the default grid background colour (white) is the same as the colour of
the check mark -- so changing the checkbox background to it makes it
invisible.

Work around this by adding a new SetTransparentPartColour() method that
can be used by wxGrid (and, in the future, user code if we decide that
this is really the best solution to this problem that we can provide) to
make the checkbox blend in with its background without actually changing
its appearance.
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
851d11ba2c Determine the checkbox size in wxGetGridCheckBoxRect() itself
It doesn't make much sense to pass the size to the function supposed to
compute it, so call wxRendererNative::GetCheckBoxSize() from the
function itself instead of forcing its callers to do it.

No real changes.
2019-11-28 02:14:50 +01:00
Ilya Sinitsyn
3ca9491c5f Improve grid editors placing
Remove the code in wxGrid::ShowCellEditControl() which moves grid
editors unnecessarily and also remove workarounds that were required
because of it in the editors SetSize() functions.

This helps to ensure that the editor is placed at the same position the
renderer draws the cell value, so that it doesn't jump around annoyingly
when editing starts (which was especially noticeable for boolean-valued
cells).
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
6a21d6f2e4 Add missing required header to wx/generic/private/grid.h
Make this header self-sufficient, instead of requiring wx/headerctrl.h
to be included before including it.

Remove the now unnecessary wx/headerctrl.h inclusion from
src/generic/grideditors.cpp.
2019-11-28 02:14:50 +01:00
Ilya Sinitsyn
53ffbf6cf5 Allow ignoring margins in wxRendererNative::GetCheckBoxSize()
Add ability to get the size of the checkbox without any margins by
passing wxCONTROL_CELL flag: this can be useful when the checkbox is
part of some "cell", e.g. wxGrid one, and doesn't need any extra margins
around it.

Currently wxCONTROL_CELL is only really used by wxGTK2 implementation.
2019-11-28 02:14:50 +01:00
Vadim Zeitlin
4ca327b50a Declare AddTreeviewHeaderButton() only when it's defined
This method of wxGtkStyleContext uses a GTK function only available
since 3.20, and so can't be implemented for the earlier versions, hence
don't even define it in this case.

Note that the caller still needs to test for the run-time version.
2019-11-27 23:23:57 +01:00
Maarten Bent
5fefe1df11 wxUSE_ACCESSIBILITY requires wxUSE_OLE 2019-11-27 21:24:33 +01:00
Paul Cornett
ae7fcc440c Use C++11 default copy ctor for wxUniCharRef
It's a little simpler, and still suppresses -Wdeprecated-copy warnings
2019-11-25 21:27:09 -08:00
Paul Cornett
4990515aba Avoid clang-cl -Wnon-virtual-dtor warning
Extend the existing workaround to all compilers, not just GCC
2019-11-25 21:16:00 -08:00
Paul Cornett
ef99c2a6db Avoid warning from clang-cl about unrecognized pragma 2019-11-25 21:05:35 -08:00
Vadim Zeitlin
d51a9f9686 Use "wxWidgets application" in the manifests descriptions
We don't use "wxWindows" since many years.
2019-11-22 15:21:15 +01:00
GH Cao
c0c2260944 Add MSW manifests for ARM and ARM64 platforms
Closes https://github.com/wxWidgets/wxWidgets/pull/1657
2019-11-22 15:17:40 +01:00
Vadim Zeitlin
73f0c9dff8 Fix crash with blocking accepting sockets in threads under Unix
Sockets returned by wxSocket::Accept() are non-blocking by default and
the only way to use them safely in worker threads is by switching them
to the blocking mode by calling SetFlags(wxSOCKET_BLOCK).

However this didn't work correctly since at least 2.8 days, as turning
wxSOCKET_BLOCK on didn't unregister the socket from the event loop, with
which it had been registered on creation. Fix this by doing this now,
which ensures that the main thread doesn't get any notifications about
the socket if it's used, in a blocking way, in a worker thread.

Note that making the new socket blocking after accpeting is still pretty
inefficient and pre-creating the socket as blocking and using
AcceptWith() is still preferable, but at least it does work now.

Closes #12886.
2019-11-20 20:21:25 +01:00
Vadim Zeitlin
51ea713826 Extend and rename wxSocketImpl::UnblockAndRegisterWithEventLoop()
In addition to unblocking and registering the socket, also support using
this function to make the socket blocking and unregistering it from the
event loop, if its flags include wxSOCKET_BLOCK.

This was already half-done by wxMSW, which took wxSOCKET_BLOCK presence
into account in its implementation, but not by the Unix implementation.
Now do it under all platforms, as this will be useful for switching a
previously non-blocking socket to blocking mode.

Finally, rename the function to better reflect what it really does.

See #12886.
2019-11-20 18:59:51 +01:00
Vadim Zeitlin
e0102c2396 Allow disabling events for blocking sockets in Unix version
It should still be possible to use DoEnableEvents() to disable events
for blocking sockets and this can be useful if a previously non-blocking
socket became blocking due to a SetFlags(wxSOCKET_BLOCK) call, so adjust
the fix of e18c8fd29a (see #17031) to
avoid calling EnableEvents() for blocking sockets instead of ignoring
them in DoEnableEvents() itself.

Also add an assert checking that we never try enabling events for
blocking sockets as this still doesn't make sense and so shouldn't
happen.

No real changes yet, but this is necessary for the upcoming commits.

See #12886.
2019-11-20 18:47:09 +01:00
Vadim Zeitlin
5cf9c735cb Handle taskbar updates not removing notification icons from it
Fix bug with not being able to update wxTaskBarIcon under MSW after a
DPI scale change or [dis]connection of another monitor using different
DPI: this resulted in "TaskbarCreated" message being sent by the system,
which we handled by trying to create the taskbar icon again. However in
this case, recreating it failed, presumably because it still existed, as
modifying the existing icon still worked.

Change the handle of "TaskbarCreated" to try both adding and updating
the icon, as it seems that we can't be sure whether we still have it or
not when we get this message.

Refactor the existing code to specify the operation to perform when
calling the new DoSetIcon(). This actually makes things slightly simpler
for it, as it doesn't need to update m_iconAdded inside it any more.

Closes #18588.
2019-11-18 19:14:38 +01:00
Vadim Zeitlin
8005c59615 Stop truncating all wxString::Printf() arguments to 65535 chars
There is absolutely no good reason to do it and it resulted in
silently truncating all the string formatted using "%s" to their first
65535 characters when using our wxPrintf() implementation.

Closes #18586.
2019-11-17 18:30:33 +01:00
Vadim Zeitlin
428d47f534 Merge branch 'wxwebviewieimpl' of https://github.com/MaartenBent/wxWidgets
Actually allow using wxWebVieWIE-specific methods for setting the
emulation level.

Make it possible to include wx/msw/webvieW_ie.h by removing inclusion of
the private headers from it, which was in turn achieved by moving all
the implementation details into a private class.

See https://github.com/wxWidgets/wxWidgets/pull/1647
2019-11-14 17:26:00 +01:00
Vadim Zeitlin
2da8426ed6 Merge branch 'gtk-spin-width-from-text'
Fixes for wxSpinCtrl::GetSizeFromTextSize() and best size in wxGTK.

Closes #18568.

See https://github.com/wxWidgets/wxWidgets/pull/1645
2019-11-14 16:07:05 +01:00
Maarten Bent
e67c814765 Make webview_missing.h a private header 2019-11-14 00:04:56 +01:00
Maarten Bent
67ace7b243 Move wxWebViewIE classes to private header
Cleanup includes.
2019-11-13 23:56:40 +01:00
Maarten Bent
7e682a09d6 Add wxWebViewIEImpl class for all private wxWebViewIE members and functions
Move wxWebViewIE::Find implementation to wxWebViewIEImpl because it has a lot
of member accesses.
2019-11-13 23:46:13 +01:00
Vadim Zeitlin
9b43bd8af2 Merge branch 'dpi-textctrl' of https://github.com/MaartenBent/wxWidgets
Improvements for wxTextCtrl, wxSearchCtrl, wxButton when using
non-default DPI.

See https://github.com/wxWidgets/wxWidgets/pull/1634
2019-11-13 15:47:59 +01:00
Vadim Zeitlin
7f368872d7 Adjust entry width of wxSpinCtrl in wxGTK to its range
Ensure that the entry is always (just) big enough to show any value
valid in this spin control.

This also ensures that GetBestSize() doesn't need to be overridden to
use GetSizeFromTextSize() any longer as the best size will be determined
correctly by GTK itself.
2019-11-13 15:46:16 +01:00
Vadim Zeitlin
b891ffe8d0 Factor out another wxSpinCtrl helper for getting its max length
This will be used in wxGTK implementation.

For now no real changes yet.
2019-11-13 15:46:16 +01:00
Vadim Zeitlin
eb3d8395c2 Rename wxSpinCtrl helper functions
Put them in wxSpinCtrlImpl namespace and remove "wxSpinCtrl" prefix from
the function names themselves, this was ugly.

No real changes.
2019-11-13 15:46:16 +01:00
Vadim Zeitlin
4444694043 Move private wxSpinCtrl helpers into a private header
Np real changes, just don't put these functions in the public
wx/spinctrl.h, they have nothing to do there.
2019-11-13 02:59:42 +01:00
Stefan Csomor
f1aa3c1c9a add bridging info for apps using ARC
this is not wx building with -fobjc-arc but for apps using wx
2019-11-12 15:03:03 +01:00
Paul Cornett
df9f4af357 Improve our estimate of GtkEntry margins
For GTK2, get the "inner border" the same way GTK does it. And for GTK3,
provide an actual implementation. Also, don't return a wxPoint for a size.
See #18567
2019-11-11 08:29:28 -08:00
Vadim Zeitlin
0b16b4f439 Merge branch 'primary-display'
Handle the situation when primary display is not the first one.

See https://github.com/wxWidgets/wxWidgets/pull/1641
2019-11-10 00:39:14 +01:00
Paul Cornett
a5b03ea23c Suppress -Wdeprecated-declarations warnings from GTK2 headers
GLib has deprecated some things used by GTK2
2019-11-09 12:07:07 -08:00
Maarten Bent
57d054cf95 Fix font size of rich wxTextCtrl when created on display with non-system DPI
Apply a zoom factor based on the active DPI and the system DPI. On the first
DPI change, revert the scaling factor.
2019-11-08 20:46:47 +01:00
Artur Wieczorek
6eccec3ae7 Use empty() member function to determine if string is empty
Use this dedicated function instead of checking if length() function returns zero/non-zero value.
2019-11-08 18:53:03 +01:00
Artur Wieczorek
6b00cc80f1 Revert making wxComboCtrl a wxCompositeWindow
Commit 70e9dbd756 has fixed #18394 but unfortunately it also caused several other issues observed e.g. in #18540. Apparently wxComboCtrl doesn't fit well to the wxCompositeWindow framework -  especially when wxCB_READONLY flag is set and there is no main editor control what is problematic for wxCompositeWindow implementation. At the moment it is more pragmatic to go back to the original wxComboCtrl concept as a plain compound control to fix the regression and try to fix #18394 in an alternative way.

Closes #18540.
See #18394.
2019-11-08 18:51:07 +01:00
Vadim Zeitlin
d8cd02b480 Create primary monitor when using wxDisplay default ctor
Previously, the first monitor was created instead and while it was often
also the primary one, this wasn't always the case.

In particular, this makes wxGetDisplayPPI() always return something
reasonable instead of returning (0, 0) when the first monitor is not the
primary one, as expected by plenty of code, including our own printing
sample, which divides by the values returned from wxGetDisplayPPI()
without checking if they're zero.
2019-11-08 00:26:20 +01:00
Vadim Zeitlin
cdc588e4eb Don't resize the parent from wxToolBar::SetSize() in wxUniv
This could result in infinite recursion in wxX11, as the test for the
new size being different from the old one which was supposed to stop the
recursion, failed there in case the new size was 0: as wxX11 can't use 0
size for the window, the actual size was always different and so we kept
sending size events to the parent, which kept resizing the toolbar etc.

It could be argued that there is a bug in wxX11 and that GetSize() must
return the same value as was passed to SetSize(), even if it was 0, and
this might even be correct, in theory, but it doesn't seem worth to do
it just to accommodate this weird use case, especially because resizing
the parent from the child shouldn't be necessary in the first place and
none of wxToolBar implementations in the other ports does it.

So just remove this code completely.

Closes #18554.
2019-11-06 15:06:36 +01:00
Stefan Csomor
294c8a6b23 moving datatransfer.h to source files
former place in private.h broke Audacity builds
2019-11-05 19:20:51 +01:00
Stefan Csomor
715cb66ac4 Fixing IconRef Build re adding support for reading icns files 2019-11-05 09:46:02 +01:00
Maarten Bent
82668e1e85 Remove FromDIP in wxGetEditHeightFromCharHeight
This caused wxTextCtrl to become to high at higher DPI.

It was added to fix appearance of wxSearchCtrl at high DPI. Remove an unneeded
FromDIP there too, so it gets the same height as a normal wxTextCtrl.
And centre the textctrl inside the searchctrl.
2019-11-03 21:50:24 +01:00
Vadim Zeitlin
0dfafdcafb Merge branch 'pmdpi-sizers' of https://github.com/MaartenBent/wxWidgets
Update sizer borders and spacers on DPI change.

Closes #18551.

See https://github.com/wxWidgets/wxWidgets/pull/1628
2019-11-02 16:26:14 +01:00
Maarten Bent
918e102533 Support DPI change in sizers
Return the size of DoGetDefaultBorderInPx as float, so no precision is lost
when multiplying it for DoubleBorder and TripleBorder.

Closes #18551.
2019-11-01 21:07:15 +01:00
Vadim Zeitlin
be83879733 Merge branch 'always-use-wchar_t'
Remove obsolete wxUSE_WCHAR_T option, it must be always 1.

See https://github.com/wxWidgets/wxWidgets/pull/1624
2019-11-01 14:32:42 +01:00
Paul Cornett
4697ce23d9 Don't allow DestroyClippingRegion() to remove paint update area clipping with GTK3
See #18560
2019-10-31 23:30:18 -07:00
Vadim Zeitlin
c0d992cf67 Improve wording of MSWGetFocusHWND() comment
No real changes, just try to explain what this function is for better.
2019-10-31 23:58:21 +01:00
Vadim Zeitlin
96da0060ca Remove MSWGetFocusHwnd() helper
It doesn't seem worth having it when it's only used in a couple of
places in a single file, unlike GetHwnd() which is used in dozens of
places across entire wxMSW.
2019-10-31 23:56:55 +01:00
Ilya Sinitsyn
bfde3d3e08 Fix focus behaviour of the spin control under MSW
Override MSWGetFocusHwnd for wxSpinCtrl to focus the right subwindow.
So the correct window will be used in wxWindowMSW::SetFocusFromKbd and
the spin controls content will be selected on TAB key.
2019-11-01 00:27:43 +07:00
Ilya Sinitsyn
1b6dc0a2fb Add MSWGetFocusHWND to allow focus a subwindow
Under MSW allow override which subwindow will be focused for composite
windows which are implemented not as a set of wxControl (i.e. using only
Windows native controls).
2019-11-01 00:19:53 +07:00
Vadim Zeitlin
d7a640933d Remove wxUSE_WCHAR_T, it must always be 1 anyhow
This is not really an option as building requires it to be 1, so don't
make it one in setup.h/configure/cmake and just hardcode it as 1 for
compatibility.

Closes #18558.
2019-10-31 02:16:19 +01:00
Vadim Zeitlin
349e73994b Merge branch 'dpi-awareness-option' of https://github.com/MaartenBent/wxWidgets
Add wxUSE_DPI_AWARE_MANIFEST option allowing to choose to use a manifest
specifying per-monitor DPI awareness.

See https://github.com/wxWidgets/wxWidgets/pull/1622
2019-10-30 21:25:45 +01:00
Maarten Bent
d0b26a90ff Resolve -Wdeprecated-copy warning in wxDataFormat
Implicitly-declared 'constexpr wxDataFormat::wxDataFormat(const wxDataFormat&)'
is deprecated because 'wxDataFormat' has user-provided
'wxDataFormat& wxDataFormat::operator=(const wxDataFormat&)'.
2019-10-29 23:49:51 +01:00
Maarten Bent
6f02c3a897 Add DPI Awareness option to CMake
For VS solutions, the DPI aware manifest is added as additional manifest.
For makefiles, the DPI aware manifest is included via the resource file.

Set the default DPI Awareness to per-monitor.
2019-10-29 23:49:36 +01:00
Artur Wieczorek
9e4d28ba7f Fix names of wxDirProperty ctor parameters
First two paramaters of ctors of wxPGProperty and its derivates are named
'label' and 'name' so wxDirProperty ctor should conform to this convention.

Close #18547.
2019-10-29 23:34:37 +01:00
Vadim Zeitlin
0a02f4c190 Increment version number to 3.1.4
Done by running misc/scripts/inc_release, manually updating version.bkl,
rebaking and rerunning autoconf.

Also a header for the next version to the change log.
2019-10-28 14:11:00 +01:00
Vadim Zeitlin
67739303fd Don't force wxAuiToolBar size to be less than its parent
This results in the toolbar being too small to show any items in it
in wxGTK and wxOSX, because the parent window size is still the default
small one and not the actual size it will be when shown, when the size
of the toolbar is first set.

And it seems completely unnecessary to do this anyhow, as toolbar is
resized by wxAuiManager in any case.

Closes #18218.
2019-10-27 17:41:05 +01:00
Vadim Zeitlin
d38d8f4f9c Remove Carbon-specific code from wxScreenDC implementation
Carbon is not supported any more and defining m_overlayWindow, which was
only used by Carbon code, resulted in "unused private variable" warning
from clang.
2019-10-27 01:44:29 +02:00
Vadim Zeitlin
87bba02fef Stop handling performKeyEquivalent: in wxOSX
We can't handle the accelerators (known as "key equivalents" in Cocoa)
in this function because it is called for the views in top to bottom
order, while wx semantics is for accelerators to be handled in the
accelerator table closest to the focused window.

So just remove this code and rely on accelerator handling happening in
wxWindowMac::OSXHandleKeyEvent() instead.

Closes #13937.
2019-10-27 00:02:29 +02:00
Vadim Zeitlin
198a4e97a0 Fix wrongly cached state of children focusability under Mac
Remove caching of whether any of the children accept focus in
wxControlContainer as it can change at any moment under Mac, due to full
keyboard access being turned on and off (which can be done using
Ctrl-F7, i.e. easily, and so this might be something users actually do
and not just a theoretical edge case). This also incidentally fixes
caching of the wrong focusability state during window initialization,
when its children are not yet shown, as [NSView canBecomeKeyView:] used
for AcceptsFocusFromKeyboard() implementation under Mac, apparently
always returns false for hidden windows.

The behaviour under the other platforms should remain the same, but
AcceptsFocus() is slower now as it always has to query children instead
of being able to avoid doing it when we know that none of them accepts
focus anyhow. OTOH this only happens to the windows that don't accept
focus themselves and, at least at some moment, don't have any children
accepting focus neither, which should be quite rare and optimizing this
case doesn't seem to be worth the extra code complexity due to extra
preprocessor platform checks.

Closes #18089.
2019-10-26 02:58:29 +02:00
Vadim Zeitlin
6d1b6c71c4 Fix wxUpdateUIEvent prcoessing for standard menu items under Mac
Handle these events in the menu itself first, then the window and only
then at the application level instead of falling back on the application
before searching the window for the handler.

This requires using the logic already present in the base class
DoProcessEvent() method, so make it protected to allow reuse.

Closes #4769.
2019-10-25 04:10:23 +02:00
Vadim Zeitlin
288b570e11 Don't account for size grip under platforms not showing it
Size grip in generic wxStatusBar is only supported in wxGTK as it's
drawn using GTK functions, but this is not really a problem as other
platforms either use native implementations (MSW, Qt) or shouldn't show
size grip anyhow as it looks non-native (Mac).

So just ensure we don't leave space for the grip if it's not shown,
correcting the change of 6c1b2b23cf.

Closes #18469.
2019-10-25 04:10:23 +02:00
Vadim Zeitlin
b8c9e6754d Merge branch 'msvc-warns'
Fix an annoying MSVC warning in SDK headers.

Remove wxUSE_IOSTREAMH.

See https://github.com/wxWidgets/wxWidgets/pull/1614
2019-10-23 19:50:14 +02:00
Stefan Csomor
235e61c311 Implement macOS-specific wxDataViewCheckIconTextRenderer
This implementation suffers at least from 2 problems:

1. It doesn't support icons at all.
2. It toggles the checkbox when clicking on the text and not just on the
   checkbox itself, as would be expected.

but it's still better than the current version which simply doesn't work
at all, i.e. can't be toggled in any way (and also doesn't draw itself
correctly when using dark mode under macOS 10.14+), so use it for now.

A better solution would be to fix the problem with ActivateCell() not
working at all (see #17746) and update the code to respect drawing in
dark mode.

Closes #17473.

Closes https://github.com/wxWidgets/wxWidgets/pull/904
2019-10-21 21:14:54 +02:00
Vadim Zeitlin
ad6799f249 Merge branch 'grid-uitests-gtk'
Fixes to wxUIActionSimulator allowing the tests using it to work for
wxGrid in wxGTK.

And some improvements and bug fixes to wxGrid itself.

Closes https://github.com/wxWidgets/wxWidgets/pull/1609
2019-10-21 21:12:01 +02:00
Vadim Zeitlin
271711b030 Get rid of spurious warning in CRT malloc.h with MSVS 2017
Recent MSVS 2017 versions (15.9.x) as well as MSVS 2019 give warning
C4548 about "expression before comma having no effect" when including
standard CRT headers.

This happens because when building projects targeting 8.1 SDK, as the
IDE uses the hard coded 10.0.240.0 version of UCRT headers in this case
(see \Common7\IDE\VC\VCTargets\Microsoft.Cpp.Common.props), and the
headers in this version haven't been, and will never be, updated to
avoid this warning, as was done in later 10.0.x UCRT versions.

Fix this by explicitly disabling the warning in wx/beforestd.h, as even
setting the warning level to 1 for the standard headers somehow isn't
enough to suppress it if it's enabled.
2019-10-21 20:52:49 +02:00
Vadim Zeitlin
fc711f869f Remove obsolete wxUSE_IOSTREAMH option
This is always 0 for any still supported compiler, so remove the option
and configure checks for it.

Still define it as 0 for compatibility, just in case it's used outside
of the library.
2019-10-21 20:46:21 +02:00
Vadim Zeitlin
416fc8582d Remove unused code inside MSVC 6 version checks
We don't support MSVC 6 (__VISUALC__ == 1200) or eVC (1201) since more
than 5 years (see f4b80e5337), so it's
useless to keep code compiled only when this compiler is used.
2019-10-21 20:36:08 +02:00
Vadim Zeitlin
4fac71fc29 Merge branch 'per-monitor-dpi-aware-controls-3' of https://github.com/MaartenBent/wxWidgets
Add, or improve, per-monitor DPI awareness to/for more controls.

See https://github.com/wxWidgets/wxWidgets/pull/1589
2019-10-19 20:10:05 +02:00
Artur Wieczorek
bae8bb4c45 Optimize drawing horizontal/vertical lines
On DC with a non-rotated coordinate system drawing a filled rectangle with ExtTextOut() Win API is faster than drawing a line with MoveTo()/LineTo() so on such DCs we can use ExtTextOut() to draw horizontal/vertical lines with solid colors and square ends instead of calling MoveTo()/LineTo().

See #18517.
2019-10-18 18:06:12 +02:00
Vadim Zeitlin
b4dee76b4c Set focus to the main grid window in wxGrid::SetFocus()
After changing wxGrid to not inherit from wxPanel, this needs to be done
explicitly now.
2019-10-18 04:00:46 +02:00
Vadim Zeitlin
38247f596c Remove wrong wxGrid::GetMainWindowOfCompositeControl() override
This method is supposed to be overridden in the sub-windows of a
composite control (and is indeed correctly implemented in
wxGridSubwindow), but it doesn't make any sense to implement it in the
parent window itself.

This method was probably never executed (which is how the problem went
unnoticed for 10+ years since 760be3f7cb),
but it's still wrong to define it here, so remove it.
2019-10-18 04:00:46 +02:00
Vadim Zeitlin
9a424602e4 Stop deriving wxGrid from wxPanel
This is unnecessary as TAB navigation is not supposed to work between
wxGrid children and actually harmful as this resulted in SetFocus()
doing nothing, instead of setting focus to wxGridWindow, if the focus
was on wxGrid itself for some reason (this happened at least in the grid
unit tests and resulted in failures because the in-place editor didn't
appear as expected).
2019-10-18 04:00:46 +02:00
Vadim Zeitlin
ad7fb7f4aa Merge branch 'warnings' of https://github.com/catalinr/wxWidgets
Fix MSVS analyzer warnings about int multiplication overflow and
uninitialized member variables.

See https://github.com/wxWidgets/wxWidgets/pull/1606
2019-10-15 22:50:17 +02:00
catalinr
67dd28619f Cast more int vars to double to avoid overflow warning 2019-10-14 22:20:37 +03:00
catalinr
62981e1561 Move member initialization in default ctor 2019-10-14 21:34:00 +03:00
Paul Cornett
2ece977ed7 Add copy ctor for wxUniCharRef
It just does the default, but C++11 deprecates having copy assignment operator
without copy ctor. Eliminates many GCC -Wdeprecated-copy warnings.
2019-10-14 09:08:13 -07:00
Paul Cornett
a3598ba33f Remove unnecessary copy ctors/copy assignment operators
C++11 deprecates having one without the other.
Eliminates many, many GCC -Wdeprecated-copy warnings.
2019-10-14 09:07:21 -07:00
Paul Cornett
764c01832d Use C++11 member-delete in NO_COPY_CLASS/NO_ASSIGN_CLASS macros 2019-10-14 09:06:48 -07:00
catalinr
0508764973 Initialize isLSB to avoid warning 2019-10-14 08:10:41 +03:00
catalinr
2fc569f0c2 Initialize member variables to avoid warnings 2019-10-14 08:09:47 +03:00
catalinr
c150ece20f Cast int to double to avoid arithmetic overflow warning 2019-10-14 07:49:28 +03:00
Maarten Bent
05e0fad687 Resolve some recently introduced warnings 2019-10-13 08:34:30 -07:00
Paul Cornett
0cced058d8 Fix linking when wxUSE_VALIDATORS==0
The changes from 25e9be6873 don't work, at least with GCC 9, as the compiler
seems to be removing the definition of the wxDefaultValidator variable.
2019-10-12 09:18:19 -07:00
Vadim Zeitlin
9e2ff111a4 Restore, but deprecate, default ctor of wxTimerEvent
Apparently some existing code still used it, even though it only created
an object that could never be used for anything, so undo its removal in
bd09b4132d and deprecate it instead.

Unfortunately, this also requires changing wxTimerEvent::m_timer type
back to pointer, even though it should be a reference.
2019-10-11 19:22:55 +02:00
Vadim Zeitlin
a668db8b64 Do nothing in wxListCtrl::SetDoubleBuffered() in wxMSW
Setting WS_EX_COMPOSITED, as the base class version does, just results
in visual artefacts and is useless, as we turn on LVS_EX_DOUBLEBUFFER
already, if it's supported, anyhow.

So don't break the display if people call SetDoubleBuffered() in the
mistaken belief that it does something useful in this case.
2019-10-11 15:34:49 +02:00
Vadim Zeitlin
9e8352b5cb Document in comments that wxAuiToolBarArt element sizes use DIPs
This is not as good as relying on the type system, but better than
nothing.
2019-10-10 14:00:51 +02:00
Vadim Zeitlin
cc7c0bbd9c Merge branch 'msw-richedit-paste'
Fix pasting long strings into wxTextCtrl in wxMSW.
2019-10-10 13:56:00 +02:00
Maarten Bent
c538e8f9d6 Add wxGraphicsRenderer::CreateFontAtDPI to support font with fractional pixel-size 2019-10-09 22:24:28 +02:00
Vadim Zeitlin
efc2a9da2d Fix pasting long strings in wxTextCtrl under MSW
Adjust the length limit before pasting to ensure that all text on
clipboard will be successfully pasted, instead of only pasting the part
of it which fits.

Add a unit test checking that this works.

Closes #4646.
2019-10-09 14:40:53 +02:00
Vadim Zeitlin
612634fffd Merge branch 'spinctrl-fixes'
Various improvements to wxSpinCtrl and wxGridCellNumberEditor, using it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1588
2019-10-09 01:52:10 +02:00
Ilya Sinitsyn
8dadc2e68c Improve wxGridCellNumberEditor placement in the grid
Use the best height and don't let the editor be smaller then min size.
Also align center vertically.
2019-10-09 01:44:32 +02:00
Ilya Sinitsyn
1be43ed67b Improve best size determination for wxSpinCtrl
Use the range and the base to determine the widest value string and use
it to calculate the best size.
2019-10-09 01:44:13 +02:00
Ilya Sinitsyn
9ef1b1529d Add wxControl::GetSizeFromText() helper function
Add the helper function that combines GetSizeFromTextSize() and
GetTextExtent() as they are often used together.
2019-10-09 01:43:50 +02:00
Olly Betts
e2b4cd9f77 Fix typos in comments and assertion messages
Closes https://github.com/wxWidgets/wxWidgets/pull/1596
2019-10-08 23:30:22 +02:00
Stefan Csomor
f83577df45
Changing datatransfer implementation from CFPasteboard to NSPasteboard API (#1264)
* changing datatransfer from CFPasteboard to NSPasteboard API

* factoring and cleaning up

* Switching back naming

* missed file

* getting wxCFStringRef to be independent of system headers

* add unichar include

* using wxCFStringRef in header

* moving to private headers, change method name

* adapting to lesser content in cfstring.h

* Removing malloc/free usage

* use wxScopedArray throughout

* using wxMemoryBuffer instead of char[]

* fixing nonprecomp headers

* missing forward decl in non-precomp builds
2019-10-08 06:32:44 +02:00
Vadim Zeitlin
654bfaea31 Add wxListCtrl::IsEmpty()
Add a simple accessor for consistency with the other controls.
2019-10-08 01:20:44 +02:00
Vadim Zeitlin
f95ce8d9d5 Add wxListCtrlBase::GetItemCount() pure virtual
No real changes, just ensure that all derived classes implement this
method (which already was the case).
2019-10-08 01:16:50 +02:00
Vadim Zeitlin
30dabbdf69 Merge branch 'grid-native-header-autosize'
Fixes for auto-sizing grid columns when using native header control.

Closes https://github.com/wxWidgets/wxWidgets/pull/1579
2019-10-07 22:26:02 +02:00
Ilya Sinitsyn
b2194d9ad5 Fix the native header column minimal width determination
wxGrid::AutoSizeColumn can set per column minimal width and this values
must be used for native headers columns.
2019-10-07 22:25:10 +02:00
Ilya Sinitsyn
8971321542 Send the autosize column event for grid native header columns
Send wxEVT_GRID_COL_AUTO_SIZE on double clicking on a separator line of
the grid native header to allow override default behaviour.
2019-10-07 22:25:10 +02:00
Maarten Bent
87a97054f2 Allow to retrieve the wxWindow associated with a wxBufferedPaintDC
When a wxBufferedPaintDC is created, the base classes does not initialize the
m_window variable with the used wxWindow. Only the associated m_paintdc
initializes this variable. Add a protected function that allows to set the
wxWindow of a wxDC so GetWindow() will return the window.

This fixes the font size of custom attributes in wxDataViewCtrl when the DPI
changes.
2019-10-07 00:54:59 +02:00
Maarten Bent
a1c3fa0468 Fix wxPropertyGrid row height on DPI change
Fix collapse button size of wxPropertyGrid in High DPI.
2019-10-07 00:54:59 +02:00
Maarten Bent
62c5b2d8d1 Support DPI change in wxStyledTextCtrl
Change to zoom-level and margin width based on the active DPI.
Send wxDPIChangedEvent to all controls and windows.
2019-10-07 00:54:58 +02:00
Vadim Zeitlin
2c604863de Fix compilation after fpos_t change in with MinGW runtime 5.2
fpos_t is now a union and not just a simple typedef any more, so we
can't cast between it and long long. Unfortunately we still need to
convert between the two, so add an explicit version check and use the
private union field to make this work with the latest MinGW 32 versions.
2019-10-06 00:17:57 +02:00
Vadim Zeitlin
4c517dea40 Merge branch 'qt_clipboard_bitmap' of https://github.com/GeoTeric/wxWidgets
Implement copying bitmap to clipboard for wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1368
2019-10-05 15:04:47 +02:00