This was sufficiently misleading that event our own wxGrid unit tests
used this function in an attempt to start editing a grid cell -- even
though it actually doesn't do it at all.
Unfortunately documenting the surprising semantics of this functions
looks like the best thing we can do because it appears to have always
behaved like this and changing it now to actually show the cell editor
control, i.e. starting to edit the cell, is almost certain to break some
existing code.
This makes simulating keys much more reliable, previously they were just
completely lost (i.e. never resulted in key-press-event signal being
generated by GTK) sometimes.
These tests are still disabled by default during run-time, but at least
allow explicitly enabling them (by setting WX_UI_TESTS=1) even when
using wxGTK where they're known to fail.
Don't use FromDIP together with ConvertDialogToPixels, because the font height
is already adjusted to the DPI.
Also limit the button height at higher DPI. Because the height determined by
ConvertDialogToPixels is higher than standard buttons use on Windows.
Closes#18528
Apparently some existing code still used it, even though it only created
an object that could never be used for anything, so undo its removal in
bd09b4132d and deprecate it instead.
Unfortunately, this also requires changing wxTimerEvent::m_timer type
back to pointer, even though it should be a reference.
Setting WS_EX_COMPOSITED, as the base class version does, just results
in visual artefacts and is useless, as we turn on LVS_EX_DOUBLEBUFFER
already, if it's supported, anyhow.
So don't break the display if people call SetDoubleBuffered() in the
mistaken belief that it does something useful in this case.
There is no need to draw cross hair lines within the entire viewport because only the part inside the current clipping region will be actually drawn. This way we can also avoid working with huge numeric values of coordinates (VIEWPORT_EXTENT = 2^27-1) which apparently are not handled properly by LineTo() API.
Closes#18526.
Get and release the HDC, instead of using WindowHDC. Because stc.cpp is used on
all platforms, don't include wxMSW specific wx/msw/private.h.
Also use const int for the variables.
Since the performance of drawing lines with various pen styles can be the subject of examination it would be good to have the ability to select pen style with a command line option.
So, a new option "pen-style" is supported since now and with this new option "solid", "dot", "long_dash", "short_dash" styles can be explicitly selected.
This reverts commit ec2f175241 because it
doesn't seem useful to forcefully turn off the connecting lines when
wxTR_HAS_BUTTONS is specified: they will still be off by default in
wxGTK and wxMac because wxTR_NO_LINES is part of wxTR_DEFAULT_STYLE, but
will be shown now (as they used to be back in 2.6 days) if a style
excluding wxTR_NO_LINES is explicitly specified.
Closes#11522.
If there is a valid wxWindow, use its DPI. Otherwise use a dedicated function
of the context to get the DPI. Don't use the common wxGraphicsContext::GetDPI
because this will return hard-coded 72 when there is no valid wxWindow.
The grid editor window can be composite, so check whether it or one of
its children focus has focus when determining whether we should set the
focus to the grid when the grid editor is being hidden, otherwise the
focus was simply lost when such an editor was hidden.
Closes https://github.com/wxWidgets/wxWidgets/pull/1599
Some of the grid cell editors (all of them not based on wxTextCtrl
basically, i.e. wxGridCellBoolEditor, wxGridCellChoiceEditor,
wxGridCellEnumEditor) didn't process Esc, Enter and Tab under MSW,
making them inconvenient to use.
Fix this by adding wxWANTS_CHARS style flag to ensure the editors do get
these keys.
Closes https://github.com/wxWidgets/wxWidgets/pull/1598
This is useless, as it always returns true (since 2.31), and just
results in warnings about using deprecated macro (since 2.62).
Also remove the now unnecessary warning suppression macros, as
g_thread_init() wasn't deprecated in 2.30 yet, so it shouldn't give any
warnings in glib versions in which it could be actually used.
gtk_widget_get_preferred_size() return zero size if the GTK widget is
hidden, so show it temporarily in order to find its real preferred size.
Add a unit test checking that the best size of a hidden wxChoice is now
determined correctly.
Closes https://github.com/wxWidgets/wxWidgets/pull/1587
Adjust the length limit before pasting to ensure that all text on
clipboard will be successfully pasted, instead of only pasting the part
of it which fits.
Add a unit test checking that this works.
Closes#4646.