From 98a0a3a7c3d24144c773629dd827bb06ea6cf5c1 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Thu, 7 Jul 2011 10:33:56 +0200 Subject: Add support for virtual listctrls --- lib/wx/api_gen/wx_extra/wxListCtrl.c_src | 101 +++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) (limited to 'lib/wx/api_gen/wx_extra/wxListCtrl.c_src') diff --git a/lib/wx/api_gen/wx_extra/wxListCtrl.c_src b/lib/wx/api_gen/wx_extra/wxListCtrl.c_src index cd3074e481..6443c02be2 100644 --- a/lib/wx/api_gen/wx_extra/wxListCtrl.c_src +++ b/lib/wx/api_gen/wx_extra/wxListCtrl.c_src @@ -1,3 +1,22 @@ +%% +%% %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% +%% + <> + +<> + +<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>> + +<> \ No newline at end of file -- cgit v1.2.3 From f6d661504a1998f3a243731d3fe5769641f80bcc Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Thu, 7 Jul 2011 15:13:48 +0200 Subject: Fix documentation and callback options in wxListCtrl:create/3 --- lib/wx/api_gen/wx_extra/wxListCtrl.c_src | 134 ++++++++++++++++++++++--------- 1 file changed, 97 insertions(+), 37 deletions(-) (limited to 'lib/wx/api_gen/wx_extra/wxListCtrl.c_src') diff --git a/lib/wx/api_gen/wx_extra/wxListCtrl.c_src b/lib/wx/api_gen/wx_extra/wxListCtrl.c_src index 6443c02be2..54d6fafd01 100644 --- a/lib/wx/api_gen/wx_extra/wxListCtrl.c_src +++ b/lib/wx/api_gen/wx_extra/wxListCtrl.c_src @@ -17,30 +17,25 @@ %% %CopyrightEnd% %% -<port = Ecmd.port; - cb->callbackID = sortCallback; - bool Result = This->SortItems(wxEListCtrlCompare, (long)cb); - delete cb; +<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(); + int onGetItemText; + int onGetItemAttr; + int onGetItemColumnImage; + ErlDrvPort port; - rt.addBool(Result); - break; -} -SortItems>> + 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>> <> -<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>> + +<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>> + - 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>> \ No newline at end of file -- cgit v1.2.3