Commit Graph

8 Commits

Author SHA1 Message Date
Vadim Zeitlin
119e862ca9 Fix wxDataViewChoiceRenderer behaviour in wxOSX/Cocoa.
Changing the value of a "choice" cell in wxDataViewCtrl didn't work correctly
in wxOSX/Cocoa because wxDataViewChoiceRenderer used the base class version of
OSXOnCellChanged() which passed the integer index we received from NSOutlineView
to the model instead of the expected string.

Fix this by overriding OSXOnCellChanged() in wxDataViewChoiceRenderer itself
and using its argument as an integer index of the selection because this is
what it is, at least under OS X 10.7.

Closes #14373.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-02 14:36:56 +00:00
Francesco Montorsi
b1153ed60f no real change: just fix RCS-ID so that it reflects the current revision number
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-25 21:33:16 +00:00
Vadim Zeitlin
061a5c21db Add wxOSX_USE_COCOA around Cocoa-only OSXApplyAttr() method.
This method is used in wxOSX/Cocoa only.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-11 01:36:36 +00:00
Vadim Zeitlin
aaedb44c5e Revert r62598 which removed "unnecessary wxOSX_USE_COCOA checks."
These checks were not unnecessary at all, this file is used for both Cocoa and
Carbon, fix this momentary lapse of reason.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62606 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-11 01:32:58 +00:00
Vadim Zeitlin
b0607dd221 Add support for custom attributes to wxOSX/Cocoa wxDataViewCustomRenderer.
Virtualize applying the attributes in a new OSXApplyAttr() function and simply
store the attribute in its wxDataViewCustomRenderer version so that it could
be reused later in Render().

The attributes now work correctly in wxOSX/Cocoa dataview sample too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62599 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:42:24 +00:00
Vadim Zeitlin
b7cc3b72f9 No changes, just remove unnecessary wxOSX_USE_COCOA checks.
This file is only compiled in wxOSX/Cocoa build so there is no need to check
that we're using Cocoa here.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62598 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:42:13 +00:00
Vadim Zeitlin
62265c2c67 Allow custom wxDataViewCtrl renderers to easily use attributes.
Set up the DC passed to wxDataViewCustomRenderer::Render() to use the font and
colour defined by the item attribute by default so that any calls to
RenderText() from it will use them automatically.

Also added public wxDataViewCustomRenderer::GetAttr() to allow retrieving the
attribute explicitly in Render().

The column using custom renderer in the dataview sample now works as expected
in the generic version; the native ones will be corrected in the upcoming
commits.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:41:11 +00:00
Vadim Zeitlin
6eec70b984 Big wxDataViewCtrl renderer classes refactoring.
This commit adds no changes in functionality but paves way for the upcoming
improvements of wxDataViewCustomRenderer.

First, introduce wxDataViewCustomRendererBase class in order to allow
implementing behaviour common to custom renderers in all ports in this class
instead of triplicating it.

This required splitting monolithic dataview.h in more parts, now we have
wx/dvrenderer.h which defines wxDataViewRendererBase and the new
wxDataViewCustomRendererBase and includes wx/port/dvrenderer.h which define
wxDataViewRenderer and wx/port/dvrenderers.h which defines all the other
renderer classes.

Also bring renderers hierarchy in the generic version closer to other ports:
all standard renderer classes now inherit from wxDataViewRenderer and not
wxDataViewCustomRenderer in for consistency with the other ports.
wxDataViewRenderer itself still does derive from wxDataViewCustomRendererBase,
unlike elsewhere, but this is unavoidable considering that all generic
renderers are custom ones.

Finally do some cleanup in OS X part of the code: correct indentation,
spacing, comment style.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:40:58 +00:00