]> git.saurik.com Git - wxWidgets.git/blob - src/cocoa/NSTableView.mm
File/dir dialog styles and other changes (patch 1488371):
[wxWidgets.git] / src / cocoa / NSTableView.mm
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cocoa/NSTableView.mm
3 // Purpose: wxCocoaNSTableView / wxCocoaNSTableDataSource
4 // Author: David Elliott
5 // Modified by:
6 // Created: 2003/08/05
7 // RCS-ID: $Id$
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWidgets licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // ============================================================================
13 // declarations
14 // ============================================================================
15
16 // ----------------------------------------------------------------------------
17 // headers
18 // ----------------------------------------------------------------------------
19
20 #include "wx/wxprec.h"
21 #ifndef WX_PRECOMP
22 #include "wx/log.h"
23 #endif // WX_PRECOMP
24
25 #include "wx/cocoa/ObjcPose.h"
26
27 #include "wx/cocoa/NSTableDataSource.h"
28 #include "wx/cocoa/NSTableView.h"
29 #import <AppKit/NSTableView.h>
30
31 // ----------------------------------------------------------------------------
32 // globals
33 // ----------------------------------------------------------------------------
34 WX_IMPLEMENT_OBJC_INTERFACE_HASHMAP(NSTableView)
35
36 // ============================================================================
37 // @class wxCocoaNSTableDataSource
38 // ============================================================================
39 @implementation wxCocoaNSTableDataSource : NSObject
40
41 - (int)numberOfRowsInTableView: (NSTableView *)tableView
42 {
43 wxCocoaNSTableView *wxView = wxCocoaNSTableView::GetFromCocoa(tableView);
44 wxCHECK_MSG(wxView, 0, wxT("No associated wx object"));
45 return wxView->CocoaDataSource_numberOfRows();
46 }
47
48 - (id)tableView:(NSTableView *)tableView
49 objectValueForTableColumn: (NSTableColumn *)tableColumn
50 row: (int)rowIndex
51 {
52 wxCocoaNSTableView *wxView = wxCocoaNSTableView::GetFromCocoa(tableView);
53 wxCHECK_MSG(wxView, nil, wxT("No associated wx object"));
54 return wxView->CocoaDataSource_objectForTableColumn(tableColumn,rowIndex);
55 }
56
57 @end // implementation wxCocoaNSTableDataSource
58