Instead of using separate check and icon+text columns in the list model
page, use the combined check+icon+text column to verify that it works
(which is not the case current in the native Mac version).
Implement support for this attribute only in the generic version so far,
it will hopefully be implemented for the natives ones in the future.
Also add a new toggle column to the dataview sample to check how it
works: checking the items in this column enables using this attribute
for some other ones.
Closes#18180.
Handle "&" in exactly the same way as "&" in wxMarkupParser, i.e. do not
map the former to "&&" to prevent it from being interpreted as a mnemonic as
this is incompatible with using markup for anything but the control labels,
e.g. for wxDataViewCtrl items text, in which mnemonics are not recognized.
And even when using markup for control labels, it was a questionable decision
as it's really not clear at all why should the XML entity and the raw
character itself be handled differently.
Also split wxMarkupText into two classes, wxMarkupText that handles
mnemonics in the markup (which is typically a label) and a very
similar, but not derived, wxItemMarkupText that handles mnemonics-less
markup for list etc. items, uses DrawItemText() and supports
ellipsizing.
Illustrate the use of ampersands in the dataview sample.
The code handling background colour was commented out for some reason, simply
enable it as it seems to be working just fine -- and update the sample to show
that it does.
Try to show as much useful information as possible for the available width,
notably show the time fully, including seconds, which was never done before.
Also add a date column to the dataview sample to allow seeing how this works
in practice.
See #16640.
Increasing it to 10000000 in r77905 brought both the native GTK (see #16741)
and OSX (see #16740) wxDataViewCtrl implementation to their knees, so don't do
this.
This is, of course, just hiding the real bug, but still better than not
allowing people to run the sample at all.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78287 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This makes the code (slightly) shorter and more clear and is more efficient as
selecting all items in wxDataViewCtrl is now a O(1) operation instead of being
O(N), where N is the number of items -- and the latter could take quite a long
time (and consume non-negligible amount of memory) for large N.
Increase the size of the virtual list control from 1000 to 10000000 in the
sample to show this.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
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
Add new wxDataViewModel::IsEnabled() and wxDataViewListStore::IsEnabledByRow()
methods and implement support for actually disabling the items in wxOSX/Cocoa
native implementation of wxDataViewCtrl and limited support for it in the
generic version.
We need to implement this in wxGTK using GtkCellRenderer "sensitive" propriety
later.
Closes#12686.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
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
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
Add a column using custom renderer to the example using a list model with
attributes to test attributes support -- currently they are ignored, but this
will be fixed soon.
Also make the custom renderer display somewhat more clear as previously it
didn't depend at all on its value.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62588 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Using Col_EditableText, Col_IconText and Col_TextWithAttr instead of 0, 1 and
2 makes the sample code a bit easier to read.
Also use switch on the column value instead of nested ifs everywhere to give
compiler a chance to warn us if we forget to update some function when a new
column is added.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62587 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is an incompatible change but having to use a non-const model pointer to
call a clearly logically const version was simply too ugly so change it while
we still can.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There doesn't seem to be any reason to not use them and having different
appearance under OS X and elsewhere is just confusing and looks like a bug.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62491 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Implemented ellipsization in the generic, GTK and both OS X Carbon and Cocoa
versions but it currently doesn't work well in GTK as it changes the item
alignment unconditionally, this will need to be fixed later.
The behaviour for the columns is currently inconsistent between ports too:
under MSW they (natively) use wxELLIPSIZE_END, under GTK -- wxELLIPSIZE_NONE
and under OS X the same ellipsization mode as the column contents, i.e.
wxELLIPSIZE_MIDDLE by default.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This has a possible advantage of a more native look and feel (although it's
hard to tell the difference between drawing the icon ourselves and how the
default GTK+ renderer does it to be honest) and a very real advantage of
allowing to edit in place cells with icons. It also reduces code duplication
in GTK implementation.
Modify the sample to make the icon-text column in the list model editable to
show that it works. This required storing the values of the second column as
well, so do it in its own array and to avoid calling it "m_array2", rename the
existing m_array to m_textColValues (which accounts for most of the diff in
the sample) and call the new one m_iconColValues.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The attribute used for the last item was reused for the next item in the same
column unless it was overridden in the attribute of this item, fix this by
remembering the original attribute and using it if no attributes are
explicitly specified.
Also change the sample to show the items without attributes in a column with
attributes and make the label correspond to the attribute of the item.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Make the colours of the items in the "attributes" column blue/green/red in
order instead of making all odd items blue and all even and divisible by 3
ones green while making the rest of them red -- it was a bit difficult to
figure out how it worked before.
Also correct wxDataViewItemAttr::SetItalic() check: comparing the remainder of
the division by 2 with 5 didn't risk to work.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Main additions:
- now it's possible to change the DVC style dynamically
- make models more robust against deleting items, and against other allowed user actions
- comment portions of the code to make it more didactive
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775