Commit Graph

53274 Commits

Author SHA1 Message Date
Vadim Zeitlin
311c4a7a85 Fix drawing of expander columns not at 0 position in generic wxDVC.
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
2011-07-21 13:50:14 +00:00
Vadim Zeitlin
4385e70296 Correct test for maximal row index in generic wxDataViewCtrl.
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
2011-07-21 13:50:10 +00:00
Vadim Zeitlin
26647ae4a7 Never restore focus to hidden child.
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
2011-07-21 13:50:06 +00:00
Vadim Zeitlin
2b232decc5 Allow marking wxTreeBook nodes to expand initially in XRC.
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
2011-07-21 13:50:03 +00:00
Vadim Zeitlin
fb4faeb5de Make wxEnhMetaFileDC ctor from wxDC explicit.
This avoids implicit conversion of any kind of wxDC to wxEnhMetaFileDC which
is totally unexpected.

See #13326.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68317 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-21 13:49:59 +00:00
Vadim Zeitlin
1a63798c5a Fix parsing of negated long options in wxCmdLineParser.
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
2011-07-21 13:49:55 +00:00
Vadim Zeitlin
dd18cc6594 Reset negatable switches correctly in wxCmdLineParser::Reset().
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
2011-07-21 13:49:51 +00:00
Julian Smart
6607ee151a No longer ignores first-line indent if no left indent specified
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68314 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-20 16:23:37 +00:00
Vadim Zeitlin
5707e433a3 Don't use template member function in drawing sample to placate VC6.
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
2011-07-20 11:41:07 +00:00
Stefan Csomor
7a68fc9c34 fixes redraw problems under OSX, see #13345
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68310 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-20 06:36:06 +00:00
Vadim Zeitlin
5568067a3d Fix harmless gcc warning about uninitialized mask in PNG saving code.
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
2011-07-19 22:36:00 +00:00
Vadim Zeitlin
a09da78b03 Refresh the old current row when right clicking in wxDataViewCtrl.
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
2011-07-19 22:35:57 +00:00
Vadim Zeitlin
2a648479df Add wxDataViewEvent::IsEditCancelled() and support for vetoing edit events.
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
2011-07-19 22:35:53 +00:00
Vadim Zeitlin
d32fb5f9f4 Fix deleting columns in wxGridStringTable with custom column labels.
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
2011-07-19 22:35:48 +00:00
Vadim Zeitlin
8c6b0819ec Allow saving the drawing sample canvas to a file or clipboard.
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
2011-07-19 22:35:45 +00:00
Vadim Zeitlin
2d770c4f82 Added wxGCDC(wxEnhMetaFileDC) ctor too.
Make it possible to create wxGCDC associated with a metafile DC in wxMSW too.

Closes #13326.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-19 22:35:41 +00:00
Vadim Zeitlin
b64bb3ca1b Fix keyboard navigation in wxGrid with hidden columns.
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
2011-07-19 22:35:37 +00:00
Stefan Csomor
3e88d48700 doing WakeUp in osx_carbon differently for the main event as well
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68302 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-19 17:56:57 +00:00
Stefan Csomor
85a74f93bf make sure we can issue a WakeUp call that really triggers at the NSRunLoop level not only only CFRunLoop
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-19 16:17:44 +00:00
Stefan Csomor
f51afd8f40 fixing width/height (were negative) thanks to Werner Smekal
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68300 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-19 10:56:04 +00:00
Vadim Zeitlin
05d65177f8 Fix memory leak in wxPanel::SetBackgroundBirmap() in wxMSW.
The brush allocated for the bitmap was never freed, do free it in dtor.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68299 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-18 19:36:31 +00:00
Václav Slavík
7243eb6d3b Add support for column header images to wxListCtrl XRC handler.
Fixes #13319 (patch).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68286 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-16 10:05:02 +00:00
Václav Slavík
d8eae94f53 Fix wxListCtrlXmlHandler so that it accepts icon with wxLC_LIST and wxLC_REPORT styles too.
Fixes #13319 (patch).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68285 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-16 10:04:57 +00:00
Václav Slavík
0915bc4d71 Fix wxXmlResourceHandler::GetImageList() to use specified size.
Fixes #13319 (patch).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-16 10:04:54 +00:00
Václav Slavík
527d2d2d47 Add check to prevent creation of element wxXmlNodes with content data.
Just like in the DOM, only text, ctype etc. nodes have textual content,
elements don't.

