Commit Graph

63841 Commits

Author SHA1 Message Date
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
Tobias Taschner
d6b88ca399 Add footer text and icon to wxRichMessageDialog
The underlying Windows TaskDialog supports adding an additional footer
to the message dialog. This makes the native functionality available
and implements it in the generic version.

See https://github.com/wxWidgets/wxWidgets/pull/573
2018-01-20 16:53:13 +01:00
Vadim Zeitlin
bc13119494 Don't check for non-standatd xlocale.h in configure
Testing for xlocale.h was due to a misunderstanding, this header wasn't
supposed to define locale_t which is defined by locale.h itself and was
just some internal glibc header which was removed in its 2.26 release,
see

https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27

Stop checking for it in configure and also don't always define
wxUSE_XLOCALE but only do it if the configure test succeeded.
2018-01-20 13:47:21 +01:00
Vadim Zeitlin
7ff5e5e749 Regenerate configure after gtk.m4 update
This should have been part of 8e35398037.
2018-01-20 13:45:31 +01:00
Vadim Zeitlin
0cd2e4b6cb Don't document wxEVT_ICONIZE as being for wxMSW and wxGTK only
It's generated by wxOSX too.

Closes #17840.
2018-01-20 13:10:10 +01:00
Vadim Zeitlin
a67f4b8254 Don't pretend static box with enabled label is disabled
Trying to be smart by setting m_isEnabled to false in
wxStaticBox::Enable() without actually disabling the box itself (because
it can't be done if its label window is to remain enabled) didn't really
work. For example, it was impossible to TAB to a checkbox label of the
box when it was disabled, because keyboard navigation (correctly)
doesn't recurse into disabled windows and there could be similar
problems with any other code iterating over windows and skipping over
the disabled ones.

So, finally, simplify things and keep m_isEnabled in sync with the real
box state, even if this, counter-intuitively, means that IsEnabled() on
the box returns true after calling Enable(false) on it.

This also reverts 4ee35cf5ee569b6ee6c7d0d5702484d4d2a20f96 ("Don't
disable wxStaticBox children at wx level when disabling it") as we can't
avoid really disabling the children any more now that their parent is
not disabled: without this, their IsEnabled() would return true, i.e.
they wouldn't be disabled at all, from the program point of view. This
is unfortunate for the reasons that originally motivated that commit,
i.e. if some wxStaticBox child is disabled, disabling and re-enabling
the box will now re-enable this child, even if it shouldn't, but seems
impossible to avoid. The only possible alternative is to modify
IsEnabled() to add some wxStaticBox-specific hook to it, e.g. instead of
calling GetParent()->IsEnabled() there, we could call some now
AreChildrenEnable() method, which would delegate to IsEnabled() by
default but overridden in wxStaticBox. However this seems complicated,
and will add an extra virtual function call to all (frequently
happening) IsEnabled() calls.
2018-01-18 23:28:16 +01:00
Vadim Zeitlin
4839932227 Allow tabbing to the windows inside non-notebook wxBookCtrl
Remove wxBookCtrlBase::AcceptsFocus() returning false as it didn't make
any sense: even though wxBookCtrlBase doesn't, indeed, accept focus on
itself, it does accept it for its children and returning false prevented
the focus from ever getting inside it.

This fixes, for example, keyboard navigation in a window containing
wxSimplebook and TAB can now be used to move to the controls inside it
from the outside.

Also remove the now unnecessary AcceptsFocus() override which was just
undoing the damage of the base class method and is not needed any more.
2018-01-18 22:59:45 +01:00
Vadim Zeitlin
c6e445d40c Set focus to wxSimplebook contents when setting focus to it
This is more expected than simply doing nothing, as happened until now.
2018-01-18 22:59:42 +01:00
Stefan Csomor
a1cf0e1cd4 Removing manual focus handling
see https://github.com/wxWidgets/wxWidgets/pull/672 , commit 61b1a9a3533d4e16b2b7a9441e42766d8d9655c7 , revert this change if problems arise to see whether this is a recursion
2018-01-18 19:42:08 +01:00
Vadim Zeitlin
0a966eb145 Merge branch 'xrc-text-escape'
Miscellaneous improvements for handling mnemonics in XRC.

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

Closes #18033.
2018-01-18 00:23:18 +01:00
Vadim Zeitlin
35a0ba4fce Avoid crash on abnormal exit in wx+MFC combined applications
Reset m_pMainWnd in wxMFCApp::ExitInstance() to avoid crash when
deleting it again in OnMainWindowDestroyed() that could happen if
ExitInstance() was called not because the main window was closed (normal
case) but because wxApp::ExitMainLoop() was called, as it happens when
an unhandled exception is thrown.
2018-01-17 11:51:03 +01:00
Vadim Zeitlin
4750e1ee78 Exit the main loop, not the current one, on unhandled exception
If wxApp::OnExceptionInMainLoop() returns false, we're supposed to exit
the application by stopping its main event loop, not the loop that is
currently running, so do the former instead of the latter.

Also call wxAbort() if we can't exit the application in any other way,
this is not ideal, but still better than not doing anything and, for
example, keeping showing the same "Unexpected error occurred" message
box to the user over and over again if the exception comes from an event
handler being called repeatedly, such as wxEVT_PAINT or wxEVT_IDLE.
2018-01-17 11:50:31 +01:00
Vadim Zeitlin
1dd102d741 Fix crash when deleting all wxTreeListCtrl items with wxGTK3
GTK+ 3 (but not the generic version nor even GTK+ 2, apparently) sends
"selection changed" event from gtk_tree_model_row_deleted() when
deleting the currently selected row, which resulted in sending of
wxEVT_TREELIST_SELECTION_CHANGED events with invalid wxTreeListItem,
containing a dangling pointer, and a crash in the treelist sample when
trying to dump it.

Avoid this by clearing the model (and hence generating these events)
first and deleting the items only afterwards.

Also add a trivial unit test for wxTreeListCtrl::DeleteAllItems(), which
doesn't even allow to reproduce this bug, but is still probably better
to have than not to.

Closes #18045.
2018-01-17 10:44:28 +01:00
Vadim Zeitlin
321c9d5f30 Add another email address for John Roberts
See https://github.com/wxWidgets/wxWidgets/pull/676
2018-01-17 10:18:37 +01:00
John Roberts
4ad61f3048 Fix LAN detection in wxDialUpManager for macOS
Check for enX interface name for Darwin.

Closes https://github.com/wxWidgets/wxWidgets/pull/676
2018-01-17 10:15:30 +01:00
Vadim Zeitlin
91f54ea7e4 Remove a useless assert from wxDataViewTreeNode::GetChildNodes()
Checking that a pointer is non-null before dereferencing it is perfectly
useless: the code will crash anyhow, so assert doesn't help with
debugging it in debug builds nor with preventing the crash in release.
2018-01-17 10:15:11 +01:00
Vadim Zeitlin
ff3b3269dd Fix adding items to wxDataViewCtrl broken in the last commit
SetHasChildren(true) must be called before checking GetChildNodes() if
the parent hadn't had any items in the initial model.

Also remove the assert checking that the node is open in
BuildTreeHelper() as we may need to build even a closed tree branch.
2018-01-17 10:15:11 +01:00
Vadim Zeitlin
4dc78a33e0 Fix adding items to a never opened branch of generic wxDataViewCtrl
Calling ItemAdded() on a parent item that had never been opened yet
"lost" all its children that initially existed in the model, as the
corresponding subtree wasn't built any more in Expand() when this item
was finally opened because the list of item children wasn't empty any
more after ItemAdded() added the new child to it.

Fix this by simply not doing anything in ItemAdded() in this situation,
there is no need to update a closed tree branch immediately anyhow.
2018-01-17 00:15:50 +01:00
Vadim Zeitlin
3294b9a63a Don't invalidate best size for controls with wxST_NO_AUTORESIZE
This results in non-intuitive behaviour, as the controls with this style
still get resized after changing their label, so don't do it.

See https://groups.google.com/d/msg/wx-dev/58xFP4FIxXc/hm5WO0xNBwAJ
2018-01-16 22:18:54 +01:00
Vadim Zeitlin
c19e53e75e Don't skip wxStaticText auto-resizing if it's ellipsized
There doesn't seem to be any good reason for this, as it's perfectly
possible to use ellipsize the text if it's too long to fit even when the
control is resized to its maximal extent, but still allow the control to
resize in the first place.

See https://groups.google.com/d/msg/wx-dev/58xFP4FIxXc/d5lj6901CQAJ
2018-01-16 16:46:54 +01:00
Vadim Zeitlin
51bfc68423 Avoid unnecessary checks in wxStaticText::SetFont() in wxGTK
There is no need to do anything if the font didn't actually change.
2018-01-16 16:46:54 +01:00
Vadim Zeitlin
6651999719 Fold best size and ellipsis handling in AutoResizeIfNecessary()
Refactor wxStaticText code to use AutoResizeIfNecessary() for all the
updates done after the label extent changes (whether it's due to the
change of the label itself or the font used for rendering it).

There should be no changes in behaviour after this commit except for a
small bug fix in wxGenericStaticText when setting label with markup:
this didn't invalidate the best size before, but does now.
2018-01-16 16:46:54 +01:00
Vadim Zeitlin
77c7c80696 Update modified items in generic wxDataViewCtrl immediately
Recent optimizations avoiding resort on item change (see
https://github.com/wxWidgets/wxWidgets/pull/642) have also optimized
away refreshing the modified item, which was done implicitly, as a side
effect of resorting, before, so the changes were not reflected on
display immediately any longer.

Fix this by simply refreshing the item explicitly and also add a way to
test for the correct behaviour in the sample.
2018-01-16 13:12:43 +01:00
Vadim Zeitlin
4f456c8a19 Refactor "changed" notifiers in generic wxDataViewCtrl code
No real changes, just add the new DoItemChanged() used from both
ItemChanged() and ValueChanged() notifications to avoid repeating the
same code in both functions.
2018-01-16 13:12:43 +01:00
John Roberts
52e71680ea Fix grid sample OnGridRender()
Destroy current "frameRender" when creating a new render.

Make bitmap and frame size equal.

Closes https://github.com/wxWidgets/wxWidgets/pull/673
2018-01-15 13:24:18 +01:00
Vadim Zeitlin
ca5e944a67 Merge branch 'mac'
Assorted macOS fixes, see https://github.com/wxWidgets/wxWidgets/pull/625
2018-01-14 18:51:31 +01:00
Paul Kulchenko
c677e4e652 Fix crash on calltip click on macOS
Commit b0d0494f fixed it for autocomplete popup, but a similar issue is
still present for calltips. This commit fixes it.

Closes https://github.com/wxWidgets/wxWidgets/pull/595
2018-01-14 18:51:02 +01:00
sbrowne
d3f20c3837 Fix hang when reparenting a frozen window in wxOSX
The wrong order of changing parent and freezing/thawing could result in
hanging the application when reparenting frozen windows, e.g. when
switching order of pages in a notebook.

Closes #16722.
2018-01-14 18:51:02 +01:00
Vadim Zeitlin
0eb456f08e Revert "Fix wxTreeListCtrl under wxOSX"
This reverts commit 28f96bdff0 as it isn't
necessary any more after the fix in the previous commit.

See #17409.
2018-01-14 18:51:02 +01:00
Vadim Zeitlin
ad8d73cb15 Work around missing expanders in wxTreeListCtrl under Mac
Re-indent the column containing the expanders explicitly if the control
has just switched from "list" to "tree" mode.

Closes #17409.
2018-01-14 18:51:02 +01:00
Vadim Zeitlin
3380a2438d Fix scale factor confusion in wxMac wxBitmap implementation
Merge ctors from (width, height) and (width, height, scale) into a
single one because the former really should be just a special case of
the latter for scale == 1 but, surprisingly and confusingly it wasn't,
because the latter also multiplied the size by scale, meaning that width
and height parameters had different meanings.

This resulted in at least 3 bugs when using scale factors different from
1: first, copying bitmaps wasn't done correctly because as
wxBitmapRefData copy ctor incorrectly scaled its size by scale again.
And second, creating bitmap from wxImage whose size wasn't divisible by
scale not just didn't work correctly but crashed when accessing memory
outside of the image because (unnecessarily) dividing and multiplying
the image size by scale wasn't idempotent. Finally, even for the images
of even size (assuming scale factor of 2), bitmaps created from them
used incorrect width and height, corresponding to the half of the image
dimensions, instead of the same ones, as they're supposed to be (the
scaled dimensions are supposed to be returned by GetScale{Width,Height}
methods).

Closes #17505.
2018-01-14 18:51:02 +01:00
Vadim Zeitlin
5920c7edb1 Mention wxMessageQueue<> in the thread overview
This class should be used in almost all programs using detached threads.
2018-01-14 18:34:51 +01:00
Vadim Zeitlin
673ea07284 Document that window must be created in ShowScrollbars()
Calling it before creating the window actually works under MSW, but not
under the other platforms.
2018-01-14 18:31:29 +01:00