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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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/986Closes#18243.
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.
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.
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.
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.