Commit Graph

65003 Commits

Author SHA1 Message Date
Maarten Bent
53dbff2962 CMake: Fix building dialogs sample
Add the source files of the generic dialogs to the project,
similar as is done in the bakefile.

See previous commits 573e887a4c and
6415bd553f, which partially reverted it,
for the full story.
2018-09-17 23:30:53 +02:00
Maarten Bent
d8211f389c Remove OS/2 remnants from bakefile of dialogs sample 2018-09-17 23:30:47 +02:00
Vadim Zeitlin
764b174199 Merge branch 'cmake-adv' of https://github.com/MaartenBent/wxWidgets
Keep empty adv library for backwards compatibility in CMake builds too.

See https://github.com/wxWidgets/wxWidgets/pull/918
2018-09-17 23:28:06 +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
795095a4ec Fix wxGenericListCtrl build with wxUSE_STD_CONTAINERS and C++98
Use wxShrinkToFit() instead of wxVector::shrink_to_fit() which is not
defined in this build configuration.

This was broken by recent 2af7e38153.

See https://github.com/wxWidgets/wxWidgets/pull/924
2018-09-17 23:20:03 +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
2cc44337c6 Use only wxFont ctor from wxFontInfo in the samples
Follow the documentation advice and prefer to use the ctor taking
wxFontInfo as it makes the code slightly shorter and more readable.
2018-09-17 15:29:42 +02:00
Vadim Zeitlin
b1dcdb864c Add simple unit tests for the new wxFont features
Check that calling SetFractionalPointSize() and SetNumericWeight() at
the very least results in the expected return values from
GetFractionalPointSize() and GetNumericWeight().
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
5a4d46bf7d Handle fractional point sizes in DirectWrite wxGraphicsFont
Also stop scaling the font size by DPI manually, we don't need to do it
if we use points instead of pixels. This, in turn, made it unnecessary
to pass ID2D1Factory parameter to wxD2DFontData ctor.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
d5020362ff Handle fractional point sizes in GDI+ wxGraphicsFont
Also switch to using UnitPoint when creating GDI+ fonts as it's not
clear at all why should we use UnitPixel here.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
f085981601 Add strikethrough support for fonts defined in XRC
Handle this attribute as well as "underlined" for completeness.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
ca164bb4ca Support fractional font sizes and numeric weights in XRC
Change the code to handle them, the XRC sample to test them, the schema
to accept them and the documentation to describe them.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
aedf89b098 Update wxNativeFontInfo::{To,From}String() after wxFont changes
Handle fractional point sizes and numeric weights in the custom string
formats in the ports using those.
2018-09-17 15:24:42 +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
c302a8d1e7 Use fractional point sizes in wxRichText code
When scaling, just use the floating point result directly instead of
rounding it.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
03f29d4b67 Don't round the larger or smaller font sizes unnecessarily
Use SetFractionalPointSize() instead of SetPointSize() to avoid losing
the fractional part of the font size, if any.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
85b8798558 Use fractional point size when scaling fonts in wxTipDialog
Don't unnecessarily round the result to int any longer.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
ac8b2e10a9 Use fractional point sizes in SetWindowVariant()
Don't round the scaled font size now that we can just directly use the
fractional value.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
cd24db056e Use SetFractionalPointSize() in wxFont::Scale()
This will result in more precise scaling.
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
e65381c8ee Show fractional point size and numeric weight in wxDumpFont()
Update to show the new wxFont fields.
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
aff4b82663 Don't assert in wxNativeFontInfo::SetStyle() in wxGTK1
Add missing "break" statement.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
3e2fd136ff Disable tons of warnings given during wxGTK1 build
These warnings are not going to be fixed, so suppress them to at least
see the other ones more clearly.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
140b3c5e65 Disable wxGraphicsContext in wxGTK1 build, it doesn't compile
There is no chance of wxGraphicsContext ever being supported in this
legacy port, but at least disable it automatically instead of requiring
to specify --disable-graphics-ctx on the command line.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
468545943a Remove unnecessary line from the font sample
This was mistakenly left over in the commit adding private fonts support
(547e40b114).
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
720e1372e4 Allow leaving the point size unspecified for ports using XLFD
Rather than defaulting to the normal font size, just leave the font size
unspecified as it might result in better font size being chosen.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
22839b865d Fix bug with point sizes in wxX11 without Pango
XLFD strings specify size in tens of points, so add the missing factor
of 10.
2018-09-17 15:24:41 +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
03266b1091 Add wxFontRefData ctor from wxFontInfo to wxQt
This actually implements support for the fractional font sizes, as
previously the fractional part was lost when passing by the legacy
Create() taking only integer size.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
ce1e69cfa1 Implement wxNativeFontInfo::SetPixelSize() in wxQt
There doesn't seem to be any way to specify both font width and height
and pixels in Qt API, so just use QFont::setPixelSize() with the height.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
8715e56676 Remove unnecessary wxFontRefData::operator==() in wxQt
It wasn't used anywhere anyhow.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
d002acfec6 Add "Apply" button to the font sample
Live changes don't work correctly in all ports, notably wxQt, which
doesn't seem to generate the events correctly for wxSpinCtrl, so add a
button to apply the changes.

This could be seen as a better UI anyhow.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
2d8decd7f4 Improve mapping of font weights between Qt and wx
Support the entire [0, 99] range used by Qt instead of just some
selected values while still mapping all the predefined symbols to their
corresponding wx equivalents.
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
9b661b918e Fix indentation of wxQt wxFontRefData declaration
No real changes.
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
de7ab2a45f Remove unnecessary wxFontRefData dtor in wxOSX too
Smart pointers will clean up the resources automatically, there is no
need to call Free() manually from the dtor.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
d9b62e0832 Initialize wxFontRefData::m_info directly in wxOSX code
Instead of using default ctor and Init() later, just use the appropriate
ctor directly.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
a860f5710b Change wxFontRefData ctor to take wxFontInfo in wxOSX too
Change wxOSX similarly to wxGTK and wxMSW in the two previous commits.
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