X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c937bcac0fb8a8df7c0cbfc8c478a2874fec3eb9..f7d32bb716ba2191d52cbf3ada5b3ff72103dfea:/src/osx/carbon/dataview.cpp diff --git a/src/osx/carbon/dataview.cpp b/src/osx/carbon/dataview.cpp index 38f94678c9..f64e35c430 100644 --- a/src/osx/carbon/dataview.cpp +++ b/src/osx/carbon/dataview.cpp @@ -1318,8 +1318,7 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc( // variable definition and initialization: wxVariant modifiedData(true); - if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col) && - dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col)) + if (dataViewCtrlPtr->GetModel()->ChangeValue(modifiedData, dvItem, col)) return noErr; else return errDataBrowserInvalidPropertyData; @@ -1329,8 +1328,7 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc( // variable definition and initialization: wxVariant modifiedData(false); - if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col) && - dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col)) + if (dataViewCtrlPtr->GetModel()->ChangeValue(modifiedData, dvItem, col)) return noErr; else return errDataBrowserInvalidPropertyData; @@ -1357,8 +1355,7 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc( #endif wxVariant modifiedData(modifiedString.AsString()); - if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col) && - dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col)) + if (dataViewCtrlPtr->GetModel()->ChangeValue(modifiedData, dvItem, col)) return noErr; else return errDataBrowserInvalidPropertyData; @@ -1704,7 +1701,7 @@ wxMacDataViewDataBrowserListViewControl::DataBrowserDrawItemProc(DataBrowserItem { // make sure that 'Render' can draw only in the allowed area: dc->SetClippingRegion(content.left,content.top,content.right-content.left+1,content.bottom-content.top+1); - (void) (dataViewCustomRendererPtr->Render( cellrect, dc, + (void) (dataViewCustomRendererPtr->WXCallRender( cellrect, dc, ((state == kDataBrowserItemIsSelected) ? wxDATAVIEW_CELL_SELECTED : 0))); dc->DestroyClippingRegion(); // probably not necessary } @@ -2286,14 +2283,11 @@ wxEllipsizeMode wxDataViewRenderer::GetEllipsizeMode() const return wxELLIPSIZE_NONE; if ( flags & kDataBrowserTruncateTextAtStart ) return wxELLIPSIZE_START; - if ( flags & kDataBrowserTruncateTextMiddle ) - return wxELLIPSIZE_MIDDLE; if ( flags & kDataBrowserTruncateTextAtEnd ) return wxELLIPSIZE_END; - wxFAIL_MSG( "unknown flags" ); - - return wxELLIPSIZE_NONE; + // kDataBrowserTruncateTextMiddle == 0 so there is no need to test for it + return wxELLIPSIZE_MIDDLE; } void wxDataViewRenderer::SetNativeData(wxDataViewRendererNativeData* newNativeDataPtr) @@ -2308,7 +2302,9 @@ IMPLEMENT_ABSTRACT_CLASS(wxDataViewRenderer,wxDataViewRendererBase) // wxDataViewCustomRenderer // --------------------------------------------------------- wxDataViewCustomRenderer::wxDataViewCustomRenderer(wxString const& varianttype, wxDataViewCellMode mode, int align) - :wxDataViewRenderer(varianttype,mode,align), m_editorCtrlPtr(NULL), m_DCPtr(NULL) + :wxDataViewCustomRendererBase(varianttype,mode,align), + m_editorCtrlPtr(NULL), + m_DCPtr(NULL) { SetNativeData(new wxDataViewRendererNativeData(kDataBrowserCustomType)); } @@ -2479,6 +2475,13 @@ wxDataViewColumn::~wxDataViewColumn() delete m_NativeDataPtr; } +int wxDataViewColumn::GetWidth() const +{ + // FIXME: This returns the last programatically set width and will not work if + // the user changes the column's width by dragging it with the mouse. + return m_width; +} + bool wxDataViewColumn::IsSortKey() const { wxDataViewCtrl * const dataViewCtrlPtr(GetOwner());