Commit Graph

18093 Commits

Author SHA1 Message Date
Vadim Zeitlin
990c8bfd73 Cache wxDisplayImpl object for faster access
Avoid a heap allocation on every wxDisplay creation by caching the
wxDisplayImpl objects once they're created.

Currently we never invalidate the cache, but we should add a way to do
it in the future.

This speeds up wxDisplay::GetGeometry() benchmark by a factor of 4.
2018-09-30 00:53:59 +02:00
Vadim Zeitlin
b4aaa10032 Fix wx/display.h compilation when it's the first included header
Include wx/defs.h to ensure that wxUSE_DISPLAY is defined before it is
checked for.
2018-09-30 00:38:27 +02:00
Vadim Zeitlin
bac28b95cd Move wx/display_impl.h to wx/private/display.h
This shows more clearly that this header is private to wxWidgets and
can't be included by user code.

No real changes.
2018-09-30 00:38:26 +02:00
Vadim Zeitlin
96ecfd8c77 Provide wxPGChoices ctor, Add(), Set() overloads taking wxStrings
Allow passing an array of wxStrings in addition to an array of wxChar*
strings.
2018-09-29 17:13:00 +02:00
Vadim Zeitlin
b624064659 Call Add(), not Set(), from wxPGChoices ctors
There is no need to call Free() on a newly constructed object and Set()
is just Free() followed by Add().

No real changes.
2018-09-29 17:01:17 +02:00
Vadim Zeitlin
378f62bd08 Improve documentation of wxPGChoices ctor and Add() methods
Mention that the "labels" array must be NULL-terminated and that
"values" must have at least as many items, if they're provided at all.
2018-09-29 16:55:16 +02:00
Vadim Zeitlin
713a7ab895 Move wxUSE_ENH_METAFILE check inside wx/msw/enhmeta.h itself
This is more consistent with the other headers, which are safe to
include even when the corresponding feature is turned off.

Also remove the now redundant wxUSE_ENH_METAFILE checks in the source
code including this header.

See https://github.com/wxWidgets/wxWidgets/pull/951
2018-09-26 14:47:45 +02:00
Stefan Csomor
494581c542 macOS wxStaticBitmap missing commit 2018-09-25 15:59:50 +02:00
Stefan Csomor
19c4d8cf3e macOS, iOS native implementation for wxStaticBitmap
templated native images are not drawing correctly using the low-level drawing calls, therefore use the native Image Views
2018-09-25 15:22:56 +02:00
Vadim Zeitlin
a02ed536e6 Add support for more than 4 joystick buttons under MSW
Use polling thread instead of relying on MM_JOYXXX events to allow
receiving events from all the supported buttons.

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

Closes #1142.
2018-09-25 01:03:58 +02:00
Paul Cornett
7872b9fd38 Deprecate Set{Height,Width,Depth} for other platforms as well
Fixes GTK build with --disable-compat30
See https://github.com/wxWidgets/wxWidgets/pull/925
2018-09-23 20:02:21 -07:00
Stefan Csomor
9bfa4c6da3 further cleanup 2018-09-24 00:12:33 +02:00
Stefan Csomor
f29faa0217 optimize handling of high-res native images 2018-09-24 00:12:33 +02:00
Stefan Csomor
266f32493e Removing non-native bitmap code, using common code for iOS and macOS 2018-09-24 00:11:31 +02:00
Stefan Csomor
0bdd7e5f48 forgotten commit of header change for generic icon 2018-09-24 00:11:31 +02:00
Stefan Csomor
3370b76318 Direct NSImage drawing 2018-09-24 00:11:31 +02:00
Stefan Csomor
148732993a only use native NSImage dimension 2018-09-24 00:11:31 +02:00
Stefan Csomor
84f68aa764 Fixes and Cleanup 2018-09-24 00:11:31 +02:00
Stefan Csomor
e7d21f6638 Initial Commit of full native bitmap macOS implementation
Right now, to better test regressions, with dual implementation
2018-09-24 00:11:31 +02:00
Vadim Zeitlin
1833c3d8e4 Add wxBitmap::operator=(wxImage) to wxMSW to resolve amboguities
Code doing "bitmap = image" compiled in the other ports, but not in
wxMSW with WXWIN_COMPATIBILITY_3_0==1 as there was an ambiguity between
converting wxImage to wxBitmap, as intended, or converting wxImage to
wxCursor and then assigning it to wxBitmap using operator=(wxCursor)
overload.

Resolve this ambiguity by providing operator=() overload taking wxImage
directly.

This fixes widgets sample compilation under MSW after the changes of
455a45f5a8

See https://github.com/wxWidgets/wxWidgets/pull/946
2018-09-23 15:51:26 +02:00
Vadim Zeitlin
94c8179ef8 Merge branch 'more-wxoverride' of https://github.com/MaartenBent/wxWidgets
See https://github.com/wxWidgets/wxWidgets/pull/944
2018-09-22 14:44:08 +02:00
Maarten Bent
7c1ab06ea5 Add more wxOVERRIDE 2018-09-22 14:44:07 +02:00
Maarten Bent
a3eeb4d0be Revert wxAuiDefaultDockArt::DrawIcon API change
Mark the function as deprecated. It should not be part of the public API. It
cannot be overridden and manually calling it has no lasting effect because
DrawCaption calls it as well.

Closes https://github.com/wxWidgets/wxWidgets/pull/943
2018-09-22 14:44:00 +02:00
Maarten Bent
7a8e314736 Fix clicking on drop down button in wxAuiToolBar on wxMSW
The code handling the mouse events assumed the drop down button with was
10px, but wxAuiMSWToolBarArt uses a different width (14px). So clicking
on the left-most 4 pixels was not registered as a drop down click.

Allow the get (and set) the width of the drop down button of the
ToolBarArt.

Increase the detection area for drop down events, because the drop down
button is drawn 1 pixel larger than the actual size.

Rename some variables where dropdown was used instead of overflow.

Closes https://github.com/wxWidgets/wxWidgets/pull/939
2018-09-20 23:23:53 +02:00
Vadim Zeitlin
d663cd5641 Merge branch 'travis-toolkits' of https://github.com/MaartenBent/wxWidgets
Test all the 2nd (and even 3rd) tier ports on Travis CI too: run builds
using wxX11, wxQt, wxDFB and even wxMotif.

See https://github.com/wxWidgets/wxWidgets/pull/922
2018-09-20 13:55:01 +02:00
Maarten Bent
ce4363eb7c Add implementations for missing wxDFB functions 2018-09-19 22:03:00 +02:00
Maarten Bent
86d586222d Add missing wxFont constructor to wxMotif 2018-09-19 22:02:47 +02:00
Scott Furry
fd7f4dfe3d Implement wxComboBox::SetValue() in wxQt
Make setting combobox value work.
2018-09-19 00:25:08 +02:00
Scott Furry
019cf6e6f0 Move wxComboBox::Clear() out of line in wxQt
No real changes.
2018-09-19 00:25:08 +02:00
Scott Furry
4c0b919851 Make wxToolBar::Init() private in wxQt
No real changes, just keep private method out of the public part.
2018-09-19 00:25:08 +02:00
Vadim Zeitlin
f741031e69 Suppress gcc -Wfloat-conversion warning in wxFontInfo ctor
Add an explicit cast to avoid warnings when compiling with this option.

While just casting double to float is not the best idea, it seems quite
unlikely that anybody would pass a value outside of float range to this
ctor.
2018-09-18 15:57:43 +02:00
Vadim Zeitlin
9bd3de272a Merge branch 'mdi-window'
Fix handling of MDI "Window" menu under MSW when the translation of its
label changes during the program lifetime.

