The drawing code in the generic version of wxDataViewCtrl incorrectly supposed
that the expander column was always at position 0. This resulted in the
expander column not being drawn at all if it was not really the first one.
Fix the test to use wxDataViewCtrl::GetExpanderColumn() to correct this.
Closes#12870.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68321 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The comparison in EVT_CHAR handler was incorrect for an empty control without
any rows as it subtracting 1 from 0 resulted in UINT_MAX and not -1 as all the
values were unsigned.
Fix this by checking that the new row is valid instead, this is correct for
both signed and unsigned values.
Closes#13356.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68320 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't set focus to a hidden window in our focus management code, this never
makes sense and results in apparent focus loss.
It also fixes, as a side effect, a crash in wxGrid under wxMSW as the focus is
not restored to the hidden grid editor any longer and so the code in its
wxEVT_KILL_FOCUS handler that resulted in the crash is not executed any
longer, see #13349.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add new "expanded" attribute for XRC nodes of treebookpage class.
Also update the sample and the XRC format documentation.
Closes#13355.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Negated long options were not recognized in wxCmdLineParser::Parse(), do check
for them now.
Also extend the unit test to check for negated options.
Closes#13335.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The "negated" flag of wxCmdLineOption struct was not reset by Reset() so
parsing a command line with a negatable option once influenced the result of
parsing it the next time because the old value was kept.
Do clear it now to allow calling Parse() several times without side effects.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68315 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
VC6 can't instantiate member template functions so get rid of it and use ugly
dynamic casts in the non-template function to construct wxGCDC correctly.
See #13327.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68311 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The mask was actually only used when it was initialized (or, conversely, the
mask was always initialized when it was used) but gcc doesn't seem to notice
this and still warns that mask components "may be used uninitialized in this
function".
Suppress the warnings by always initializing the mask, even if we don't use
it.
Closes#13333.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
the generic implementation of wxDataViewCtrl left the old current still
focused after selecting another row as current when it was right clicked.
Fix this by refreshing the previously current row after unfocusing it.
Closes#13330.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68308 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Currently this is only implemented in the generic wxDataViewCtrl, the native
GTK/OSX ports should be modified to support this later.
Closes#13323.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We erroneously removed too many elements from m_colLabels array (basically we
always removed all the elements remaining after this column, irrespectively of
the actual number of columns to delete), fix this by removing at most the
specified number of columns -- or possibly less if the array isn't entirely
filled.
See #13329.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This allows to test wxMemoryDC and, under MSW, wxMetafileDC and also can be
used to compare the output of different versions of the sample (possibly from
different ports, too).
Closes#13327.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68305 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The hidden columns (i.e. those whose size was set to 0) should be skipped when
find the previous/next column to select when the user presses Left/Right
cursor arrow keys in wxGrid, otherwise the focus could completely disappear as
it was invisible when it was set to a hidden column.
Closes#13281.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68303 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
As there doesn't seem to be any native functions for comparing HIShapes,
compute their differences to find out if they are equal.
Closes#13339.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Their GetSize() method used hardcoded size of (80,16). Instead, use
GetTextExtent() to compute the size from content, as should be done. Add
some extra room for editor control's extra parts. The space needed isn't
computed exactly, as that would be quite convoluted (and in the end,
most likely not 100% accurate even then), using a simple approximation
instead.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Instead of using broken emulation of the support for hints available in the
text control, use the real wxTextCtrl::SetHint() for SetDescriptiveText()
implementation in the search control.
This looks better and, more importantly, fixes the bug when searching for the
string equal to the current descriptive text searched for an empty string
instead.
Closes#13324.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68237 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
r68230 fixed the width of the value label in this case but not its position:
it was left-aligned instead of being centered as it should be.
See #13291.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68236 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxSlider with wxSL_LABELS style but without wxSL_MIN_MAX_LABELS didn't show
the current value because the width of the value label was 0.
Fix this by always computing the widths of min and max labels and using the
longest of them for the value label, even if we don't actually show them.
Closes#13291.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxMSW wxSlider implementation stored the min and max labels widths as fields
of wxSlider object for some reason even though they were only used in one of
its methods (and can be easily computed anyhow).
Make them simple local variables instead and also rename an existing local
variable which started conflicting with their new names.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxMSW used to handle VK_RETURN in the same way as VK_TAB if it wasn't consumed
by the default push button but this didn't correspond to the native platform
behaviour which considers pressing Return when the OK button is disabled an
error and audibly notifies the user about it.
Fix this by passing VK_RETURN to IsDialogMessage() if we don't translate it to
a button click.
Also add a possibility to test what happens when the default (or all)
button(s) in the dialog are disabled to the dialogs sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use GetWindow() instead of GetInvokingWindow() to send the event to the
associated window for the menus that are part of the menu bar and not only the
popup ones. This was broken since r64127 because GetInvokingWindow() is now
only used for the popup menus.
Closes#13317.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Currently these values can only be read from/written to wxTextCtrl but support
for other controls (e.g. wxSpinCtrlDouble for float/double) could be added in
the future.
Closes#13304.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68217 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
At least in wxGTK it is necessary to remove the page from the notebook first
as reparenting it doesn't work otherwise currently.
This should ideally be fixed but in the meanwhile at least document it.
See #13305.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68214 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
A notebook page removed from its notebook can have a non-NULL wx parent but
not have any parent at GTK level any longer, so test for the window parent at
GTK level before removing the widget from it, otherwise we were getting GTK
asserts when trying to remove a window from its no-more-parent.
See #13305.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Although normally the control header is not supposed to be resized below its
minimal vertical size, sometimes this can still happen and in this case ugly
artefacts were displayed because it wasn't refreshed properly. Do refresh it
to avoid them.
Closes#13313.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Do it for consistency, as the state of all the other buttons is already shown,
and also to have some place for testing this functionality.
Closes#13309.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68211 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Running console sample without parameters didn't do anything by default and
didn't output anything neither which was presumably rather confusing. Do
output a welcome message at least to indicate that something happened.
Closes#13299.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68209 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775