Commit Graph

17955 Commits

Author SHA1 Message Date
Vadim Zeitlin
309f942aa6 Merge branch 'qt-build'
Minor wxQt API fixes and simplifications.

See https://github.com/wxWidgets/wxWidgets/pull/962
2018-10-07 19:55:37 +02:00
Vadim Zeitlin
24b5e256df Add wxDisplay::GetDepth() and use it for wxDisplayDepth()
Allow getting the depth of any display, not just the primary one, even
though this is not implemented for Unix ports currently.

Mostly do this for consistency with the other display-related functions.
2018-10-07 00:30:12 +02:00
Scott Furry
f8c14d1176 Define more wxToolBar::SetToolXXX() methods in wxQt
Provide a stub for SetToolShortHelp() and really implement
SetTool{Normal,Disabled}Bitmap().
2018-10-06 14:07:02 +02:00
Scott Furry
2ea9548ffb Add default argument values to wxToolBar::CreateTool() in wxQt
Make the API consistent with the other ports.
2018-10-06 14:06:55 +02:00
Vadim Zeitlin
e0ba727dec Extract X11 functions used by wxGTK in a separate header
This makes src/unix/displayx11.cpp almost readable as it's not littered
by "#ifndef __WXGTK20__" checks everywhere any more -- instead this file
is just not compiled as part of wxGTK2 at all any longer (it is still
included in wxGTK1 as well as wxX11 itself and wxMotif).

wxGTK code also can just include the new wx/unix/private/displayx11.h
instead of having to declare all the X11 functions it uses manually.

There should be no changes in behaviour, this is just a clean up.
2018-10-04 17:07:11 +02:00
Vadim Zeitlin
9cc1424b84 Return empty string from wxDisplayImpl::GetName() by default
Simplify the code by not making this function pure virtual as all the
ports except MSW had to override it just to return an empty string.

Instead, just return empty string by default as it's not critical to
force the derived classes to override this function.
2018-10-04 16:37:12 +02:00
Maarten Bent
32d32f8172 Revert "Fix missing wxOwnerDrawn functions in WXQT wxMenuItem"
This reverts commit 4e23b3e7f4.
wxOwnerDrawn is only used with wxMSW toolkit.
2018-10-01 21:47:33 +02:00
Vadim Zeitlin
761f9f74fc Merge branch 'simplify-display'
Centralize all display-related code in wxDisplay class and avoid
duplicating or reimplementing it in wxDisplaySize() and
wxClientDisplayRect() functions.

See https://github.com/wxWidgets/wxWidgets/pull/955
2018-10-01 13:52:07 +02:00
Stefan Csomor
00197d0c75 removing the menu from the public API of wxChoice on osx
on iOS pickers are having data sources that are not implemented using a menu, therefore the implementation API had to be changed
2018-10-01 08:28:41 +02:00
Stefan Csomor
ca6cae20e8 Adding more osx types as opaque public types 2018-10-01 08:12:03 +02:00
Stefan Csomor
c2ab36a2da add implicit conversion to NSArray* 2018-10-01 08:10:13 +02:00
Stefan Csomor
ef48d7f184 set wxOSX_USE_ICONREF to 0 if not defined 2018-10-01 07:21:49 +02:00
Vadim Zeitlin
ddc88b74b6 Remove unnecessary DLL export declarations for private classes
wxDisplayFactory and wxDisplayImpl don't have to be exported from the
wxWidgets shared libraries and, in fact, shouldn't be.
2018-09-30 23:08:43 +02:00
Vadim Zeitlin
c2162792cf Implement wxDisplaySize() and wxClientDisplayRect() via wxDisplay
Instead of forwarding to these functions from wxDisplay implementation
in wxUSE_DISPLAY==0 case, make the functions themselves wrappers around
wxDisplay, which may, or not, depending on the platform, have a simpler
implementation in wxUSE_DISPLAY==0 case, but is always available in any
case.

As part of this change, only use src/osx/core/display.cpp in macOS
builds, not iOS ones and update the Xcode project accordingly too.

This cuts down on code duplication, especially in wxGTK, and facilitates
further additions to wxDisplay API.
2018-09-30 23:07:45 +02:00
Maarten Bent
7f0d7ef520 Fix several build errors in WXQT
Move declaration of wxOwnerDrawnBase::ms_defaultMargin to correct file.
Do not include headers when wxUSE_UIACTIONSIMULATOR is disabled.
Add guards for wxUSE_DRAG_AND_DROP.
Use a different wxFont constructor in printing sample, which is also available in WXQT.
2018-09-30 17:23:58 +02:00
Maarten Bent
4e23b3e7f4 Fix missing wxOwnerDrawn functions in WXQT wxMenuItem 2018-09-30 17:23:58 +02:00
Maarten Bent
bb82470640 Fix missing gl functions in WXQT 2018-09-30 17:23:58 +02:00
Maarten Bent
8f017509f6 Remove wxConsoleEventLoop from WXQT
The console event loop in the wxBase library is GUI toolkit independent.
2018-09-30 17:23:58 +02:00
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
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