Commit Graph

65326 Commits

Author SHA1 Message Date
Vadim Zeitlin
8d75368a30 Minor formatting and style fixes to the previous commit
Fix indentation and spacing.

Also declare some variables when initializing them and make them const
if they don't change later.
2018-01-25 17:18:27 -06:00
New Pagodi
df1456e4e2 Apply erans patch to allow building with MinGW 2018-01-25 16:08:33 -06:00
New Pagodi
b936bfe85e Add Direct2D support to wxSTC 2018-01-25 16:07:54 -06:00
Vadim Zeitlin
f836d430e9 Merge branch 'dvc-delete-all'
Fix crashes when deleting all items from wxTreeListCtrl in wxGTK3.

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

Closes #18045.
2018-01-25 19:39:55 +01:00
Vadim Zeitlin
ee0dd4edb1 Replace wxGTKCairoDCImpl::m_{width,height} with m_size
This allows to avoid initializing the variables to 0 in all the
overloaded ctors: wxSize default ctor already does it.

It's also more convenient to use GetScaledSize() rather than assigning
m_width and m_height separately, even if the rest of the code is broadly
unchanged.
2018-01-25 14:56:43 +01:00
Vadim Zeitlin
4c8e701d84 Remove wxGTKCairoDCImpl ctor taking dummy int
We can reuse another ctor taking wxWindow* instead. Although this does
require an ugly cast, it's more explicit than just passing 0 which
could, in principle, match both the ctor taking wxWindow* and another
one taking double, and so is still preferable.
2018-01-25 14:56:43 +01:00
Vadim Zeitlin
0be81cb34b Add wxGTKCairoDCImpl::SetSize() helper
Avoid repeating gdk_window_get_{width,height}() calls in several places.
2018-01-25 14:56:43 +01:00
Vadim Zeitlin
a1cb2eb12a Also return display DPI from wxScreenDC in wxGTK3
This is similar to the previous commit and is done for the same reasons:
screen DC needs to use the same DPI as the screen itself, instead of the
default Cairo 72 DPI.
2018-01-25 14:56:43 +01:00
Vadim Zeitlin
4ad1a3d969 Return display PPI from wxDC::GetPPI() in wxGTK3
For wxDC associated with a window, such as wx{Window,Client,Paint}DC,
this method should return the window PPI, not the hard coded 72 DPI of
Cairo graphics context.

This still doesn't work correctly when using multiple monitors with
different DPI settings, but is still a (modest) improvement.
2018-01-25 14:35:11 +01:00
Vadim Zeitlin
afe0e776b9 Remove confusing "base_type" typedef from wxGTK3 wxDC code
This typedef isn't really useful in base class initializer lists and it
wasn't really used anywhere else.
2018-01-25 14:32:49 +01:00
Lauri Nurmi
8bad0d4d58 Fix attribution in docs/changes.txt
Fix wrong attribution for the changes of
https://github.com/wxWidgets/wxWidgets/pull/552

A fix for 56323b5aba

See https://github.com/wxWidgets/wxWidgets/pull/684
2018-01-25 14:27:07 +01:00
Vadim Zeitlin
56511118d9 Merge branch 'cxx11-abi-fix'
Avoid ABI issues when building the library in C++98 mode and the
application using C++11 due to using different unordered containers.

Closes #18034.
2018-01-25 13:50:21 +01:00
Vadim Zeitlin
a9b44af251 Fix crash with wxDataViewVirtualListModel in generic wxDataViewCtrl
Recent sorting-related changes resulted in calling FindNode(), which
can only be used with the non-"virtual list" models, unconditionally,
after the items values was changed by user, resulting in a crash.

Add the missing IsVirtualList() check and also add a comment explicitly
stating that all code involving wxDataViewTreeNode can only be used
after checking that IsVirtualList() returns false.

