Define the common logic for positioning editors not taking the entire
cell area (i.e. basically anything other than wxGridCellTextEditor) in
the new DoPositionEditor() function.
Also use the cell and editor alignment to decide where to position the
control if it's smaller than the cell, as it looks better if e.g.
wxGridCellDateEditor appears near the place where the date is displayed
instead of being centered in the middle of a wide column.
Even when resizing rows by dragging their edges was disabled via
DisableDragRowSize(), it was still possible to try to resize them when
the mouse was over the cell corner.
Fix this and remove the special case for the corners entirely, it's not
necessary as the existing cases cover this one already.
Just rearrange them in the right order to prefer column resizing, as
this seems to be a much more commonly used operation than row resizing.
It is necessary to do it since the switch to double buffering wxGrid
painting in ebbadae09a (Double buffer wxGridWindow drawing, 2020-01-28)
as even a "full cell" editor such as wxGridCellTextEditor still doesn't
fill the entire cell, as there are margins around it, and the backing
bitmap could keep whatever junk happened to be there if we didn't erase
it, so do erase it now.
Remove the code doing the same thing from ShowCellEditControl(),
however, as it's redundant and doesn't do anything except creating some
flicker, and also doesn't work on the platforms not supporting the use
of wxClientDC anyhow.
This just looks very strange if the row has much bigger height than
default and it already isn't done for other editors, e.g. those using
wxSpinCtrl or wxDatePickerCtrl, for the same reason, so this is also
more consistent.
There is no need to check that the rectangle fits as it's done by wxGrid
itself, so just use a single wxRect::CenterIn() call instead of several
lines doing it manually.
No real changes.
This code never worked (as proved by the conversion in it which was
wrong by a factor of 1e12) and should never be needed anyhow.
Simplify configure and give an error, not warning, if neither
nanosleep() nor usleep() are available, as otherwise we'd just get a
build error later when compiling utilsunx.cpp later.
On Retina display macs, those values can contain halves. If you round
them down, you end up cutting off content (e.g. cutting off the last
letter in a text label).
Closes https://github.com/wxWidgets/wxWidgets/pull/1905
GetPaths/GetFilenames() must be used instead when more than one file
could be selected: document this and assert if the wrong functions are
called.
Closes https://github.com/wxWidgets/wxWidgets/pull/1883
Don't make it larger than 150% than its normal width and also don't make
it larger than its normal width at all if it's not going to be large
enough to cover the entire cell anyhow -- this just looks strange, as
the editor is both too wide and not wide enough.
The existing logic for adjusting the editor window position by moving it
was flawed as it didn't take into account the fact that the editor could
decide to use a different (and usually bigger) rectangle than the one we
provided it with, if it doesn't fit into the given one. Fix it to ensure
that the editor window is fully inside the grid client area by moving it
only after letting it choose its own size.
The existing code was also inconsistent as CalcDimensions() didn't take
any adjustment to the cell rectangle done in ShowCellEditControl() into
account at all and always just blithely assumed it was positioned at the
cell top left corner, which resulted in wrong virtual size calculation
and could make scrollbars appear when starting editing, as happened in
the "Bugs table" example of the grid sample when showing any comboboxes
in the last grid row. Fix this code to use the actual editor rectangle
instead.
This is another attempt to get rid of the flicker when using the native
header control with wxGrid under MSW and avoid calling UpdateColumn(),
which is currently implemented in a very inefficient way in wxHeaderCtrl
under MSW, during interactive resizing.
See #18794.
Clicking on (or near) the grid column or row edges was handled specially
to allow dragging them in order to resize the column or row, but this
doesn't need to be done if drag-resizing the columns or rows is not
allowed in the first place and resulted in surprising user-visible
behaviour: e.g. when using row selection, clicking mostly anywhere in
the row selected it, except if the click happened to be between the two
columns, in which case it didn't.
Fix this and always select the row in such scenario now.
Unfortunately, doing this required adding yet more CanDragXXX()
functions in addition to the already impressive panoply of them in
wxGrid, but we need CanDragGridColEdges() as none of the existing
functions checked for m_useNativeHeader (there was instead an ad hoc
check for it directly in the mouse handling code) and the row version
had to be added for symmetry.
Although the native (single line) text control understands Alt-Backspace
as an accelerator for "Undo", using it was not really practical because
it resulted in an annoying beep due to Alt-anything trying to find an
item with matching mnemonic in the menu.
Work around this native (mis)feature by pretending to handle this
particular Alt-combination ourselves when the currently focused control
is text-like, as indicated by it overriding WXGetTextEntry() -- this is
not ideal, but seems to be the best we can currently do. An alternative
could be to just mark Alt-Backspace as handled unconditionally.
Gradually reduce the page increment in the case of a narrow range for
convenience and to limit possible EVT_SPIN_UP/EVT_SPIN_DOWN ambiguity
when wrapping is on.
Closes https://github.com/wxWidgets/wxWidgets/pull/1900
Not being able to use space for starting editing the values of the
numeric columns was inconsistent with most (if not all) the other ones
and so surprising and inconvenient. Make space work for these columns
too, but just ignore it, i.e. in particular do not erase the current
cell contents when it's pressed, to avoid changing the old behaviour too
much.
Use the following CMake flags:
-DCMAKE_SYSTEM_NAME=iOS - for specifying it is an iOS build
-DCMAKE_FIND_ROOT_PATH=/usr/local - dir to search for the built wxWidgets libraries
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO - don't require signing app packages
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 - specify a target so both the libraries and sample will use the same architecture
Also use the code signing flag when testing precompiled header support.
Don't build the default samples, widgets sample has features that are not supported by the iOS build.
Xcode seems to rebuild the libraries when installing, so call CMake only once.
Start the fold before echoing the description, so the description is shown when folded.
Combine Xcode checks into one statement.
Add missing '-G' argument when building sample using CMake.
wxOSX's wxApp::MacReopenApp() previously contained logic to unhide
hidden windows, but this code was commended out since 2013 as
problematic - it was showing windows like closed, but not yet
destroyed, non-modal dialogs.
Unfortunately while this part was commented out, the rest of the code
that handled existence of hidden windows was not, resulting in a bug
where nothing happened after clicking app icon in the Dock if the
application didn't have any visible window at the moment, but had a
"technical" hidden one, e.g. after opening and closing
wxPreferencesEditor.
Fixed by simplyfing and removing all (functionally commented-out) code
related to hidden windows. Instead, the logic is now:
1. do nothing if some window is already visible
2. restore an iconized window if there's one
3. call MacNewFile() if neither happened
The new method allows to set the zoom level more precisely than the
existing SetZoom(wxWebViewZoom).
Also improve the webview sample by using radio menu items instead of
check items and manually resetting them.
Closes https://github.com/wxWidgets/wxWidgets/pull/1894Closes#18769.
We need to ensure the configure arguments to disable features
are passed in immediately before calling, because the builtin
is the fallback if the system library is not found.
Fixes#18791
Optimize wxGrid::AutoSizeColumns() for big grids.
This includes an optimization of wxDC::GetTextExtent() at the price of
slightly reduced precision in wxMSW.
See https://github.com/wxWidgets/wxWidgets/pull/1893
It turns out that wxEnhMetaFileDC doesn't have any valid font in wxMSW,
so the changes of 70768a33d2 (Dramatically speed up measuring text
extent in wxMSW, 2020-06-10) broke its GetTextExtent().
Fix this by checking if we have a valid font explicitly, although
perhaps a better fix would be to ensure that wxEnhMetaFileDC also always
has a default font, as the other wxDC classes.