Commit Graph

65033 Commits

Author SHA1 Message Date
Vadim Zeitlin
7500a999bd Add numeric weights support for ports using XLFD-based fonts
Translate numeric weight to the symbolic name too instead of only doing
it in the other direction in GetNumericWeight().
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
Maarten Bent
f3ab72ca55 Remove trailing spaces in dialogs sample 2018-09-14 21:33:56 +02:00
Artur Wieczorek
75225cc1a6 Remove references to "adv" library from MSVS 201x test projects 2018-09-13 20:56:54 +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
5b1aa5bb9c Don't use deprecated SetHBITMAP() method
Inside wxBitmap we have a direct access to wxBitampData so HBITMAP can be stored directly in this structure and there is no need to call SetHBITMAP() function.
2018-09-12 22:02:56 +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
PB
12c44f1c79 Make small corrections in wxTimePickerCtrl docs 2018-09-12 17:05:06 +02:00
Stefano D. Mtangoo
e6a2aa5ae3 Show correct icon for branch nodes in wxDataViewTreeCtrl
The icon wasn't updated when the node was expanded (or collapsed) due to
the inversed check for HasImageList().

Fix this by correcting the check.

Closes https://github.com/wxWidgets/wxWidgets/pull/929
2018-09-12 14:10:51 +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
4fd80960ca Document wxGridTable::GetValueAsCustom() return value constraint
The returned pointer must be allocated on the heap as
wxGridCellDateTimeRenderer::GetString() currently deletes it.

This seems like a rather poor idea, as any internally stored values must
be cloned on each call, but it seems too dangerous to change this as it
could result in massive memory leaks in the existing code.
2018-09-11 01:38:39 +02:00
Alexander Kovalenko
df87960bfc Russian translations update from Alexander Kovalenko 2018-09-07 18:48:56 +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
b84db46feb Add unit test for wxFont::GetStyle() and special style values
Similarly to the previous commit, verify that wxNORMAL, wxITALIC and
wxSLANT still work for compatibility (note the latter is synonymous with
wxITALIC under MSW).
2018-09-06 03:13:23 +02:00
Vadim Zeitlin
5bf920775a Add unit test for wxFont::GetWeight() and special weight values
Verify that using wxNORMAL, wxBOLD and wxLIGHT still works, as they must
do for compatibility reasons.
2018-09-06 03:13:23 +02:00
Vadim Zeitlin
de3cc614b2 Add unit test for wxFont::GetPointSize() and special sizes
Verify that using wxDEFAULT works to create a font of default size, for
compatibility reasons, and that using -1 works in the same way too.
2018-09-06 03:13:23 +02:00
Vadim Zeitlin
7cc016b5fa Remove CppUnit boilerplate from wxFont unit test
No real changes, just remove the test case class which is not at all
necessary in this unit test.
2018-09-06 03:13:23 +02:00
Vadim Zeitlin
76aad86cfb Remove unnecessary wxUSE_FONTMAP guard from wxFont unit test
This test doesn't require wxFontMapper.
2018-09-06 03:13:23 +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
F
32af4c8727 Consistently handle wxImage Load_Verbose flag in LoadFile
In wxImage, it is possible to set the Load_Verbose flag (default) if
messages are to be shown to the user in popup message boxes (via
wxLogError and wxLogWarning).

Unsetting this flag is supposed to remove these message boxes but in
practice, this was only applied in the function DoLoad() while other
messages could be issued earlier in overloads of the function LoadFile().

This commit checks if Load_Verbose is set or not and behaves accordingly
in LoadFile() overloads so that all messages can be suppressed.

See https://github.com/wxWidgets/wxWidgets/pull/920
2018-09-05 23:24:18 +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
236c79f809 undoing previous commit 2018-09-05 14:44:53 +02:00
Jouk
bd9c89f96d Avoid double (contradicting) specification of wxNativeFontInfo::SetWeight 2018-09-05 10:44:55 +02:00
Jouk
8d1063389a update gtk1 font routines to support nwe code in wxWidgets 2018-09-05 10:42:35 +02:00
Vadim Zeitlin
dcb12e633b Extract helper functions for wxFontWeight <-> int conversions
Make these functions available for the upcoming reuse in wxFont.

This is almost a pure refactoring, except that assert checking for the
symbolic weight validity was corrected (it was always true before due to
wrong use of "||" instead of "&&", so split it in 2 asserts to ensure
that this doesn't happen any more).
2018-09-05 02:02:56 +02:00
Pavel Kalugin
fcae53c5b1 Add documentation for new [Get/Set]CornerLabelValue functionality 2018-09-04 21:00:47 +03:00
Stefan Csomor
ccff3e43fc fix window menu on macOS
the window menu was potentially added multiple times and could have multiple copies of the active window

closes https://github.com/wxWidgets/wxWidgets/pull/917 , thanks to @hwiesmann
2018-09-04 19:57:48 +02:00
Pavel Kalugin
34416d7507 Add corner label orientation toggle to grid sample 2018-09-04 18:20:34 +03:00
Pavel Kalugin
ccc93c0cd9 Add corner label alignment command to grid sample 2018-09-04 17:51:01 +03:00
Pavel Kalugin
d473d47e7e Add text alignment and orientation support for corner label 2018-09-04 16:52:52 +03:00
Pavel Kalugin
7ed7f87a50 Get corner window's rectangle in a more clear way 2018-09-04 15:27:35 +03:00
Pavel Kalugin
db83d41693 Replace C++11 expressions with C++03 ones 2018-09-04 15:27:35 +03:00
Pavel Kalugin
e07d27ce78 Add a command to set corner label to grid sample 2018-09-04 15:27:35 +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
Maarten Bent
cf169531fb CMake: Do not add dummy.cpp to libraries
Cotire does not need it for PCH creation, the PCH will be created when
compiling the first source file.
2018-09-04 13:55:16 +02:00
Maarten Bent
ed704caede CMake: Keep empty adv library for backwards compatibility 2018-09-04 13:46:55 +02:00
Vadim Zeitlin
cd915a63fa Provide an even more detailed explanation of wxWindow::Create()
Explicitly mention that it is not virtual and thus can't be overridden
by the derived class.
2018-09-04 12:44:45 +02:00
Vadim Zeitlin
c97fbe9331 Merge branch 'adv-fixes'
Use dummy source file when building wxAdv if necessary and do not use
the wxSound SDL plugin file.

See https://github.com/wxWidgets/wxWidgets/pull/915
2018-09-03 23:48:54 +02:00
Vadim Zeitlin
8283a760bb Document wxWindow::Create() and explain why it can be useful
Somehow, this important function wasn't documented at all previously.
2018-09-03 23:25:54 +02:00
Frédéric Bron
e685ae1d13 Fix wxMac compilation in 32 bits after font changes
Resolve ambiguity in wxCFTypeRef::GetValue() calls: CGFloat is float,
not double, in 32 bit builds, so the type of the first argument is
"float *" while the type of 0.0 is "double".

Fix this by casting 0 to CGFloat too, as this works in both 32 and 64
bit builds.
2018-09-02 23:49:21 +02:00
Vadim Zeitlin
c3bc7941c8 Avoid errors due to not having any files in "adv" library
Compile dummy.cpp as part of the library under Unix to avoid problems
with some versions of ar refusing to create empty static libraries.
2018-09-02 23:42:22 +02:00