summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
50b1e15)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60907
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
///////////////////////////////////////////////////////////////////////////////
// Name: src/osx/cocoa/dataview.mm
// Purpose: wxDataView
///////////////////////////////////////////////////////////////////////////////
// Name: src/osx/cocoa/dataview.mm
// Purpose: wxDataView
// Modified by:
// Created: 2009-01-31
// RCS-ID: $Id: dataview.mm$
// Modified by:
// Created: 2009-01-31
// RCS-ID: $Id: dataview.mm$
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
NSTableColumn* tableColumn; // not owned by the class
wxDataViewCustomRenderer* customRenderer; // not owned by the class
NSTableColumn* tableColumn; // not owned by the class
wxDataViewCustomRenderer* customRenderer; // not owned by the class
wxPointerObject* item; // not owned by the class
}
wxPointerObject* item; // not owned by the class
}
-(id) copyWithZone:(NSZone*)zone
{
wxCustomRendererObject* copy;
-(id) copyWithZone:(NSZone*)zone
{
wxCustomRendererObject* copy;
copy = [[[self class] allocWithZone:zone] init];
copy->customRenderer = customRenderer;
copy->item = item;
copy = [[[self class] allocWithZone:zone] init];
copy->customRenderer = customRenderer;
copy->item = item;
static NSInteger CompareItems(id item1, id item2, void* context)
{
NSArray* const sortDescriptors = (NSArray*) context;
static NSInteger CompareItems(id item1, id item2, void* context)
{
NSArray* const sortDescriptors = (NSArray*) context;
NSUInteger const noOfDescriptors = [sortDescriptors count];
NSInteger result(NSOrderedAscending);
NSUInteger const noOfDescriptors = [sortDescriptors count];
NSInteger result(NSOrderedAscending);
wxSortDescriptorObject* const sortDescriptor = (wxSortDescriptorObject*)[sortDescriptors objectAtIndex:i];
int wxComparisonResult;
wxSortDescriptorObject* const sortDescriptor = (wxSortDescriptorObject*)[sortDescriptors objectAtIndex:i];
int wxComparisonResult;
wxComparisonResult = [sortDescriptor modelPtr]->Compare(wxDataViewItem([((wxPointerObject*) item1) pointer]),
wxDataViewItem([((wxPointerObject*) item2) pointer]),
[sortDescriptor columnPtr]->GetModelColumn(),
wxComparisonResult = [sortDescriptor modelPtr]->Compare(wxDataViewItem([((wxPointerObject*) item1) pointer]),
wxDataViewItem([((wxPointerObject*) item2) pointer]),
[sortDescriptor columnPtr]->GetModelColumn(),
{
self = [super init];
if (self != nil)
{
self = [super init];
if (self != nil)
{
self = [super init];
if (self != nil)
{
self = [super init];
if (self != nil)
- self.pointer = initPointer;
+ self->pointer = initPointer;
-(id) copyWithZone:(NSZone*)zone
{
wxSortDescriptorObject* copy;
-(id) copyWithZone:(NSZone*)zone
{
wxSortDescriptorObject* copy;
copy = [super copyWithZone:zone];
copy->columnPtr = columnPtr;
copy->modelPtr = modelPtr;
copy = [super copyWithZone:zone];
copy->columnPtr = columnPtr;
copy->modelPtr = modelPtr;
[children release];
[items release];
[children release];
[items release];
NSString* bestType([pasteboard availableTypeFromArray:supportedTypes]);
NSString* bestType([pasteboard availableTypeFromArray:supportedTypes]);
if (bestType != nil)
{
wxDataViewCtrl* const dataViewCtrlPtr(implementation->GetDataViewCtrl());
if (bestType != nil)
{
wxDataViewCtrl* const dataViewCtrlPtr(implementation->GetDataViewCtrl());
{
NSArray* dataArray((NSArray*)[pasteboard propertyListForType:DataViewPboardType]);
NSUInteger indexDraggedItem, noOfDraggedItems([dataArray count]);
{
NSArray* dataArray((NSArray*)[pasteboard propertyListForType:DataViewPboardType]);
NSUInteger indexDraggedItem, noOfDraggedItems([dataArray count]);
indexDraggedItem = 0;
while (indexDraggedItem < noOfDraggedItems)
{
indexDraggedItem = 0;
while (indexDraggedItem < noOfDraggedItems)
{
CFDataRef osxData; // needed to convert internally used UTF-16 representation to a UTF-8 representation
wxDataObjectComposite* dataObjects (new wxDataObjectComposite());
wxTextDataObject* textDataObject(new wxTextDataObject());
CFDataRef osxData; // needed to convert internally used UTF-16 representation to a UTF-8 representation
wxDataObjectComposite* dataObjects (new wxDataObjectComposite());
wxTextDataObject* textDataObject(new wxTextDataObject());
osxData = ::CFStringCreateExternalRepresentation(kCFAllocatorDefault,(CFStringRef)[pasteboard stringForType:NSStringPboardType],kCFStringEncodingUTF8,32);
if (textDataObject->SetData(::CFDataGetLength(osxData),::CFDataGetBytePtr(osxData)))
dataObjects->Add(textDataObject);
osxData = ::CFStringCreateExternalRepresentation(kCFAllocatorDefault,(CFStringRef)[pasteboard stringForType:NSStringPboardType],kCFStringEncodingUTF8,32);
if (textDataObject->SetData(::CFDataGetLength(osxData),::CFDataGetBytePtr(osxData)))
dataObjects->Add(textDataObject);
NSArray* newDescriptors;
NSMutableArray* wxSortDescriptors;
NSArray* newDescriptors;
NSMutableArray* wxSortDescriptors;
NSUInteger noOfDescriptors;
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
NSUInteger noOfDescriptors;
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
NSString* bestType([pasteboard availableTypeFromArray:supportedTypes]);
NSString* bestType([pasteboard availableTypeFromArray:supportedTypes]);
if (bestType != nil)
{
wxDataViewCtrl* const dataViewCtrlPtr(implementation->GetDataViewCtrl());
if (bestType != nil)
{
wxDataViewCtrl* const dataViewCtrlPtr(implementation->GetDataViewCtrl());
{
NSArray* dataArray((NSArray*)[pasteboard propertyListForType:DataViewPboardType]);
NSUInteger indexDraggedItem, noOfDraggedItems([dataArray count]);
{
NSArray* dataArray((NSArray*)[pasteboard propertyListForType:DataViewPboardType]);
NSUInteger indexDraggedItem, noOfDraggedItems([dataArray count]);
indexDraggedItem = 0;
while (indexDraggedItem < noOfDraggedItems)
{
indexDraggedItem = 0;
while (indexDraggedItem < noOfDraggedItems)
{
CFDataRef osxData; // needed to convert internally used UTF-16 representation to a UTF-8 representation
wxDataObjectComposite* dataObjects (new wxDataObjectComposite());
wxTextDataObject* textDataObject(new wxTextDataObject());
CFDataRef osxData; // needed to convert internally used UTF-16 representation to a UTF-8 representation
wxDataObjectComposite* dataObjects (new wxDataObjectComposite());
wxTextDataObject* textDataObject(new wxTextDataObject());
osxData = ::CFStringCreateExternalRepresentation(kCFAllocatorDefault,(CFStringRef)[pasteboard stringForType:NSStringPboardType],kCFStringEncodingUTF8,32);
if (textDataObject->SetData(::CFDataGetLength(osxData),::CFDataGetBytePtr(osxData)))
dataObjects->Add(textDataObject);
osxData = ::CFStringCreateExternalRepresentation(kCFAllocatorDefault,(CFStringRef)[pasteboard stringForType:NSStringPboardType],kCFStringEncodingUTF8,32);
if (textDataObject->SetData(::CFDataGetLength(osxData),::CFDataGetBytePtr(osxData)))
dataObjects->Add(textDataObject);
// string representation exists
{
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
// string representation exists
{
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
wxDataViewItemArray dataViewItems;
wxDataViewItemArray dataViewItems;
size_t const dataBufferSize = sizeof(wxDataFormatId)+dataSize;
// variable definitions (used in all case statements):
wxMemoryBuffer dataBuffer(dataBufferSize);
size_t const dataBufferSize = sizeof(wxDataFormatId)+dataSize;
// variable definitions (used in all case statements):
wxMemoryBuffer dataBuffer(dataBufferSize);
dataBuffer.AppendData(&idDataFormat,sizeof(wxDataFormatId));
switch (idDataFormat)
{
dataBuffer.AppendData(&idDataFormat,sizeof(wxDataFormatId));
switch (idDataFormat)
{
if (dataStringAvailable)
{
wxCFStringRef osxString(dataString);
if (dataStringAvailable)
{
wxCFStringRef osxString(dataString);
[pasteboard declareTypes:[NSArray arrayWithObjects:DataViewPboardType,NSStringPboardType,nil] owner:nil];
[pasteboard setPropertyList:dataArray forType:DataViewPboardType];
[pasteboard setString:osxString.AsNSString() forType:NSStringPboardType];
[pasteboard declareTypes:[NSArray arrayWithObjects:DataViewPboardType,NSStringPboardType,nil] owner:nil];
[pasteboard setPropertyList:dataArray forType:DataViewPboardType];
[pasteboard setString:osxString.AsNSString() forType:NSStringPboardType];
-(id) copyWithZone:(NSZone*)zone
{
wxImageTextCell* cell;
-(id) copyWithZone:(NSZone*)zone
{
wxImageTextCell* cell;
cell = (wxImageTextCell*) [super copyWithZone:zone];
cell->image = [image retain];
cell->imageSize = imageSize;
cell = (wxImageTextCell*) [super copyWithZone:zone];
cell->image = [image retain];
cell->imageSize = imageSize;
// to draw an image correctly the coordinate system has to be transformed to a bottom-top coordinate system, otherwise the image's
// content is flipped:
NSAffineTransform* coordinateTransform([NSAffineTransform transform]);
// to draw an image correctly the coordinate system has to be transformed to a bottom-top coordinate system, otherwise the image's
// content is flipped:
NSAffineTransform* coordinateTransform([NSAffineTransform transform]);
if ([controlView isFlipped])
{
[coordinateTransform scaleXBy: 1.0 yBy:-1.0]; // first the coordinate system is brought back to bottom-top orientation
if ([controlView isFlipped])
{
[coordinateTransform scaleXBy: 1.0 yBy:-1.0]; // first the coordinate system is brought back to bottom-top orientation
// if the image was not hit let's try the text part:
if (textFrame.size.width > [self cellTextSize].width) // for unknown reasons the alignment of the text cell is ignored; therefore change the size so that
textFrame.size.width = [self cellTextSize].width; // alignment does not influence the visualization anymore
// if the image was not hit let's try the text part:
if (textFrame.size.width > [self cellTextSize].width) // for unknown reasons the alignment of the text cell is ignored; therefore change the size so that
textFrame.size.width = [self cellTextSize].width; // alignment does not influence the visualization anymore
- return [super hitTestForEvent:event inRect:textFrame ofView:controlView];
+ return [super hitTestForEvent:event inRect:textFrame ofView:controlView];
if (imageFrame.size.height > imageSize.height)
imageFrame.size.height = imageSize.height;
imageFrame.origin.y += ceil(0.5*(cellFrame.size.height-imageFrame.size.height));
if (imageFrame.size.height > imageSize.height)
imageFrame.size.height = imageSize.height;
imageFrame.origin.y += ceil(0.5*(cellFrame.size.height-imageFrame.size.height));
// has full control if a context menu should be shown or not
{
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
// has full control if a context menu should be shown or not
{
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU,dataViewCtrlPtr->GetId());
wxDataViewItemArray selectedItems;
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU,dataViewCtrlPtr->GetId());
wxDataViewItemArray selectedItems;
wxDataViewColumn* const dataViewColumnPtr(reinterpret_cast<wxDataViewColumn*>([[tableColumn identifier] pointer]));
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
wxDataViewColumn* const dataViewColumnPtr(reinterpret_cast<wxDataViewColumn*>([[tableColumn identifier] pointer]));
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK,dataViewCtrlPtr->GetId());
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK,dataViewCtrlPtr->GetId());
// remove the sort order from the previously sorted column table (it can also be that
// no sorted column table exists):
UInt32 const noOfColumns = [outlineView numberOfColumns];
// remove the sort order from the previously sorted column table (it can also be that
// no sorted column table exists):
UInt32 const noOfColumns = [outlineView numberOfColumns];
for (UInt32 i=0; i<noOfColumns; ++i)
[[[outlineView tableColumns] objectAtIndex:i] setSortDescriptorPrototype:nil];
// make column table sortable:
NSArray* sortDescriptors;
NSSortDescriptor* sortDescriptor;
for (UInt32 i=0; i<noOfColumns; ++i)
[[[outlineView tableColumns] objectAtIndex:i] setSortDescriptorPrototype:nil];
// make column table sortable:
NSArray* sortDescriptors;
NSSortDescriptor* sortDescriptor;
sortDescriptor = [[NSSortDescriptor alloc] initWithKey:[NSString stringWithFormat:@"%d",[outlineView columnWithIdentifier:[tableColumn identifier]]]
ascending:YES];
sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
sortDescriptor = [[NSSortDescriptor alloc] initWithKey:[NSString stringWithFormat:@"%d",[outlineView columnWithIdentifier:[tableColumn identifier]]]
ascending:YES];
sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
-(BOOL) outlineView:(NSOutlineView*)outlineView shouldCollapseItem:(id)item
{
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
-(BOOL) outlineView:(NSOutlineView*)outlineView shouldCollapseItem:(id)item
{
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING,dataViewCtrlPtr->GetId()); // variable definition
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING,dataViewCtrlPtr->GetId()); // variable definition
-(BOOL) outlineView:(NSOutlineView*)outlineView shouldExpandItem:(id)item
{
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
-(BOOL) outlineView:(NSOutlineView*)outlineView shouldExpandItem:(id)item
{
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING,dataViewCtrlPtr->GetId()); // variable definition
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING,dataViewCtrlPtr->GetId()); // variable definition
wxDataViewColumn* const dataViewColumnPtr(reinterpret_cast<wxDataViewColumn*>([[[[self tableColumns] objectAtIndex:newColumnPosition] identifier] pointer]));
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
wxDataViewColumn* const dataViewColumnPtr(reinterpret_cast<wxDataViewColumn*>([[[[self tableColumns] objectAtIndex:newColumnPosition] identifier] pointer]));
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED,dataViewCtrlPtr->GetId());
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED,dataViewCtrlPtr->GetId());
-(void) outlineViewItemDidCollapse:(NSNotification*)notification
{
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
-(void) outlineViewItemDidCollapse:(NSNotification*)notification
{
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED,dataViewCtrlPtr->GetId());
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED,dataViewCtrlPtr->GetId());
-(void) outlineViewItemDidExpand:(NSNotification*)notification
{
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
-(void) outlineViewItemDidExpand:(NSNotification*)notification
{
wxDataViewCtrl* const dataViewCtrlPtr = implementation->GetDataViewCtrl();
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED,dataViewCtrlPtr->GetId());
wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED,dataViewCtrlPtr->GetId());
{
// initialize scrollview (the outline view is part of a scrollview):
NSScrollView* scrollview = (NSScrollView*) this->GetWXWidget(); // definition for abbreviational purposes
{
// initialize scrollview (the outline view is part of a scrollview):
NSScrollView* scrollview = (NSScrollView*) this->GetWXWidget(); // definition for abbreviational purposes
[scrollview setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[scrollview setBorderType:NSNoBorder];
[scrollview setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[scrollview setBorderType:NSNoBorder];
int wxCocoaDataViewControl::GetSelections(wxDataViewItemArray& sel) const
{
NSIndexSet* selectedRowIndexes([this->m_OutlineView selectedRowIndexes]);
int wxCocoaDataViewControl::GetSelections(wxDataViewItemArray& sel) const
{
NSIndexSet* selectedRowIndexes([this->m_OutlineView selectedRowIndexes]);
sel.Empty();
sel.Alloc([selectedRowIndexes count]);
indexRow = [selectedRowIndexes firstIndex];
sel.Empty();
sel.Alloc([selectedRowIndexes count]);
indexRow = [selectedRowIndexes firstIndex];
int indexColumn;
int indexRow;
int indexColumn;
int indexRow;
indexColumn = [this->m_OutlineView columnAtPoint:nativePoint];
indexRow = [this->m_OutlineView rowAtPoint: nativePoint];
if ((indexColumn >= 0) && (indexRow >= 0))
indexColumn = [this->m_OutlineView columnAtPoint:nativePoint];
indexRow = [this->m_OutlineView rowAtPoint: nativePoint];
if ((indexColumn >= 0) && (indexRow >= 0))
size_t indexFormat;
wxDataFormat* formats;
size_t indexFormat;
wxDataFormat* formats;
// get all formats and check afterwards if the formats are compatible; if they are compatible the preferred format is returned otherwise
// wxDF_INVALID is returned;
// currently compatible types (ordered by priority are):
// get all formats and check afterwards if the formats are compatible; if they are compatible the preferred format is returned otherwise
// wxDF_INVALID is returned;
// currently compatible types (ordered by priority are):
{
wxDataFormatId dataFormatID;
{
wxDataFormatId dataFormatID;
[dataObject getBytes:&dataFormatID length:sizeof(wxDataFormatId)];
switch (dataFormatID)
{
[dataObject getBytes:&dataFormatID length:sizeof(wxDataFormatId)];
switch (dataFormatID)
{
case wxDF_UNICODETEXT:
{
wxTextDataObject* textDataObject(new wxTextDataObject());
case wxDF_UNICODETEXT:
{
wxTextDataObject* textDataObject(new wxTextDataObject());
if (textDataObject->SetData(wxDataFormat(dataFormatID),[dataObject length]-sizeof(wxDataFormatId),reinterpret_cast<char const*>([dataObject bytes])+sizeof(wxDataFormatId)))
{
wxDataObjectComposite* dataObjectComposite(new wxDataObjectComposite());
if (textDataObject->SetData(wxDataFormat(dataFormatID),[dataObject length]-sizeof(wxDataFormatId),reinterpret_cast<char const*>([dataObject bytes])+sizeof(wxDataFormatId)))
{
wxDataObjectComposite* dataObjectComposite(new wxDataObjectComposite());
:wxDataViewRenderer(varianttype,mode,align)
{
NSTextFieldCell* cell;
:wxDataViewRenderer(varianttype,mode,align)
{
NSTextFieldCell* cell;
cell = [[NSTextFieldCell alloc] init];
[cell setAlignment:ConvertToNativeHorizontalTextAlignment(align)];
[cell setLineBreakMode:NSLineBreakByTruncatingMiddle];
cell = [[NSTextFieldCell alloc] init];
[cell setAlignment:ConvertToNativeHorizontalTextAlignment(align)];
[cell setLineBreakMode:NSLineBreakByTruncatingMiddle];
:wxDataViewRenderer(varianttype,mode,align)
{
NSImageCell* cell;
:wxDataViewRenderer(varianttype,mode,align)
{
NSImageCell* cell;
cell = [[NSImageCell alloc] init];
this->SetNativeData(new wxDataViewRendererNativeData(cell));
[cell release];
cell = [[NSImageCell alloc] init];
this->SetNativeData(new wxDataViewRendererNativeData(cell));
[cell release];
:wxDataViewRenderer(wxT("string"),mode,alignment), m_Choices(choices)
{
NSPopUpButtonCell* cell;
:wxDataViewRenderer(wxT("string"),mode,alignment), m_Choices(choices)
{
NSPopUpButtonCell* cell;
cell = [[NSPopUpButtonCell alloc] init];
[cell setControlSize:NSMiniControlSize];
[cell setFont:[[NSFont fontWithName:[[cell font] fontName] size:[NSFont systemFontSizeForControlSize:NSMiniControlSize]] autorelease]];
cell = [[NSPopUpButtonCell alloc] init];
[cell setControlSize:NSMiniControlSize];
[cell setFont:[[NSFont fontWithName:[[cell font] fontName] size:[NSFont systemFontSizeForControlSize:NSMiniControlSize]] autorelease]];
NSDateFormatter* dateFormatter;
NSDateFormatter* dateFormatter;
dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
[dateFormatter setDateStyle:NSDateFormatterShortStyle];
dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
[dateFormatter setDateStyle:NSDateFormatterShortStyle];
:wxDataViewRenderer(varianttype,mode)
{
wxImageTextCell* cell;
:wxDataViewRenderer(varianttype,mode)
{
wxImageTextCell* cell;
cell = [[wxImageTextCell alloc] init];
[cell setAlignment:ConvertToNativeHorizontalTextAlignment(align)];
this->SetNativeData(new wxDataViewRendererNativeData(cell));
cell = [[wxImageTextCell alloc] init];
[cell setAlignment:ConvertToNativeHorizontalTextAlignment(align)];
this->SetNativeData(new wxDataViewRendererNativeData(cell));
if (this->GetValue().GetType() == this->GetVariantType())
{
wxDataViewIconText iconText;
if (this->GetValue().GetType() == this->GetVariantType())
{
wxDataViewIconText iconText;
wxImageTextCell* cell;
cell = (wxImageTextCell*) this->GetNativeData()->GetItemCell();
wxImageTextCell* cell;
cell = (wxImageTextCell*) this->GetNativeData()->GetItemCell();
:wxDataViewRenderer(varianttype,mode)
{
NSButtonCell* cell;
:wxDataViewRenderer(varianttype,mode)
{
NSButtonCell* cell;
cell = [[NSButtonCell alloc] init];
[cell setAlignment:ConvertToNativeHorizontalTextAlignment(align)];
[cell setButtonType:NSSwitchButton];
cell = [[NSButtonCell alloc] init];
[cell setAlignment:ConvertToNativeHorizontalTextAlignment(align)];
[cell setButtonType:NSSwitchButton];
:wxDataViewRenderer(varianttype,mode,align)
{
NSLevelIndicatorCell* cell;
:wxDataViewRenderer(varianttype,mode,align)
{
NSLevelIndicatorCell* cell;
cell = [[NSLevelIndicatorCell alloc] initWithLevelIndicatorStyle:NSContinuousCapacityLevelIndicatorStyle];
[cell setMinValue:0];
[cell setMaxValue:100];
cell = [[NSLevelIndicatorCell alloc] initWithLevelIndicatorStyle:NSContinuousCapacityLevelIndicatorStyle];
[cell setMinValue:0];
[cell setMaxValue:100];
NSArray* sortDescriptors;
NSSortDescriptor* sortDescriptor;
NSTableColumn* tableColumn;
NSArray* sortDescriptors;
NSSortDescriptor* sortDescriptor;
NSTableColumn* tableColumn;
tableColumn = this->m_NativeDataPtr->GetNativeColumnPtr();
sortDescriptor = [[NSSortDescriptor alloc] initWithKey:[[tableColumn sortDescriptorPrototype] key] ascending:m_ascending];
sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
tableColumn = this->m_NativeDataPtr->GetNativeColumnPtr();
sortDescriptor = [[NSSortDescriptor alloc] initWithKey:[[tableColumn sortDescriptorPrototype] key] ascending:m_ascending];
sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
#if (wxUSE_DATAVIEWCTRL != 0) && (!defined(wxUSE_GENERICDATAVIEWCTRL) || (wxUSE_GENERICDATAVIEWCTRL == 0))
#if (wxUSE_DATAVIEWCTRL != 0) && (!defined(wxUSE_GENERICDATAVIEWCTRL) || (wxUSE_GENERICDATAVIEWCTRL == 0))
-#include <carbon/carbon.h>
#include <limits>
#ifndef WX_PRECOMP
#include <limits>
#ifndef WX_PRECOMP
{
// variable definition:
wxVariant dataValue;
{
// variable definition:
wxVariant dataValue;
dataViewCtrlPtr->GetModel()->GetValue(dataValue,dataViewItem,dataViewCtrlPtr->GetColumn(i)->GetModelColumn());
if (i > 0)
dataString << wxT('\t');
dataViewCtrlPtr->GetModel()->GetValue(dataValue,dataViewItem,dataViewCtrlPtr->GetColumn(i)->GetModelColumn());
if (i > 0)
dataString << wxT('\t');
for (col = 0; col < num; col++)
{
wxDataViewColumn* column(this->m_DataViewCtrlPtr->GetColumnPtr(col));
for (col = 0; col < num; col++)
{
wxDataViewColumn* column(this->m_DataViewCtrlPtr->GetColumnPtr(col));
if (!(column->IsHidden()))
{
wxDataViewCustomRenderer *renderer = dynamic_cast<wxDataViewCustomRenderer*>(column->GetRenderer());
if (!(column->IsHidden()))
{
wxDataViewCustomRenderer *renderer = dynamic_cast<wxDataViewCustomRenderer*>(column->GetRenderer());
for (col = 0; col < num; col++)
{
wxDataViewColumn* column(this->m_DataViewCtrlPtr->GetColumnPtr(col));
for (col = 0; col < num; col++)
{
wxDataViewColumn* column(this->m_DataViewCtrlPtr->GetColumnPtr(col));
if (!(column->IsHidden()))
{
wxDataViewCustomRenderer *renderer = dynamic_cast<wxDataViewCustomRenderer*>(column->GetRenderer());
if (!(column->IsHidden()))
{
wxDataViewCustomRenderer *renderer = dynamic_cast<wxDataViewCustomRenderer*>(column->GetRenderer());
{
wxSize best = wxControl::DoGetBestSize();
best.y = 80;
{
wxSize best = wxControl::DoGetBestSize();
best.y = 80;
return best;
}
void wxDataViewCtrl::OnMouse(wxMouseEvent& event)
{
event.Skip();
return best;
}
void wxDataViewCtrl::OnMouse(wxMouseEvent& event)
{
event.Skip();
if (GetModel() == NULL)
return;
if (GetModel() == NULL)
return;
UInt16 headerHeight = 0;
MacDataViewListCtrlPtr->GetHeaderButtonHeight(&headerHeight);
UInt16 headerHeight = 0;
MacDataViewListCtrlPtr->GetHeaderButtonHeight(&headerHeight);
if (event.GetY() < headerHeight)
{
unsigned int col_count = GetColumnCount();
if (event.GetY() < headerHeight)
{
unsigned int col_count = GetColumnCount();
wxDataViewColumn *column = GetColumn( col );
if (column->IsHidden())
continue;
wxDataViewColumn *column = GetColumn( col );
if (column->IsHidden())
continue;
- ::GetDataBrowserItemPartBounds( MacDataViewListCtrlPtr->GetControlRef(),
+ ::GetDataBrowserItemPartBounds( MacDataViewListCtrlPtr->GetControlRef(),
reinterpret_cast<DataBrowserItemID>(firstChild.GetID()), column->GetPropertyID(),
kDataBrowserPropertyEnclosingPart, &itemrect );
reinterpret_cast<DataBrowserItemID>(firstChild.GetID()), column->GetPropertyID(),
kDataBrowserPropertyEnclosingPart, &itemrect );
if (abs( event.GetX() - itemrect.right) < 3)
{
if (column->GetFlags() & wxDATAVIEW_COL_RESIZABLE)
if (abs( event.GetX() - itemrect.right) < 3)
{
if (column->GetFlags() & wxDATAVIEW_COL_RESIZABLE)
SetCursor( *wxSTANDARD_CURSOR );
#endif
}
SetCursor( *wxSTANDARD_CURSOR );
#endif
}