Commit Graph

1946 Commits

Author SHA1 Message Date
Artur Wieczorek
b6d305e4f2 Assure that all images in the generic wxImageList have the same scale factor
Mixing images with various scale factors could be misleading and error
prone.
2021-04-03 18:54:32 +02:00
Paul Cornett
30637ad3b6 Make wxGridEvent methods GetRow() and GetCol() const and not virtual
See #19085
2021-03-05 07:38:32 -08:00
Paul Cornett
4388b9bd6b Make some member functions const 2021-03-04 11:49:33 -08:00
Dimitri Schoolwerth
7bf2dc71c3 Remove wxGridCellWithAttr
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.
2021-02-15 12:36:03 +01:00
Dimitri Schoolwerth
061191e659 Improve responsiveness of a wxGrid having plenty of attributes
Speed up grid attribute lookups by using a hash map instead of array.

Closes #12764.
2021-02-15 12:36:03 +01:00
Vadim Zeitlin
febd185fc6 Merge branch 'web-request'
Add wxWebViewRequest and related classes allowing to use HTTPS and
HTTP/2.

See https://github.com/wxWidgets/wxWidgets/pull/977
2021-01-17 18:19:47 +01:00
Vadim Zeitlin
4a5de04ece Fix background colour drawing in wxGenericTreeCtrl under Mac
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.
2021-01-16 19:17:57 +01:00
Vadim Zeitlin
9c66a9a8db Merge branch 'macos-native-statusbar' of https://github.com/vslavik/wxWidgets
Improve macOS status bar appearance and simplify code.

See https://github.com/wxWidgets/wxWidgets/pull/2160
2021-01-16 18:57:23 +01:00
Václav Slavík
634f60ff23 Remove redundant code from wxStatusBarMac
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
2021-01-16 18:30:55 +01:00
Artur Wieczorek
dfb09d2ae9 Fix adding wxBitmap with mask to generic wxImageList
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.
2021-01-12 18:21:37 +01:00
Vadim Zeitlin
abcc31c6b2 Update wxCredentialEntryDialog to use wxWebCredentials
As a side effect, make wxWebCredentials default-constructible.

Also demonstrate using wxCredentialEntryDialog in the sample.
2021-01-10 21:27:15 +01:00
Vadim Zeitlin
2ddf8705af Make wxGenericCredentialEntryDialog non-copyable
No real changes, just a bit of extra safety.
2020-12-13 00:09:22 +01:00
Vadim Zeitlin
6bdab7b3c8 Merge branch 'master' into web-request
Merge with the latest master in preparation for merging into master.

Rebake to resolve conflicts in generated files.
2020-12-12 18:12:25 +01:00
Vadim Zeitlin
d47fa718cd Add wxDataViewCtrl::ExpandChildren()
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.
2020-12-05 16:37:13 +01:00
Vadim Zeitlin
f65caa3183 Fix wxDatePickerCtrl build in wxOSX after the previous commit
This should have been done there, as overriding OSXGenerateEvent() is
not necessary (and actively harmful in C++ mode) any more after its
changes.
2020-11-13 13:55:05 +01:00
Vadim Zeitlin
d319e70a7c Fix inheritance hierarchy of wxDatePickerCtrlGeneric too
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
2020-11-13 01:19:52 +01:00
Vadim Zeitlin
5ae2a8ebb8 Simplify API for extending wxListCtrl background display
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.
2020-11-09 00:37:55 +01:00
Marcos
584d1ae47d Allow showing rules and background on entire wxListCtrl window
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
2020-11-09 00:07:53 +01:00
Vadim Zeitlin
8d4b6ac8b8 Merge branch 'date-picker-blank'
Allow customizing text displayed in wxDatePickerCtrl without valid
value, notably not displaying anything in it in this case.

See https://github.com/wxWidgets/wxWidgets/pull/2109
2020-11-05 16:27:13 +01:00
Vadim Zeitlin
8a64b6acea Fix inheritance hierarchy of wxTimePickerCtrlGeneric
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.
2020-11-05 00:34:10 +01:00
Vadim Zeitlin
ce0f10c377 Get dates directly from table in wxGridCellDateEditor if possible
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().
2020-11-03 17:30:54 +01:00
Vadim Zeitlin
cced297b26 Remove unused wxGridCellDateTimeRenderer::m_dateDef
This has apparently never been really used ever since it was added in
d10f4bf950 (applied tons of wxGrid patches, 2001-05-27).
2020-11-03 03:09:17 +01:00
Vadim Zeitlin
705006615f Add support for date format to wxGridCellDateEditor too
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.
2020-11-03 02:57:22 +01:00
Vadim Zeitlin
56ec476a3a Refactor wxGridCellDateRenderer::Parse() to make it reusable
No real changes, just create TryParseDate() helper in order to allow
reusing it from wxGridCellDateEditor too in the upcoming commit.
2020-11-03 02:50:31 +01:00
Gary Allen
095d1e317c Add wxGridSelectNone selection mode
In this mode the user can't select any cells at all in wxGrid.
2020-10-31 17:01:36 +01:00
PB
6fbacb20d8 Remove checks for wxNEEDS_CHARPP
wxNEEDS_CHARPP was needed only for now unsupported GCC versions.
2020-10-19 20:07:16 +02:00
ali kettab
fedc80eee3 Improve selection and focus events generation in wxGenericLisCtrl
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
2020-10-10 19:13:52 +02:00
oneeyeman1
61ef150044 Implement GetStringSelection() in generic wxBitmapComboBox
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
2020-10-01 02:19:12 +02:00
Vadim Zeitlin
b9f946fcd3 Merge branch 'check-headers-max-warn'
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
2020-08-31 15:10:16 +02:00
Vadim Zeitlin
be2a61519b Merge branch 'grid-selected'
Split the wxGrid RANGE_SELECT event into separate SELECTING and SELECTED
events.

