Commit Graph

17967 Commits

Author SHA1 Message Date
jbbbms
87195cf3ea Put wxDECLARE_EVENT_TABLE at the end of wxTextCtrl declaration
This fixes the access specifier effectively used for the members
following these macros, as it's changed to "public" inside them, meaning
that e.g. m_privateContextMenu was actually public even though it was
ostensibly declared in the private section and the intention was for it
to be private.

Closes #16038.
2018-11-10 23:37:33 +01:00
Artur Wieczorek
c86f795914 Move shared wxVector utilities to one place 2018-11-10 22:27:57 +01:00
Artur Wieczorek
43f7e35c52 Explicitly return Boolean value as declared 2018-11-10 20:56:24 +01:00
Artur Wieczorek
e2115d0d6f Remove unneeded calls to c_str() 2018-11-10 20:44:54 +01:00
Artur Wieczorek
322d6874c3 Use wxVector<> instead of wxArrayPGProperty 2018-11-10 20:43:58 +01:00
Vadim Zeitlin
664b8c153f Don't export sorted dynamic arrays from the shared library
This shouldn't be necessary and doing it seems to result in duplicate
symbol errors when using MSVC under some not completely elucidated
circumstances.

See https://github.com/utelle/wxpdfdoc/pull/48

Closes https://github.com/wxWidgets/wxWidgets/pull/1013
2018-11-10 12:17:53 +01:00
Vadim Zeitlin
463deb03c9 Merge branch 'gtk-dpi'
A bunch of improvements for per-monitor DPI support in wxGTK and
wxGraphicsContext more generally.

