Commit Graph

64687 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Vadim Zeitlin
0225f191e8 Replace PLUGIN_ADV_SRC to PLUGIN_SRC and put them into "core"
wxSound SDL plugin should be in "core" too, when linking the plugins
statically, rather than in "adv", now that wxSound itself is in core.
2018-09-02 23:36:41 +02:00
Bryan Petty
f4b0ae0370 Update docs.wxwidgets.org links to HTTPS. 2018-09-02 15:35:48 -06: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
Vadim Zeitlin
746b082de7 Normalize email address for Frédéric Bron
Recognize Frédéric as author of commits done with 2 different email
addresses.
2018-09-02 15:40:16 +02:00
Vadim Zeitlin
a443249a3d Normalize email address for Hartwig Wiesmann
Recognize Hartwig as author of commits done with 2 different email
addresses.
2018-09-02 15:38:56 +02:00
Hartwig
bee5852a16 Remove commented out code in wxOSX wxMenuBar
The code seems to be unused since 2008.

Closes https://github.com/wxWidgets/wxWidgets/pull/913
2018-09-02 15:26:46 +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
F
d2c77146db wxImageList::GetIcon() converts wxBitmap to wxIcon instead of wxNullIcon on OSX (#906)
On OSX, wxImageList::GetIcon() returned wxNullIcon when a wxBitmap was
stored. This could lead to no image seen in controls like wxTreeListCtrl.

Instead of that, we convert the wxBitmap to wxIcon with CopyFromBitmap.
2018-09-01 11:33:03 +02:00
Daniel Kulp
0b69ba6459 Set the appearance when working with wxColour components (#910) 2018-09-01 07:29:11 +02:00
Vadim Zeitlin
d70b515216 Remove <shobjidl.h> inclusion to fix MinGW TDM 32 bit build
This header, added in b61123cd7d, doesn't
seem to be needed and breaks compilation with TDM gcc 4.8 and 5.1, so
just avoid including it.

See #15402.
2018-08-31 19:23:43 +02:00
Jouk
a5756073f7 set WXWIN_COMPATIBILITY_x_y to 0 for OpenVMS 2018-08-31 12:44:20 +02:00
Jouk
4c29056ea4 include wxcrtvararg.h (non precomp) for wxVsnprintf/wxSscanf 2018-08-31 12:42:46 +02:00
Vadim Zeitlin
783b82913b Mention wxTL_NO_HEADER in wxTreeListCtrl documentation too
This style was documented in the global scope, but not in the class
description where it would be expected to be found.
2018-08-30 00:21:02 +02:00
Nineis K
54ddce99f5 Fix wxColour::Green() wxColour::Blue() wxColour::Alpha() returns wrong value on macOS (#902) 2018-08-28 08:13:29 +02:00
Hartwig
372daae9dc Remove stray backspace character from wxCocoaDataViewControl
Somehow, a raw ASCII ^H made its way into this source file. Remove it.

See https://github.com/wxWidgets/wxWidgets/pull/901
2018-08-27 22:59:09 +02:00
Hartwig
3591756166 Update wxDataViewColumn when sort order changes under macOS
The value returned by wxDataViewColumn::IsSortOrderAscending() wasn't
updated when the sort order changed due to the user clicking on a column
and reversing the sort order.

Fix this now by explicitly calling SetSortOrderVariable() when this
happens.

Closes https://github.com/wxWidgets/wxWidgets/pull/901
2018-08-27 22:57:08 +02:00
Vadim Zeitlin
560d00f3cc Replace references to "adv" with "core" in classes documentation
All classes previously in "wxadv" are now in "wxcore".
2018-08-27 22:52:15 +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
7a77d8d9e6 Don't use a separate section for "adv" library controls
Put them together with the other "miscellaneous" controls now that the
"adv" library doesn't exist any more.
2018-08-27 22:49:45 +02:00
Vadim Zeitlin
f71c4f55a3 Completely remove "adv" library from CMake build system
This build system is new and so doesn't need to keep "adv" for
compatibility.
2018-08-27 21:13:04 +02:00
Vadim Zeitlin
424bc34d9d Remove references to "adv" library from MSVS 201x projects
They are not generated by bakefile, so need to be updated manually.
2018-08-27 21:13:04 +02:00
Vadim Zeitlin
c98751cb5b Force creating import library for "adv" DLL under MSW
No library was created as no symbols were exported by the DLL any more,
so add a dummy symbol just to force the import library creation -- this
is important to let the projects referencing it to continue to link,
even if it's now useless.
2018-08-27 21:13:04 +02:00
Vadim Zeitlin
21263b8c22 Fix wrong DLL in the declaration of wxPendingDelete
This object is defined in "base", not "core".

Somehow this still worked before, but it was still wrong and stopped
working when taskbarcmn.cpp was moved to "core" itself from "adv".
2018-08-27 21:13:04 +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
Stefan Csomor
99eba63796 use Cocoa fix for nested modal loops for system dialogs also 2018-08-27 11:50:35 +02:00
Vadim Zeitlin
fd569842b1 Merge branch 'html-set-cell'
Make wxHTML API more flexible by allowing to operate on individual
wxHtmlContainerCell instead of only the entire HTML document text.

See https://github.com/wxWidgets/wxWidgets/pull/899
2018-08-27 02:17:10 +02:00
Vadim Zeitlin
895edcdddf Merge branch 'id-docs'
Improve documentation of window and menu item IDs.

Closes https://github.com/wxWidgets/wxWidgets/pull/890
2018-08-27 02:15:53 +02:00
Blake-Eryx
6bd9bd18ec Remove wxT() and _() macros from dialogs sample
Make the code more readable by removing the unnecessary macros.

Closes https://github.com/wxWidgets/wxWidgets/pull/888
2018-08-27 02:14:10 +02:00
Vadim Zeitlin
f572856051 Fix ifacecheck utility build after array macro changes
Previously it was somehow possible to implicitly convert "false" to
wxMethodPtrArray (which is an array of wxMethod pointers), but this,
correctly, doesn't compile any more, so return an empty array instead.
2018-08-27 02:01:37 +02:00
Stefan Csomor
a8cc8f5ae8 Adding missing header for non-precompiled headers 2018-08-26 18:20:24 +02:00
Stefan Csomor
cfab2206da Supporting deeper nesting levels of modal dialogs on macOS
In order to make sure a parent NSPanel cannot be activated, turn off its worksWhenModal flag while the child has its turn

see #18204
2018-08-26 16:52:40 +02:00
Stefan Csomor
f38b4d8ae3 Merge branch 'master' of https://github.com/wxWidgets/wxWidgets 2018-08-26 11:33:43 +02:00