File: Grid.xs

package info (click to toggle)
libwx-perl 0.9702-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,240 kB
  • ctags: 1,812
  • sloc: cpp: 8,988; perl: 6,366; makefile: 38; ansic: 1
file content (107 lines) | stat: -rw-r--r-- 3,629 bytes parent folder | download
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/////////////////////////////////////////////////////////////////////////////
// Name:        ext/grid/Grid.xs
// Purpose:     XS for Wx::Grid
// Author:      Mattia Barbon
// Modified by:
// Created:     04/12/2001
// RCS-ID:      $Id: Grid.xs 2757 2010-01-17 10:26:27Z mbarbon $
// Copyright:   (c) 2001-2004, 2006-2010 Mattia Barbon
// Licence:     This program is free software; you can redistribute it and/or
//              modify it under the same terms as Perl itself
/////////////////////////////////////////////////////////////////////////////

#define PERL_NO_GET_CONTEXT

#include "cpp/wxapi.h"

#undef THIS

#include <wx/control.h>
#include <wx/grid.h>
#include <wx/generic/gridctrl.h>

typedef wxGrid::wxGridSelectionModes wxGridSelectionModes;
typedef wxGridCellAttr::wxAttrKind wxAttrKind;

// event macros
#define SEVT( NAME, ARGS )    wxPli_StdEvent( NAME, ARGS )
#define EVT( NAME, ARGS, ID ) wxPli_Event( NAME, ARGS, ID )

// !package: Wx::Event
// !tag:
// !parser: sub { $_[0] =~ m<^\s*S?EVT\(\s*(\w+)\s*\,> }

static wxPliEventDescription evts[] =
{
    EVT( EVT_GRID_CMD_CELL_LEFT_CLICK, 3, wxEVT_GRID_CELL_LEFT_CLICK )
    EVT( EVT_GRID_CMD_CELL_RIGHT_CLICK, 3, wxEVT_GRID_CELL_RIGHT_CLICK )
    EVT( EVT_GRID_CMD_CELL_LEFT_DCLICK, 3, wxEVT_GRID_CELL_LEFT_DCLICK )
    EVT( EVT_GRID_CMD_CELL_RIGHT_DCLICK, 3, wxEVT_GRID_CELL_RIGHT_DCLICK )
    EVT( EVT_GRID_CMD_LABEL_LEFT_CLICK, 3, wxEVT_GRID_LABEL_LEFT_CLICK )
    EVT( EVT_GRID_CMD_LABEL_RIGHT_CLICK, 3, wxEVT_GRID_LABEL_RIGHT_CLICK )
    EVT( EVT_GRID_CMD_LABEL_LEFT_DCLICK, 3, wxEVT_GRID_LABEL_LEFT_DCLICK )
    EVT( EVT_GRID_CMD_LABEL_RIGHT_DCLICK, 3, wxEVT_GRID_LABEL_RIGHT_DCLICK )
    EVT( EVT_GRID_CMD_ROW_SIZE, 3, wxEVT_GRID_ROW_SIZE )
    EVT( EVT_GRID_CMD_COL_SIZE, 3, wxEVT_GRID_COL_SIZE )
    EVT( EVT_GRID_CMD_RANGE_SELECT, 3, wxEVT_GRID_RANGE_SELECT )
#if WXPERL_W_VERSION_LT( 2, 9, 0 )
    EVT( EVT_GRID_CMD_CELL_CHANGE, 3, wxEVT_GRID_CELL_CHANGE )
#endif
    EVT( EVT_GRID_CMD_SELECT_CELL, 3, wxEVT_GRID_SELECT_CELL )
    EVT( EVT_GRID_CMD_EDITOR_SHOWN, 3, wxEVT_GRID_EDITOR_SHOWN )
    EVT( EVT_GRID_CMD_EDITOR_HIDDEN, 3, wxEVT_GRID_EDITOR_HIDDEN )
    EVT( EVT_GRID_CMD_EDITOR_CREATED, 3, wxEVT_GRID_EDITOR_CREATED )
    EVT( EVT_GRID_CMD_CELL_BEGIN_DRAG, 3, wxEVT_GRID_CELL_BEGIN_DRAG )
    SEVT( EVT_GRID_CELL_LEFT_CLICK, 2 )
    SEVT( EVT_GRID_CELL_RIGHT_CLICK, 2 )
    SEVT( EVT_GRID_CELL_LEFT_DCLICK, 2 )
    SEVT( EVT_GRID_CELL_RIGHT_DCLICK, 2 )
    SEVT( EVT_GRID_LABEL_LEFT_CLICK, 2 )
    SEVT( EVT_GRID_LABEL_RIGHT_CLICK, 2 )
    SEVT( EVT_GRID_LABEL_LEFT_DCLICK, 2 )
    SEVT( EVT_GRID_LABEL_RIGHT_DCLICK, 2 )
    SEVT( EVT_GRID_ROW_SIZE, 2 )
    SEVT( EVT_GRID_COL_SIZE, 2 )
    SEVT( EVT_GRID_RANGE_SELECT, 2 )
#if WXPERL_W_VERSION_LT( 2, 9, 0 )
    SEVT( EVT_GRID_CELL_CHANGE, 2 )
#endif
    SEVT( EVT_GRID_SELECT_CELL, 2 )
    SEVT( EVT_GRID_EDITOR_SHOWN, 2 )
    SEVT( EVT_GRID_EDITOR_HIDDEN, 2 )
    SEVT( EVT_GRID_EDITOR_CREATED, 2 )
    SEVT( EVT_GRID_CELL_BEGIN_DRAG, 2 )
    { 0, 0, 0 }
};

MODULE=Wx__Grid

BOOT:
  INIT_PLI_HELPERS( wx_pli_helpers );

INCLUDE: XS/Grid.xs
INCLUDE: XS/GridCellAttr.xs
INCLUDE: XS/GridEvent.xs
INCLUDE: XS/GridCellRenderer.xs
INCLUDE: XS/GridCellEditor.xs

INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t ../../typemap.xsp XS/GridTable.xsp

INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t ../../typemap.xsp XS/GridTableMessage.xsp

MODULE=Wx__Grid PACKAGE=Wx::Grid

void
SetEvents()
  CODE:
    wxPli_set_events( evts );

#include "cpp/gr_constants.cpp"

#  //FIXME//tricky
#if defined(__WXMSW__)
#undef XS
#define XS( name ) WXXS( name )
#endif

MODULE=Wx__Grid