After the previous commit the coords stored by wxGridCellWithAttr have
become redundant as the coords are now also stored as part of the key
used for an attributes map. With then only an attribute remaining in
wxGridCellWithAttr it can be removed completely, letting the value of
an attributes map point directly to a (ref-counted) attribute instead.
Revert 8535cde836 (Remove apparently unnecessary m_hasExplicitFont,
2020-07-14) and make 9cd3ab5ebd (Improve wxGenericTreeCtrl colours/fonts
updating on theme change, 2020-07-14) really work as expected by using
not only m_hasExplicitFont, but also m_hasExplicit{Fg,Bg}Col in order to
ensure that we only update the attributes if they hadn't been explicitly
set.
This is necessary because the hack with reusing m_has{Fg,Bg}Col didn't
work under Mac where the colour wasn't used at all when they were false.
This still seems to be a problem as the behaviour is different from that
of the other ports, but fixing this in wxOSX doesn't seem to be simple,
so don't rely on this working and use separate variables instead.
Closes#18940.
Remove a lot of Mac-specific code from wxStatusBarMac in favour of using
shared wxStatusBarGeneric:
- Now that wxFRAME_EX_METAL aka NSWindowStyleMaskTexturedBackground
doesn’t affect text placement, there’s no reason for customized
DrawFieldText(). As a side effect of this removal, ellipsizing fields
is now supported.
- Remove customized DoUpdateStatusText() code that is no longer needed.
See https://github.com/wxWidgets/wxWidgets/pull/2160#pullrequestreview-563916013
If wxBitmap with mask is added to wxImageList that doesn't support masks
we need to convert a bitmap mask to alpha channel values prior to adding
bitmap to the list to preserve bitmap transparency.
This convenient method allows to expand all children of the item
recursively.
This is directly supported by both native implementations, so it makes
sense to have this in wxDataViewCtrl itself, even if it could be also
(less efficiently) implemented in the user code.
This is very similar to 8a64b6acea (Fix inheritance hierarchy of
wxTimePickerCtrlGeneric, 2020-11-04) and is done for the same reasons
(avoid having to somehow implement MSW-specific virtual methods of the
native controls base class in the generic version) and suffers from the
same drawback (there is no common base class for the native and generic
version any more).
See https://github.com/wxWidgets/wxWidgets/pull/2109
Replace SetListRulesAlternateColourOnBlank() taking 2 arguments, with
the second of them being used only when the first one is true, with a
simpler but still sufficient ExtendRulesAndAlternateColour(bool).
Make the new method virtual and define it as doing nothing in
wxListCtrlBase class, so that it's still available, even if currently
not implemented, in wxMSW.
Also simplify the implementation, fix style problems and other minor
improvements.
Previously they were both limited to the part occupied by the items
only, add a new method allowing to extend them to the whole client
window area.
See https://github.com/wxWidgets/wxWidgets/pull/2106
This class must not derive from the native wxDatePickerCtrl, as it
doesn't make much sense and resulted in the need for an ugly hack with
either overriding unused and inapplicable pure virtual methods in this
class itself, as was originally done in 569c7d8ccb (Add wxTimePickerCtrl
class., 2011-09-29) when it was introduced, or not making these methods
pure virtual in the first place, as was done in d0da5061ce (Dirty hack
to allow generic wxDatePickerCtrl to compile under MSW., 2011-10-20),
but didn't really fix the problem.
Do fix it now by using different hierarchies for the native and generic
classes. The main disadvantage of doing it is that there is no common
base class for wxTimePickerCtrl and wxTimePickerCtrlGeneric providing
SetTime() and GetTime() methods any more, but this seems like a
relatively small price to pay because real applications won't be using
these two classes simultaneously, as the calendar sample does, anyhow.
Unlike wxGridCellDateRenderer, which already did it, the editor class
always got the cell value from the table as a string, even if the table
supported returning the dates directly.
Fix this by using the same code in the editor as in the renderer, which
required a further refactoring in order to make it reusable: the helper
TryParseDate() was replaced with TryGetValueAsDate() and DateParseParams
was added to allow overriding the arguments passed to it in the
overridden wxGridCellDateTimeRenderer::GetDateParseParams().
This is needed to allow editing the cells using wxGridCellDateRenderer
with a custom format, otherwise the editor might parse the contents of
the cell differently from what is actually shown.
In particular, this ensures that using "date:%d.%m.%y" (or any other
custom format) as "cell type" works correctly, which wasn't the case
before.
Avoid sending spurious wxEVT_LIST_ITEM_{FOCUSED, SELECTED, DESELECTED}
events and make the generic version consistent with the behaviour of the
native wxMSW one.
Also add/extend the tests and slightly improve the sample.
Closes https://github.com/wxWidgets/wxWidgets/pull/2044
Also update the test to avoid assuming that wxBitmapComboBox inherits
from wxComboBox, which now allows it to build (and pass) on all
platforms.
Closes https://github.com/wxWidgets/wxWidgets/pull/2057
Check compilation of all wx headers with all gcc warnings enabled.
This should make it impossible to introduce problems that only appear
when -Wpedantic or -Wany-other-not-completely-unreasonable-warning is
enabled when building user code including wx headers again.
See https://github.com/wxWidgets/wxWidgets/pull/2033
Unlike the later versions, g++ 4.8 produces a -Wshadow when the name of
a parameter is the same of the name of a method, so rename the (private)
parameters to avoid this.
Instead of just passing a boolean flag indicating whether
wxEVT_GRID_RANGE_SELECTED should be sent, pass wxEventType to send, with
wxEVT_NULL being interpreted as "don't send anything".
No real changes yet, but this will allow using the existing functions to
send wxEVT_GRID_RANGE_SELECTING and not only SELECTED in the upcoming
commits.
Remove m_isSelecting and StartSelecting() from wxGridSelection to avoid
inconsistency of wxGridSelection selecting mode state with wxGrid state,
as wxGrid already has m_isDragging field which tells it if the selection
state is final or not.
Instead, just allow wxGrid to specify the event to send from
ExtendCurrentBlock().
We still need a separate EndSelecting() for sending the final
wxEVT_GRID_RANGE_SELECTED event, but send it only for the last selection
block, and not all the selected blocks, as this makes more sense (there
should be one SELECTED event for each block and it was already sent for
the other blocks before) and is consistent with the events generated
when performing the same actions from keyboard.
This will allow the applications that are only interested in the final
selection to ignore the intermediate SELECTING events, which are now
sent as soon as the selection changes while dragging the mouse, and only
handle the final SELECTED ones, when the drag is over.
This simplifies the code by removing the need for a special event,
and also means the combox popup handler is no longer needed to reset
the inSetFocus flag for the closing handler.
The changes of e6e6dbe077 (Fix problems due to deleting grid cells in
the event handlers, 2020-05-02) fixed the bug (see #18731), but
introduced another one in place: if wxEVT_GRID_CELL_CHANGED handler
deleted any cells, wxGrid code could mistakenly restore the "old" cell
value (actually it restored the value for a different cell, as the
current cell coordinates necessarily changed too in this case).
This bug became more visible after the addition of activatable editors
as the new code asserts, instead of trying to restore the old value, if
wxEVT_GRID_CELL_CHANGED is vetoed, which also resulted in asserts if the
handler deleted the current cell instead.
Fix this by separating the cases of event being really vetoed and of the
event handler deleting the cell for which the event was generated and
handle the latter separately from the former where it matters.
This commit is best viewed ignoring whitespace changes.