Closes #18057.
2018-01-25 13:02:14 +01:00
Vadim Zeitlin
bdcf21a5bd Explicitly use libc++ in C++11 CMake macOS builds on Travis CI
Just using -DCMAKE_CXX_STANDARD=11 isn't enough, as it doesn't seem to
use C++11 for configuration checks, so set CMAKE_CXX_FLAGS explicitly
too.
2018-01-25 12:22:34 +01:00
Vadim Zeitlin
c7599c8ec0 Merge branch 'collpane-best-size'
Fix resizing of nested wxCollapsiblePanes in wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/681
2018-01-24 23:57:37 +01:00
Daniel Kulp
d8b3fc84c2 Fix sorting in generic wxDataViewCtrl broken by recent changes
The comparator used with std::sort() must return true only if the first
item is strictly less than the second one, this is a requirement of the
sorting algorithm and not respecting it results in wrong final order.

See https://github.com/wxWidgets/wxWidgets/pull/642
2018-01-24 23:40:37 +01:00
Vadim Zeitlin
ad03c8475d Revert "Fix crash when deleting all wxTreeListCtrl items with wxGTK3"
This reverts commit 1dd102d741 as it
introduced a crash in the same method when using generic wxDataViewCtrl
implementation, e.g. under MSW, and is not necessary to avoid the crash
with wxGTK3 any longer after the few previous commits.
2018-01-24 23:09:30 +01:00
Vadim Zeitlin
e1d8137e70 Use wxGtkTreePath instead of calling gtk_tree_path_free()
Use RAII helper class instead of freeing the object manually.

Also add a couple of "const"s and other minor style fixes.

No real changes.
2018-01-24 23:09:30 +01:00
Vadim Zeitlin
27f705686d Avoid using the already deleted model items when clearing it
There is an impedance mismatch between wxDataViewCtrl API, which allows
deleting all items of the model at once, and GtkTreeView, which only
allows deleting them one by one, so bad things happen when we start
deleting the items from the GTK+ model after already having deleted them
from the wxDataViewModel, due to dereferencing the already freed
pointers.

Work around this by explicitly marking the model as being "temporarily
unsafe to use" by setting the stamp, uniquely identifying it, to 0 (and
ensuring that it's never 0 during the normal operation), and checking
for it in all functions that are called by GTK+ from inside
gtk_tree_model_row_deleted() that we call from Cleared().

The fix is not ideal, as the list of these functions was determined
empirically and could change in the future GTK+ versions, and also ugly,
but there doesn't seem to be any other way around this and at least now
Valgrind doesn't report invalid memory reads after calling
wxTreeListCtrl::DeleteAllItems() as it did before.
2018-01-24 23:09:30 +01:00
Vadim Zeitlin
0cea0a67f1 Use RAII SelectionEventsSuppressor in wxGTK wxDataViewCtrl code
This is simpler and safer than always remembering to call
GtkDisableSelectionEvents() and GtkEnableSelectionEvents() in pairs.

