File: DataViewIndexListModel.xsp

package info (click to toggle)
libwx-perl 1%3A0.9932-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,300 kB
  • sloc: cpp: 11,064; perl: 8,603; ansic: 711; makefile: 53
file content (85 lines) | stat: -rw-r--r-- 3,261 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#############################################################################
## Name:        ext/dataview/XS/DataViewIndexListModel.xsp
## Purpose:     XS++ for Wx::DataViewIndexListModel
## Author:      Mattia Barbon
## Modified by:
## Created:     05/11/2007
## RCS-ID:      $Id: DataViewIndexListModel.xsp 2927 2010-06-06 08:06:10Z mbarbon $
## Copyright:   (c) 2007-2010 Mattia Barbon
## Licence:     This program is free software; you can redistribute it and/or
##              modify it under the same terms as Perl itself
#############################################################################

#if wxUSE_DATAVIEWCTRL

%module{Wx};

#include <wx/dataview.h>
#include "xspp/dataviewindexmodel.h"

%file{xspp/dataviewindexmodel.h};
%{
#include "cpp/v_cback.h"

class wxPlDataViewIndexListModel : public wxDataViewIndexListModel
{
    WXPLI_DECLARE_V_CBACK();
public:
    wxPlDataViewIndexListModel( const char* package, unsigned int initial_size )
        : wxDataViewIndexListModel( initial_size ),
          m_callback( "Wx::PlDataViewIndexListModel" )
    {
        m_callback.SetSelf( wxPli_make_object( this, package ), true );
    }

//     DEC_V_CBACK_UINT__VOID( GetRowCount );
    DEC_V_CBACK_UINT__VOID_const( GetColumnCount );
    DEC_V_CBACK_WXSTRING__UINT_const( GetColumnType );
    DEC_V_CBACK_VOID__mWXVARIANT_UINT_UINT_const( GetValueByRow );
    DEC_V_CBACK_BOOL__WXVARIANT_UINT_UINT( SetValueByRow );
};

DEF_V_CBACK_UINT__VOID_const_pure( wxPlDataViewIndexListModel,
                                   wxDataViewIndexListModel, GetColumnCount );
DEF_V_CBACK_WXSTRING__UINT_const_pure( wxPlDataViewIndexListModel,
                                       wxDataViewIndexListModel, GetColumnType );
// DEF_V_CBACK_UINT__VOID_pure( wxPlDataViewIndexListModel,
//                              wxDataViewIndexListModel, GetRowCount );
DEF_V_CBACK_VOID__mWXVARIANT_UINT_UINT_const_pure( wxPlDataViewIndexListModel,
                                                   wxDataViewIndexListModel,
                                                   GetValueByRow );
DEF_V_CBACK_BOOL__WXVARIANT_UINT_UINT_pure( wxPlDataViewIndexListModel,
                                            wxDataViewIndexListModel,
                                            SetValueByRow );
%}
%file{-};

%name{Wx::DataViewIndexListModel} class wxDataViewIndexListModel
{
##    unsigned int GetRowCount();

    void GetValueByRow( wxVariant &variant,
                        unsigned int row, unsigned int col ) const;

    bool SetValueByRow( const wxVariant &variant,
                        unsigned int row, unsigned int col );

    void RowPrepended();
    void RowInserted( unsigned int before );
    void RowAppended();
    void RowDeleted( unsigned int row );
    void RowChanged( unsigned int row );
    void RowValueChanged( unsigned int row, unsigned int col );

    unsigned int GetRow( const wxDataViewItem &item ) const;
    wxDataViewItem& GetItem( unsigned int row ) const;
    void Reset( unsigned int new_size );
};

%name{Wx::PlDataViewIndexListModel} class wxPlDataViewIndexListModel
{
    wxPlDataViewIndexListModel( unsigned int initial_size = 0 )
        %code{% RETVAL = new wxPlDataViewIndexListModel( CLASS, initial_size ); %};
};

#endif