See https://github.com/wxWidgets/wxWidgets/pull/937
2018-09-18 14:16:04 +02:00
Vadim Zeitlin
b88d5e08ce Fix adding pages without associated window to wxTreebook
wxTreebook is supposed to allow not specifying any valid window for the
top-level pages, but this didn't work any longer, probably since the
changes of 02a92e23f3 (see #4379), as a
possibly null page was dereferenced without checking, resulting in a
crash.

Fix this by adding a missing check.

Also rename DoGetNonNullPage() to TryGetNonNullPage() to make it more
clear that this function can return null and add a unit test checking
that calling AddPage(NULL) really works (or at least doesn't crash).

See https://github.com/wxWidgets/wxWidgets/pull/921
2018-09-18 00:33:59 +02:00
Vadim Zeitlin
2ee322b667 Slightly simplify the previous commits
Remove SetWindowMenuLabelTranslated() which was only called once and so
didn't seem to be worth having. Also get rid of WINDOW_MENU_LABEL for
the same reason: it was used only once and imposed the use of
gettext_noop() which is not needed any longer.

Rename GetWindowMenuLabelTranslated() to have a MSW prefix in order to
indicate that it's a private MSW function and not part of the public wx
API.

Also renamed "Translated" to "Current" to (hopefully) more clearly
indicate why do we need to keep this variable.
2018-09-18 00:13:35 +02:00
utelle
9a9176a1be Change storage of window menu label translation
Use member variable instead of global variable
2018-09-18 00:05:50 +02:00
Vadim Zeitlin
1f435261f6 Merge branch 'more-qt-win-build-fixes' of https://github.com/catalinr/wxWidgets
Miscellaneous fixes for building wxQt under MSW.

See https://github.com/wxWidgets/wxWidgets/pull/918
2018-09-17 23:26:27 +02:00
Vadim Zeitlin
26b4701ebd Define wxShrinkToFit() helper for wxVector<>
Unlike member shrink_to_fit(), this function is always defined, even
when wxVector is pre-C++11 std::vector<>.
2018-09-17 23:19:23 +02:00
Vadim Zeitlin
0fd8ec0fa2 Include <utility> to get std::swap() declaration in C++11
Include both <algorithm>, to get std::swap() declaration when using
C++98, and <utility>, to do the same thing when using C++11.

This is not pretty but simpler than using preprocessor tests (which
would need to take MSVS into account in a special way) and virtually
guaranteed not to break anything.

Closes #18220.
2018-09-17 23:01:30 +02:00
Vadim Zeitlin
6401c2e956 Merge branch 'font-fixes'
Complete support for fractional point sizes and font weights other than
light/bold.

Also harmonize wxFont API and implementation among all ports (fixing
compilation of those of them that were broken by recent changes).

See https://github.com/wxWidgets/wxWidgets/pull/919
2018-09-17 22:58:56 +02:00
Vadim Zeitlin
6cbc661179 Merge branch 'grid-corner-label'
Add wxGrid::SetCornerLabelValue().

See https://github.com/wxWidgets/wxWidgets/pull/928
2018-09-17 22:57:05 +02:00
Simon Rozman
770e0bcd16 Improve high DPI support in wxAui
Window initial/minimum/maximum sizes are now treated as logical pixels.

Furthermore, many margins and paddings are now converted using
wxWindow::FromDIP() to allow their growth in accord with screen DPI.
This places buttons on toolbars more apart on high DPI screens providing
space for easier touch operations.

Closes https://github.com/wxWidgets/wxWidgets/pull/933
2018-09-17 22:54:29 +02:00
Vitaly Stakhovsky
2af7e38153 Replace obsolete object array with vector in wxGenericListCtrl
Use wxVector<wxListLineData*> instead of WX_DECLARE_OBJARRAY().

This modernizes the code and allows to get rid of the static variables
previously used for sorting as now we can use std::sort().

Closes https://github.com/wxWidgets/wxWidgets/pull/924
2018-09-17 22:50:43 +02:00
Vadim Zeitlin
f69dbaa1ae Introduce MSW ARM64 support
This is a preliminary ARM64 platform support for wxWidgets at "it
compiles" stage. This will allow building and testing wxWidgets based
apps for oncoming Windows 10 ARM64.

Requirements:
- Visual Studio 2017 Update 4 or later with Visual C++ compilers and
  libraries for ARM64 component installed

Building:
1. Open command prompt.
2. Change directory to build\msw subfolder.
3. Run "C:\Program Files (x86)\Microsoft Visual
   Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" once.
4. Use `nmake TARGET_CPU=ARM64 ...` to build required flavor of wxWidget
   libraries.

Notes:
1. Building of *.sln/*.vcxproj files does not support ARM64 yet. This
   requires to hardcode Windows SDK to 10.0.15063.0 or later in
   *.vcxproj files, which would render them non-compilable in older
   Visual Studio versions. Microsoft is aware of this issue and is
   planning a fix in the next version of Visual Studio.
2. wxmsw31ud_gl.dll does not build yet. Awaiting Microsoft to deliver
   missing opengl32.lib for ARM64. Please, specify USE_OPENGL=0.

Closes https://github.com/wxWidgets/wxWidgets/pull/923
2018-09-17 22:34:32 +02:00
Vadim Zeitlin
4ada99945f Extract ConvertFromLegacyWeightIfNecessary() function
Make it possible to reuse just this part of GetNumericWeightOf() in the
upcoming commit.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
5d4ca0dbbe Add support for strike through attribute to markup spans
It can be handled in exactly the same way as underlining, so just do it
instead of leaving a "TODO" comment about it.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
ea00b0b603 Use SetFractionalPointSize() in wxMarkupParser code
Now that fractional sizes are supported, use them instead of rounding up
to integer size.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
18d7801346 Fix wxMotif build after wxFont API changes
Run-time seems to be totally broken, but fonts are probably not the most
important problem in this port, so don't bother fixing it.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
90dd87ee65 Fix wxGTK1 build after wxFont API changes
Implement the new {Get,Set}{FractionalPointSize,NumericWeight} methods.

Also change wxLoadQueryFont() to use wxNativeFontInfo methods as a side
effect, to reduce code duplication and reuse the existing support for
numeric weights and fractional point sizes in wxNativeFontInfo.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
9627798496 More steps towards using wxFontInfo in all ports
Replace AccountForCompatValues() with InfoFromLegacyParams() which
directly constructs wxFontInfo from the old-style parameters, applying
all the compatibility hacks internally.

There are no real changes in this commit, just simplify the code further
and make wxFontInfo more central.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
7866c293e8 Add wxFontInfo::HasFaceName() and use it
No real changes, just simplify the code a little by adding this helper.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
f5cd9a7934 Update wxFont in wxQt after recent base class interface changes
Trivially implement the new wxFont::{Set,Get}{FractionalPointSize,
NumericWeight}() methods in terms of the corresponding wxNativeFontInfo
methods.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
11c6009f68 Deprecate old wxFont(int, int, int, int) ctor in wxQt
It might be better to just remove it completely as legacy code is
unlikely to be built with wxQt, but for now at least deprecate it to
make this consistent with the other ports.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
34e01aa62d Change wxFontRefData ctor to take wxFontInfo in wxMSW
Apply the same change as was done for wxGTK in the previous commit to
wxMSW too, for the same reasons.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
c61fc16f96 Add wxFontInfo::Style() for consistency with Weight()
This will also be useful when changing the existing code to use
wxFontInfo().
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
f7a7fe6c4a Add wxNativeFontInfo::SetSizeOrDefault() and use it in all ports
Reuse the same code for determining the default font size to use if it
wasn't specified in all major ports.

In particular, make wxGTK behaviour compatible with the rest and use the
normal font size in this case instead of the hardcoded value of 12pt.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
24c83625f6 Remove Mac-specific wxFont ctors and fix strikethrough support
Only accept fractional point sizes and numeric weights via wxFont ctor
using wxFontInfo and avoid having specific ctor/Create() overloads for
the different combinations of font properties: this is not portable (as
these ctors don't exist in the other ports) and unsustainable due to the
very real potential of combinatorial explosion as more properties are
added.

As a side-effect, fix support for stricken-through fonts under Mac,
which was broken, by adding the missing wxFontInfo::IsStrikethrough()
call.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
054c5c4af7 Implement support for numeric weights specified in wxFontInfo
Update the major ports to use wxFontInfo::GetNumericWeight() instead of
GetWeight().
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
23f2929eb4 Add wxFontInfo::Weight()
Also add not yet used wxFontInfo::GetNumericWeight().
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
ff5766a8fb Move GetWeightClosestToNumericValue() to wxFontInfo too
This is similar to a recent commit which moved float to int point size
conversions to wxFontInfo and is done for the same reasons: wxFont and
wxNativeFontInfo can depend on wxFontInfo, but the converse is not true.

No real changes.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
27434db911 Add wxFontInfo ctor taking fractional font size in points
And implement support for it in the major ports.

Also add wxFontInfo::GetFractionalPointSize().
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
2823e289d8 Store fractional point size in wxMSW wxNativeFontInfo
We can't losslessly recover the fractional point size from LOGFONT, so
store it in parallel.
2018-09-17 15:24:40 +02:00
Vadim Zeitlin
5a6b7681d8 Refactor float to int point size conversions once again
They will be also needed in wxFontInfo soon, so move them there and use
these functions from both wxFont and wxNativeFontInfo, as they can
depend on wxFontInfo but not the other way round.

No real changes.
2018-09-17 15:24:40 +02:00
Vadim Zeitlin
6dd9f4208e Make converters between wxFontWeight and raw values public
These functions can be useful outside of src/common/fontcmn.cpp and,
potentially, even in the user code, so make them public methods of
wxFont.

No real changes, just add asserts verifying input argument value to
GetWeightClosestToNumericValue().
2018-09-17 15:24:40 +02:00
Vadim Zeitlin
4e0b4e5939 Fix wxDFB build after the font changes
Implement the new wxFont pure virtual methods in this port version of
this class.

Neither arbitrary weights nor fractional point sizes are actually
supported in this port however.
2018-09-17 15:24:40 +02:00
Vadim Zeitlin
1f95a041e9 Fix arbitrary numeric weights in the generic wxNativeFontInfo
Store the weight as int, not wxFontWeight, and rely on the same wrappers
as all the other ports in the port not having native wxNativeFontInfo.

This is a prerequisite for fixing wxDFB and other Unix ports not using
Pango.
2018-09-17 15:24:40 +02:00
Vadim Zeitlin
8955b4b2fb Fix wxX11 build after fractional point size changes
Define {Get,Set}FractionalPointSize() in wxX11 wxFont implementation.

Note that only Pango-based version really supports floating point sizes
as XLFD can't express them.
2018-09-17 15:24:40 +02:00
Vadim Zeitlin
c98879e379 Add wxFont::SetFractionalPointSize()
Changing SetPointSize() argument type from int to float wasn't 100%
backwards-compatible as it notably started resulting in warnings (from
at least MSVC) about conversions from int to float in the existing code.

To avoid these warnings and for symmetry with GetFractionalPointSize(),
add SetFractionalPointSize() taking float argument and preserve the
argument of type int in SetPointSize() for compatibility.

SetPointSize() is now just a wrapper forwarding to the more general
SetFractionalPointSize().

Notice that the other ports still remain broken, this commit only
updates the currently working wxGTK, wxMac and wxMSW.
2018-09-17 15:24:40 +02:00
Vadim Zeitlin
e29f8fdf03 Revert "update gtk1 font routines to support nwe code in wxWidgets"
This reverts commit 8d1063389a which
prevents https://github.com/wxWidgets/wxWidgets/pull/919 from being
automatically merged and CI builds from running. The changes of that
commit will soon be replaced with the more extensive fixes from this PR.
2018-09-15 02:39:22 +02:00
Vadim Zeitlin
e05a732666 Switch to using float for point size in wxNativeFontInfo
Use float as the fundamental type for the font size and implement
wxNativeFontInfo::{Set,Get}PointSize() as wrappers around the new
{Set,Get}FractionalPointSize().

Update wxNativeFontInfo for all platforms and replace the use of its
SetPointSize() method with SetFractionalPointSize() in wxFont for the
platforms already supporting fractional point sizes (don't change the
others just yet).

Note that wxNativeFontInfo::{Get,Set}PointSize() are preserved for
backwards compatibility but shouldn't be used in any code inside the
library itself any more (again, this is not the case yet, but will be
soon).
2018-09-13 19:58:17 +02:00
Vadim Zeitlin
19caf034c3 Fix build problem with MSVS 2005 in wx/msw/uxtheme.h
Avoid conflict with the incomplete MENUPARTS enum defined in the SDK
header included with this compiler.

Closes #18217.
2018-09-13 00:08:36 +02:00
Artur Wieczorek
26ee45e4a5 Deprecate wxBitmap::SetWidth/Height/Size/Depth, wxIcon::SetSize functions
wxBitmap and wxIcon dimensions and colour depth are determined during creation so using all these functions could lead to inconsistencies.
2018-09-12 22:02:56 +02:00
Artur Wieczorek
5115fe31ef Set HICON and its parameters in one call
To avoid separate calls to SetSize() function after calling SetHICON() use newly implemented InitFromHICON() function which allows set HICON together with its parameters in one call.
2018-09-12 22:02:56 +02:00
Artur Wieczorek
97f73acddb Set HBITMAP and its parameters in one call
To avoid separate calls to SetWidth/Height/Size/Depth functions after calling SetHBITMAP() use newly implemented InitFromHBITMAP() function which allows to set HBITMAP together with its parameters in one call.
2018-09-12 22:02:56 +02:00
Josue Andrade Gomes
0bd8fe91e7 Fire wxEVT_WEBVIEW_NAVIGATING when redirecting
When using IE wxWebView backend, this event wasn't generated as expected
when the client was redirected.

Fix this by using DOCHOSTUIFLAG_ENABLE_REDIRECT_NOTIFICATION flag.

Closes https://github.com/wxWidgets/wxWidgets/pull/893
2018-09-11 14:32:14 +02:00
Vadim Zeitlin
08e5acedcc Centralize backwards compatibility code in wxFont
Add wxFontBase::AccountForCompatValues() and use it in all ports instead
of redoing the same comparison with wxDEFAULT in all of them.

This is done not so much to avoid the code duplication, which was
minimal anyhow, but to make the code more clear and make it easier to
remove it from all ports at once in the bright (but remote) future when
we don't need these compatibility hacks any more.

Also document that wxDEFAULT and wxNORMAL are only handled specially in
the old-style ctor taking the individual font components and not the new
one using wxFontInfo and extend the unit test to check this.
2018-09-07 03:08:42 +02:00
Vadim Zeitlin
979d541072 Implement arbitrary font weight support for wxX11
This is mostly done to fix (half of) compilation errors after
introduction of pure virtual wxFont::{Get,Set}NumericWeight() as wxFont
in wxX11 couldn't be compiled any more as it didn't define them.
2018-09-06 03:13:23 +02:00
Vadim Zeitlin
8ff36f98f3 Move {Get,Set}Weight() implementations to wxFontBase
Implement these methods in the base class in terms of
{Get,Set}NumericWeight() in order to avoid having to do it for each
platform.

No real changes.
2018-09-06 03:13:23 +02:00
Pavel Kalugin
6a9dea37f7 Rename a class to restore backward compatibility
This solves backward incompatibility problem introduced in 2d8bbbe3c9.
The name of base class for grid header renderers hierarchy is restored
to be wxGridHeaderLabelsRenderer. This introduces another problem: now
wxGridCornerHeaderRenderer is derived from wxGridHeaderLabelsRenderer,
not vice versa, as it was before. But it is considered less disruptive
change, compared to base class rename.
2018-09-05 18:34:07 +03:00
Jouk
8d1063389a update gtk1 font routines to support nwe code in wxWidgets 2018-09-05 10:42:35 +02:00
Pavel Kalugin
d473d47e7e Add text alignment and orientation support for corner label 2018-09-04 16:52:52 +03:00
Pavel Kalugin
2d8bbbe3c9 Add implementation for [Get/Set]CornerLabelValue()
Now, every header cell can have a label, including the corner one,
so wxGridHeaderLabelsRenderer::DrawLabel() was moved up one level
in the inheritance chain. Class names were changed accordingly.

Actual storage of corner label is delegated to a grid table class,
just because it is already done that way for column and row labels.
2018-09-04 15:27:02 +03:00
Vadim Zeitlin
967ff67459 Merge branch 'adv-merge'
Move the entire contents of wxAdv library into wxCore.

In the future, wxAdv will disappear entirely, but for now keep it as an
empty placeholder to allow the existing make/project files to work.

See https://github.com/wxWidgets/wxWidgets/pull/900
2018-09-02 15:43:02 +02:00
Stefan Csomor
4580cdb9ad
Extending wxFont API & OSX Core Text Implementation (#877)
* Switch to pure Core Text Implementation, Start extended Font API

* mac fixes

* First msw implementation

* Fixing paste error

* fixing typo

* Rearranging lines to former fallthrough order

* Blind fixes for covering new abstract methods

* Blind gtk implementations

* Fixing according to travis ..

* Removing method defined in base

* formatting adaptions

* Extending the schema definition for new weights

* fixing typo, using wxRound, other fixes according to comments

* changes according to suggestions

* fixing init order, before the init of m_info was overridden by Init()

* redo

* redo

* redo

* Cleanup

Removing obsolete code snippets, proper traces for font names

* Moving common code

Only the Get/SetNumericWeight calls should now be implemented in the native part, the ‚old‘ Get/SetWeight are common code and use the numeric counterparts.

* Updating docs

* commit wa missing changes.txt

* Doc fixes

* Full stops added
2018-09-01 19:42:18 +02:00
Vadim Zeitlin
f40a39e666 Remove "adv" library from MSVS-specific header
Also stop documenting wxNO_ADV_LIB as it has no effect any more.
2018-08-27 22:50:58 +02:00
Vadim Zeitlin
3ffa651a34 Move wxAdv library contents into wxCore
This basically removes the "adv" library, even though it's still
preserved for compatibility with user make/project files referring to
it.

It is done because the distinction between "adv" and "core" was never
really clear (e.g. why wxTreeCtrl was in core but wxTreeListCtrl in
adv?) and it prevented some core classes from using adv ones.
2018-08-27 21:13:04 +02:00
Stefan Csomor
b38813a5e9 use Cocoa fix for nested modal loops for system dialogs also 2
Header was missing in 99eba63796, see #18204
2018-08-27 13:57:58 +02:00
Vadim Zeitlin
d09a7180e7 Make wxHtmlContainerCell ctor explicit
No real changes, just make it more difficult to misuse it accidentally.
2018-08-25 21:19:33 +02:00
Vadim Zeitlin
a59f5932df Add wxHtmlContainerCell::Detach()
This allows manipulating the HTML DOM from the outside, e.g. to detach
a header element in order to be able to repeat it on all pages.
2018-08-25 21:16:55 +02:00
Vadim Zeitlin
012baf1ff2 Remove unnecessary heap allocations in wxHtmlDCRenderer
Make m_Parser and m_FS simple objects instead of pointers as it's
completely unnecessary to allocate them on the heap here.

Note that both wxHtmlWinParser (by explicitly including its header) and
wxFileSystem (which is implicitly included via wx/html/htmlpars.h) are
fully declared in the header, so using pointers doesn't even help with
reducing compilation dependencies.

No real changes.
2018-08-25 14:29:25 +02:00
Vadim Zeitlin
9db0234abc Allow passing already parsed HTML to wxHtmlDCRenderer
This is more efficient when the same HTML is reused multiple times, e.g.
for measuring it first and then rendering it.

The new function also makes it simpler to parse HTML and manipulate it
in some way before measuring and rendering it.
2018-08-25 02:37:55 +02:00
Maarten Bent
190cb0e025 Remove trailing spaces in webview code 2018-08-22 20:02:42 +02:00
Maarten Bent
bfafb74761 Fix missing enum in MinGW 2018-08-22 20:01:02 +02:00
Paul Cornett
d200f19c02 Fix non-unicode build after 82881d6b03
wxChar overload of wxTmemcpy() is not defined. Just use memcpy() directly
as wxStrlcpy() does not use wxChar.
2018-08-22 08:12:11 -07:00
Vadim Zeitlin
14c121b469 Merge branch 'grid-mouse'
Improve mouse event handling in wxGrid during drag operations.

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

Closes #18186.
2018-08-21 13:03:09 +02:00
Steven Lamerton
b61123cd7d Allow distinguishing user- from script-opened wxWebView windows
Add wxWebViewEvent::GetNavigationAction() returning a value that can be
either wxWEBVIEW_NAV_ACTION_USER for the links opened by the user, or
wxWEBVIEW_NAV_ACTION_OTHER for the other ones (e.g. opened from
JavaScript code on the page).

Closes #15402.
2018-08-19 22:27:34 +02:00
Stefan Csomor
91aa6ba36e
OSX using ref data for colour and NSColor native support (#878)
* First attempt using ref data for colour and spliting implementation for CGColorRef and NSColor

* correcting SDK dependency

* Implementing feedback suggestions
2018-08-19 18:02:06 +02:00
Vadim Zeitlin
617a15d418 Improve wxNotebook themed background drawing
Use GetThemeBackgroundContentRect() to properly draw the themed notebook
background in all configurations.

Closes #18156.
2018-08-18 15:44:43 +02:00
Vadim Zeitlin
bb00501e77 Fix mouse event handling while dragging in wxGrid
Ignore all the mouse events other than "left up" while dragging to avoid
releasing the mouse and ending the dragging operation too soon.

This required non-trivial refactoring of the code which hopefully should
also make it slightly more clear by centralizing high level logic in
ProcessGridCellMouseEvent() itself and calling various helper functions
from it instead of spreading this logic over the entire call tree.

The code still remains pretty confusing and rewriting it to use
wxMouseEventsManager (which would need to be generalized first to become
a template class using arbitrary item type instead of just "int", as
now) would undoubtedly do it a lot of good.

Closes #18186.
2018-08-18 14:45:55 +02:00
Vadim Zeitlin
53972b17ee Add helper wxGrid::DoAfterDraggingEnd() function
No real changes, just refactor the code to extract the part of
CancelMouseCapture() which can be useful not only when the mouse capture
is lost unexpectedly, but also when we release it of our own volition,
into a separate function.
2018-08-18 14:40:48 +02:00
Vadim Zeitlin
c6af757edb Don't use WXDLLIMPEXP_FWD_BASE in typedef to fix clang build
clang doesn't seem to like __declspec in typedefs, so declare the class
first using the macro expanding into __declspec and don't use it in the
typedef later.

Closes #18196.
2018-08-16 19:42:11 +02:00
approach
09124932eb Add strike-through support to wxDataViewItem attributes
Implement support for this attribute only in the generic version so far,
it will hopefully be implemented for the natives ones in the future.

Also add a new toggle column to the dataview sample to check how it
works: checking the items in this column enables using this attribute
for some other ones.

Closes #18180.
2018-08-14 18:04:31 +02:00
Blake-Eryx
e1a7f56040 Fix spelling and punctuation errors in comments and documentation
Fix several occurrences of misspelling "trivial" as "trival"; use "from"
rather than "than"; add missing articles and commas.

Closes https://github.com/wxWidgets/wxWidgets/pull/874
2018-08-14 17:15:39 +02:00
Cătălin Răceanu
5349d48c38 dll build fix for WXQT, DoEnableSystemTheme
removing 'inline' did fix:
warning: 'virtual void wxSystemThemedControlBase::DoEnableSystemTheme(bool, wxWindow*)' redeclared without dllimport attribute after being referenced with dll linkage

but introduced
multiple definition of `wxSystemThemedControlBase::DoEnableSystemTheme(bool, wxWindow*)'.

The proposed form gets no complaints
2018-08-05 15:46:50 +03:00
Stefan Csomor
e136f34944 Removing extra semicola 2018-08-05 14:21:50 +02:00
Cătălin Răceanu
cdaf3d12eb added wxQT declaration of wxGUIAppTraits 2018-08-03 02:33:06 +03:00
Cătălin Răceanu
5adc65d085 do not define __WXMSW__ and __WXQT__ at the same time 2018-08-03 02:33:06 +03:00
Cătălin Răceanu
f1bfa20fca DLL import fix for wxTaskBarIcon under QT 2018-08-03 02:33:06 +03:00
Cătălin Răceanu
97c9f7599d removed leading spaces of a code line 2018-08-03 02:33:06 +03:00
Vitaly Stakhovsky
9d47b1956e Tidy up wxGenericFontDialog code a little
Make the (originally) auto-generated code of this dialog slightly more
readable by replacing some auto-generated variable names with more clear
ones.

Also avoid using FindWindow(), this is useless and we already have the
window pointers.

Closes https://github.com/wxWidgets/wxWidgets/pull/872
2018-08-02 01:10:14 +02:00
Blake-Eryx
49e20a961d Fix misspellings in comments and documentation
No real changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/870
2018-07-31 13:20:17 +02:00
Stefan Csomor
d553859812 Cleanup accessor code 2018-07-30 18:03:01 +02:00
Stefan Csomor
4bda27c96c Adding wrapper for CFArray, updating other wrappers 2018-07-30 16:32:12 +02:00
Vitaly Stakhovsky
a02efd1fc7 Implement wxFontDialog::SetTitle() in wxMSW
Base class SetTitle() implementation didnd't work for this class as it
used the (invalid) HWND of not yet existing dialog, so add a hook
procedure for the common font dialog, similar to the existing one for
wxColourDialog, which allows us to set the dialog title when the dialog
is really created.

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

Closes #18177.
2018-07-30 16:11:25 +02:00
Cătălin Răceanu
4430ab8661 Disable wxRearrangeCtrl without wxCheckListBox in wxMSW
Add a check ensuring that if wxCheckListBox is disabled, then so is
wxRearrangeCtrl, to avoid build errors that would happen otherwise.

Closes https://github.com/wxWidgets/wxWidgets/pull/866
2018-07-30 14:55:11 +02:00
Vadim Zeitlin
1c9083fd49 Merge branch 'dvc-sort-unset'
Implement wxDataViewColumn::UnsetAsSortKey() for native versions too.

See https://github.com/wxWidgets/wxWidgets/pull/861
2018-07-30 00:09:50 +02:00
Stefan Csomor
56a51ad1e7 fixing non-precompiled header build, adding method body 2018-07-28 20:14:26 +02:00
Stefan Csomor
342e445423 Adding wrapper for Core Foundation dictionaries 2018-07-28 17:49:42 +02:00
Stefan Csomor
d08033292c correcting doc 2018-07-28 15:28:45 +02:00
Vadim Zeitlin
4af7d4e0d5 Also implement wxDataViewColumn::UnsetAsSortKey() for wxGTK
Allow to reset the sort order in native GTK+ implementation too.

See #18176.
2018-07-28 02:54:44 +02:00
Daniel Kulp
2a59c1fb20 Implement wxDataViewColumn::UnsetAsSortKey() in macOS version
It was impossible to stop sorting the control if it had been sorted
before, so implement UnsetAsSortKey() to allow doing it by destroying
the current sort descriptor.

Closes #18176.
2018-07-28 02:29:30 +02:00
Vadim Zeitlin
1345b38c51 Merge branch 'gtk-datapick-focus'
Fix focus event generation for generic wxDatePickerCtrl and other
wxCompositeWindows.

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

Closes #18120.
2018-07-25 20:15:32 +02:00
Vadim Zeitlin
06d2b836a0 Bind focus events to direct children only in wxCompositeWindow
Previously, wxEVT_{SET,KILL}_FOCUS event handlers were connected to all
children, even the indirect ones, which resulted in duplicate focus
events if a grandchildren forward its focus event to its parent window,
as happens e.g. with wxComboCtrl, which contains a text control that
forwards its focus events to the containing control itself.

This change seems globally sound, even if it might break some controls
whose children don't get the expected focus events themselves, because
the right thing to do is to fix those children. And it fixes duplicate
focus events in wxDatePickerCtrlGeneric.
2018-07-25 14:11:17 +02:00
Vadim Zeitlin
4e7b21cd72 Merge branch 'mac-def-bmpbtn-margins'
Stop using wxBU_AUTODRAW under Mac and everywhere else.

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

Closes #18170.
2018-07-24 15:17:32 +02:00
Vadim Zeitlin
90edeace90 Merge branch 'ansi-fix'
Fix wxMSW compilation errors in non-Unicode build.

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

Closes #18172.
2018-07-24 15:15:28 +02:00
Vadim Zeitlin
98eec2646e Merge branch 'mingw-w64-warn-fixes'
Fix a few (harmless) warnings when building with gcc 8 from MinGW-w64.

See https://github.com/wxWidgets/wxWidgets/pull/854
2018-07-24 15:14:09 +02:00
Vadim Zeitlin
97e217e175 Ensure that wxDatePickerCtrlGeneric does get focus events
Revert 1de107c037 and remove the focus
event handler which duplicated and interfered with the handler inherited
from this class to make sure that we get wxEVT_{SET,KILL}_FOCUS for the
objects of this class.

Unfortunately these events now come in pairs, due to an extra artificial
event generated by wxComboBoxExtraInputHandler::OnFocus(), which is
still wrong -- but arguably less wrong and more useful than not sending
them at all.
2018-07-22 19:12:17 +02:00
orbitcowboy
8dfd799fd5 Use const for constant local variables in wxWidgets headers
This avoids warnings from MSVS 2017 static analyzer when C++ core rule
set is activated.

Closes https://github.com/wxWidgets/wxWidgets/pull/819
2018-07-21 16:16:32 +02:00
Vadim Zeitlin
71cef5f3be Stop using wxBU_AUTODRAW in wxWidgets code
This style bit is obsolete and doesn't do anything, so remove confusing
references to it.
2018-07-21 14:42:06 +02:00
Vadim Zeitlin
c4c4fb46d9 Remove unnecessary SetMargins() calls from wxBitmapButton ctor
Margins are overwritten by Create() anyhow, so there is just no need to
set them in the default ctor.
2018-07-21 14:35:56 +02:00
Vadim Zeitlin
d390bee8a2 Allow comparing wxString with wide strings in non-Unicode build
This fixes a compilation error in wxMSW private fonts support
implementation, which compares wxString with a wide string but, unlike a
local fix there, makes sense more broadly and should reduce the
likelihood of similar errors in the future.

It also makes comparisons with narrow C strings more efficient in the
default, Unicode, build by using wxString::Cmp() method instead of
creating a temporary wxString, as was done before.

See #18172.
2018-07-21 14:08:45 +02:00
Vadim Zeitlin
4a53b029de Mark WXSTRINGCAST and related macros as obsolete in a comment
Make it clear that these macros are defined for compatibility only and
shouldn't be used.

See https://github.com/wxWidgets/wxWidgets/pull/857
2018-07-21 13:25:44 +02:00
Vadim Zeitlin
040e897fdb Merge branch 'objarray-ptr-compat'
Restore using object array of pointers broken by recent changes.

Closes #18169.

See https://github.com/wxWidgets/wxWidgets/pull/856
2018-07-21 13:21:27 +02:00
Stefan Csomor
d3e8d3f271 Support or disable "insert" for drag/drop wxDataViewCtrl on OSX
see #18167
2018-07-16 19:42:35 +02:00
Vadim Zeitlin
02ffdd16f6 Fix using WX_DECLARE_OBJARRAY() with pointer types
While this doesn't make, and never made, any sense (pointers should be
stored in a plain, non-object array), we still should continue to
support it for compatibility.

Fix the problem introduced by 97684a9267
by writing "T const&" instead of "const T&" as the latter didn't have
the same meaning when the macro parameter "T" expanded into "U*" as
"const" applied to "U", making this type incompatible with the actual
one.

Also extend the unit test to check for this.
2018-07-15 14:48:08 +02:00
Vadim Zeitlin
b227875f98 Remove CMPFUNC##T definition from WX_DECLARE_OBJARRAY macro
It is unnecessary and fails to compile when "T" is not an identifier
(but e.g. a pointer type).
2018-07-15 14:38:01 +02:00
Stefan Csomor
0e92eb13dc initializing m_ItemCell always 2018-07-13 18:22:45 +02:00
Vadim Zeitlin
61223ab32d Fix using radio buttons in wxDataViewToggleRenderer under macOS
Changing item cell in ShowAsRadio() was wrong as the item cell doesn't
exist when it is called and changing the column cell didn't seem to work
well, so just recreate the entire cell in it instead.

See https://github.com/wxWidgets/wxWidgets/pull/853
2018-07-13 18:16:16 +02:00
pavel-t
82881d6b03 Use memcpy instead of strncpy in wxStrlcpy
Avoid stringop-overflow warning about strncpy size argument depending on source size.
Checking for null in src is not needed because it is already checked by strlen.
2018-07-12 12:19:07 +03:00
Vadim Zeitlin
03a13591b9 Add wxDataViewToggleRenderer::ShowAsRadio()
This allows showing radio buttons in wxDataViewCtrl easily and natively.

Notice that this approach, adding an extra function to the existing
renderer class instead of creating some new wxDataViewRadioRenderer (see
https://github.com/wxWidgets/wxWidgets/pull/809), was finally chosen
because it is simpler to implement and, more importantly, because it
will be more natural to generalize if/when we also add a 3-state
check/radio renderer.

Closes https://github.com/wxWidgets/wxWidgets/pull/853
2018-07-11 23:48:14 +02:00
Vadim Zeitlin
58832ce8d7 Merge branch 'gtk1-fix'
Fix building wxGTK with GTK+ 1 after gtk/private/wrapgtk.h addition.

Closes https://github.com/wxWidgets/wxWidgets/pull/850
2018-07-11 19:26:16 +02:00
Vadim Zeitlin
8ebcfebc5c Fix wxGTK 1 build after gtk/gtk.h wrapper header addition
Changes of c0b0562533 to common code broke
wxGTK1 build, as wx/gtk/private/wrapgtk.h is for wxGTK 2+ only.

Fix this by handling wxGTK 1 separately and including gtk/gtk.h directly
for it.

Hopefully this code will be removed, together with the rest of wxGTK1
support, in some not so distant future.
2018-07-10 14:54:19 +02:00
Vadim Zeitlin
f54ac4e243 Merge branch 'searchctrl-improve'
Closes https://github.com/wxWidgets/wxWidgets/pull/851
2018-07-10 14:40:58 +02:00
Vadim Zeitlin
a0298f3149 Only drain all pending events when exiting outermost wxEventLoop
This is especially important under MSW, where the modality of the nested
event loops actually ends as soon as wxModalEventLoop::Exit() is called,
and so we must avoid dispatching any events in the current loop after it
happens or we risk reentering the same loop again, which could result in
e.g. parent modal dialog being closed before the child event loop
returns (because the event closing the former was dispatched from the
latter) and other unexpected sequences of events.

To prevent this from happening, only dispatch pending events after the
loop exit if it's the outermost loop, as there should be no danger in
doing it in this case. Conversely, we don't lose anything by not doing
this in nested event loops as the outer loop will take care of any
remaining pending events anyhow.

To make this work in an ABI-compatible way, add a global counter of the
currently existing event loops which is used to check if there is more
than one event loop currently running.

Closes #11273, #11573, #11269.
2018-07-10 14:40:05 +02:00
Vadim Zeitlin
9f04318720 Fix MSW EDIT_HEIGHT_FROM_CHAR_HEIGHT() for high DPI
Apply DPI scaling to the extra vertical margin added by this macro to
the font height.

This makes sense and results in wxTextCtrl (and other controls, e.g.
wxSearchCtrl) having the same height as native ones when using high DPI
too.

Note that this required adding wxGetEditHeightFromCharHeight() function
as one of the existing uses of EDIT_HEIGHT_FROM_CHAR_HEIGHT() wasn't
inside a wxWindow-derived class method and also adding wxUSE_GUI guard
around these GUI-only definitions as a function, unlike a macro, can't
be compiled without full wxWindow declaration in scope.
2018-07-09 20:24:58 +02:00
Vadim Zeitlin
c713bee7ea Remove unnecessary wxSearchCtrl::DoMoveWindow() override
There is no need to override this virtual function, if the control size
changes, a wxEVT_SIZE event is generated in any case, resulting in a
call to LayoutControls() without explicitly calling it from here.
2018-07-09 17:54:09 +02:00
Vadim Zeitlin
67bceedfda Get rid of m_searchButtonVisible and m_cancelButtonVisible
There doesn't seem to be any reason to have these flags, which duplicate
the visibility state of m_searchButton and m_cancelButton respectively.

Also update the buttons visibility immediately in ShowSearchButton() and
ShowCancelButton() instead of doing it in LayoutControls() as before,
which was confusing as laying out is not supposed to show/hide anything.

Finally, return true, not false, from IsSearchButtonVisible() if the
button is actually visible because there is an associated menu, even if
ShowSearchButton(false) had been called. This seems more logical and
makes the code simpler, but we need to check whether the native Mac
version also behaves like this or not.

No other changes in behaviour.
2018-07-09 17:12:02 +02:00
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
03b7491bea Remove unnecessary DoUpdateWindowUI() override in wxSearchCtrl
There is no need to override this virtual method just to call the base
class version.
2018-07-07 00:57:44 +02:00
Vadim Zeitlin
6ed3865925 Remove commented out stream operations in wxSearchCtrl
Just remove unused and unnecessary declarations.
2018-07-07 00:54:30 +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
Vadim Zeitlin
724409a10c Simplify wxSortedArray_SortFunction used in STL build
There is no need to pass the function type as the template parameter as
it's determined by the type of the objects being compared anyhow.
2018-05-31 19:47:08 +02:00
Vadim Zeitlin
a69cbd3d0c Merge branch 'wrap-gtk.h'
Add a wrapper for gtk/gtk.h allowing to avoid gcc 8 warnings when
including the GTK+ header directly.

See https://github.com/wxWidgets/wxWidgets/pull/814
2018-05-31 01:28:40 +02:00
Vadim Zeitlin
e11a187f7b Merge branch 'msvc-setup_h-monolithic'
Add support for auto-linking monolithic library when using MSVC too.

Closes https://github.com/wxWidgets/wxWidgets/pull/806
2018-05-31 01:23:59 +02:00
Vadim Zeitlin
30c2bbf081 Factor out WXUSINGDLL check in MSVC-specific wx/setup.h
Don't repeat the same check for !defined(WXUSINGDLL) many times.

No real changes, this is just a simplification (which should be viewed
with "git diff -w --color-words" to see how little has really changed).
2018-05-31 01:21:20 +02:00
PB
46ba9ca2f9 Fix automatic linking with MSVC for monolithic builds
MSVC users can simplify their projects by prepending
$(WXWIN)\include\msvc to the compiler include directories, which results
in automatic including the build-specific setup.h and linking all
required wxWidgets and system libraries.

This worked only for the default multilib builds but not for monolithic
builds where wxWidgets libraries are created and named differently.

This patch allows the users (by defining wxMONOLITHIC=1 in their
project) to use it also for monolithic builds.
2018-05-31 01:13:16 +02:00
Vadim Zeitlin
d4f380e16e Use Bind() instead of Connect() in wxWidgets code
Use more modern function which allows to avoid wxXXXEventHandler()
macros use.

No real changes.
2018-05-30 13:06:20 +02:00
Vadim Zeitlin
424f64f27d Fix invalid cast in wxMSW AutoHANDLE::InvalidHandle()
Somehow this compiled with the previous gcc versions (as well as MSVS),
but a static_cast from an integer wxUIntPtr type to a pointer HANDLE
type is obviously invalid and a reinterpret_cast is needed here.

This fixes compilation with g++ 8.
2018-05-27 22:56:05 +02:00
Vadim Zeitlin
adfde70054 Remove redundant wxHtmlDCRenderer::m_NumPages
The actual number of pages is given by the number of elements in
m_PageBreaks vector after CountPages() is shown and is unknown until
then, so m_NumPages is completely unnecessary and can be just removed.
2018-05-25 01:35:34 +02:00
Vadim Zeitlin
8d7601295b Make wxHtmlDCRenderer::FindNextPageBreak() const
It doesn't modify the renderer.
2018-05-25 01:31:54 +02:00
Vadim Zeitlin
c5bb583cdf Replace wxList used in wxHtmlPrintout with wxVector<> too
Prefer the use of the standard-like template class to macro-based list.

It also makes more sense to use a vector rather than a linked list here,
as the elements are never removed from or inserted into m_Filters, so
there is no reason to prefer the list structure.
2018-05-25 01:22:29 +02:00
Vadim Zeitlin
edeca4d9d6 Use wxVector<int> instead of wxArrayInt in wxHtmlDCRenderer
No real changes, just prefer standard-like template class to the legacy
wx one.
2018-05-25 01:19:01 +02:00
Vadim Zeitlin
b9b6ccb804 Remove "known_pagebreaks" from wxHtmlCell::AdjustPagebreak()
This parameter is not actually needed for any reasonable page breaking
algorithm, as it shouldn't care about any previous page breaks except
for the last one, which is already known as "*pagebreak - pageHeight" in
this function.

Removing it will allow to stop using wxArrayInt in the code using this
method and switch to an std::vector<int> instead.

This is not a backwards compatible change, but it seems that there is
very little code actually overriding this function (none could be found
in any open source repositories) and updating it should be as simple as
removing the now unneeded argument.
2018-05-24 18:12:40 +02:00
Vadim Zeitlin
63add2cd19 Don't call AdjustPagebreak() in a loop, this seems useless
There doesn't seem to be any reason to call this function more than once
on the same cell as the existing implementations are idempotent and it's
difficult to see why this should ever not be the case.
2018-05-24 17:53:26 +02:00
Vadim Zeitlin
e01892c669 Split and simplify wxHtmlDCRenderer::Render()
This function was difficult to understand as it did two quite different
things depending on the value of its "dont_render" argument and using it
also made CountPages() logic more complicated than necessary.

Simplify the code by splitting Render() into FindNextPageBreak(), which
is used by CountPages(), and Render() itself, which doesn't need to deal
with pagination at all as it's either already provided the page start
and end positions or can just assume that everything fits on a single
page (the latter is the case for the headers and footers renderer).

This is a notionally backwards-incompatible change, but no code using
wxHtmlDCRenderer could be found in the wild and the new API is so much
simpler that it seems to be worth switching to it.
2018-05-24 17:53:26 +02:00
Vadim Zeitlin
048b7f44ec Add wxPrintout::SetUp() to reuse the same code in all ports
MSW, GTK, OSX and Postscript implementations all did almost exactly the
same thing to initialize wxPrintout, so extract this common code into a
new wxPrintout method and just call it instead.

There should be no changes in behaviour.
2018-05-23 17:52:31 +02:00
Vadim Zeitlin
6121b08b67 Compilation fix for wxGUIEventLoop in wxDFB
Rename YieldFor() to DoYieldFor() in the header too.

This was broken by f740cc3881
2018-05-23 17:20:39 +02:00
Maarten Bent
802c77b964 Fix building without precompiled headers on Windows 2018-05-22 17:04:42 +02:00
Vadim Zeitlin
7eef4a4549 Fix build with GTK+ < 2.20 due to undefined key code constants
Include gdk/gdkkeysyms.h from wx/gtk/private/gtk2-compat.h as it must be
included before it for the compatibility header to define the new names
for the key constants even when using old GTK+ versions.
2018-05-22 17:01:07 +02:00
Frédéric Bron
a195bf86a2 Make compilation with mingw-w64 possible with -std=c++17.
The definition of macros min and max in include/wx/msw/wrapgdip.h
b/include/wx/msw/wrapgdip.h was clashing with the new bessel functions
that use std::numeric_limits<T>::min/max.

So #include <cmath> before #include <gdiplus.h> and use using
declarations of std::min and max instead of macros.
2018-05-22 16:10:11 +02:00
Vadim Zeitlin
9fa9880f97 Pass known page breaks as const ref to wxHtmlDCRenderer::Render()
This method doesn't modify the known page breaks, it only uses them to
find the next one, so make it more clear by using const reference in the
function signature.
2018-05-21 19:06:21 +02:00
Vadim Zeitlin
f1ea4afdbe Make wxHtmlPrintout::m_Renderer{,Hdr} objects instead of pointers
There is no need to allocate these objects on the heap and delete them
later when we can just make them members of wxHtmlPrintout object
itself.

No real changes.
2018-05-21 16:39:02 +02:00
Vadim Zeitlin
c0b0562533 Avoid many -Wparentheses warnings from gtk/gtk.h with gcc8
Add wx/gtk/private/wrapgtk.h wrapping gtk/gtk.h in pragmas disabling
these warnings and include it everywhere instead of directly including
gtk/gtk.h.

Also include wx/gtk/private/gtk2-compat.h from this wrapper header as it
was included by 90% of the files including gtk/gtk.h itself and it seems
to be better and simpler to just always include it.
2018-05-21 12:34:04 +02:00
Jeff Bland
8b18bbb9c7 Fix uses of wxPalette without check for wxUSE_PALETTE 2018-05-18 18:49:05 -06:00
Jeff Bland
26715a1fe0 Fix warning with missing override 2018-05-18 18:49:00 -06:00
Vadim Zeitlin
610db240a8 Consider g++ ABI 1011 to be compatible with 1002 too
The changes between 1010 (which was already considered equivalent to
1002) and 1011 don't seem to affect wxWidgets and the library compiled
with g++6 can be used from the application built with g++7 without any
problems.
2018-05-17 04:00:59 +02:00
Vadim Zeitlin
822809ef78 Stop forwarding DoPopupMenu() to wxGenericListCtrl main window
There doesn't seem to be anything wrong with just showing the popup menu
in this window itself and this avoids the need to do any coordinate
adjustments, which didn't work correctly for the menus shown over the
header window after the previous commit (and hadn't worked correctly for
the menus shown over the non-header area before it).

See #18133.
2018-05-17 03:41:53 +02:00
Vadim Zeitlin
4710302aec Add wxOVERRIDE to all relevant wxAuiMDIChildFrame methods
Now that this class derives from wxMDIChildFrameBase, SetTitle() and
Activate() are inherited from it.
2018-05-13 02:49:07 +02:00
Vadim Zeitlin
be696ed8a4 Reuse base class icon-related functions in wxAuiMDIChildFrame
Don't define GetIcon(), GetIcons() and SetIcon() at all as the base
class already implements them and just keep SetIcons(), which can now be
marked as overridden as it's inherited from wxTopLevelWindow via
wxTDIChildFrame.
2018-05-13 02:46:33 +02:00
Vadim Zeitlin
f7b0ec38dd Remove useless wxAuiMDIClientWindow::SetSelection()
It just called the base class version, so it's better to not have it at
all.
2018-05-13 02:45:40 +02:00
Vadim Zeitlin
24e06054fc Remove wxAuiMDIChildFrame::DoShow()
This method is confusing as it's not used for implementing Show(), which
is the usual naming convention when both Foo() and DoFoo() members
exist, and gives no clear indication about what does it really do.

Just call wxWindow::Show() directly instead.

Also create the wxAuiMDIChildFrame window hidden from the beginning,
instead of creating it in a visible state and then hiding it.
2018-05-13 02:45:40 +02:00
Vadim Zeitlin
ceee16c01a Remove sizing hacks from wxAuiMDIChildFrame
There doesn't seem to be any reason for overriding DoSetSize() and
DoMoveWindow(), so just stop doing it.

Notice that this was already changed for wxGTK many years ago in
a94476deb9 and there is no reason to use
different code wxGTK and other ports.
2018-05-13 02:44:18 +02:00
Vadim Zeitlin
c1bcf16eb9 Derive wxAuiMDIChildFrame from wxFrame for consistency
Make it easier to use AUI-based MDI child frame class instead of
normal wxMDIChildFrame itself by inheriting it from the same base class.

This also allows to get rid of duplicate stubs in wxAuiMDIChildFrame.
2018-05-13 02:41:58 +02:00
Vadim Zeitlin
826ab19ac9 Add missing wxUSE_MDI check to wxAUI MDI header
The implementation file already checked for both wxUSE_AUI && wxUSE_MDI,
but wx/aui/tabmdi.h didn't check the value of the latter -- do it now.
2018-05-13 02:41:58 +02:00
Vadim Zeitlin
f53923dd31 Left-align wxSpinCtrl contents by default
The default alignment of the text in wxSpinCtrl was changed to "right"
in 7e4952db83, which added alignment
support (see #10621), but this made it inconsistent with the native
up-down control under MSW and, perhaps more importantly, with spin
controls created from XRC as the default style was never modified there
and did not include wxALIGN_RIGHT.

Resolve this inconsistency by reverting to left-aligning the text by
default.
2018-05-12 19:14:00 +02:00
Frédéric Bron
232d123f8d Remove the separator static line in wxGenericCollapsiblePane
The horizontal static line was added to separate the button from the
child window when visible, but this didn't seem very useful and looked
bad and was inconsistent with the native GTK+ implementation as well as
similar controls commonly used under MSW (wxOSX already disabled the
static line use).

Just remove it to make things simpler and better looking.

Closes https://github.com/wxWidgets/wxWidgets/pull/804
2018-05-12 19:10:28 +02:00
Paul Cornett
9bfa890480 Build fixes for __WXUNIVERSAL__==1 2018-05-11 10:16:49 -07:00
Vadim Zeitlin
2e8516c5fe Merge branch 'MoveOutsideShortInterval' of https://github.com/catalinr/wxWidgets
Allow using positions in the entire int range for window positions under
MSW, and not just those in (slightly less than) short range, that are
supported by the native API.

Closes #4262.

Closes https://github.com/wxWidgets/wxWidgets/pull/779
2018-05-02 23:19:11 +02:00
Maarten Bent
59c37cb5eb Show correct save path when using compressed debug report
The compressed report location could be set to a different location from
the one shown in the dialog.

Closes #17176.

Closes https://github.com/wxWidgets/wxWidgets/pull/797
2018-05-02 15:36:11 +02:00
Vadim Zeitlin
6ae7aa4443 Fix saving/restoring window position for maximized windows
Save both the normal window geometry and its maximized position instead
of saving just its current position. This fixes restoring geometry of
the maximized windows as previously they were always restored on the
primary monitor, as their original position was lost.

Use the native {Get,Set}WindowPlacement() functions for a MSW-specific
wxTLWGeometry implementation to achieve this.

Closes #16335.
2018-04-29 20:35:44 +02:00
Vadim Zeitlin
d97c055514 Introduce platform-dependent wxTLWGeometry class
Previously, TLW geometry was implicitly defined as just its position,
size and the maximized/iconized state by wxPersistentTLW code. This
already wasn't enough for wxGTK which added the decoration sizes to the
geometry being saved/restored, but this had to be done using conditional
compilation, which was not ideal. And it didn't allow using an entirely
different geometry representation as will be done for wxMSW soon.

Change the code to use wxTLWGeometry class defining the geometry, as
used by the current port, explicitly and move wxPersistentTLW logic into
it, as wxPersistentXXX classes are supposed to be very simple, which
wasn't really the case.

Also provide public SaveGeometry() and RestoreToGeometry() methods in
wxTopLevelWindow, which can be useful even to people not using
wxPersistentTLW for whatever reason.

There should be no changes in behaviour so far.
2018-04-29 19:51:10 +02:00
Vadim Zeitlin
f04a46364c Remove useless forward declaration of wxTopLevelWindowBase
This class is fully declared just below, so there is no need to
forward-declare it.
2018-04-29 19:43:22 +02:00
Cătălin Răceanu
578474526f fix window position under MSW when limited by short range 2018-04-18 20:19:45 +03:00
Jan Niklas Hasse
496da2e550 Remove trailing whitespace from several files
No real changes.

See https://github.com/wxWidgets/wxWidgets/pull/787
2018-04-18 15:45:42 +02:00
Jan Niklas Hasse
8d02384792 Use wxString() instead of "" for empty strings
This will allow this code to work even when implicit conversion from
"const char*" is disabled in wxString and is already marginally more
efficient even now.

See https://github.com/wxWidgets/wxWidgets/pull/782
2018-04-17 22:32:25 +02:00
Vadim Zeitlin
e38866d3a6 Merge branch 'lzma'
Add support for using externally available liblzma via new
wxLZMA{Input,Output}Stream classes.

Closes https://github.com/wxWidgets/wxWidgets/pull/771
2018-04-06 15:41:36 +02:00
Vadim Zeitlin
1cdb384d7b Add wxLZMAClassFactory for run-time LZMA stream creation
This should allow handling .xz files in wxFileSystem, for example.
2018-04-06 15:39:55 +02:00
Vadim Zeitlin
50b102ffd2 Add wxLZMAOutputStream for compressing data using LZMA
As liblzma API is similar to zlib API, this class is also close to
wxZlibOutputStream, except that it uses reusable functions instead of
repeating their code.
2018-04-06 15:39:55 +02:00
Vadim Zeitlin
e66ade1b84 Factor out reusable part of wxLZMAInputStream into wxLZMAData
No changes yet, this is a pure refactoring in preparation for adding
wxLZMAOutputStream.
2018-04-06 15:39:55 +02:00
Vadim Zeitlin
af7e2901fe Add wxLZMAInputStream for decompressing data in XZ format
No compression support yet.
2018-04-06 15:39:55 +02:00
Vadim Zeitlin
311b2aee5f Check for liblzma headers in configure too and add wxUSE_LIBLZMA
Prepare for using liblzma in wxWidgets code by adding the necessary
option and updating the configure check for it (which had been already
present due to libtiff possible dependency on liblzma).

No real changes yet.
2018-04-06 15:39:39 +02:00
Vadim Zeitlin
bee28c2730 Use wxVector<> for wxBookCtrlBase::m_pages array
Get rid of another macro-based array in favour of wxVector<>.

No real changes.
2018-03-31 01:45:10 +02:00
Vadim Zeitlin
02a92e23f3 Reuse wxBookCtrlBase::DoSetSelection() in wxTreebook too
Avoid duplicating base class DoSetSelection() implementation in
wxTreebook, just extend it slightly by using DoGetNonNullPage() to allow
using a (sub-)page if the page associated to the selected item is null
and reuse it.

Also get rid of wxTreebook::m_actualSelection, it seems completely
unnecessary to bother keeping and updating it when we can just find it
whenever we need (which actually seems to only have been the case in the
now removed DoSetSelection() implementation anyhow).

As a side effect of this, wxTreebook pages should now be sizer correctly
when switching to them as DoSetSelection() in the base class does call
SetSize() on the page before showing it, unlike the previously used
version in wxTreebook, which omitted this call for some reason.

There should be no other user-visible changes.

Closes #4379.
2018-03-31 01:45:06 +02:00