Commit Graph

68603 Commits

Author SHA1 Message Date
Stefan Csomor
81e3760e4a avoiding assertion on macOS in wxOwnerDrawnComboBox::DoClear
wxTextEntry on macOS is calling GetEditableWindow to arrive at the native text entry view, which in this case fails, so route things directly
2020-07-04 15:06:38 +02:00
Vadim Zeitlin
3c87ffdaec Fix dumping wrong selector in wxOSX trace message
No real changes, just pass the correct (and interesting) value to
wxLogTrace() to actually see which selector are we called for.
2020-07-04 14:10:45 +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
9ea0f6de3c Merge branch 'gendirctrl-fixes' of https://github.com/MaartenBent/wxWidgets
Fixes for handling filters in wxGenericDirCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1925
2020-07-04 13:15:39 +02:00
Gilbert Pelletier
76c7f723fc Add wxFontDialog::RestrictSelection() to disallow raster fonts
Under MSW it is possible to restrict the native font dialog to showing
only scalable fonts only, disallowing the raster fonts, so add a method
to wxFontDialog exposing this functionality in wxWidgets API.

Closes https://github.com/wxWidgets/wxWidgets/pull/1926

Closes #16988.
2020-07-04 13:14:38 +02:00
Maarten Bent
1f0e548e3a Fix null pointer reference when changing filter in wxGenericDirCtrl
See #18799
2020-07-03 23:01:42 +02:00
Maarten Bent
be405158cb Fix height of filter list in wxGenericDirCtrl
Closes #18799
2020-07-03 23:01:41 +02:00
Vadim Zeitlin
b35ef94a72 Merge branch 'mac-cleanup'
Remove unused variable and consistent usage of NULL.

Closes https://github.com/wxWidgets/wxWidgets/pull/1921
2020-07-02 16:06:59 +02:00
Hertatijanto Hartono
bfca375f17 Remove unused wxBitmapDataObject::m_pictCreated
This variable was initialized, but never used, so just remove it.
2020-07-02 16:03:32 +02:00
Hertatijanto Hartono
1676d52d2b Use NULL, not 0, for CGImageRef initialization
No real changes, just improve consistency.
2020-07-02 16:01:45 +02:00
Vadim Zeitlin
1c209f113f Merge branch 'configure-mac-arm'
Fix wxOSX build under ARM using configure.

