This makes the code slightly simpler, as there is just one function
instead of two, and also changes the meaning of the value stored in the
cookie parameter as a side effect: previously, it was the index of the
last retrieved item, while now it's the index of the next item to
retrieve.
The difference is not huge, but the latter is more usual and, more
importantly, avoids a stack overflow due to infinite recursion in the
treectrl sample, which assumed that cookie is never null after a
successful call to GetFirstChild(). The code in the sample is arguably
incorrect, as the cookie is supposed to be opaque, but it's still better
to avoid crashing, especially because similar code is almost certainly
present in user code if it was copied from the sample.
wxUIntProperty::DoValidation() is already declared as private and the same access level should be applied to DoValidation() in other numeric properties because these functions are helpers intended for internal use only.
Move template function NumericValidation() to wxNumericProperty because all data necessary to validate the value are available here: acceptable value range, SpinCtrl editor value wrapping mode, etc.
All numeric properties (wxIntProperty, wxUIntProperty, wxFloatProperty) share some features (like specific attributes, numeric validation, SpinCtrl editor support) so for the sake of clear design it would be good to derive them from the common base class (wxNumericProperty) in which all shared functions are implemented. This class is not intended to be instantiated so it's an abstract class.
Instantiate NumericValidation() template directly for required data type in DoValidation() and avoid this way intermediate conversions to another data types.
Duplicating the code of the entire NumericValidation() template function just for one specialization (for double value type) seems to be an overkill. Only small fraction of the code (to round the validated value) is really dependent on the value type and this part can be moved to the template function GetRoundedValue() which in turn can be specialized as required.
Use wxWindow instead of wxControl in wxGridCellEditor to allow using
any window as an editor control, as it doesn't need to be a wxControl.
Closes https://github.com/wxWidgets/wxWidgets/pull/1370
This OS update has broken resizing of NSOpenGLView, which worked
correctly up until to 10.14.4.
Work around it by preventing the default implementation of update from
being executed. It's not clear why should it help with the problem, but
it does.
Closes https://github.com/wxWidgets/wxWidgets/pull/1354Closes#18402.
It seems better to disable LZMA rather than silently building the
binaries depending on an external library when we were explicitly
requested not to do it.
The last digit was truncated as the code discarded the trailing "\n"
which wasn't really there, as ReadLine() helper function already removed
it, and so ended up removing the last digit of the line number,
resulting in mostly plausibly looking but completely wrong line
information in the assert dialog.
This was already done in the other functions, but not this one,
resulting in a crash if it was called for an object with null m_nowpeer
(e.g. before it's created or when it's not a real wxNonOwnedWindow
object as when it's a subobject of wxTDIChildFrame).
See #18423.
This notably fixes the problem with wxAuiMDIChildFrame::GetScreenRect()
returning the wrong window position since the changes of
c1bcf16eb9.
Closes#18423.
This replaces and extends the previous commit by using `$var` instead of
`$(var)` when this makes sense and using the ugly workaround for Doxygen
expanding environment variables even inside Markdown backticks elsewhere.
Also use backticks around more strings.
It turns out that Doxygen expands $(VAR) into the actual value of the
VAR environment variable on the machine where it runs, which is
definitely not what we want in the instructions telling people to use
"$wxwin" in their projects, so remove the parentheses to prevent Doxygen
from expanding it.
Another alternative would be to escape "$" with a backslash, but this
would make the source markdown file uglier.
Use print() and byte strings to make the code compatible with Python 3,
while also keeping it compatible with Python 2 (>= 2.6, at least).
Closes https://github.com/wxWidgets/wxWidgets/pull/1348
Under wxGTK, wxGauge was returning fixed values for height and width.
This meant that the gauge would not center correctly in a sizer,
particularly under GTK+ 3 where the default gauge height is just a few
pixels.
Following this change, wxGauge renders correctly on GTK+ 3 and matches
the reference widget display in the gtk3-widget-factory app.
Note, this change will also result in a slimmer widget on GTK+ 2, but
the gauge height can be forced using wxGauge::SetMinSize() on the older
toolkit.
The gauge presentation is totally theme dependent under GTK+ 3. For
example, the user can have thicker gauges by setting the following in
their ~/.config/gtk-3.0/gtk.css file:
progress, trough {
min-height: 20px;
}
Closes https://github.com/wxWidgets/wxWidgets/pull/1353
A number of object files in wxCore can end up being empty due to the
corresponding wxUSE_XXX options being set to 0. This is normal and
getting tons of warnings from MSVC during the build about it wasn't
helpful.
It turns out that these warnings can be suppressed by using the
undocumented, but described at
http://www.geoffchappell.com/studies/msvc/link/link/options/ignore.htm
"/ignore" option, so do this to finally get a clean build.