See #13297.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68283 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-16 10:04:48 +00:00
Stefan Csomor
7973979598 proper guard for bitmap constructors
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-16 06:57:30 +00:00
Stefan Csomor
913bcbfc3d fixing typo
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68281 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-16 06:57:07 +00:00
Vadim Zeitlin
1715d4fef9 Implement wxRegion::Equal() for wxOSX.
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
2011-07-15 22:58:36 +00:00
Vadim Zeitlin
0aab87fddd Ensure we don't modify a shared object in wxOSX wxRegion::DoOffset().
Call AllocExclusive() before modifying the object.

Closes #13338.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-15 22:58:32 +00:00
Vadim Zeitlin
22aa243d58 No real changes, just use AllocExclusive() in wxOSX wxRegion.
Don't fiddle with the reference count manually, just use the base class
function doing it instead.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-15 22:58:30 +00:00
Václav Slavík
a1c9e7d143 Better sizing in wxDataViewSpinRenderer and wxDataViewChoiceRenderer.
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
2011-07-13 08:32:17 +00:00
Vadim Zeitlin
7ecc7eb6be Use native hint wxTextCtrl support in wxSearchCtrl.
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
2011-07-12 09:13:43 +00:00
Vadim Zeitlin
b748750e13 Centre wxSlider value correctly when wxSL_MIN_MAX_LABELS is not used.
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
2011-07-12 09:13:39 +00:00
Vadim Zeitlin
1bf9327b5d Document wxEnhMetaFileDC-related wxGraphics functions.
Closes #13325.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68235 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-12 09:13:36 +00:00
Vadim Zeitlin
16e79d4879 Fix showing slider label in wxMSW when wxSL_MIN_MAX_LABELS was not used.
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
2011-07-11 22:49:33 +00:00
Vadim Zeitlin
5db9025368 No real changes, just make some wxSlider members local variables.
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
2011-07-11 22:49:30 +00:00
Vadim Zeitlin
c3b8a19638 Fix and improve documentation of wxT_2() macro.
Documentation for wxT_2() applied to wxS() instead, fix this. Also correct the
wording and add @since tags.

Closes #13321.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-11 22:49:26 +00:00
Vadim Zeitlin
efaf786535 Don't handle "Return" key as "TAB" even when the default button is disabled.
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
2011-07-11 22:25:24 +00:00
Vadim Zeitlin
550d5748b1 Copy recently added wxGenericValidator fields in Copy().
The pointers added in r68217 must be also initialized when creating a copy of
the validator.

Closes #13304.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68225 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-11 14:51:32 +00:00
Stefan Csomor
24e059c32c support multi-line labels, add different native styles for buttons as we did for bitmap buttons
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68219 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-10 14:20:45 +00:00
Vadim Zeitlin
0a63a7b38f Use the correct event handler in wxMenuBase::UpdateUI().
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
2011-07-10 12:55:30 +00:00
Vadim Zeitlin
e96be167e7 Support float, double and file name values in wxGenericValidator.
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
2011-07-09 23:37:28 +00:00
Vadim Zeitlin
065ba6fb09 No changes, just use NULL instead of 0 for pointers.
Initialize pointers with NULL in wxGenericValidator.

See #13304.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-09 23:37:21 +00:00
Vadim Zeitlin
e7cda1c350 Generate events for two auxiliary mouse buttons in wxGTK.
Add code to generate wxEVT_AUXN_XXX events to wxGTK.

Closes #13310.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-09 23:37:15 +00:00
Vadim Zeitlin
013b02092f Mention that wxNotebook page must be removed before reparenting it.
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
2011-07-09 23:37:09 +00:00
Vadim Zeitlin
0edbdf6a45 Check for GTK window parent, not wx one, when reparenting.
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
2011-07-09 23:37:03 +00:00
Vadim Zeitlin
cd9b34ef83 Refresh the generic wxDataViewCtrl header if it was made too small.
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
2011-07-09 23:36:55 +00:00
Vadim Zeitlin
dcd6f73654 Show extra mouse buttons and wheel state in the text sample output too.
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
2011-07-09 23:36:50 +00:00
Vadim Zeitlin
0e27ef576e Don't duplicate wxImage::ConvertToDisabled() in wxAUI code.
Just reuse the existing function.

Also add an example of showing a disabled bitmap to the aui sample.

Closes #13303.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68210 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-09 23:36:44 +00:00
Vadim Zeitlin
1719a200c7 Output something from the console sample even if it's ran without arguments.
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
2011-07-09 23:36:38 +00:00