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.
even on dark mode not all NSViews have their own layer, therefore don’t take that as a condition, because a child of such a view still might be layer-backed and need an explicit redraw.
Avoid spurious redraws for not visible windows (especiall important for not-yet fully constructed views or views during destruction)
Return empty rectangle if the item is not currently visible, for
whatever reason, and use physical coordinates for the rectangle origin.
This makes the unit test for GetItemRect() pass under macOS too.
For some unfathomable reason IsExpanded() returns wrong value for one of
the items. This should be fixed, but for now just leave a warning in the
test but don't fail it.
Also document this bug to at least spare people some surprises.
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.
Store wxPGProperty for which wxPGComboBox editor is activated and use
this reference in all further drawing operations instead of retrieving
each time currently selected wxPGProperty which during the entire
lifetime of the editor is the same as property selected on editor
activation.
See #18211.
As anything shown to the user, this string must be translated, so use
_() around it instead of wxT().
Also reword the string a little; remove unnecessary call to .c_str() and
use a const reference instead of making a copy of the URL unnecessarily.
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.
Fix wxNativeFontInfo::ToString and FromString to work correctly under
locales that don't use '.' for decimal separator. The code incorrectly
parsed descriptions using ToCDouble and this '.', but wrote them out
using locale's native separator. Fixed by using FromCDouble for output
too.
A couple of fixes compared to the previous commit:
- Use the correct gtk_tree_view_get_cell_area() rather than
gtk_tree_view_get_background_area() which doesn't work correctly
for the items which are not shown because their parent is collapsed.
- Translate logical coordinates to physical ones using
gtk_tree_view_convert_bin_window_to_widget_coords().
With these fixes, the unit tests for this function pass and can now be
enabled under wxGTK as well.
See https://github.com/wxWidgets/wxWidgets/pull/990
This function returns a wxRect of the given wxDataViewItem. If no column
is provided, the width will be the sum of all the visible columns widths.
See https://github.com/wxWidgets/wxWidgets/pull/990
This will allow reusing it in other tests too.
Also make the output slightly more readable by formatting the rectangle
as "{x,y w*h}" instead of "{x,y,w,h}".
No real changes.
No real changes, just avoid mentioning CPPUNIT_ASSERT_EQUAL() in the
comments for the operator<<() overloads as it is used with CATCH too.
Also don't duplicate the same comment 4 times unnecessarily.
This was already the case if the item was not visible because its parent
was not expanded, but now make it also true for the items which are not
visible due to the current scrollbar position.
Add unit tests checking for this and also verifying that GetItemRect()
returns the coordinates in the physical window coordinates.
Replace a redundant (because the same size was already specified in the
ctor) SetSize() call with a Layout() call which resizes
wxDataViewMainWindow to fit the parent control size when using the
generic implementation.
This is important for any tests dealing with the control geometry, i.e.
calling GetItemRect() or HitTest().
Rename its m_ret field to a more clear and more consistent with
RowToTreeNodeJob::m_current name and also make m_current, unlike m_ret,
0-based from the beginning instead of having to subtract 1 from it in
GetResult().
There should be no changes in the class behaviour.
Get rid of hardcoded, without any explanation, "-2" value passed to this
class ctor and instead initialize its m_current member to -1 and explain
why do we do it and increment it after processing the current item, not
before, in operator().
No changes in behaviour.
Calling GetItemRect() for an item which was not currently visible
because its parent was collapsed resulted in silently returning the
value for a wrong value before the recent fix to GetRowByItem() and in
a crash after it because GetTreeNodeByRow() returned null when passed
invalid row index.
Fix this by explicitly checking whether the item is shown and just
returning an empty rectangle instead.
Also document this behaviour and add a unit test for it.
If the item was not found at all, which can happen if all its parents
are not expanded, this function still returned a valid but completely
wrong row index.
This affected many functions which could call it for the items which
were not necessarily visible, i.e. all of them except for the event
handlers as events can only affect the visible items, including but not
limited to SetCurrentItem(), all the selection-related functions, all
the expansion-related functions, EnsureVisible(), HitTest() and
GetItemRect().