Commit Graph

68574 Commits

Author SHA1 Message Date
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
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
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
Vadim Zeitlin
a5f172bacb Fix hiding the editor when the mouse simply moved around
Since the changes done in 8b2237cd2d (Make row/column drag-resizing in
wxGrid "live", 2020-03-01) the grid editor was dismissed whenever the
mouse crossed any row/column separator, which was, of course, wrong, as
it was only supposed to be hidden when row/column was actually resized,
i.e. when the separator was dragged by the mouse.

Fix this by moving calls to DoStartResizeRowOrCol() to more appropriate
places and do it only when the button is pressed now.

Note that it might actually be better to just disable column/row
resizing while a cell is being edited, but for now keep things working
as they did before and at least fix the latest regression which is
definitely unwanted.
2020-06-28 18:54:45 +02:00
gerard-durand
604e64a519 Small improvements in French translation
Closes https://github.com/wxWidgets/wxWidgets/pull/1913
2020-06-28 18:34:38 +02:00
Stefan Csomor
d3d508b7e6 Fix visibility of embedded controls in non-native toolbar 2020-06-28 17:46:16 +02:00
Vadim Zeitlin
47adeb14b9 Remove unnecessary Mac-specific IsShownOnScreen() implementation
It ended up returning the result of the base class method anyhow, just
after doing a lot of unnecessary work, so this commit shouldn't change
anything, but should significantly speed up this function.

We may want to explore the possibility of implementing this method
natively using GetPeer()->IsVisible() later, as it could be faster than
our own implementation, but we need to ensure that this always returns
the same result as before, which might not be the case when the TLW is
in the process of being shown or hidden, so don't do this for now.

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

Closes #18645.
2020-06-28 15:38:50 +02:00
Vadim Zeitlin
b7bfe53bed Merge branch 'spelling-fixes'
Fix spelling mistakes found by codespell in the headers and
documentation.

See https://github.com/wxWidgets/wxWidgets/pull/1909
2020-06-28 15:31:54 +02:00
Vadim Zeitlin
f03878251b Also fix spelling mistakes in the documentation files
Run the same codespell command on docs directory.
2020-06-28 15:30:04 +02:00
Stefan Csomor
2e95a03a7b removing erronously added files 2020-06-28 09:11:39 +02:00
Stefan Csomor
199a3f51ef remove older code for new macos 10.10 base requirement 2020-06-28 08:47:50 +02:00
Vadim Zeitlin
c7f77afbf4 Avoid macOS debug messages about invalid glyph index
Don't use NSLayoutManager lineFragmentRectForGlyphAtIndex:effectiveRange
when NSTextView is empty, as this result in debug error messages.

Fall back to using the font height in this case instead, as this seems
to be the only thing to do in this case.

Closes #18793.
2020-06-28 02:18:56 +02:00
Vadim Zeitlin
7235c77f81 Use GetCellSize() return value instead of checking rows/columns
No real changes, just use the value returned by the function to
determine if the cell is inside a multi-cell, instead of comparing
rows/columns with 0 to make code slightly more readable and self
explanatory.
2020-06-28 01:55:17 +02:00
Vadim Zeitlin
a400a380f2 Add wxGrid::DoEnableCellEditControl() with bool return value
Checking the new function return value is simpler than checking the
value of m_cellEditCtrlEnabled after calling EnableCellEditControl().

Do this now also when starting editing using the mouse, as it was simply
forgotten before and so StartingClick() was still called even if editing
was vetoed.

Also add DoDisableCellEditControl(), but this one exists purely for the
symmetry.
2020-06-28 01:47:06 +02:00
Vadim Zeitlin
2d9112bd9b Add DoHideCellEditControl() for symmetry
This also allows to reset m_cellEditCtrlEnabled earlier, as we don't
have to keep it true for the duration of HideCellEditControl()
execution.

No real changes, as with the previous commit, this one is best viewed
ignoring whitespace changes.
2020-06-28 00:40:09 +02:00
Vadim Zeitlin
c73634c520 Add DoShowCellEditControl() showing the editor unconditionally
It doesn't make sense to perform the checks in ShowCellEditControl()
when it's called from EnableCellEditControl() and this makes the code
unnecessarily fragile as m_cellEditCtrlEnabled needs to be set at just
the right moment for it to work correctly.

Call the new DoShowCellEditControl() instead and perform the checks only
in the public function, for compatibility.

Also note in a comment and the documentation that ShowCellEditControl()
is not very useful anyhow and that EnableCellEditControl() should most
often be used instead.

No real changes (the commit is best viewed ignoring whitespace changes).
2020-06-28 00:30:57 +02:00
Vadim Zeitlin
181747f462 Remove useless IsCellEditControlEnabled() checks
There is no need to do this before calling DisableCellEditControl() as
it won't do anything if the cell edit control is already disabled.
2020-06-28 00:21:23 +02:00
Vadim Zeitlin
c14008f287 Add file allowing to always ignore some commits with git-blame
Skip some commits that don't introduce any interesting changes when
running git-blame, as we never really care about them.
2020-06-28 00:11:53 +02:00
Vadim Zeitlin
63643eb122 Fix typo in wxGrid::EnableCellEditControl() documentation
Just s/show/shown/
2020-06-28 00:02:43 +02:00
Vadim Zeitlin
45bc2e648b Remove check for read only cells from IsCellEditControlEnabled()
This check was introduced back in 283b7808d8 (added support for readonly
cells and 3d border drawing, 2000-02-16), but was wrong even then and
remained wrong ever since: we must not set m_cellEditCtrlEnabled to true
when the current cell is read-only, so there is no need to check for the
latter condition if m_cellEditCtrlEnabled is indeed true.

