This adds a demonstration of autocompletion for C preprocessor
directives to the stc sample. It also shows how to register and use
small images with the autocompletion popup.
In this case wx-specific RTTI is used and GetWxTypeId() method was
overridden without using wxOVERRIDE, which resulted in dozens of
warnings for each translation unit.
In wxMSW, a focused wxRadioButton is always checked, which meant that
checking a wxRadioButton while focus was not in the window containing it
and later giving the focus to that window could uncheck it by giving
focus to another wxRadioButton that had had it previously.
Fix this by adding WXSetPendingFocus() to wxMSW wxWindow and calling it
from wxRadioButton::SetValue() to ensure that when the focus is
regained, it goes to the newly checked radio button and not some other
one.
This replaces the previously used, for the same purpose, wxMSW-specific
wxTopLevelWindow::SetLastFocus(), so while this solution is not exactly
pretty, it's not worse than we had before, while being more generic.
Also add a unit test checking that things work correctly in the scenario
described above.
Closes https://github.com/wxWidgets/wxWidgets/pull/1257Closes#18341.
Don't set the focus to the window the rich tooltip refers to in its
ShowFor() method because this was inconsistent with plain tooltips and
also could result in infinite recursion if the window decided to show
its tooltip when it got focus.
Closes https://github.com/wxWidgets/wxWidgets/pull/1265
Apparently, ScrollTo() can be called when processing keyboard input in
the control before its initial resize and hence before scrolling is
initialized and in this case per-unit scroll units are still 0, so
dividing by them is not a good idea.
Just avoid scrolling in this case.
Closes https://github.com/wxWidgets/wxWidgets/pull/1262
Currently the Scintilla message SCI_REGISTERIMAGE is mapped to
wxStyledTextCtrl::RegisterImage(int, const wxBitmap&). This makes
RegisterImage a manually defined method and passes the bitmap directly
to the listbox instead of first converting to an XPM.
To backfill the message map, SCI_REGISTERIMAGE is now mapped to a new
method overload RegisterImage(int, const char* const*). The new method
accepts XPM data instead of a wxBitmap.
Currently the Scintilla message SCI_MARKERDEFINEPIXMAP is mapped to the
wxStyledTextCtrl::MarkerDefineBitmap method. This has two
drawbacks. First this requires the XPM image handler be loaded before
this method can be called. Second, any alpha data except for opaque and
transparent is lost in the conversion to XPM format.
Instead have MarkerDefineBitmap be a manually declared method but
reimplemented it in a way similar to how the SCI_MARKERDEFINERGBAIMAGE
message works. The new implementation preserves alpha data if it exists.
To backfill the message map, the SCI_MARKERDEFINEPIXMAP is now mapped to
a new method MarkerDefinePixmap(int, const char* const*). The new method
accepts XPM data instead of a wxBitmap.
The ListBoxImpl::RegisterImage in PlatWX.cpp is supposed to accept an
XPM and convert it into a useable form. For wxWidgets, the useable form
is obviously a wxBitmap. According to the Scintilla specification, the
function should accept both a copy of an XPM file and a set of XPM data.
Currently RegisterImage uses the the wxWidgets XPM image handler. This
has 2 drawbacks. First it requires that the XPM handler is loaded before
the function can be called. Second, the function only accepts a copy of
an XPM file and does not work with XPM data.
Instead use wxXPMDecoder. This class can be decode both types of input
and can be used to build a wxBitmap.
Add a unit test for a special case of a wrap sizer min size caclulation.
Test wxWrapSizer::CalcMinFromMinor function for this case, when a wrap
sizer used inside a sizer with the same alignment.
Fix the `wxWrapSizer::CalcMinFromMinor` function: at the end of the
calculation a `sumMinor` variable contain minor size sum without minor
size of a last line, so add `maxMinor` size to the result min size.
Expat requires C99 and doesn't compile without the appropriate command
line option at least under Solaris as <stdbool.h> is not available
without it there.
Closes https://github.com/wxWidgets/wxWidgets/pull/1250Closes#18352.
The command used for linking to the core library was "@library{core}"
instead of correct "@library{wxcore}". This resulted into plain text
"page_libs_core" being displayed instead of expected "wxCore" hyperlink.
Closes https://github.com/wxWidgets/wxWidgets/pull/1259
wx-config has --optional-libs command line option for requesting linker
flags for libraries that an application could optionally use but might
not be available in current wxWidgets build.
Make this feature available to Autoconf macro users.
Closes https://github.com/wxWidgets/wxWidgets/pull/1256
OnValidationFailure() in derived class wxEnumProperty has the same implementation (empty body) as the implementation in the base class wxPGProperty so overriding this function in derived class is not necessary.
Invalid wxPGProperty needs to be redrawn after setting wxPG_FL_CELL_OVERRIDES_SEL because this flag
is used to select proper colors to mark property as invalid.
This order of operations is important under e.g. wxMSW when redrawing with DrawItemAndChildren() is done immediately.
Closes#18351.
This message just seems too weird and unreliable, so get rid of it and
compute the toolbar size entirely on our own, which at the very least
gives predictable and reproducible results and makes GetSize()
consistent with GetBestSize().
The toolbar height doesn't remain exactly the same as before, with 1px
differences here and there, but now the height is the same initially and
after changing the toolbar styles, while previously the height changed
when doing this.
Don't truncate addresses under Win64 when printing debug messages using
wxMemStruct.
This avoids build errors if wxUSE_DEBUG_CONTEXT = 1 when building on
Win64.
Closes https://github.com/wxWidgets/wxWidgets/pull/1249
Restore the hack with making the toolbars with wxTB_FLAT style 3px less
tall than the value given to them by TB_AUTOSIZE.
There is no real explanation for doing this, this adjustment was added
by 98b9643647 back in 2002 with the
rationale "make flat toolbars look slightly better", but after doing it
for 17 years during which nobody complained about this, we probably
should keep doing it now.