3a8ad952 introduced compilation failures with (some versions of) MinGW
and VC8 because their winnls.h apparently doesn't declare
SetThreadUILanguage(). Just declare the function ourselves to fix it.
This failure seems to only happen on buildbot, at least it couldn't be
reproduced after 100 runs of the test locally, so it just doesn't seem
possible to debug it.
Disable it to allow detecting when other tests fail (which would be
unexpected, unlike this one).
Calling SetContainingSizer() on a window which had been contained in another
sizer previously asserts since efce9b2306, so
change wxWrapSizer to set the containing sizer to NULL before resetting it.
Starting with Vista, SetThreadLocale() does basically nothing and does
not affect UI language. We need to call SetThreadUILanguage() as well
from wxLocale::Init() to have the locale reflected in e.g. standard
dialogs.
Currently, customizing some dialogs for small screen environment is done statically on the build stage by setting wxPG_SMALL_SCREEN to 1 (what is done for WXWINCE only).
Instead, we can do this for all platforms in a dynamic manner, based on the classification provided by wxSystemSettings::GetScreenType() function.
In order to do so there is introduced a static helper function wxPropertyGrid::IsSmallScreen() which is used to select right parameters (size, position) for several dialogs in order to display them correctly on the small screen.
Use a workaround to compensate for the differences between a non-GUI and
GUI event loop with wxOSX. This allows the FS watcher tests to pass
(previously it would hang) under OS X without having to move the tests
to the test GUI application (where the tests do pass on OS X already,
without needing this workaround).
See #16969.
If the test is interrupted and run again an assert is raised because the
temporary fswatcher_test dir has had no chance to be deleted and still
exists. Fix this by removing the dir before each test.
It's not only an error to insert a window twice into the same sizer, it's
already an error, and even a more insidious one, to insert it twice into
different sizers, so guard against this as well as debugging it (much) later,
when the window and the sizer is destroyed is much less fun.
Apparently in some versions of the compiler even simply dereferencing a
pointer inside typeid() still provokes -Wpotentially-evaluated-expression.
Avoid this by dereferencing it outside and only using typeid() with
references.
Closes#16968.
When calculating widths of columns in the header there is necessary to take into account also width of the vertical scrollbar in the grid, if it exists. When scrollbar is ignored in calculations then we get wrong width of internal border and in result the columns of the header don't match the columns of the grid (this issue can be observed in the propgrid sample).
Because code responsible for determining widths of all columns is duplicated in OnPageUpdated() and OnColumWidthsChanged() methods it can be moved to the new shared method DetermineAllColumnWidths().
Method DetermineColumnWidth() used now to determine width of the one column only is no longer necessary and can be removed.
Setting focus to the control when receiving a selection event can result in
another selection event being generated by the control itself if it hadn't had
any selection before, which is completely artificial, i.e. doesn't correspond
to any user action, and so has to be suppressed.
Closes#16999.
This simplifies the code and fixes the bug with GetItemCount() returning wrong
(old) value in wxEVT_LIST_INSERT_ITEM event handler as m_count wasn't updated
by then yet.
Closes#3793.
This deprecated method was never actually defined, so could never be used. The
fact that nobody complained about it would seem to be an indication that it is
not used anywhere, so just remove it.
See #17007.
Code responsible for header demonstration should be excluded in this case because header management functions in wxPropertyGridManager depend on wxHeaderCtrl (via wxPGHeaderCtrl) and if it is not present then respective methods in wxPG are not exposed.
This is not natural for the non-consecutive values of the font styles and
doesn't properly check for the array indices being valid, resulting in static
analysis tools warnings about a possibly out of bound array access.