Ensure that we really never erroneously set m_cellEditCtrlEnabled for
the read-only cells by replacing an wxASSERT_MSG checking for this in
EnableCellEditControl() with wxCHECK_RET().

Also explicitly document this function precondition, also added back in
b54ba67107 ([...] added CanEnableCellControl() and use it before calling
EnableEC, 2000-02-17) but never documented so far.
2020-06-28 00:02:29 +02:00
Vadim Zeitlin
1a330bb43e Remove apparently useless call to ShowCellEditControl()
This code seems to have been there ever since da6af900f1 (Added
drag-shrinking, 2000-02-04), but while it probably made sense back then,
it lost its purpose a long time ago as the cell editor is now not only
hidden, but also disabled when drag-resizing starts, so it doesn't make
sense to attempt showing it back when the mouse button is released: it's
never going to do anything (and didn't).

Just remove this code, as hiding the editor while drag-resizing is not
the behaviour we want from the UI point of view anyhow. And, again,
removing it doesn't actually change anything in the current version of
the code.
2020-06-27 23:34:11 +02:00
Vadim Zeitlin
fca9460522 Fix typo in wxWebViewEdgeImpl::Uninitialize() name
As this is a private header, we can fix this without any compatibility
concerns.

Thanks codespell for finding it.
2020-06-27 22:56:22 +02:00
Vadim Zeitlin
d7f19ee610 Fix spelling in comments and documentation using codespell
Apply the utility from https://github.com/codespell-project/codespell/
to fix spelling issues in the headers under both include and interface
directories and add a file with a couple of exceptions.

The exact command line used was:

    $ codespell -w -I misc/scripts/codespell.ignore -i 3 in*
2020-06-27 22:56:22 +02:00
Vadim Zeitlin
4b1f057d74 Factor out DoAcceptCellEditControl() into a separate function
This allows to fold the last DoSaveEditControlValue() call into this
function, so that it's only called from DoAcceptCellEditControl() or
from SaveEditControlValue() (which is public, and hence can't be
changed, even if its behaviour doesn't make much sense).

This commit means that m_cellEditCtrlEnabled is now reset to false when
AcceptCellEditControlIfShown() is called, which was not the case before,
but this seems to make sense, as we shouldn't be just hiding the editor
while leaving it enabled, and, also, doesn't really seem to change
anything as hiding the editor indirectly results in a call to
DisableCellEditControl(), via wxGrid::OnHideEditor(), and so it was
actually already reset before -- but now this happens slightly earlier
and more explicitly.
2020-06-27 17:13:04 +02:00
Vadim Zeitlin
3a874471c3 Add helper AcceptCellEditControlIfShown() function
This is just another refactoring in order to avoid duplicating calls to
HideCellEditControl() and SaveEditControlValue() in several different
places.

Also call DoSaveEditControlValue() because if the editor is shown, it is
also necessarily enabled and there is no need to check for this.
2020-06-27 16:57:40 +02:00
Vadim Zeitlin
0fb153a2bd Use ProcessWindowEvent() in wxGrid code
No real changes, just replace multiple calls to ProcessEvent() on
GetEventHandler() with a simpler call to ProcessWindowEvent().
2020-06-27 16:46:52 +02:00
Vadim Zeitlin
2a368fec9f Document that using wxClientDC for drawing is not portable
We can't make wxClientDC work on the platforms not supporting drawing
outside of wxEVT_PAINT handler, but at least document that this doesn't
work.

Also add an example of using this class for the purpose for which it
still works (measuring) and remove references to it and wxWindowDC from
wxPaintDC documentation as we don't want to encourage people using it.

See #17820.
2020-06-27 16:37:48 +02:00
Vadim Zeitlin
ed0f58c2dd Add helper wxGrid::GetCurrentCellEditorPtr() and use it
No real changes, just simplify the code by using a single function to
retrieve the editor to use for the current cell.

This also allows to get rid of a few temporary variables, further
amplifying the simplification.
2020-06-27 16:00:02 +02:00
Vadim Zeitlin
d5e568c2d9 Merge branch 'stc-tech-fix'
Fix size and position of STC popups when using DirectWrite.

See https://github.com/wxWidgets/wxWidgets/pull/1906
2020-06-27 13:51:36 +02:00
Vadim Zeitlin
3bd832b2f3 Add comment after closing "#endif" for clarify
No real changes.
2020-06-27 13:51:01 +02:00
Vadim Zeitlin
8129b38ee4 Remove unnecessary pointer check before deleting it
No real changes.
2020-06-27 13:50:59 +02:00
Vadim Zeitlin
b7e7bb763a Fix rare crash when using native header in wxGrid under MSW
Pressing Esc while double clicking on the column separator in the native
header in wxGrid could result in a crash due to using invalid index when
calling GetColLeft(m_dragRowOrCol) in GetPositionForResizeEvent() called
from DoHeaderEndDragResizeCol() because m_dragRowOrCol had been already
reset to -1.

Guard against the crash with a check in GetPositionForResizeEvent()
itself and also add a check to DoHeaderDragResizeCol() to avoid calling
the former function in this case.

Reproducing the original problem is relatively simple as it's enough to
just keep double clicking a column separator while also pressing Esc,
but catching it under debugger is much more complicated and so it's not
really clear how exactly does this happen, but tracing shows that the
native control just decides to generate two HDN_ENDTRACK messages
without any intervening HDN_BEGINTRACK, so it doesn't seem like we can
do anything else than just silently ignore the unwanted HDN_ENDTRACK, as
it's done in this commit.
2020-06-27 01:42:57 +02:00