See https://github.com/wxWidgets/wxWidgets/pull/1920
2020-07-02 14:51:05 +02:00
Hertatijanto Hartono
bb1c1e0fa0 Remove useless casting to CGContextRef
This is not necessary any more after the changes done in 360240a70b
(Replace deprecated methods from utilscocoa.mm (#1916), 2020-06-30).

Closes https://github.com/wxWidgets/wxWidgets/pull/1922
2020-07-02 14:50:06 +02:00
Stefan Csomor
243f81a66e adding arm optimization file 2020-07-01 23:03:09 +02:00
Vadim Zeitlin
d91d97dfa9 Update Catch submodule to use correct ARM break instruction
This is required for unit tests under macOS on ARM.
2020-07-01 22:39:13 +02:00
Vadim Zeitlin
103daf60d4 Don't remove multiple -arch flags from configure flags neither
The changes of 273e2e7343 (Remove duplicated flags from
{C,CPP,CXX,LD}FLAGS in configure, 2020-02-12) took care to leave
multiple -framework flags in LDFLAGS because removing them would be
wrong, but we also need to avoid removing -arch flags, that can possibly
appear multiple times (when using universal binaries) as well.

Change dedup_flags() itself to keep a list of exceptions to pass through
without checking that they're unique. If this list becomes longer in the
future, we could use an array and use "$0 in array" instead of multiple
"==" checks, but for now keep things simple.
2020-07-01 18:45:11 +02:00
Vadim Zeitlin
d7c6dc6235 Default to building wxOSX, not wxiOS, under Apple ARM platforms
Now that desktop Macs using ARM exist, we should default to building the
normal, macOS-targeting, port on them and not wxiOS any more.

This is a backwards incompatible change, but it shouldn't affect many
people, so should hopefully be fine.
2020-07-01 18:33:48 +02:00
Vadim Zeitlin
5a0723223d Merge branch 'grid-activatable-editors'
Add support for activatable editors in wxGrid and make
wxGridCellBoolEditor activatable.

Also a couple of editor-related bug fixes.

See https://github.com/wxWidgets/wxWidgets/pull/1917
2020-07-01 14:37:44 +02:00
Vadim Zeitlin
3cde77244b Actually use the validator passed to wxGridCellTextEditor
SetValidator() had no effect if it was called after creating the editor,
but in some situations it is convenient to call it from BeginEdit(), as
we don't have the cell coordinates before it is called, so ensure that
the validator set using this function is actually used even if it's
called after creating the text control.
2020-07-01 02:20:04 +02:00
Fabian Cenedese
a571a13d44 Fix bug in wxFileName::Normalize() with leading ".."
Don't discard initial ".." when there is more than one such component in
the beginning of the path.

Closes #18800.
2020-06-30 23:00:06 +02:00
Artur Wieczorek
ff87733cd8 Refresh window layout after changing wxSpinCtrl base in widgets sample
Changing the base of the number changes the size of wxSpinCtrl
so the layout needs to be reset to account this new size.
2020-06-30 19:35:15 +02:00
Artur Wieczorek
016924e14c Update wxSpinCtrl size while changing the base under OSX
Changing the base changes the textual representation of the number
so we need to reset the best size of numeric box to enforce
size recalculation.
2020-06-30 19:29:55 +02:00
Artur Wieczorek
5a676ac855 Set proper value of wxSpinEvent generated by wxSpinCtrl
Current way of converting wxSpinCtrl value to integer does not work
for negative values. We can just use here integer value returned
by GetValue().

Closes #18802.
2020-06-30 19:24:58 +02:00
Vadim Zeitlin
c8124b691f Add more commits to ignore when running git-blame
Ignore global changes touching the entire code base as well as some more
local commits which changed the EOL style and so affected all lines.
2020-06-30 19:18:00 +02:00
Vadim Zeitlin
13e1b384e7 Fix another possible bug in wxEVT_GRID_CELL_CHANGED handling
Even when wxEVT_GRID_CELL_CHANGED is really vetoed, it's still possible
that m_currentCellCoords was changed by the handler, so use the row/col
coordinates of the cell that was really changed instead of the possibly
different m_currentCellCoords value to avoid a bug similar to the one
fixed by the previous commit.
2020-06-30 19:15:15 +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
Vadim Zeitlin
f877106663 Use EventResult enum instead of magic numbers in wxGrid code
This is more verbose, but also much more clear (and so allows to remove
some previously necessary comments).

No real changes, even keep the same values for the enum elements as were
previously used: this is probably unnecessary but do it just to minimize
changes.
2020-06-30 18:51:13 +02:00
Tobias Taschner
d881f2e72b Include macOS 11 name in wxGetOsDescription() (#1918) 2020-06-30 18:14:19 +02:00
Vadim Zeitlin
72565cf195 Document nmake arguments needed when using MSVC binaries
In particular, mention that COMPILER_PREFIX must be set.

Closes #18801.
2020-06-30 15:08:11 +02:00
Stefan Csomor
59ea594db7 add autorelease support 2020-06-30 14:45:44 +02:00
Stefan Csomor
6b460d64a8 replacing deprecated methods 2020-06-30 10:20:37 +02:00
Stefan Csomor
1d67ef6cef Replacing Handle based code with CFData 2020-06-30 08:19:08 +02:00
Vadim Zeitlin
505a6f0807 Fix double-to-float conversion warnings in wxWebViewIE
Avoid warnings about truncating double literals to float introduced by
the recent 895424ecc0 (Add wxWebView::SetZoomFactor(float) and
GetZoomFactor(), 2020-06-13) by using float literals in the first place.

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

See #18769.
2020-06-30 02:36:49 +02:00
Vadim Zeitlin
dc69cb79d7 Support activation in wxGridCellBoolEditor
This makes it much more convenient to use interactively, as the cell
value is toggled immediately and, even more importantly, the UI doesn't
enter the confusing editing mode which doesn't look any different from
the normal grid appearance except for the current cell border absence.

Note that we still keep support for classic in-place editing to preserve
compatibility with the code which calls EnableCellEditControl()
explicitly and expects an editor to be shown, but perhaps we could
switch to using only activation in the future.
2020-06-30 02:31:29 +02:00
Vadim Zeitlin
ca84560350 Add wxGridCellActivatableEditor and show it in the grid sample
Add a helper class making it easier to define activation-only editors
and use it to implement MyGridStarEditor in the sample, showing a
typical example of using such editor.
2020-06-30 02:30:36 +02:00
Vadim Zeitlin
3cc3236f10 Add support for "activatable" editors to wxGrid
This is useful for editors which don't really need to show any control
as they can change their value directly and will be used to reimplement
wxGridCellBoolEditor in the upcoming commits.
2020-06-30 02:25:14 +02:00
Vadim Zeitlin
73532c4d95 Fix "wider column" width in the grid sample
The changes of the commit 393f5c8e2b (Use less arbitrary column/row
sizes in the grid sample, 2020-03-31) accidentally made this column
narrower than default instead of making it wider due to a typo in the
name of wxGrid method: it should be the default column size, not the
default column label size.
2020-06-30 01:39:50 +02:00
Vadim Zeitlin
f845a8dc71 Always initialize wxGridCellBoolEditor::m_value
Do it even when the cell value is not one of the recognized boolean
representations, as we later use m_value as an index into a 2 element
array and leaving it uninitialized could result in an out of bound
access, so make sure this doesn't happen.
2020-06-30 01:04:31 +02:00
Vadim Zeitlin
251584b73b Refactor wxGridCellBoolEditor to make some functions reusable
No real changes, just factor out code for getting and setting the grid
cell value as bool from {Begin,Apply}Edit() to {Get,Set}GridValue() to
make it possible to reuse these functions in the upcoming commits.

This commit is best viewed with the --color-moved option.
2020-06-30 01:04:03 +02:00
Vadim Zeitlin
d14a33bf37 Merge branch 'grid-streamline'
Various simplifications and bug fixes in wxGrid code, mostly related to
handling in-place cell editing.

See https://github.com/wxWidgets/wxWidgets/pull/1910
2020-06-30 00:25:46 +02:00
Maarten Bent
dec895e1d7 Add more initialization checks for wxSTC SurfaceD2D target
Return early if the check fails. No functional changes.

This commit is best viewed ignoring whitespace changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1914
2020-06-30 00:23:31 +02:00
Artur Wieczorek
a2823983a3 Automatically adjust wxSpinCtrl size in widgets sample
wxSpinCtrl/wxSpinCtrlDouble best size is adjusted automatically
while changing the value range so there is no need to resize
the controls manually.
2020-06-29 23:23:27 +02:00
Artur Wieczorek
0065799965 Fix calculating the size of wxSpinCtrl numeric box under wxOSX
Since 8189ce89ed (Improve wxTextCtrl::DoGetSizeFromTextSize() in wxOSX, 2020-05-28) GetSizeFromTextSize() is fully functional under wxOSX
so we can revert 39d586421b (Don't call GetSizeFromText() under wxOSX, 2020-05-21) and use GetSizeFromText() in calculating text box size.

Closes #18766.
2020-06-29 23:23:27 +02:00
Stefan Csomor
ce9b7bcd81 replace deprecated constants 2020-06-29 22:42:09 +02:00
Stefan Csomor
f739fd13ca switching to 10.10+ API 2020-06-29 22:37:01 +02:00
dvertx
360240a70b Replace deprecated methods from utilscocoa.mm (#1916) 2020-06-29 22:27:25 +02:00
Robin Dunn
42a5745367 InheritAttributes is public in the base class, make it so here too. 2020-06-29 12:23:10 -07:00
Robin Dunn
c43af017c9 Document wxDC::[GS]etGraphicsContext 2020-06-29 10:14:43 -07:00
Vadim Zeitlin
4e62b24042 Fix bug with Shift-Enter selecting cells while editing
It was unexpected that pressing Shift-Enter while an editor was active
didn't close it, but just selected the cell below (and then the one
below it if pressed again and so on), so now always finish editing when
it's pressed.

It could be argued that it's still unexpected for Shift-Enter to select
the cell below after closing the editor, but this is consistent with how
Tab works, and so shouldn't be as confusing as the old behaviour.
2020-06-28 23:14:32 +02:00
Stefan Csomor
f80ac025ba added wxUSE_MENUBAR
for platforms like iOS where menus are available but menubars are not we need a finter level of control
2020-06-28 22:59:00 +02:00
Vadim Zeitlin
3747169660 Remove apparently unnecessary wxGrid::m_inOnKeyDown
Although this variable, and a check for it in OnKeyDown(), was present
since the first version of this code added back in f85afd4e46 (Added new
wxGrid classes[...], 1999-10-06), there doesn't seem to be any
indication that it has ever been needed, so remove it to simplify the
code and make it possible to add early returns to this function easily.

No real changes yet.
2020-06-28 22:53:10 +02:00