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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2011. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
%%
%% %CopyrightEnd%
%%
<<wxListCtrl_class
class EwxListCtrl : public wxListCtrl {
public: ~EwxListCtrl();
EwxListCtrl(wxWindow * parent,wxWindowID winid,const wxPoint& pos,const wxSize& size,long style,const wxValidator& validator) : wxListCtrl(parent,winid,pos,size,style,validator) {};
EwxListCtrl() : wxListCtrl() {};
int onGetItemText;
int onGetItemAttr;
int onGetItemColumnImage;
ErlDrvPort port;
private:
virtual wxString OnGetItemText(long item, long col) const;
virtual wxListItemAttr* OnGetItemAttr(long item) const;
virtual int OnGetItemImage(long item) const;
virtual int OnGetItemColumnImage(long item, long column) const;
};
wxListCtrl_class>>
<<wxListCtrl_new_0
case ~s: { // wxListCtrl::wxListCtrl
wxListCtrl * Result = new EwxListCtrl();
newPtr((void *) Result, 0, memenv);
rt.addRef(getRef((void *)Result,memenv), "wxListCtrl");
break;
}
wxListCtrl_new_0>>
<<wxListCtrl_new_2
case ~s: { // wxListCtrl::wxListCtrl
wxWindowID winid=wxID_ANY;
wxPoint pos= wxDefaultPosition;
wxSize size= wxDefaultSize;
long style=wxLC_ICON;
const wxValidator * validator= &wxDefaultValidator;
wxWindow *parent = (wxWindow *) getPtr(bp,memenv); bp += 4;
int onGetItemText = 0, onGetItemAttr = 0, onGetItemColumnImage = 0;
bp += 4; /* Align */
while( * (int*) bp) { switch (* (int*) bp) {
case 1: {bp += 4;
winid = (wxWindowID)*(int *) bp; bp += 4;
} break;
case 2: {bp += 4;
int * posX = (int *) bp; bp += 4;
int * posY = (int *) bp; bp += 4;
pos = wxPoint(*posX,*posY);
bp += 4; /* Align */
} break;
case 3: {bp += 4;
int * sizeW = (int *) bp; bp += 4;
int * sizeH = (int *) bp; bp += 4;
size = wxSize(*sizeW,*sizeH);
bp += 4; /* Align */
} break;
case 4: {bp += 4;
style = (long)*(int *) bp; bp += 4;
} break;
case 5: {bp += 4;
validator = (wxValidator *) getPtr(bp,memenv); bp += 4;
} break;
case 6: {bp += 4;
onGetItemText = *(int *) bp; bp += 4;
} break;
case 7: {bp += 4;
onGetItemAttr = *(int *) bp; bp += 4;
} break;
case 8: {bp += 4;
onGetItemColumnImage = *(int *) bp; bp += 4;
} break;
}};
EwxListCtrl * Result = new EwxListCtrl(parent,winid,pos,size,style,*validator);
Result->onGetItemText = onGetItemText;
Result->onGetItemAttr = onGetItemAttr;
Result->onGetItemColumnImage = onGetItemColumnImage;
Result->port = Ecmd.port;
newPtr((void *) Result, 0, memenv);
rt.addRef(getRef((void *)Result,memenv), "wxListCtrl");
break;
}
wxListCtrl_new_2>>
<<Create
case ~s: { // wxListCtrl::Create
wxWindowID winid=wxID_ANY;
wxPoint pos= wxDefaultPosition;
wxSize size= wxDefaultSize;
long style=wxLC_ICON;
const wxValidator * validator= &wxDefaultValidator;
EwxListCtrl *This = (EwxListCtrl *) getPtr(bp,memenv); bp += 4;
wxWindow *parent = (wxWindow *) getPtr(bp,memenv); bp += 4;
int onGetItemText = 0, onGetItemAttr = 0, onGetItemColumnImage = 0;
bp += 4; /* Align */
while( * (int*) bp) { switch (* (int*) bp) {
case 1: {bp += 4;
winid = (wxWindowID)*(int *) bp; bp += 4;
} break;
case 2: {bp += 4;
int * posX = (int *) bp; bp += 4;
int * posY = (int *) bp; bp += 4;
pos = wxPoint(*posX,*posY);
bp += 4; /* Align */
} break;
case 3: {bp += 4;
int * sizeW = (int *) bp; bp += 4;
int * sizeH = (int *) bp; bp += 4;
size = wxSize(*sizeW,*sizeH);
bp += 4; /* Align */
} break;
case 4: {bp += 4;
style = (long)*(int *) bp; bp += 4;
} break;
case 5: {bp += 4;
validator = (wxValidator *) getPtr(bp,memenv); bp += 4;
} break;
case 6: {bp += 4;
onGetItemText = *(int *) bp; bp += 4;
} break;
case 7: {bp += 4;
onGetItemAttr = *(int *) bp; bp += 4;
} break;
case 8: {bp += 4;
onGetItemColumnImage = *(int *) bp; bp += 4;
} break;
}};
if(!This) throw wxe_badarg(0);
bool Result = This->Create(parent,winid,pos,size,style,*validator);
This->onGetItemText = onGetItemText;
This->onGetItemAttr = onGetItemAttr;
This->onGetItemColumnImage = onGetItemColumnImage;
This->port = Ecmd.port;
rt.addBool(Result);
break;
}
Create>>
<<SortItems
case ~s: { // wxListCtrl::SortItems taylormade
wxListCtrl *This = (wxListCtrl *) getPtr(bp,memenv); bp += 4;
int sortCallback=*(int *) bp; bp += 4;
if(!This) throw wxe_badarg(0);
callbackInfo* cb = new callbackInfo();
cb->port = Ecmd.port;
cb->callbackID = sortCallback;
bool Result = This->SortItems(wxEListCtrlCompare, (long)cb);
delete cb;
/* Destroy the callback, see wxEPrintout::clear_cb */
wxeReturn cbrt = wxeReturn(WXE_DRV_PORT, memenv->owner, false);
// NOTE: Remove this later when changing from funs to gen_server
cbrt.addAtom("wx_delete_cb");
cbrt.addInt(sortCallback);
cbrt.addTupleCount(2);
cbrt.send();
rt.addBool(Result);
break;
}
SortItems>>
|