Due to a confusion between DIPs and Pts, the stc autocomp window was
a little larger than it should have been when Direct2D was used.
Instead use the methods defined in SurfaceD2D so the popup will be
measured and drawn the same way the main editor window is.
The stc autocomp popup is supposed to report the location at which text
is drawn with the wxSTCListBox::CaretFromEdge function. To return the
correct value, the popup needs to compute the largest width of any
bitmap used for icons in the popup since text is drawn to the right of
the popup's images.
Previously the wxSTCListBox tried to compute this largest width when
the listbox items were set. However, Scintilla actually calls
CaretFromEdge before setting the listbox items. Consequently the
CaretFromEdge was returning a value that assumed zero width for the
list's images since images had not been set yet.
Instead, keep a running tally of the widest image width when images are
registered. This means that this variable must be moved to the
wxSTCListBoxVisualData class since that is where image registration is
handled. Also track the largest image height since that is also needed.
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
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
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.
Previously, we ensured that the combobox was tall enough, but not that
it was wide enough, which could result in truncation of its contents if
the cell rectangle was too small.
Fix this by increasing the size in both directions, if necessary.
Also make the code simpler by using higher-level wxSize and wxRect
methods instead of fiddling with the coordinates directly.
This allows to make computing the best width of numeric columns an O(1)
operation instead of O(number-of-rows), which can make a huge difference
for big grids.
Previously columns using a set of predetermined values used plain
wxGridCellStringRenderer, which didn't allow to determine their best
size efficiently, as wxGrid had to iterate over all the rows of the
table, even if they only took a couple of possible values.
Add wxGridCellChoiceRenderer (refactoring wxGridCellEnumRenderer to
extract the common code from it in the process) which implements
GetMaxBestSize() by just finding the best size of all of these values,
which is much faster for large grids.
This does result in a change in behaviour, as the column now adapts to
its "theoretical" best size and not just the size of the values actually
shown in it, but this seems to be a worthwhile trade-off and could even
be seen as an advantage, as editing a cell won't make its value overflow
the auto-sized column width any more, as it is wide enough to show any
of the column values.
This is another optimization, useful for the renderers that are used
with the values of a fixed form or part of a limited set, as it is much
faster to compute the best size for all values of the set rather than
computing them for all the cells in the column.
The wxMDIParentFrame::Create() function simply called
wxApp::GetRegisteredClassName(wxT("wxMDIFrame")) without providing
apropriate flags parameter depending on the presence/absence of the
wxFULL_REPAINT_ON_RESIZE flag in style. Thus, the MDI parent frame was
always created using the window class with the CS_HREDRAW | CS_VREDRAW
style flags set. Choosing the appropriate value for the flags parameter
of the wxApp::GetRegisteredClassName() function (like in the
wxWindowMSW::GetMSWClassName() function) fixes the flicker issue. The
wxApp::GetRegisteredClassName() call in wxMDIChildFrame::Create()
is adapted as well just for the sake of consistency.
See #18213.
Closes https://github.com/wxWidgets/wxWidgets/pull/1892
We need to explicitly call SetInitialSize() after setting the value of
the control (if it's not empty), as the first call, done from inside of
PostCreation(), doesn't take the initial control contents into account
and so doesn't allocate the height correctly for multiline text controls
containing more than 2 lines of text, for example.
Closes https://github.com/wxWidgets/wxWidgets/pull/1891
Skip correction for the under/overhang for non-italic fonts: it seems to
be pretty small for them and avoiding the calls to ::GetCharABCWidths()
makes GetTextExtent() 7-8 times faster, which seems to be a worthwhile
compensation.
If we decide to restore these calls in the future, we will need to
implement some kind of cache for them, as they're just too slow
otherwise.
Handle the case of a single line string specially, it's faster to do
this than use slow loop over all characters.
Also avoid constructing the string with the characters to measure one by
one and do it all at once instead.
Add a possibility to benchmark GetMultiLineTextExtent() rather than
GetTextExtent() in the graphics benchmark.
There is no need to reimplement the same logic in wxGrid code when we
already have a perfectly cromulent way to do it in wxDC itself (which
hadn't existed when this code was originally written, explaining why it
wasn't used here before).
This makes the code shorter and also a bit faster, as we avoid using
wxStringTokenizer unnecessarily.
No changes in behaviour.
This completes the changes of f730da3c14 (Add imm32.lib to
wxStyledTextCtrl, 2020-05-10) that didn't take care of MSW makefiles,
that need to contain the new required library as well.
Closes#18788.
Extend wxAnimationCtrl XRC handler to cover wxGenericAnimationCtrl too.
Also fix a bug with wxGenericAnimationCtrl inactive bitmap background.
See https://github.com/wxWidgets/wxWidgets/pull/1889