See https://github.com/wxWidgets/wxWidgets/pull/2028
2020-08-31 14:55:56 +02:00
Vadim Zeitlin
2f605badf3 Fix g++ 4.8 -Wshadow for parameter/function conflicts
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.
2020-08-31 01:25:07 +02:00
Ilya Sinitsyn
5d3d376766 Remove unused wxGrid function 2020-08-24 02:09:01 +02:00
Vadim Zeitlin
682cb8355c Replace "sendEvent" parameter in wxGridSelection with "eventType"
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.
2020-08-21 11:49:34 +02:00
Ilya Sinitsyn
0a2c62fc5c Remove the selecting mode flag from wxGridSelection
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.
2020-08-20 16:56:03 +02:00
Daniel Kulp
415f080c80 Split wxGrid RANGE_SELECT event into SELECTING and SELECTED
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.
2020-08-20 16:56:03 +02:00
Maarten Bent
b10ba803f5 Make wxGenericColourDialog DPI aware 2020-07-31 22:25:10 +02:00
Maarten Bent
9e2615ac06 Move creating custom bitmaps of wxGenericColourDialog into separate function 2020-07-31 22:25:08 +02:00
Maarten Bent
a54b4073f9 Remove unused members from wxGenericColourDialog 2020-07-31 22:25:04 +02:00
Maarten Bent
4f09f83597 Make wxGenericColourButton DPI aware 2020-07-31 22:25:02 +02:00
Arrigo Marchiori
c86bcf962d Use wxASCII_STR() on string literals
Fix the build with wxNO_IMPLICIT_WXSTRING_ENCODING.
2020-07-17 17:52:16 +02:00
Vadim Zeitlin
857bb9e806 Merge branch 'im/gridcombo' of https://github.com/imciner2/wxWidgets
Close the cell editor when the editor's combobox is closed.

See https://github.com/wxWidgets/wxWidgets/pull/1941
2020-07-15 16:15:42 +02:00
Vadim Zeitlin
8535cde836 Remove apparently unnecessary m_hasExplicitFont
Just use wxWindow::m_hasFont instead.
2020-07-14 15:47:35 +02:00
Vadim Zeitlin
0d7ab26e7d Factor out wxGenericTreeCtrl::InitVisualAttributes()
No real changes, just avoid calling an event handler directly.
2020-07-14 15:46:05 +02:00
Vadim Zeitlin
1ec7ae9a6f Use wxBrush objects instead of pointers in wxGenericTreeCtrl
There is no need for double indirection, wxBrush object is already
pointer-like internally.

No real changes, just simplify/optimize the code a little.
2020-07-14 15:43:23 +02:00
Ian McInerney
b256aa6956 Replace wxEVT_GRID_HIDE_EDITOR usage with CallAfter
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.
2020-07-14 12:28:13 +01:00
Paul Cornett
5325ccfda6 Update generic wxTreeCtrl appearance when theme changes
See #18823
2020-07-13 20:26:59 -07:00
Ian McInerney
8b7fdc5e5b Close the cell editor when the editors combobox is closed
Closes #16404
2020-07-09 18:15:24 +01:00
Stefan Csomor
792e4dcced macOS wxTextEntry::GetTextPeer fix for wxGenericComboCtrl (#1931)
* overriding GetTextPeer in generic combo control

* undo 81e3760e4a

* inlining GetTextPeer()

* moving out of line to reduce header include
2020-07-06 17:06:09 +02:00
Vadim Zeitlin
17b3a9fa96 Add missing wxOVERRIDE to wxGridCellActivatableEditor
Fix -Winconsistent-missing-override due to the changes of ca84560350
(Add wxGridCellActivatableEditor and show it in the grid sample,
2020-06-30).
2020-07-04 13:36:44 +02:00
Vadim Zeitlin
8445d1993e Fix bug in workaround for event handlers deleting wxGrid cells
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.
2020-06-30 19:04:52 +02:00