Closes https://github.com/wxWidgets/wxWidgets/pull/995
2018-11-10 12:15:27 +01:00
VZ
cce9ef9d53 Fix compatibility breakage with wxMask::Create() in wxOSX (#1019)
Defining a Mac-specific Create(wxMemoryBuffer) overload hid the other
Create() overloads, which are actually part of the public API, so they
couldn't be used any longer since the changes of
e7d21f6638

Fix this by renaming this Create() to OSXCreate(), to avoid hiding the
base class methods.

Also remove Mac-specific ctor taking wxMemoryBuffer, this is confusing
and can be avoided by just calling OSXCreate() directly in the only
place where it is used.
2018-11-09 17:52:58 +01:00
Vadim Zeitlin
3d18e1a2b4 Merge branch 'joystick-fixes'
Harmonize joystick events between different platforms.

See https://github.com/wxWidgets/wxWidgets/pull/1017
2018-11-07 18:33:26 +01:00
Vadim Zeitlin
5e53b22bd4 Add wxGraphicsContext::GetWindow()
This method allows to retrieve the window this context is associated
with, if any.

Add "wxWindow*" argument to wxGraphicsContext ctor and provide the
window pointer to it when available, i.e. when creating the context from
a wxWindow directly or from wxWindowDC, which is also associated with a
window, in platform-specific code.

No real changes yet.
2018-11-06 03:36:53 +01:00
Vadim Zeitlin
3e246c767f Return true from wxHyperlinkCtrl::MSWOnNotify()
As SendEvent() not only sends the event about clicking on the link, but
also opens the link in the default browser if this event was not
processed (which wasn't really obvious from its name, so at least
mention it in its comment), the event is actually always handled and so
MSWOnNotify() must return true, not false (and definitely not 0) to
indicate it.

Closes #18266.
2018-11-05 19:35:44 +01:00
Vadim Zeitlin
1c68979fb4 Move wxCTZ() documentation to the appropriate place
The documentation comment belongs to interface/wx/math.h, not the header
under include.

Also change the argument type to wxUint32 as the non-gcc version only
works for 32 bit values.
2018-11-05 19:27:53 +01:00
Mick Phillips
291a880d0c Synchronize joystick events between all ports
Generate wxJoystickEvent with the same fields under all platforms by
making the Linux and macOS versions follow MSW convention of using
"1 << N" for the changed button.

Add GetButtonOrdinal() accessor which can be used to retrieve just N.

Closes #18233.
2018-11-05 19:27:36 +01:00
Vadim Zeitlin
84d3ee10cc Merge branch 'simplify-imagelist'
Merge Mac-specific and generic wxImageList versions and modernize the
code.

See https://github.com/wxWidgets/wxWidgets/pull/1001
2018-11-04 14:15:16 +01:00
Artur Wieczorek
161bb592ce Use wxVector<int> instead of wxArrayInt 2018-11-01 18:22:22 +01:00
Artur Wieczorek
e7357eafa2 Declare array explicitly as a wxVector instead of using wxArrayPGProperty alias 2018-11-01 18:19:56 +01:00
Paul Cornett
e13a2cfd03 Make wxGtkStyleContext ctor explicit, just to be safe 2018-11-01 08:50:59 -07:00
Paul Cornett
5ff0d3a458 Improve wxRendererGTK drawing with HiDPI 2018-11-01 00:11:31 -07:00
Vadim Zeitlin
5ee0edde99 Merge branch 'propagate-inform-first-dir'
Fix some layouts involving wxWrapSizer by correctly propagating
InformFirstDirection() call to the nested sizers that need it.

See https://github.com/wxWidgets/wxWidgets/pull/988
2018-11-01 00:13:18 +01:00
Vadim Zeitlin
f57cb6c1d9 Add wxDisplay(wxWindow*) ctor with fall back on primary display
This is more convenient than calling GetFromWindow() and then checking
its return value.
2018-11-01 00:02:47 +01:00
Vadim Zeitlin
83a7b49954 Always store wxBitmap objects in wxGenericImageList
There doesn't seem to be any point in storing pointers to wxBitmap or
wxIcon and storing the objects directly allows to avoid an extra heap
allocation and all the code dealing with freeing memory when replacing
or removing images from the list, making things much simpler.

Also use wxVector<> for storage instead of the obsolete and ugly
wxObjectList.

There shouldn't be any user-visible changes.
2018-10-31 15:35:30 +01:00
Vadim Zeitlin
3b5441f59e Deprecate wxGenericImageList::GetBitmapPtr()
This function was in effect deprecated since 2.5.5 (!) and it's not
finally time to do it formally and to stop using it in wxWidgets own
code.
2018-10-31 15:35:30 +01:00
Vadim Zeitlin
61e4534bd2 Deprecate useless wxGenericImageList::Create() overload
This overload doesn't do anything and doesn't exist in the MSW version,
so deprecate it.
2018-10-31 15:32:23 +01:00
Silent
6fff1c37b5 Avoid using mismatched translations for wxWizard buttons
Cache labels for "Next>" or "Finish" button in wxWizard so that their
translations stay consistent throughout wizard's lifetime: previously,
this button could use a label in a different language if the currently
used translations have changed since the wizard creation, as this label
was recreated on every page change, unlike the other labels which were
only translated once in the very beginning.

Closes https://github.com/wxWidgets/wxWidgets/pull/1000
2018-10-30 23:45:12 +01:00
Vadim Zeitlin
9f8684c789 Factor out wxDisplayImpl::ComputePPI() helper
No real changes, this is a pure refactoring.
2018-10-30 23:43:29 +01:00
Vadim Zeitlin
26c6db4b90 Replace wxGenericImageList::m_{width,height} with m_size
Using a single wxSize variable is slightly simpler and shorter than
using 2 ints.

No real changes.
2018-10-30 22:01:32 +01:00
Stefan Csomor
9a05410470 Adding IsSolid to wxColour
Under macOS colors can be patterns, then accessors for RGB values are useless, IsSolid returns true if the color can be expressed in RGB values at all.
2018-10-30 20:53:35 +01:00
Vadim Zeitlin
c374eefd34 Fold wxOSX-specific wxImageList into generic version
Get rid of wxOSX wxImageList implementation as it was 99% identical to
the generic version and the non-identical parts should really have been
made part of the generic version too from the beginning.

Notably, use GetScaled{Width,Height}() in Add() method in the generic
version too now.
2018-10-30 16:28:07 +01:00
Vadim Zeitlin
a2a3518b71 Also remove wxImageList::Replace(wxIcon) overload from wxOSX
This one is harmless, unless Add() overload removed by the previous
commit, but still unnecessary.
2018-10-30 16:28:07 +01:00
VZ
3ab2bfd62a Remove unused wx/osx/icon.h header (#998)
This header isn't necessary any longer after the changes of
0bdd7e5f48
2018-10-30 09:34:19 +01:00
VZ
d118ca6c56 Remove wxImageList::Add() overload taking wxIcon from wxOSX (#997)
This is not necessary as wxIcon is implicitly convertible to wxBitmap
anyhow, so calling Add(icon) works using the existing Add(wxBitmap)
overload, and is actually harmful because of the wrong icon size check
in this function, which used physical bitmap size instead of the logical
(scaled) size.

Closes #18188.
2018-10-30 09:31:15 +01:00
Vadim Zeitlin
53f527726e Merge branch 'use-scrollbar-fixes'
Minor fixes, mostly add wxUSE_SCROLLBAR guards.

See https://github.com/wxWidgets/wxWidgets/pull/989
2018-10-29 23:15:39 +01:00
Vadim Zeitlin
a34bedd7b5 Revert "Add guard over wxMSWDateControls"
This reverts commit f1fa6d5ea2 which
doesn't seem correct nor necessary.
2018-10-29 23:12:57 +01:00
Vadim Zeitlin
f09b9dbfa2 Add wxDisplayImpl::GetScaleFactor() and implement it for wxGTK
We need to account for the scale factor under GTK+ (and, presumably,
under macOS) to compute the correct PPI value as it must use the number
of physical and not logical pixels.
2018-10-29 18:33:26 +01:00
Vadim Zeitlin
8890a25db3 Merge branch 'setup-h-cmake' of https://github.com/MaartenBent/wxWidgets
Fix issues with generating setup.h.in.

See https://github.com/wxWidgets/wxWidgets/pull/994
2018-10-29 15:18:43 +01:00
Vadim Zeitlin
5d5654742f Merge branch 'msw-popup'
Reimplement wxPopupWindow using WS_POPUP instead of WS_CHILD window in
wxMSW as the new approach allows using the controls inside the popup
normally, unlike the old one.

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

Closes #18243.
2018-10-27 15:08:22 +02:00
Maarten Bent
c41255bd98 Add recent macOS setup.h defines to correct file
It was added to setup.h, not setup_inc.h. Regenerating setup.h would remove the defines.
2018-10-24 19:30:41 +02:00
Stefan Csomor
651e1cd1b5 Supporting newer transparent background API 2018-10-22 22:36:42 +02:00
Stefan Csomor
7dfbe50fc0 fixing proper font rendering color when using emulated bold
when the stroke width is set in macOS (emulated bold), the stroke color was not correctly set - unless text color was black
2018-10-22 17:43:31 +02:00
Tim Stahlhut
09aa25ab4a Add wxUSE_SCROLLBAR guards in wxUniversal 2018-10-21 22:01:50 -04:00
Tim Stahlhut
f1fa6d5ea2 Add guard over wxMSWDateControls 2018-10-21 22:01:49 -04:00
Tim Stahlhut
caa6e5de2f Add message "wxStyledTextCtrl requires wxUSE_SCROLLBAR" 2018-10-21 22:01:49 -04:00
Tim Stahlhut
71a2fc0706 Forward declare wxQt template class 2018-10-21 22:01:49 -04:00
Vadim Zeitlin
c6cc416977 Propagate InformFirstDirection() to wxCollapsiblePane pane
As wxCollapsiblePane doesn't use sizers for layout (and while this could
be changed for the generic version, it still wouldn't fix the problem
for the native one), default InformFirstDirection() implementation
forwarding it to the window sizer doesn't work for it and we need to
explicitly let the contents of wxCollapsiblePane know about the
available size.
2018-10-21 16:45:24 +02:00
Vadim Zeitlin
e397d5d825 Propagate InformFirstDirection() calls to wxBoxSizer children
InformFirstDirection() is required to let wxWrapSizer calculate its best
height from its current width (or vice versa, but usually in this
sense), but it only worked if wxWrapSizer was an immediate child of
another size doing layout but not if wxWrapSizer was inside another
wxBoxSizer which was contained in a top-level sizer.

Explicitly forward calls to InformFirstDirection() to wxBoxSizer
children to fix this and make wxWrapSizers nested in wxBoxSizer work.

Note that there are still many problems in this code, including but not
limited to:

- Doing this forwarding for the sizer minor direction only.
- Not passing the correct value of "availableOtherDir".
- Still calling InformFirstDirection() from RecalcSizes(), when it's too
  late to change the min size returned by CalcMin().
- Inconsistency: wxGridSizer calls InformFirstDirection() from its
  CalcMin(), wxFlexGridSizer calls it from its RecalcSizes(),
  wxGridBagSizer doesn't call it at all.

All this size-in-first-direction logic really needs to be completely
reviewed, but for now at least make wxWrapSizer inside a wxBoxSizer work
as well, or as badly, as wxWrapSizer on its own.
2018-10-21 15:58:33 +02:00
Vadim Zeitlin
56c4191168 Reimplement wxPopupWindow as a WS_POPUP window under MSW
Don't use the child window of the desktop window for popup windows under
MSW, while this worked in simplest cases, it didn't allow having
functional controls inside a wxPopupWindow as e.g. wxTextCtrl didn't
accept input it at all if created as a child of such window.

Instead, switch to using a top-level window, with WS_POPUP style, and
fix the problem with the loss of activation by explicitly pretending to
still be active in the owner window when losing activation to our own
popup (thanks to Barmak Shemirani for providing this solution).

Also use an MSW-specific and much simpler implementation of detecting
when the popup should be dismissed in wxPopupTransientWindow: instead of
capturing mouse or tracking focus, just react to activation loss
directly.

Add a wxTextCtrl to the popup in samples/popup to show that editing it
works now.
2018-10-20 22:50:46 +02:00
Artur Wieczorek
5fb9d8d244 Use dedicated function to change flag 2018-10-13 23:33:21 +02:00
Vadim Zeitlin
bc974910ec Implement setting bitmaps for the menu item for wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/975
2018-10-11 14:40:20 +02:00
Vadim Zeitlin
8e1c4e9238 Avoid harmless signed/unsigned warning in g++ 5.4 wxGTK build
Change GTKGetEntryTextLength() to return a signed value, as it's always
either assigned to or compared with the signed variables anyhow.

This avoids a couple of -Wsign-compare warnings when building with g++
5.4 from Ubuntu 16.04.
2018-10-11 01:05:43 +02:00
Vadim Zeitlin
b0c025e9fd Build fix for wxUSE_CONSOLE_EVENTLOOP==0 under Unix
Don't declare GetEventLoopSourcesManager() in Unix wxAppTraits if
console event loops are not used.

See https://github.com/wxWidgets/wxWidgets/pull/953
2018-10-10 19:07:28 +02:00