Commit Graph

148 Commits

Author SHA1 Message Date
Vadim Zeitlin
3631a2d142 Merge branch listctrl-with-checkboxes
Add support for native checkboxes to wxMSW wxListCtrl.

Closes https://github.com/wxWidgets/wxWidgets/pull/153
2016-02-06 01:20:01 +01:00
Igor Korot
aa4aa74154 Don't generate wxEVT_LIST_ITEM_RIGHT_CLICK outside of item area
Make wxGenericListCtrl used under wxGTK and wxOSX behave the same as the
native wxMSW wxListCtrl and wxTreeCtrl under all platforms and only generate
ITEM_RIGHT_CLICK events when an item was actually clicked, i.e. don't generate
them for the clicks completely outside of the client area.

Closes #4711.
2016-01-30 18:54:09 +01:00
Maarten Bent
5326132c21 Updated wxListCtrl sample with check-boxes functionality. 2016-01-15 20:55:32 +01:00
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Kinaou Hervé
de7e315557 Correct implement wxLIST_AUTOSIZE_XXX in the generic wxListCtrl.
Use both the contents and the header width when wxLIST_AUTOSIZE_USEHEADER is
given instead of just the latter.

Also make both wxLIST_AUTOSIZE_USEHEADER and the previously implemented
wxLIST_AUTOSIZE work efficiently for the virtual list controls by reusing
wxMaxWidthCalculatorBase already used in the generic wxDataViewCtrl.

Closes #10326.
2015-03-11 22:03:14 +01:00
Paul Cornett
5b4a70247c use "new" wx-prefixed macros in samples
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-30 07:07:55 +00:00
Vadim Zeitlin
c3f4095921 Fix assert due to incorrect format being used in listctrl sample.
"%d" can't be used with long wxListEvent::GetIndex() value in 64 bit builds.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-11-15 13:33:31 +00:00
Vadim Zeitlin
9b31387508 Merge the changes from 3.0 branch.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-11-12 18:06:37 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Vadim Zeitlin
dc2f83c4f1 Use more readable wxListCtrl::AppendColumn() in the samples.
Call this function instead of InsertColumn() with incrementing indices.

See #15265.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74311 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-29 12:52:34 +00:00
Vadim Zeitlin
0ee169da2b Add wxListCtrl::EnableAlternateRowColours() and SetAlternateRowColour().
Add methods to simply enable alternative row background colours in wxListCtrl.

Closes #14618.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73239 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-12-22 02:33:23 +00:00
Vadim Zeitlin
87f0b1323b Don't use "Cancel" button in the about dialog of the listctrl sample.
No real changes, just remove the unnecessary button.

See #14618.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-12-22 02:33:04 +00:00
Vadim Zeitlin
d34d31f6d6 Implement incremental search in wxGenericListCtrl.
Mostly copy wxGenericTreeCtrl incremental search implementation to
wxGenericListCtrl (unfortunately there is no simple way to reuse this code
currently), including the recently added EnableBellOnNoMatch() method.

Update the sample to test it, the key event handling in it had to be modified
to allow it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72639 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-07 22:42:27 +00:00
Vadim Zeitlin
c1a9bcfbc5 Correct the test for wxHAS_IMAGES_IN_RESOURCES in listctrl sample.
wxHAS_XXX symbols need to be checked with #ifdef, not #if.

See #1614 (as this change was part of the patch submitted there, even if the
ticket itself is unrelated).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-09 10:12:43 +00:00
Vadim Zeitlin
1862529285 Exclude wxMSW-only code from wxUniversal build under Windows.
wxListCtrl::EndEditLabel() isn't available in wxUniv, it's wxMSW-only.

This fixes the sample compilation in wxUniv/MSW build.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70849 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-09 10:12:40 +00:00
Vadim Zeitlin
e709239889 Use wxHAS_IMAGES_IN_RESOURCES instead of explicit platform checks.
Add a special symbol which is defined only if the icons and other images (e.g.
cursor) are in the separate resource files and don't need to be embedded as
XPMs in the main program.

