Attempt to use wxPen::GetStyle() on the initially invalid pen resulted in an
assert, so don't do it and test for pen validity explicitly.
Closes#13524.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This library includes some wx headers and so setup.h must be available when
it's being compiled but there was no rule to copy it in its projects, so add
it now.
Closes#13526.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Implement wxTimePickerCtrl natively for MSW and add a generic implementation
(very loosely based on the original class by Paul Breen) for the other
platforms.
Also update the calendar sample to show the new control.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69224 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The documentation for this method seems to have been copy-and-pasted from
somewhere else and didn't make any sense.
Also don't say that this control doesn't have any control-specific styles when
it does.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes, just refactor wxMSW wxDatePickerCtrl to allow sharing code
with the upcoming wxTimePickerCtrl class. Even less changes for the other
platforms where wxDateTimePickerCtrl is trivial.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
For some reason comparing wxTreeListItem with its associated Type doesn't work
when using VC6 ("error C2593: 'operator ==' is ambiguous") so help the compiler
to do it.
Also remove the unnecessary (and unsupported by VC6) return from void function.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
When using the generic wxDataViewCtrl version, forcefully refresh it after
changing its size to avoid artefacts during resizing of wxTreeListCtrl.
Closes#13502.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69183 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Under GTK the columns of wxDataViewCtrl (and hence wxTreeListCtrl) are always
resized to cover the entire control width. For consistency, also do it under
the other platforms and give the remaining space to the first column and not
to the last one as GTK does by default, as the first column is more important.
Do this even if this results in reducing the size of the column: presumably,
if the entire control itself can be resized, the user wouldn't bother resizing
the columns and, on the contrary, if the user did resize the columns, the
entire control size is unlikely to change, so in practice we don't risk
overriding the user preferences and reducing as well as increasing the first
column width works much better by default as it doesn't leave the other
columns invisible after making the control wider and than reverting it back to
its initial, more narrow, state again.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69182 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Scrolling in a small wxVListBox with tall items (i.e. taller than the height
of wxVListBox itself) behaved wrongly: wrong item was being scrolled into view
and Page Up/Down didn't scroll as much as they should.
Fix both of these problems by checking for these corner cases explicitly.
Closes#13454.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fix typo in the sample, comma was used instead of a semicolon. The code still
worked correctly but make it look correctly too now.
Closes#13453.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This constructor previously used int and, especially annoyingly, wxByte* for
the data. Use standard void* for untyped binary data instead.
Also document this ctor as it seems to be implemented in all ports.
Closes#13451.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Always send this event, even if the user right clicked outside of the client
area. This is useful for showing item-independent commands in the context
menu.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69177 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow the user to sort the control contents by clicking on the columns with
wxCOL_SORTABLE flag and also provide SetSortColumn() method to sort the
control programmatically.
Also add wxTreeListItemComparator class and SetItemComparator() method to
allow customizing the way the items are compared.
Update the sample to show how to define a custom comparator.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The sort indicator on the column previously used for sorting was only reset
when the user clicked on the column header (by wxDataViewHeaderWindow code
that explicitly called wxDataViewCtrl::SetSortingColumnIndex()) but not when
wxDataViewCtrl::SetSortOrder() was called directly.
Fix this and take care of updating everything in SetSortOrder() itself. This
makes the code simpler and also means that calling SetSortOrder() from the
program now works as expected (it resulted in having sort indicators in two
columns at once before).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The two member functions, SetAsSortKey() and SetSortOrder(), were doing almost
the same thing but differently and the former was only used in the generic
wxDataViewCtrl implementation and not implemented in the native GTK/OS X one.
Remove SetAsSortKey() entirely and only keep UnsetAsSortKey() which is still
needed by generic/MSW wxDataViewCtrl. But only SetSortOrder() should now be
called to indicate that the column is used for sorting.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
It can be useful to have access to the window used to actually show the items
by wxTreeListCtrl, provide two accessors for m_view: a wxDataViewCtrl-specific
one and a generic one returning just a wxWindow that can be used to keep the
code isolated from wxDataViewCtrl.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
It's possible that wxDisplay::GetClientArea() returns (0, 0) size indicating
that it failed. Don't set the maximal window size to (0, 0) in this case as
this prevents the user from seeing the window at all and just don't do
anything instead.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If a monitor was attached or detached while a wx program was running, the
monitor handles stored in wxDisplayFactoryMSW became invalid and all display
operations (e.g. getting display size) failed from this moment onwards
requiring a program restart to work again.
Fix this by updating the monitor handles when we get WM_SETTINGCHANGE as it is
sent when a monitor is added or removed (while it's also sent in quite a few
other cases re-enumerating the monitors shouldn't take very long so just do it
always).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add wx/msw/private/hiddenwin.h with wxCreateHiddenWindow() declaration instead
of declaring it manually in all the files using it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There were two strictly identical code snippets setting the expander column to
be the first one if it hadn't been set before, replace both of them with a
call to GetExpanderColumnOrFirstOne() function.
Also use this function instead of just GetExpanderColumn() (which might return
NULL) in a couple of places.
Notice that there are still a lot of places in the code where the column 0 is
hard coded as being the expander column, this would need to be fixed to really
support non-first expander column.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775