Check if PG exists before adding or deleting a choice to wxPGProperty.

Because choice value can be added/deleted also to/from detached property object there is necessary to skip in wxPGProperty::InsertChoice and wxPGProperty::DeleteChoice the operations which are valid exclusively for property attached to the property grid.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76969 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Additional assertions in several wxPGProperty methods.

Check if property is attached to the property grid before wxPG methods are invoked. 

See #16401.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76970 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fix wxPGProperty::SetChoiceSelection

When selected choice is changed then set as selected value the value corresponding to the new index, not the index itself.

Closes #16401.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76971 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Only filter requested events in wxEventBlocker.

Contrary to the documentation, wxEventBlocker always behaved as if the
event type to block was wxEVT_ANY: while it returned false for events
not on the blacklist, it never actually called the existing event
handler as it was meant to.

Fix by calling wxEvtHandler::ProcessEvent() in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fix inserting first choice item to wxEnumProperty

Situation when when first choice item is inserted (in wxPGProperty::InsertChoice) to the empty collection must be handled in a special way. In order to do so:
1. The state when there are no choice items in wxEnumProperty object and hence no item is selected must be explicitly indicated (by special index value wxNOT_FOUND).
2. This initial state must be handled in a special way when there is determined new selection index after insertion.

See #16401.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76974 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Correct wxGrid column labels when using SetTable() with native header.

Ensure that the table pointer inside wxGrid is updated before initializing the
native column header as it uses wxGrid::GetColLabelValue() which doesn't work
correctly without a valid table pointer.

Closes #16399.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76976 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fix regression caused by r76974 (inserting first choice item to wxEnumProperty).

This is a modified way of handling insertion of the first choice item to wxEnumProperty. Previous method based on special value (wxNOT_FOUND) used to indicate empty collection caused regression in wxPGProperty::DeleteChoice(). Currently, the size of the collection is checked directly in wxPGProperty::InsertChoice().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76977 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Auto-link expat and zlib even in non-GUI programs when using MSVC.

These libraries are not GUI-specific and should be included even in console
applications.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76981 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Really add "hint" property to wxTextCtrl XRC handler schema description.

This was supposed to be done in r76629 but the property was mistakenly added
to wxRichTextCtrl instead.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add wxRESERVE_SPACE_EVEN_IF_HIDDEN flag to the XRC schema.

It seems that this one was forgotten somehow and so is not recognized.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76983 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fix background of wxRadioBox buttons and wxSlider labels in wxMSW.

Handle WM_CTLCOLOR correctly for them, this wasn't done before because the
code assumed that sub-windows (i.e. HWNDs which belong to the same logical wx
control) were always children of the main window, but they could also be its
siblings (like in at least the two above mentioned cases).

Account for this case in wxControl::DoMSWControlColor() too now.

Closes #12271.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Update wxSlider background when its parent background changes in wxMSW.

The native control doesn't redraw itself, so force it to do it from the
overridden DoMSWControlColor() which is called every time the background
colour might have changed.

See #12271.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fix static initialization order problem in wxStopWatch under MSW.

Don't rely on the static global gs_perfCounter being already initialized when
wxStopWatch::DoStart() is called, this may not be the case if wxStopWatch
variable is global.

Work around this by wrapping the variable inside a function to ensure that it
is initialized before being used.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76986 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Disable a harmless deprecation MSVC warning for wxNORMAL in a test.

Explicitly disable the warning just for the code using wxNORMAL as the use of
this deprecated constant can't be avoided in the code which tests for its
support.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add support for "%V" and "%G" to wxDateTime::Format().

This is useful for creating ISO 8601 week number based stamps.

Closes #11857.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add wxDateTime::GetWeekBasedYear().

It was just added as a private function to implement %V format specifier
support, just extract and document it as it could possibly be useful in its
own right.

See #11857.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't activate hidden buttons when Enter is pressed in wxMSW.

The keyboard handling code could decide to activate a button which wasn't
currently visible at all, e.g. because it was on a non-current, and hence
hidden, page of a wxBookCtrl. This didn't make any sense, so check for the
button visibility before activating it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Refresh the window when its layout direction changes in wxMSW.

Rearrange the window children and/or redraw its contents when its layout
direction changes.

See #15031.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76991 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fix window position calculation in wxMSW when using RTL.

Just use the native ::MapWindowPoints() to do the coordinate transformation
instead of doing it ourselves: we did it wrongly by inheriting the layout
direction from wxTheApp instead of from the parent window, so fix this in the
best possible way by not doing it at all and just relying on Windows to do it
for us.

In particular, this corrects the display of wxStatusBar in RTL frames.

Closes #15031.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76992 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add missing index initialization in one of wxEnumProperty ctor.

In every wxEnumProperty ctor, initial index value of selected choice must be set to zero.

See #16401.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76993 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775