This makes the checks more clear and more customizable as it's enough to
change wxHAS_IMAGES_IN_RESOURCES definition instead of changing many platform
checks.

Closes #14050.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70789 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-04 00:28:58 +00:00
Vadim Zeitlin
4d0c23087a Fix horizontal alignment in icon view in generic wxListCtrl.
Ensure that all the items in the same column have the same width, so that
their labels are centred.

Closes #9227.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70066 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-20 21:21:38 +00:00
Vadim Zeitlin
c4264a8317 Fix the comparison function in the list control sample to do what it says.
The comment in the function implied that it exchanged the items but in fact it
did not and kept their existing order instead.

Do revert them now, at least like this something visibly happens in the sample
when the items are sorted.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-13 13:30:07 +00:00
Vadim Zeitlin
d3ca848751 Make wxListCtrl sort function take wxIntPtr, not long, arguments.
As the arguments to the sort function contain the client data associated with
the items, they may be pointers and hence of greater size than long in Win64
builds. Use wxIntPtr instead of long everywhere to fix this.

Notice that this doesn't break compatibility for 32 bit code where long can
still be used as it is the same as wxIntPtr there after the previous commit.

Closes #4309.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67733 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-13 13:30:03 +00:00
Vadim Zeitlin
18f42b94df Remove calls to wxApp::SetTopWindow() from the samples and documentation.
It is definitely not necessary to call SetTopWindow() when there is only a
single top level window and it is arguable whether it's useful to do it even
when there are many of them so don't encourage its use in the documentation
and also remove all its occurrences from the samples.

Closes #12816.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66528 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-01-02 22:05:14 +00:00
Vadim Zeitlin
ce00f59b5b No changes whatsoever, just remove trailing whitespace.
There are no real changes in this commit but it removes all trailing white
space from our source files. This avoids problems when applying patches and
making diffs and it would be nice to prevent it from reappearing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 11:44:45 +00:00
Vadim Zeitlin
526954c596 Globally use "wxWindows licence" consistently.
Use "wxWindows licence" and not "wxWidgets licence" (the latter doesn't
exist) and consistently spell "licence" using British spelling.

See #12165.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-13 13:29:13 +00:00
Vadim Zeitlin
3cb332c155 Remove unnecessary mondrian.{ico,xpm} files from samples directory.
Standardize on using sample.rc and sample icon in all the samples, it was
confusing that some of them used it and other didn't, without any apparent
logic.