No real changes.
2018-01-24 23:09:29 +01:00
Robin Dunn
3b22d9a56b Test wxTreeListCtrl::DeleteAllItems() in the sample
Add a menu command to invoke this method for testing.
2018-01-24 17:59:25 +01:00
Vadim Zeitlin
9b51ef82af Install wx/osx/appprogress as part of "make install"
Add the file to the files list, this should have been part of
11a5b83e2c (see #16638).

Closes #18059.
2018-01-24 17:43:58 +01:00
Vadim Zeitlin
ab12d73cd5 Merge branch 'cmake-gtk-opengl' of https://github.com/MaartenBent/wxWidgets
CMake fixes for building samples, notably the ones using OpenGL, and
more.

See https://github.com/wxWidgets/wxWidgets/pull/679
2018-01-24 16:43:22 +01:00
John Roberts
f0d5e95412 Fix crash when clearing read-only wxOwnerDrawnComboBox
Check that we have an associated text entry before clearing it.

Fixes a crash introduced by 72fe57ec18
without reverting it as it still seems reasonable to use Clear() here.

Closes #18013.
2018-01-24 16:40:26 +01:00
Vadim Zeitlin
7d300183a2 Revert "Check for HAVE_TYPE_TRAITS in CMake build not only for MSVC"
This reverts commit acdd0ef09e as it
shouldn't be necessary according to this comment:

https://github.com/wxWidgets/wxWidgets/pull/658#issuecomment-358759875
2018-01-24 16:27:05 +01:00
Vadim Zeitlin
746bbd08cc Use C++11 for tests during CMake configuration if necessary
Enable CMake policy CMP0067 to ensure that the tests are done using the
same C++ dialect that is actually used for compiling the library.
2018-01-24 16:25:28 +01:00
Vadim Zeitlin
9567adb8cc Order policies by their numbers in CMake policies file
Just make it easier to maintain this file by enabling all policies in
order of their numbers.

No real changes.
2018-01-24 16:25:18 +01:00
Vadim Zeitlin
9f91756108 Remove hard TABs from CMake policies file
No real changes, just use spaces for indentation as everywhere else.
2018-01-24 16:23:45 +01:00
Maarten Bent
5ca19288f6 CMake: Fix building samples with MinGW64
Do not enable debugrpt and flash examples.
Define UNICODE when building on Windows. This allows the sdk_exe example to build, because it includes the windows headers directly.
2018-01-24 01:04:42 +01:00
Maarten Bent
6d12732f52 CMake: Remove Unix-only from OnFatalException description 2018-01-24 01:04:42 +01:00
Maarten Bent
dc0d93cccc CMake: Fix library order in wxMSW build
uuid should be linked before oleacc, otherwise it causes multiple definition of `IID_IAccessible' (with MinGW64 gcc).
To simplify even more, specify all required libraries in wxTOOLKIT_LIBRARIES, in the same order as in the makefiles.
Add uxtheme library, it is required since wxUxThemeEngine wrapper has been removed.
2018-01-24 01:04:41 +01:00
Maarten Bent
fb8403a064 CMake: Only link executables to enabled libraries 2018-01-24 00:47:58 +01:00
Maarten Bent
76617ddb1e CMake: Add missing OpenGL files in GTK build 2018-01-24 00:47:58 +01:00
Vadim Zeitlin
4a37f2dd15 Merge branch 'win_uxtheme_restructure' of https://github.com/TcT2k/wxWidgets
Don't load theme functions dynamically as it's not necessary any longer.

See https://github.com/wxWidgets/wxWidgets/pull/572
2018-01-24 00:24:38 +01:00
Vadim Zeitlin
9364690c0e Correct check for <windows.h> inclusion to fix MinGW build
MinGW compiler predefines WIN32, meaning that wx/msw/winundef.h was
always included from wx/defs.h, even when it was completely unnecessary.
This was just inefficient, but harmless, until the changes of
042d922e88 which broke MinGW compilation
as wxUSE_UNICODE_WINDOWS_H was incorrectly defined during the very first
inclusion of wx/msw/winundef.h, before _UNICODE could be defined
correctly by windows.h.

Fix this by checking whether windows.h was really already included.
2018-01-23 17:53:18 +01:00
Vadim Zeitlin
0d77df8af1 Merge branch 'dvc-update-fix'
See https://github.com/wxWidgets/wxWidgets/pull/674
2018-01-23 15:51:08 +01:00
Vadim Zeitlin
2a815ecd8b Merge branch 'stattext-no-resize'
Avoid unexpected changes to wxStaticText size with wxST_NO_AUTORESIZE.

See https://github.com/wxWidgets/wxWidgets/pull/675
2018-01-23 15:49:03 +01:00
Vadim Zeitlin
ff1fe53d66 Merge branch 'statbox-any-label'
Add support for using any wxWindow (and not just the equivalent of
wxStaticText) as wxStaticBox label.

See https://github.com/wxWidgets/wxWidgets/pull/650
2018-01-23 15:45:46 +01:00
Vadim Zeitlin
9981a0216f Add "windowlabel" element of wxStaticBoxSizer to the schema
This was forgotten in the commit updating the sizer XRC handler.
2018-01-23 15:45:05 +01:00
Vadim Zeitlin
3cbfe25fa6 Merge branch 'mfc'
A bunch of improvements for applications using both wxWidgets and MFC.
2018-01-23 15:39:00 +01:00
Jouk
95595d660b Add #undef HAVE_XLOCALE_H 2018-01-22 10:44:27 +01:00
Tobias Taschner
2d064ea3b9 Move UXTheme symbol definitions for Vista+ to msw/uxtheme.h
Remove various definitions and symbol declarations from
numerous files using msw/uxtheme.h to a single file.
When possible vssym32.h is included from the Windows SDK.
For older SDKs tmschema.h is included and missing symbols
are defined in msw/uxtheme.h.
2018-01-22 00:53:21 +01:00
Tobias Taschner
d9306f127a Remove unused definitions in msw/checkbox.cpp 2018-01-22 00:51:20 +01:00
Tobias Taschner
ddceaab001 Remove MSW wxUxThemeEngine class
This undocumented "private" class was used for various windows UxTheme
functions which are available since WinXP. As wxWidgets 3.1 is XP+ it
does not make sense anymore to load the theme functions dynamically.
2018-01-22 00:51:11 +01:00
Stefan Csomor
ce90336dff Fixing popup windows with a modal dialog as parent
When having a certain creation sequence, these popup windows were not focused correctly, see https://github.com/wxWidgets/wxWidgets/pull/672 , commit d2265136e359df4d14054860a68bbc7f4910279d , revert this change if problems arise to see whether this is a recursion
2018-01-21 20:41:52 +01:00
Stefan Csomor
aae23be946 Fixing xcode build after xlocale.h include change
see commit e723bb2ee4
2018-01-21 17:33:50 +01:00
Vadim Zeitlin
e723bb2ee4 Try to fix macOS build using cmake after xlocale changes
Commit bc13119494 removed the inclusion of
xlocale.h because it is not (and never was) needed under Linux with
glibc, but it is still needed under macOS, so this (silently) disabled
wxXLocale support under Mac when using configure and broke the build
when using cmake.

Fix both problems by using xlocale.h only if it's available, both in
configure and in cmake.
2018-01-21 16:49:26 +01:00
Vadim Zeitlin
678d1142b4 Fix typo in EVT_LIST_BEGIN_LABEL_EDIT in the documentation
"LIST" part was somehow forgotten.

Closes #18051.
2018-01-21 16:23:15 +01:00
Vadim Zeitlin
c63d47bc94 Fix broken resize handling in wxGTK wxCollapsiblePane
Almost totally rewrite the resize-after-toggle code in this control so
that it actually makes sense and works, especially in the situations
when the contents of wxCollapsiblePane changes, for example when it
contains another wxCollapsiblePane inside it which can be collapsed or
expanded. Previously, this didn't work at all in wxGTK and the inner
pane always remained at its minimal, collapsed size. Now it does, after
doing the following:

First, replace the completely useless DoGetBestSize() which just did the
same thing as its base class implementation with the code actually
determining the best size of the window that was previously hidden
inside gtk_collapsiblepane_expanded_callback() for some reason. Note
that the comment about "not caching the best size" in the old code was
very out of date and was probably left over from the days when
GetBestSize() itself was virtual, as caching is not done in
DoGetBestSize() anyhow, but in GetBestSize() itself.

So, second, do fix the best size invalidation by doing it explicitly
whenever the pane is toggled. And, relatedly, do not set the min size of
anything because this overrides the layout computations and is never
reset/invalidated, unlike the best size, even if the best size of the
pane changes, e.g. because of a change to its contents.

Finally, remove many thoroughly outdated comments, e.g. the one speaking
about OnStateChange() which doesn't exist at all in this implementation.
2018-01-20 18:21:40 +01:00
Vadim Zeitlin
5c0dfcd5ae Fix extra wxEVT_COLLAPSIBLEPANE_CHANGED with wxCP_NO_TLW_RESIZE
A pane using wxCP_NO_TLW_RESIZE would generate wxCollapsiblePaneEvent
even when toggled from a program because the GTK+ callback didn't take
m_bIgnoreNextChange flag into account in this case.

Fix this and also avoid duplicating the code for sending the event.
2018-01-20 17:47:18 +01:00