Don't divide by waveformat.uiBlockAlign which could be 0, but rather
multiply by it and verify that we get the expected result. This is more
robust, as it prevents crashes on malformed input and also slightly more
efficient even for correct input.
Check that we have enough data in the input instead of happily reading
out of bounds memory.
This fixes the most common problem of crashing on bad data which doesn't
look like WAV at all, but doesn't fix problems with parsing input which
does look like WAV, but is incorrect -- this will be done in subsequent
commits.
This is a micro-optimization, as pre-increment is at least as efficient
as post-increment and typically slightly more so because it doesn't need
to make a copy of the iterator, and better conforms to the prevailing
C++ style.
Closes https://github.com/wxWidgets/wxWidgets/pull/655
Avoid problems when using this header in code also include <windows.h>
(and not doing it via wx/msw/wrapwin.h) by ensuring that min and max
used here are not defined as macros.
We need to explicitly generate this event from the char hook handler as
we don't get the normal WM_CHAR for it, it is apparently intercepted by
the window proc installed by the auto-completing code, so check if
wxTE_PROCESS_ENTER is used for the text entry and call a special new
MSWProcessSpecialKey() method to do the right thing if it is.
Similarly, handle Tab presses correctly if wxTE_PROCESS_TAB is used.
Closes#12613.
If we don't pass these messages to it, the selected items highlight
rectangle doesn't get updated when the columns are resized when using
visual themes, as could be seen in the listctrl sample.
While this did work if the wxEVT_LIST_COL_DRAGGING event handler skipped
the event, prefer to not require doing this as things work without this
call to wxEvent::Skip() under the other platforms and even MSW with
themes disabled.
Closes#18032.
Inherit from wxCompositeWindowSettersOnly<> to make sure all the usual
setters, such as SetForegroundColour() and SetFont(), called on
wxStaticBox are propagated to the label window too.
However also prevent SetBackgroundColour() from being propagated
unnecessarily -- because the checkbox already inherits the parent
background colour by default in wxMSW anyhow -- and still override
SetFont() to adjust the label window position after the font change,
otherwise it could be truncated after increasing the font size, for
example.
Because of these issues, wxCompositeWindowSettersOnly is not ideally
suited for its use here, but on balance it still seems to be better to
use it rather than reimplement parts of its functionality here.
Extract this class from wxCompositeWindow, as sometimes it can be
convenient to just define the setter functions to do the right thing for
a window containing sub-windows, but without dealing with focus too.
This will be used in wxMSW wxStaticBox in the next commit.
Erase background of the partially transparent native child controls,
such as wxCheckBox, using our own background colour if we have it
instead of using the parent's colour.
For some reason, we -- seemingly intentionally, judging from the comment
-- didn't do it before, but this meant that checkboxes inside static
boxes didn't inherit the box background colour, if it was set, which was
ugly and inconsistent with at least wxGTK. So do use our own background
if we have it now by just reusing the existing PaintBackground() instead
of manually using the parent background brush in WM_PRINTCLIENT handler.
As this class is only supposed to be used as a base class, its ctor
doesn't need to be, and hence ought not to be, public.
Also update an outdated comment stating that the ctor didn't do anything
when it, in fact, does perform an important task.
Remove wxSIZE_AUTO from the SetSize() call, this was completely
unnecessary and unexpectedly (and wrongly) resized composite windows
managed by sizers as SetLayoutDirection() side-effect.
Introduce symbolic constants instead of using raw magic numbers.
No real changes and these numbers are still as magic as before, but at
least they will be easier to change now.
This allows to call the protected wxWindowGTK::DoApplyWidgetStyle()
method when it's really necessary, e.g. when forwarding to it from
DoApplyWidgetStyle() implementation for another window.
Factor out the code from wxStaticBoxSizer dtor into a wxStaticBox method
to improve encapsulation: the static box knows better than another class
how to detach its children from it before destroying it.
No real changes yet.
Even though the value of this variable is not actually used in this
case, we still must initialize it to something before comparing with
NSGestureRecognizerState{Began,Ended} below.
Closes https://github.com/wxWidgets/wxWidgets/pull/645
Use wxDCClipper, now that it doesn't lose the previously set clipping
region any more, in wxGridCellStringRenderer::Draw() to ensure that we
don't overflow the area allocated for the cell.
Closes#17872.
Account for the empty lines explicitly by reserving enough vertical
space for them, as wxDC::GetTextExtent() wouldn't do it as it simply
returns 0 for empty strings.
Closes#18028.
GtkAssertDialog UI is now defined with GtkBuilder XML because
gtk_widget_push_composite_child() and gtk_widget_pop_composite_child() are
deprecated since 3.10 and composite widget templates should be used
to make composite children.