aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/api_gen/wx_extra/wxListCtrl.c_src
blob: 7bf9a481de74adbdafc5bcb68b0d1d05dc6e6af4 (plain) (blame)
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
186
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%%     http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions 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;
 ErlDrvTermData 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, (wxeIntPtr)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>>