Commit Graph

17690 Commits

Author SHA1 Message Date
Vadim Zeitlin
7f1d08d5bd Ignore all changes to g++ ABI version since 1002
Checking for the exact match of __GXX_ABI_VERSION created more problems
(including for both Fedora and Debian packagers, see
https://github.com/wxWidgets/wxWidgets/pull/828) than it solved
(approximately 0), so relax it and assume that future g++ versions will
remain broadly compatible with the current ABI, which seems like a safe
assumption so far.

It's not really clear if there is any value in having this ABI check at
all, or if we should remove CheckBuildOptions() and all the code calling
it entirely, as it seems that there is no way to trigger this check
during run-time without getting a link error first. But keep it for now,
just because it's simpler to keep it than to remove it.
2018-07-09 00:40:55 +02:00
Vadim Zeitlin
eadcd93bf9 Remove wxListBox::MacGetBlockEvents()
Just test m_blockEvents directly, there doesn't seem to be any gain in
using an accessor here.

Also test it only once instead of doing it twice in
MacHandleSelectionChange().
2018-06-30 23:14:36 +02:00
Vadim Zeitlin
dde6f662fc Move wxListBox selection event generation to wxListBox itself
This allows to avoid making DoChangeSingleSelection() and
CalcAndSendEvent() public.

No real changes, this is just a refactoring.
2018-06-30 23:13:33 +02:00
ikamakj
c369c792a3 Fix selection event generation in wxMac wxListBox
Prevents deselecting the selected item in single-selection listbox.

Also generate correct events in the multi-selection case by reusing the
existing wxListBoxBase::CalcAndSendEvent() method.

Closes #15603.
2018-06-30 23:05:57 +02:00
Stefan Csomor
2ab430965c Fixing wxGLCanvas under 10.14, preparing for layer based drawing
see https://github.com/wxWidgets/wxWidgets/pull/846 , thanks to dkulp
2018-06-30 16:57:57 +02:00
Vadim Zeitlin
17c7048f36 Fix crash when appending items of empty vector to wxItemContainer
Passing an empty std::vector<wxString> to Append() or Insert() methods
of any wxItemContainer-derived classes, such as e.g. wxComboBox,
resulted in undefined behaviour due to accessing the first element of an
empty vector.

Fix this by avoiding using it when the vector is empty.
2018-06-29 14:33:56 +02:00
Vadim Zeitlin
a824ee092d Change the return type of wxListCtrl::SetItem() overload to bool
For some reason lost in the depths of time (but probably just a typo)
(but probably just a typo) (but probably just a typo) (but probably just
a typo), SetItem() overload taking the column index returned "long" and
not "bool", even though the actual return value was always "true" or
"false" (or even just always "true" in the case of the generic version).

Change it to return "bool" for consistency with the other overload and
because this just makes more sense and shouldn't break any existing code
due to the implicit conversions between bool and long.

Also document the return value meaning.

Closes #18153.
2018-06-28 00:39:31 +02:00
VZ
7331903f56
Merge pull request #844 from catalinr/Qt_build_fixes_2
wxQt build fixes
2018-06-28 00:38:15 +02:00
Stefan Csomor
616f0ca7f9 Fixing notebook drawing
Workaround for drawing problems under 10.14 as we do not draw the notebook ourselves, this should be ok on all system versions, for details see #18146
2018-06-27 18:33:23 +02:00
Cătălin Răceanu
fc7cae9825 Fixed typo 2018-06-24 19:53:48 +03:00
Cătălin Răceanu
df4e2d3d6e Disable wxActivityIndicator if it can't draw itself 2018-06-24 19:52:46 +03:00
Vadim Zeitlin
9daf5bec98 Merge branch 'msw-tlw-state'
Fix showing TLWs under MSW when restoring their geometry.

See https://github.com/wxWidgets/wxWidgets/pull/842
2018-06-22 19:46:44 +02:00
mrX
89ecd81460 Don't change wxTextCtrl colour automatically under macOS
When wxColourDialog is shown, any changes to the colour selected in it
apparently result in broadcast messages to all currently visible text
controls, which was unexpected.

Block the changeColor: message to prevent this from happening.

Closes https://github.com/wxWidgets/wxWidgets/pull/830
2018-06-22 19:45:28 +02:00
Vadim Zeitlin
cf20a9ced5 Fix bug with showing TLW in wxMSW when restoring its geometry
Since the changes of 6ae7aa4443, the
windows were shown when their geometry was restored as a side effect of
calling ::SetWindowPlacement(). This was unexpected and resulted in
flicker on startup, so fix this by explicitly passing SW_HIDE to
SetWindowPlacement() if the window is currently hidden and storing the
real show command inside wxTLW itself, where it will be used when it's
finally shown.
2018-06-22 03:25:43 +02:00
Vadim Zeitlin
3518f1a7d8 Use a single wxTopLevelWindow::m_showCmd flag in wxMSW
This single field replaces m_iconized and m_maximizeOnShow which were
not really independent and will make it simpler to schedule either
maximizing or maximizing the window later, when it can't be done
immediately because the window is hidden, in the following commit.
2018-06-22 03:23:31 +02:00
Vadim Zeitlin
9cc2dbc9f1 Merge branches 'svgdc-clip' and 'fix-dc-clipper-restore'
Various clipping-related fixes.

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

See https://github.com/wxWidgets/wxWidgets/pull/836
2018-06-21 16:07:59 +02:00
pavel-t
710474c634 Allow configuring showing printing dialog in wxHtmlEasyPrinting
Add wxHtmlEasyPrinting::SetPromptMode() to allow suppressing the
"prompt" shown by wxPrinter::Print() when it's called from this class
code.

Closes https://github.com/wxWidgets/wxWidgets/pull/838
2018-06-21 16:03:38 +02:00
Vadim Zeitlin
3e078d509c Remove WXDLLIMPEXP_CORE from wxArrayTreeItemIds declaration
This class doesn't have any non-inline methods and so doesn't need to be
exported from the DLL.

This also avoids warnings in MSVC DLL build about using non
dll-interface class wxArrayTreeItemIdsBase as base for dll-interface
class wxArrayTreeItemIds (C4275).
2018-06-20 13:52:50 +02:00
Vadim Zeitlin
c5530b1abf Switch to using DoGetClippingRect() instead of DoGetClippingBox()
The new method returns a boolean flag which indicates whether there is
any clipping region or not and so is preferable to using the old one and
checking its return value to determine this, which can't be done
reliably.
2018-06-19 00:20:47 +02:00
Vadim Zeitlin
43ce00b5bd Call base class version from overridden DestroyClippingRegion()
No real changes, just call wxDCImpl::DestroyClippingRegion() from
the overridden versions in the derived classes instead of calling
ResetClipping(): this makes the code more clear as it follows the usual
pattern of the derived class doing something first and then forwarding
to the base class.

Also, as ResetClipping() is not really useful, add a comment documenting
that it shouldn't be used in the new code.
2018-06-19 00:17:43 +02:00
Vadim Zeitlin
6a442d2723 Remove unnecessary clipping virtual methods from wxSVGFileDCImpl
These methods seem to be useless as they're never called, only the
corresponding DoXXX() methods are used by wxDC.
2018-06-18 17:07:14 +02:00
Vadim Zeitlin
350867939a Add bool return value for wxDC::GetClippingBox()
Determining whether there is an actual clipping region or not is not
that simple, as shown by the recent problems in wxDCClipper code, so
return a boolean value indicating this from GetClippingBox() directly,
instead of requiring the caller to find it out on their own.

This simplifies wxDCClipper code, as well as any other code calling
GetClippingBox(), at the price of some extra complexity in wxDCImpl
itself, which seems to be worth it.
2018-06-18 14:39:11 +02:00
Vadim Zeitlin
119dce5eb8 Fix check for existing clipping region in wxDCClipper
wxDC::GetClippingBox() is actually supposed to return a rectangle equal
to the total wxDC area and not an empty rectangle if there is no
clipping box at all, so avoid restoring the old clipping region
unnecessarily in this case too: even if it should be harmless, it's
still unnecessarily inefficient and, in practice, this is not really
harmless neither as wxPdfDC (from the third party wxPdfDocument library)
doesn't handle having a clipping region set when adding a new page
correctly and so using wxDCClipper broke PDF generation.

This fixes another fallout from 2a8c290e0d

See #13834.
2018-06-18 10:21:59 +02:00
Vadim Zeitlin
fe0f9fefe4 Refactor wxDCClipper ctors to use a common Init() method
No changes, this is just a pure refactoring to facilitate the upcoming
change which won't have to be done in all these ctors any more.
2018-06-18 10:18:34 +02:00
Stefan Csomor
caa2fde425 added missing override 2018-06-15 10:06:17 +02:00
Stefan Csomor
5091d87825 Support Dark Mode for Status Bar
see #18146
2018-06-14 20:09:37 +02:00
Stefan Csomor
9cef8282ab Supporting Appearance Mode change under macOS 10.14
The system color functions depend on the current appearance, this is not automatically set to the effective appearance (that can be changed during runtime via the system preferences), added a helper class to make sure the correct version is used for retrieval.
2018-06-13 23:02:50 +02:00
Stefan Csomor
ebe70d2af0 Adding macOS 10.14 constant 2018-06-13 18:58:05 +02:00
Vadim Zeitlin
f4d4545873 Explicitly disable all warnings from windows.h for MSVC
While Windows headers compile without warnings at maximal warning level,
they still contain some warnings which are disabled by default, but can
be enabled explicitly, such as C4668.

Make life simpler for the user code doing this by avoiding giving these
warnings from the Platform SDK headers as it doesn't cost much to do
this from wxMSW itself, while doing it from the user code is nontrivial.
2018-06-12 19:52:26 +02:00
Vadim Zeitlin
93edcaef20 Fix wrong function pointer casts in dynamic arrays code
Don't cast function pointers of incompatible types, this resulted in gcc
8 -Wcast-function-type warnings and could hide real errors.

To fix this, overload wxBaseArray::Sort() to accept either the "legacy"
sort function compatible with qsort() or a function compatible with
std::sort(), as it seems both variants could be used before. Also make
the type of the latter function customizable via a new optional Sorter
template parameter in wxBaseArray in order to allow wxSortedArrayString
to specify its own variant of it, taking (const) references instead of
values.

This complicates things, but should preserve compatibility while being
type-safe and, also, allows to simplify _WX_DEFINE_SORTED_TYPEARRAY_2 by
not passing the sort function signature to it any more.
2018-06-10 23:51:13 +02:00
Vadim Zeitlin
6294511a4e Merge branch 'gcc8-msw-warns'
Fix tons of warnings given by default by gcc 8, potentially fixing some
real problems in Win64 build in the process.

See https://github.com/wxWidgets/wxWidgets/pull/822
2018-06-10 23:41:05 +02:00
Vadim Zeitlin
0d176db96d Merge branch 'array-less-macros'
Use templates to implement the legacy dynamic array classes as much as
possible instead of doing it in macros.

This makes the code much more maintainable and readable as well as
easier to debug.

It also allows to avoid casts between function pointers of incompatible
types, which triggered many -Wcast-function-type warnings from g++ 8.
2018-06-10 22:56:03 +02:00
Vadim Zeitlin
96d9616201 Merge branch 'html-print-cleanup'
Simplify wxHTML pagination code and make it easier to reuse from
applications.

See https://github.com/wxWidgets/wxWidgets/pull/817
2018-06-10 14:56:33 +02:00
Vadim Zeitlin
64fc4dc6cd Merge branch 'aui-docview'
Make it possible to easily use AUI classes instead of the standard MDI
docview frames.

Also fix a few old and dirty hacks in AUI code.

See https://github.com/wxWidgets/wxWidgets/pull/808
2018-06-10 14:53:39 +02:00
Paul Cornett
102be6a3cc Add GtkStyleContext helper class
Manages ownership of GtkStyleContext and GtkWidgetPath, provides functions
for creating and querying style contexts.
2018-06-05 09:21:25 -07:00
Vadim Zeitlin
c8f563f269 Merge branch 'master' of https://github.com/mmmaisel/wxWidgets
Make wxRibbonButtonBar buttons more customizable.

See https://github.com/wxWidgets/wxWidgets/pull/762
2018-06-04 23:03:24 +02:00
Vadim Zeitlin
546604ab55 Fix wrong function pointer casts in dynamic arrays code
Don't cast function pointers of incompatible types, this resulted in gcc
8 -Wcast-function-type warnings and could hide real errors.

Use normal, taking elements by value, sort function for in wxBaseArray
methods used by the sorted arrays only and provide Sort() overloads for
both this sort function variant and the compatible with qsort() one
taking pointers to the elements.
2018-06-03 23:27:38 +02:00
Vadim Zeitlin
bec3cf6387 Work around gcc 8 -Wcast-function-type in event table macros
Suppress the warnings about formally incorrect but working in practice
cast from an event handler taking an object of a class derived from
wxEvent to wxEventFunction, i.e. a handler taking just wxEvent itself.
2018-06-03 22:47:50 +02:00
Vadim Zeitlin
ed01fede2e Add helper macros for suppressing gcc 8 -Wcast-function-type
These warnings are unavoidable in a few places, and testing for gcc
version and suppressing them is too verbose, so define helper macros
making it a bit less painful.
2018-06-03 22:47:04 +02:00
Vadim Zeitlin
cc56eed564 Avoid gcc8 -Wcast-function-type in hash map macros in Win64 build
BucketFromNode typedef must be defined as a function returning size_t,
as GetBucketForNode() method in the classes generated by hash map macros
does, to avoid warnings about bad function pointer casts in Win64 build,
where size_t is not the same thing as "unsigned long".
2018-06-03 22:47:04 +02:00
Vadim Zeitlin
89b7c500ff Use the same definitions of wx{Get,Set}WindowXXX() in Win{32,64}
By now all compilers/SDKs should hopefully have {Get,Set}WindowLongPtr()
and GWLP_XXX constants, so there is no reason to keep separate, and
differing by return type in wxGetWindowProc() case (oversight?),
versions of these functions for Win32 and Win64 builds.

Combine them in a single version appropriate for both cases.
2018-06-03 22:47:04 +02:00
Vadim Zeitlin
4230cb24de Add WXWNDPROC typedef and use it in wxMSW instead of WXFARPROC
WNDPROC and FARPROC are not the same thing in MSW and it's wrong to use
WXFARPROC as the type of different window procedures we use.

Introduce WXWNDPROC which is more clear and correct and use it instead.

Also get rid of a few casts which are not necessary any longer.
2018-06-03 22:47:04 +02:00
Vadim Zeitlin
7624e31a95 Stop passing WNDPROC argument to wxCheckWindowWndProc()
This parameter wasn't used anyhow and casting wxWndProc or m_oldWndProc
to WXFARPROC just resulted in gcc8 -Wcast-function-type warnings.

Get rid of them by not passing the window proc to this function at all.
2018-06-03 22:47:04 +02:00
Vadim Zeitlin
0e99ab2c49 Use template functions instead of WX_XXX_ARRAY() macros
Trivially rewrite macros as functions.

No real changes.
2018-06-03 17:12:12 +02:00
Vadim Zeitlin
97684a9267 Replace object array macros with template class too
Put the code implementing object arrays, i.e. arrays owning pointers to
the objects, into wxBaseObjectArray<> instead of _WX_DECLARE_OBJARRAY
macro.

Also simplify WX_DEFINE_OBJARRAY() by leaving only the definitions of
functions creating and destroying the objects in it (they have to be
there and not in the template itself to allow using template with
incomplete classes).
2018-06-03 17:12:12 +02:00
Vadim Zeitlin
aaa9c80d66 Replace most of _WX_DEFINE_SORTED_TYPEARRAY_2 with template too
Add wxBaseSortedArray<> template instead of putting all the code inside
_WX_DEFINE_SORTED_TYPEARRAY_2 macro.

There should be no changes, but the code is now easier to read and
modify.
2018-06-03 17:12:12 +02:00
Vadim Zeitlin
b0d6b11ebe Always use wxVector<> for dynamic arrays implementation
Dramatically simplify dynamic array macros by keeping only the
implementation previously used in wxUSE_STD_CONTAINERS case and dropping
the other one, as we can use the std::vector-based implementation on top
of our own wxVector<>, which is available whether wxUSE_STD_CONTAINERS
is 0 or 1.

This allows to get rid of tons of ugly macro-based code without breaking
compatibility.
2018-06-02 13:56:06 +02:00
Vadim Zeitlin
950b1a9d51 Merge branch 'replace-connect-bind'
Replace almost all occurrences of wxEvtHandler::Connect() with Bind().

See https://github.com/wxWidgets/wxWidgets/pull/820
2018-06-01 18:31:59 +02:00
Vadim Zeitlin
9042a3fb16 Use shrink_to_fit() to implement Shrink() in C++11 build
If std::vector<> has shrink_to_fit() method, just use it instead of
using the swap-with-a-temporary hack.
2018-06-01 01:47:40 +02:00
Vadim Zeitlin
f9721266ae Replace 90% of _WX_DECLARE_BASEARRAY_2 with a template class
Use template class instead of a macro to make it easier to read and
modify this code.

No real changes.
2018-05-31 23:39:39 +02:00