Remove the now unnecessary icon files, including the dialogs sample icon which
seemed to be corrupted (this closes #11146).

Also replace multiple OS/2 resource files with a single one in the sample
directory. The OS/2 projects/makefiles would need to be updated to use them.

Remove dialogs sample icon.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64645 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-20 17:42:33 +00:00
Vadim Zeitlin
747eb0f686 Fix wxListCtrl::EndEditLabel() which simply didn't work.
Also document it (even though it's wxMSW-only for now) and add a test for it
in the sample.

Closes #7663.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-20 22:04:03 +00:00
Vadim Zeitlin
1bab36277c Fix toggling the header in the generic wxListCtrl.
We need to update the lfags first before deciding whether we should create or
destroy the header.

Also add a test for toggling the header to the listctrl sample.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-06 00:31:00 +00:00
Vadim Zeitlin
92a2a0ef91 Fix wxListCtrl::GetSubItemRect(wxLIST_RECT_ICON/LABEL) in wxMSW for column 0.
Wrong width was returned for the icon or label rectangle when querying the
first column. Fix this and add a test to the sample allowing to check this.

GetSubItemRect() still returns wrong results for second and subsequent
columns, see #11355.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-24 00:01:38 +00:00
Vadim Zeitlin
9a83f86094 Globally replace _T() with wxT().
Standardize on using a single macro across all wxWidgets sources and solve the name clash with Sun CC standard headers (see #10660).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-23 20:30:22 +00:00
Vadim Zeitlin
43b2d5e7c3 Put braces around all calls to wxLogFunctions() inside an if statement.
This suppresses all the remaining g++ -Wparentheses warnings and uses consistent style everywhere.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-20 16:47:54 +00:00
Vadim Zeitlin
f5c7443361 no changes, just fix a typo in a menu item label
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60358 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-25 16:26:18 +00:00
Vadim Zeitlin
beb9e8f2ed added find performance test (see #9870) and the possibility to set the number of items (for list and report views only)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60357 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-25 16:23:15 +00:00
Vadim Zeitlin
8a3f03ffce only use Mac-specific menu item under Mac
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-25 15:37:33 +00:00
Vadim Zeitlin
b18e2046af pass wxIntPtr, not wxUIntPtr, to wxListCtrl::SortItems() callback as it's more compatible with the existing code assuming that this parameter is signed (as our own wxFileCtrl did)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60198 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-16 13:00:40 +00:00
Vadim Zeitlin
6e2f308461 use wxUIntPtr instead of long for 3rd parameter of wxListCtrl::SortItems() to allow passing pointers to it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60182 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-15 21:23:50 +00:00
Francesco Montorsi
9e27ff7519 revert addition of the simple listctrl; it doesn't help.
Log the version of comctl32.dll under wxMSW; it's useful when reporting bugs or when debugging

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59310 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-04 11:39:13 +00:00
Francesco Montorsi
a0d0799beb small reorganization; no real change
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-27 20:20:18 +00:00
Robert Roebling
2a0c05ebe3 Little correction to hand-made sizing
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-25 20:57:43 +00:00
Robert Roebling
37e8bdb87d Add simple wxListCtrl to complex sample
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-23 12:26:30 +00:00
Robert Roebling
a91a64da8e Use theme border in wxListCtrl sample
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-22 15:11:35 +00:00
Vadim Zeitlin
80cc5fc7ad document column reordering in wxListCtrl; fix confusion between GetColumnOrder() and GetColumnIndexFromOrder() doing this discovered; show the use of these methods in the sample and added a unit test for them
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-26 19:11:22 +00:00
Vadim Zeitlin
e974c5d258 implement wxListCtrl::GetSubItemRect() for generic version and fix bug in it in wxMSW one; also added a test for it in the sample
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-30 18:21:33 +00:00
Vadim Zeitlin
929b79014a support wxListCtrl::GetViewRect() in report view too; test it in the sample (#9484)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-29 00:12:12 +00:00
Vadim Zeitlin
d6d9c22365 change shortcut for "Sort" to Ctrl-T to avoid conflict with another item using Ctrl-S (#9574)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54211 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-14 14:06:12 +00:00
Vadim Zeitlin
d53b09d870 don't show the normal context menu while editing an item (#9543)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-07 02:30:25 +00:00
Vadim Zeitlin
17483f70a5 use 'i' and 'd' instead of WXK_DELETE/INSERT as wxMSW list control doesn't get the latter keys in its OnListKeyDown()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53832 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-05-30 01:05:43 +00:00
Vadim Zeitlin
508b652335 ensure that GetEditControl() returns something even if label editing was started by the user and not the program (closes #1325)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53831 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-05-30 00:26:07 +00:00
Vadim Zeitlin
6ef2b23056 added test of focusing/selecting another item
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-16 00:04:51 +00:00
Chris Elliott
1583600031 fixes as per http://thread.gmane.org/gmane.comp.lib.wxwidgets.devel/92325
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49114 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-10-10 07:44:34 +00:00
Vadim Zeitlin
ebc9b89d52 use ListView_RedrawItems() to implement wxListCtrl::RefreshItems(); added tests for it to the sample
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-09-16 10:24:45 +00:00
Vadim Zeitlin
e16417726c minor changes: increase the initial window size, create the log control read-only, don't create unneeded status bar panes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47348 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-07-11 23:17:39 +00:00
Vadim Zeitlin
93daabe060 removed WXWIN_COMPATIBILITY_2_4
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44632 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-03-07 19:23:13 +00:00