From: John L. <jr...@us...> - 2007-06-16 06:22:23
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19284/wxLua/docs Modified Files: changelog.txt wxlua.html wxluaref.html Added Files: FAQ.html Log Message: Add back the wxTreeCtrl into the stack dialog, on left of listctrl so you get both for easier navigation. Added functions to the wxlua.XXX table to get info about the status of wxLua Use qsort and bsearch to find the class methods ~ %25 faster Make wxLuaDebugData not always create it's ref data so it can !Ok() Index: wxluaref.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxluaref.html,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** wxluaref.html 14 Jun 2007 01:23:09 -0000 1.23 --- wxluaref.html 16 Jun 2007 06:21:43 -0000 1.24 *************** *** 1976,1980 **** <br> int Append(const <a href="#wxString">wxString</a>& item)<br> ! //int Append(const <a href="#wxString">wxString</a>& item, void *clientData)<br> int Append(const <a href="#wxString">wxString</a>& item, <a href="#wxClientData">wxClientData</a> *clientData)<br> void Append(const <a href="#wxArrayString">wxArrayString</a>& strings)<br> --- 1976,1980 ---- <br> int Append(const <a href="#wxString">wxString</a>& item)<br> ! int Append(const <a href="#wxString">wxString</a>& item, voidptr_long number) // C++ is (void *clientData) You can put a number here<br> int Append(const <a href="#wxString">wxString</a>& item, <a href="#wxClientData">wxClientData</a> *clientData)<br> void Append(const <a href="#wxArrayString">wxArrayString</a>& strings)<br> *************** *** 1982,1986 **** void Delete(unsigned int n)<br> int FindString(const <a href="#wxString">wxString</a>& string)<br> ! //void* GetClientData(unsigned int n) const<br> <a href="#wxClientData">wxClientData</a>* GetClientObject(unsigned int n) const<br> <font color=#CC0033> <i>%rename</i> GetStringClientObject <a href="#wxStringClientData">wxStringClientData</a>* GetClientObject(unsigned int n) const</font><br> --- 1982,1988 ---- void Delete(unsigned int n)<br> int FindString(const <a href="#wxString">wxString</a>& string)<br> ! // C++ Func: void* GetClientData(unsigned int n) const<br> ! voidptr_long GetClientData(unsigned int n) const // C++ returns (void *) You get a number here<br> ! <br> <a href="#wxClientData">wxClientData</a>* GetClientObject(unsigned int n) const<br> <font color=#CC0033> <i>%rename</i> GetStringClientObject <a href="#wxStringClientData">wxStringClientData</a>* GetClientObject(unsigned int n) const</font><br> *************** *** 1990,1999 **** <a href="#wxString">wxString</a> GetStringSelection() const<br> int Insert(const <a href="#wxString">wxString</a>& item, int pos)<br> ! //int Insert(const <a href="#wxString">wxString</a>& item, unsigned int pos, void *clientData)<br> int Insert(const <a href="#wxString">wxString</a>& item, unsigned int pos, <a href="#wxClientData">wxClientData</a> *clientData)<br> bool IsEmpty() const<br> // int Number() const // obsolete since 2.2 use GetCount()<br> void Select(int n)<br> ! //void SetClientData(unsigned int n, void *data)<br> void SetClientObject(unsigned int n, <a href="#wxClientData">wxClientData</a> *data)<br> void SetSelection(unsigned int n)<br> --- 1992,2001 ---- <a href="#wxString">wxString</a> GetStringSelection() const<br> int Insert(const <a href="#wxString">wxString</a>& item, int pos)<br> ! int Insert(const <a href="#wxString">wxString</a>& item, unsigned int pos, voidptr_long number) // C++ is (void *clientData) You can put a number here<br> int Insert(const <a href="#wxString">wxString</a>& item, unsigned int pos, <a href="#wxClientData">wxClientData</a> *clientData)<br> bool IsEmpty() const<br> // int Number() const // obsolete since 2.2 use GetCount()<br> void Select(int n)<br> ! void SetClientData(unsigned int n, voidptr_long number) // C++ is (void *clientData) You can put a number here<br> void SetClientObject(unsigned int n, <a href="#wxClientData">wxClientData</a> *data)<br> void SetSelection(unsigned int n)<br> *************** *** 3162,3165 **** --- 3164,3181 ---- <br> //-----------------------------------------------------------------------------<br> + // <a href="#wxClientDataContainer">wxClientDataContainer</a><br> + <br> + <font color=#AA0000><font size=+1><i>%class</i> <i>%noclassinfo</i> <b><a name="wxClientDataContainer">wxClientDataContainer</a></b></font></font><blockquote> + <a href="#wxClientDataContainer">wxClientDataContainer</a>()<br> + <br> + void SetClientObject( <a href="#wxClientData">wxClientData</a> *data )<br> + <a href="#wxClientData">wxClientData</a> *GetClientObject() const<br> + <br> + void SetClientData( voidptr_long data ) // C++ is (void *clientData) You can put a number here<br> + // C++ Func: void *GetClientData() const<br> + voidptr_long GetClientData() const // C++ returns (void *) You get a number here<br> + </blockquote><font color=#AA0000><i>%endclass</i></font><br> + <br> + //-----------------------------------------------------------------------------<br> // <a href="#wxObject">wxObject</a><br> <br> *************** *** 5783,5798 **** bool Disconnect(int id, int lastId, wxEventType eventType)<br> <br> ! //void* GetClientData()<br> <a href="#wxClientData">wxClientData</a>* GetClientObject() const<br> bool GetEvtHandlerEnabled()<br> ! //<a href="#wxEvtHandler">wxEvtHandler</a>* GetNextHandler()<br> ! //<a href="#wxEvtHandler">wxEvtHandler</a>* GetPreviousHandler()<br> virtual bool ProcessEvent(<a href="#wxEvent">wxEvent</a>& event)<br> //virtual bool SearchEventTable(wxEventTable& table, <a href="#wxEvent">wxEvent</a>& event)<br> ! //void SetClientData(void* data)<br> void SetClientObject(<a href="#wxClientData">wxClientData</a>* data)<br> void SetEvtHandlerEnabled(bool enabled)<br> ! //void SetNextHandler(<a href="#wxEvtHandler">wxEvtHandler</a>* handler)<br> ! //void SetPreviousHandler(<a href="#wxEvtHandler">wxEvtHandler</a>* handler)<br> </blockquote><font color=#AA0000><i>%endclass</i></font><br> <br> --- 5799,5814 ---- bool Disconnect(int id, int lastId, wxEventType eventType)<br> <br> ! voidptr_long GetClientData() // C++ returns (void *) You get a number here<br> <a href="#wxClientData">wxClientData</a>* GetClientObject() const<br> bool GetEvtHandlerEnabled()<br> ! <a href="#wxEvtHandler">wxEvtHandler</a>* GetNextHandler()<br> ! <a href="#wxEvtHandler">wxEvtHandler</a>* GetPreviousHandler()<br> virtual bool ProcessEvent(<a href="#wxEvent">wxEvent</a>& event)<br> //virtual bool SearchEventTable(wxEventTable& table, <a href="#wxEvent">wxEvent</a>& event)<br> ! void SetClientData(voidptr_long number) // C++ is (void *clientData) You can put a number here<br> void SetClientObject(<a href="#wxClientData">wxClientData</a>* data)<br> void SetEvtHandlerEnabled(bool enabled)<br> ! void SetNextHandler(<a href="#wxEvtHandler">wxEvtHandler</a>* handler)<br> ! void SetPreviousHandler(<a href="#wxEvtHandler">wxEvtHandler</a>* handler)<br> </blockquote><font color=#AA0000><i>%endclass</i></font><br> <br> *************** *** 5894,5898 **** <a href="#wxCommandEvent">wxCommandEvent</a>(wxEventType commandEventType = wxEVT_NULL, int id = 0)<br> <br> ! <a href="#wxObject">wxObject</a>* GetClientData()<br> <a href="#wxClientData">wxClientData</a>* GetClientObject()<br> <font color=#CC0033> <i>%rename</i> GetStringClientObject <a href="#wxStringClientData">wxStringClientData</a>* GetClientObject()</font><br> --- 5910,5914 ---- <a href="#wxCommandEvent">wxCommandEvent</a>(wxEventType commandEventType = wxEVT_NULL, int id = 0)<br> <br> ! voidptr_long GetClientData() // C++ returns (void *) You get a number here<br> <a href="#wxClientData">wxClientData</a>* GetClientObject()<br> <font color=#CC0033> <i>%rename</i> GetStringClientObject <a href="#wxStringClientData">wxStringClientData</a>* GetClientObject()</font><br> *************** *** 5903,5907 **** bool IsChecked() const<br> bool IsSelection()<br> ! void SetClientData(<a href="#wxObject">wxObject</a> *clientData)<br> void SetExtraLong(int extraLong)<br> void SetInt(int intCommand)<br> --- 5919,5923 ---- bool IsChecked() const<br> bool IsSelection()<br> ! void SetClientData(voidptr_long number) // C++ is (void *clientData) You can put a number here<br> void SetExtraLong(int extraLong)<br> void SetInt(int intCommand)<br> *************** *** 10526,10531 **** void Append(const <a href="#wxArrayString">wxArrayString</a>& strings)<br> int Append(const <a href="#wxString">wxString</a>& item)<br> ! //int Append(const <a href="#wxString">wxString</a>& item, void *clientData)<br> ! //int Append(const <a href="#wxString">wxString</a>& item, <a href="#wxClientData">wxClientData</a> *clientData)<br> </blockquote><font color=#AA0000><i>%endclass</i></font><br> <br> --- 10542,10547 ---- void Append(const <a href="#wxArrayString">wxArrayString</a>& strings)<br> int Append(const <a href="#wxString">wxString</a>& item)<br> ! int Append(const <a href="#wxString">wxString</a>& item, voidptr_long number) // C++ is (void *clientData) You can put a number here<br> ! int Append(const <a href="#wxString">wxString</a>& item, <a href="#wxClientData">wxClientData</a> *clientData)<br> </blockquote><font color=#AA0000><i>%endclass</i></font><br> <br> *************** *** 12857,12861 **** void Discard()<br> bool Error() const<br> ! <a href="#wxObject">wxObject</a>* GetClientData() const<br> bool GetLocal(<a href="#wxSockAddress">wxSockAddress</a>& addr) const<br> <a href="#wxSocketFlags">wxSocketFlags</a> GetFlags() const<br> --- 12873,12877 ---- void Discard()<br> bool Error() const<br> ! voidptr_long GetClientData() const // C++ returns (void *) You get a number here<br> bool GetLocal(<a href="#wxSockAddress">wxSockAddress</a>& addr) const<br> <a href="#wxSocketFlags">wxSocketFlags</a> GetFlags() const<br> *************** *** 12871,12875 **** void RestoreState()<br> void SaveState()<br> ! void SetClientData(<a href="#wxObject">wxObject</a> *data)<br> void SetEventHandler(<a href="#wxEvtHandler">wxEvtHandler</a>& handler, int id = -1)<br> void SetFlags(<a href="#wxSocketFlags">wxSocketFlags</a> flags)<br> --- 12887,12891 ---- void RestoreState()<br> void SaveState()<br> ! void SetClientData(voidptr_long number) // C++ is (void *clientData) You can put a number here<br> void SetEventHandler(<a href="#wxEvtHandler">wxEvtHandler</a>& handler, int id = -1)<br> void SetFlags(<a href="#wxSocketFlags">wxSocketFlags</a> flags)<br> *************** *** 12937,12941 **** <a href="#wxSocketEvent">wxSocketEvent</a>(int id = 0)<br> <br> ! <a href="#wxObject">wxObject</a> * GetClientData()<br> <a href="#wxSocketBase">wxSocketBase</a> * GetSocket() const<br> <a href="#wxSocketNotify">wxSocketNotify</a> GetSocketEvent() const<br> --- 12953,12957 ---- <a href="#wxSocketEvent">wxSocketEvent</a>(int id = 0)<br> <br> ! voidptr_long GetClientData() // C++ returns (void *) You get a number here<br> <a href="#wxSocketBase">wxSocketBase</a> * GetSocket() const<br> <a href="#wxSocketNotify">wxSocketNotify</a> GetSocketEvent() const<br> *************** *** 13588,13591 **** --- 13604,13608 ---- <a href="#wxWindow">wxWindow</a>(<a href="#wxWindow">wxWindow</a>* parent, wxWindowID id, const <a href="#wxPoint">wxPoint</a>& pos = wxDefaultPosition, const <a href="#wxSize">wxSize</a>& size = wxDefaultSize, long style = 0, const <a href="#wxString">wxString</a>& name = "wxWindow")<br> <br> + bool Create(<a href="#wxWindow">wxWindow</a> *parent, wxWindowID id, const <a href="#wxPoint">wxPoint</a>& pos = wxDefaultPosition, const <a href="#wxSize">wxSize</a>& size = wxDefaultSize, long style = 0, const <a href="#wxString">wxString</a>& name = "wxWindow")<br> virtual void AddChild(<a href="#wxWindow">wxWindow</a>* child)<br> void CacheBestSize(const <a href="#wxSize">wxSize</a>& size) const<br> *************** *** 18044,18047 **** --- 18061,18065 ---- // ============================================================================<br> <br> + //-----------------------------------------------------------------------------<br> // Compile the luaScript of the given name and return the lua error code, a message<br> // and the line number (or -1) of the error.<br> *************** *** 18050,18053 **** --- 18068,18095 ---- <br> //-----------------------------------------------------------------------------<br> + // Get information about the status of wxLua.<br> + //<br> + // Please take special note of<br> + <br> + // Get a table of all tracked top level windows that wxLua will Destroy()<br> + // when lua is closed.<br> + // Example output : { ["wxFrame"] = 1, ["wxDialog"] = 2 }<br> + <i>%function</i> LuaTable GetTrackedTopLevelWindows()<br> + <br> + // Get a table of all tracked userdata wxLua will delete when lua is closed<br> + // or lua will eventually garbage collect.<br> + // Example output : { ["wxPoint"] = 3, ["wxPen"] = 5 }<br> + <i>%function</i> LuaTable GetTrackedUserData()<br> + <br> + // Get a table of all tracked <a href="#wxEvent">wxEvent</a> callbacks that have been installed using<br> + // wxEvtHandler::Connect(...)<br> + // Example output : { ["wxEVT_COMMAND_TOOL_CLICKED"] = 2, ... }<br> + <i>%function</i> LuaTable GetTrackedEventCallbacks()<br> + <br> + // Get a table of all <a href="#wxWindow">wxWindow</a> derived classes that have been created in wxLua.<br> + // Example output : { ["wxFrame"] = 1, ["wxButton"] = 4 }<br> + <i>%function</i> LuaTable GetTrackedWindows()<br> + <br> + //-----------------------------------------------------------------------------<br> // Type information about the bindings or current userdata<br> <br> *************** *** 18080,18087 **** <font color=#007755><i>%define</i> WXLUAARG_Number</font><br> <font color=#007755><i>%define</i> WXLUAARG_String</font><br> ! <font color=#007755><i>%define</i> WXLUAARG_LuaTable</font><br> ! <font color=#007755><i>%define</i> WXLUAARG_LuaFunction</font><br> <font color=#007755><i>%define</i> WXLUAARG_UserData</font><br> ! <font color=#007755><i>%define</i> WXLUAARG_LuaThread</font><br> <font color=#007755><i>%define</i> WXLUAARG_Integer</font><br> <br> --- 18122,18129 ---- <font color=#007755><i>%define</i> WXLUAARG_Number</font><br> <font color=#007755><i>%define</i> WXLUAARG_String</font><br> ! <font color=#007755><i>%define</i> WXLUAARG_Table</font><br> ! <font color=#007755><i>%define</i> WXLUAARG_Function</font><br> <font color=#007755><i>%define</i> WXLUAARG_UserData</font><br> ! <font color=#007755><i>%define</i> WXLUAARG_Thread</font><br> <font color=#007755><i>%define</i> WXLUAARG_Integer</font><br> <br> *************** *** 18097,18102 **** <font color=#007755><i>%define</i> LUA_TTHREAD // 8</font><br> <br> ! <br> ! // Is this lua_type() (or in lua type()) considered<br> <i>%function</i> int wxlua_iswxluatype(int luatype, int wxluaarg_tag)<br> <br> --- 18139,18143 ---- <font color=#007755><i>%define</i> LUA_TTHREAD // 8</font><br> <br> ! // Is this lua_type() (or in lua the type() function) considered equivalent<br> <i>%function</i> int wxlua_iswxluatype(int luatype, int wxluaarg_tag)<br> <br> *************** *** 18107,18111 **** <i>%function</i> <a href="#wxString">wxString</a> wxlua_typename(int wxluaarg_tag)<br> <br> - <br> <font color=#CC3300>// <i>%override</i> int wxlua_type(void* object)</font><br> // Get the wxlua type (tag) of the object, this is the arg tags number<br> --- 18148,18151 ---- *************** *** 18121,18124 **** --- 18161,18165 ---- // Note: Use only '.' and NO () to make it a function call, also check to see<br> // if the item exists first (unlike the example above)!<br> + // Please see the bindings.wx.lua sample program for usage.<br> <br> /*<br> *************** *** 18146,18150 **** </blockquote><font color=#AA0000><i>%endclass</i></font><br> <br> ! <font color=#AA0000><font size=+1><i>%class</i> <b><a name="wxLuaBindClass">wxLuaBindClass</a></b></font></font><blockquote> // No constructor as this is read only<br> <br> --- 18187,18191 ---- </blockquote><font color=#AA0000><i>%endclass</i></font><br> <br> ! <i>%struct</i> wxLuaBindClass<br> // No constructor as this is read only<br> <br> *************** *** 18159,18165 **** int enums_n<br> <br> ! </blockquote><font color=#AA0000><i>%endclass</i></font><br> <br> ! <font color=#AA0000><font size=+1><i>%class</i> <b><a name="wxLuaBindMethod">wxLuaBindMethod</a></b></font></font><blockquote> // No constructor as this is read only<br> <br> --- 18200,18206 ---- int enums_n<br> <br> ! <i>%endstruct</i><br> <br> ! <i>%struct</i> wxLuaBindMethod<br> // No constructor as this is read only<br> <br> *************** *** 18173,18179 **** <a href="#wxString">wxString</a> class_name // class name this is part of (not in struct)<br> <br> ! </blockquote><font color=#AA0000><i>%endclass</i></font><br> <br> ! <font color=#AA0000><font size=+1><i>%class</i> <b><a name="wxLuaBindCFunc">wxLuaBindCFunc</a></b></font></font><blockquote> // No constructor as this is read only<br> <br> --- 18214,18220 ---- <a href="#wxString">wxString</a> class_name // class name this is part of (not in struct)<br> <br> ! <i>%endstruct</i><br> <br> ! <i>%struct</i> wxLuaBindCFunc<br> // No constructor as this is read only<br> <br> *************** *** 18186,18190 **** <a href="#wxString">wxString</a> class_name // added, not in struct<br> <br> ! </blockquote><font color=#AA0000><i>%endclass</i></font><br> <br> */<br> --- 18227,18231 ---- <a href="#wxString">wxString</a> class_name // added, not in struct<br> <br> ! <i>%endstruct</i><br> <br> */<br> *************** *** 18221,18225 **** <br> //-----------------------------------------------------------------------------<br> ! // <a href="#wxLuaObject">wxLuaObject</a> - Allows Lua data items to be used for client data.<br> <br> <font color=#007700><font size=+1><i>%enum</i> <b><a name="wxLuaObject_Type">wxLuaObject_Type</a></b></font><blockquote> --- 18262,18266 ---- <br> //-----------------------------------------------------------------------------<br> ! // <a href="#wxLuaObject">wxLuaObject</a> - Allows Lua data items to be used for <a href="#wxClientData">wxClientData</a>.<br> <br> <font color=#007700><font size=+1><i>%enum</i> <b><a name="wxLuaObject_Type">wxLuaObject_Type</a></b></font><blockquote> *************** *** 18231,18235 **** </blockquote><i>%endenum</i></font><br> <br> ! <font color=#AA0000><font size=+1><i>%class</i> <i>%delete</i> <b><a name="wxLuaObject">wxLuaObject</a></b>, <a href="#wxObject">wxObject</a></font></font><blockquote> <font color=#CC3300> // <i>%override</i> <a href="#wxLuaObject">wxLuaObject</a>(any value type)</font><br> // C++ Func: <a href="#wxLuaObject">wxLuaObject</a>(const wxLuaState& wxlState, int stack_idx = 1)<br> --- 18272,18276 ---- </blockquote><i>%endenum</i></font><br> <br> ! <font color=#AA0000><font size=+1><i>%class</i> <i>%delete</i> <b><a name="wxLuaObject">wxLuaObject</a></b>, <a href="#wxObject">wxObject</a> // ALSO! <a href="#wxClientData">wxClientData</a> use it anywhere that takes that</font></font><blockquote> <font color=#CC3300> // <i>%override</i> <a href="#wxLuaObject">wxLuaObject</a>(any value type)</font><br> // C++ Func: <a href="#wxLuaObject">wxLuaObject</a>(const wxLuaState& wxlState, int stack_idx = 1)<br> *************** *** 18253,18259 **** //<a href="#wxArrayInt">wxArrayInt</a> *GetArrayPtr();<br> <br> ! int GetAllocationFlags() const<br> ! bool HasAllocationFlag(wxLuaObject_Type flag)<br> ! //int SetAllocationFlag(wxLuaObject_Type flag, bool set) // NOT for use in lua<br> </blockquote><font color=#AA0000><i>%endclass</i></font><br> <br><HR> --- 18294,18298 ---- //<a href="#wxArrayInt">wxArrayInt</a> *GetArrayPtr();<br> <br> ! int GetAllocationFlag() const<br> </blockquote><font color=#AA0000><i>%endclass</i></font><br> <br><HR> *************** *** 18280,18284 **** // wxLua is tracking and will delete.<br> <font color=#CC3300>// <i>%override</i> void StackDialog()</font><br> ! <i>%function</i> void StackDialog()<br> <br> //-----------------------------------------------------------------------------<br> --- 18319,18323 ---- // wxLua is tracking and will delete.<br> <font color=#CC3300>// <i>%override</i> void StackDialog()</font><br> ! <i>%function</i> void LuaStackDialog()<br> <br> //-----------------------------------------------------------------------------<br> Index: wxlua.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxlua.html,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** wxlua.html 14 Jun 2007 01:23:09 -0000 1.25 --- wxlua.html 16 Jun 2007 06:21:43 -0000 1.26 *************** *** 843,850 **** Samples</h3> <ul> <li><b>bindings.wx.lua</b></li> <ul> ! <li>Lets you explore the C++ binding structs from within lua using a wxListCtrl. This is the raw data that is used to push the bindings into lua when a wxLuaState is created.</li><li>Take ! note of </li> </ul> <li><b>calculator.wx.lua</b></li> <ul> <li>A simple calculator program the demonstrates loading and --- 843,852 ---- Samples</h3> <ul> <li><b>bindings.wx.lua</b></li> <ul> ! <li>This is a MUST use program, at least once, to get a better understanding of the bindings.</li><li>Lets you explore the C++ binding structs from within lua using a wxListCtrl. This is the raw data that is used to push the bindings into lua when a wxLuaState is created.</li><li>Take ! note of the menu item "Show lua stack dialog..." and the code for it. ! You can use this dialog to debug your own programs by viewing the ! stack, local, and global variables. </li> </ul> <li><b>calculator.wx.lua</b></li> <ul> <li>A simple calculator program the demonstrates loading and *************** *** 859,864 **** <ul> <li>A demo of how to use coroutines in wxLua using wxEVT_IDLE to call ! coroutine.resume().</li> </ul> <li><b>debug.wx.lua</b></li> ! <ul> <li>Does not work... TODO ?</li> </ul> <li><b>dialog.wx.lua</b></li> <ul> <li>A simple temperature conversion program to/from Fahrenheit to/from Celsius. Shows the use of wxSizers, wxButtons, and --- 861,866 ---- <ul> <li>A demo of how to use coroutines in wxLua using wxEVT_IDLE to call ! coroutine.resume().</li> </ul> ! <li><b>dialog.wx.lua</b></li> <ul> <li>A simple temperature conversion program to/from Fahrenheit to/from Celsius. Shows the use of wxSizers, wxButtons, and --- NEW FILE: FAQ.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>wxLua FAQ</title> <meta content="John Labenski" name="author"></head> <body><h2><u>wxLua FAQ</u></h2> <ol> <li><a href="#Why_wxLua">Why wxLua?</a></li> <ol> <li><a href="#Whats_best_for_my_needs:_wxLua">What's best for my needs: wxLua, wxPython, wxSomethingElse?</a></li> <li><a href="FAQ.html#Can_I_use_wxLua_as_script_interpreter">Can I use wxLua as script interpreter embedded in my own C++ applications?</a></li> </ol> <li><a href="#Programming_in_wxLua">Programming in wxLua</a></li><ol><li><a href="#wxStrings">wxStrings?</a></li><li><a href="#wxArrayString_and_wxSortedArrayString">wxArrayString and wxSortedArrayString?</a></li><li><a href="#wxArrayInt">wxArrayInt?</a></li><li><a href="#When_and_how_should_you_delete_objects">When and how should you delete objects?</a></li></ol> </ol><hr size="2" width="100%"> <ol> <li> <h3><a name="Why_wxLua"></a>Why wxLua?</h3> </li> <ul> <li>Because the Lua language is easy and "fun" to program in. </li> <li>It vaguely looks like BASIC or C which many people are familiar with.</li> <li>The code is very readable, almost no special notation, gotchas, or oddball constructs that require a large shift in thinking from BASIC or C.</li> <li>Size : The Lua interpreter itself is ~100Kb, wxWidgets adds the remaining few Mb.</li> <li>Speed : Lua is one of the fastest interpreted languages, see the Great Computer Language Shootout.</li> <li>Again, why Lua? See <a href="http://www.lua.org/about.html">http://www.lua.org/about.html</a></li></ul><ol><li><h4><a name="Whats_best_for_my_needs:_wxLua"></a>What's best for my needs: wxLua, wxPython, wxSomethingElse?</h4></li><ol> <ol> </ol></ol><ul><li>It depends: wxPython has a much larger footprint and greater overhead than wxLua, but it does provide more add-ons from the Python standard library.</li><li>On the other hand, wxLua is as large as the wxWidgets library + ~100Kb for Lua + ~500Kb for the wxLua library.</li><li>wxLua can be easily interfaced with C++ code making it a powerful extension language, which is exactly the intent of its designers.</li><li>In conclusion, if you want to write an entire application in a scripting language and you need things supported by Python which are not present in wxLua out-of-the-box, then you should use wxPython. Instead, if you want to write applications with little overhead or extend your C++ applications, go for wxLua.</li></ul><li><h4><a name="Can_I_use_wxLua_as_script_interpreter"></a>Can I use wxLua as script interpreter embedded in my own C++ applications?</h4></li><ul><li>Yes! That's explained on the wxLua homepage. </li><li>This is one of the strong points of wxLua: it can be a lightweight, fast interpreter to extend your application and let the user customize it... </li><li>You may create as many wxLua interpreters in a single program as you like.</li> </ul></ol><li><h3><a name="Programming_in_wxLua"></a>Programming in wxLua</h3></li><ol><li><h4><a name="wxStrings"></a>wxStrings?</h4></li><ul><li>wxLua uses Lua strings and so all functions that take or return a wxString take or return a Lua string.</li><li>However, you can also use a wxString is you really want.</li></ul><li><h4><a name="wxArrayString_and_wxSortedArrayString"></a>wxArrayString and wxSortedArrayString?</h4></li><ul><li>All functions that take a wxArrayString or wxSortedArrayString can also take a numerically indexed table of strings.</li><li>Functions that return wxArrayStrings or wxSortedArrayStrings will return a wxArrayString or wxSortedArrayString unless specified otherwise in wxluaref.html</li></ul><li><h4><a name="wxArrayInt"></a>wxArrayInt?</h4></li><ul><li>All functions that take a wxArrayInt can also take a numerically indexed table of numbers.</li><li>Functions that return wxArrayInts will return a wxArrayInt unless specified otherwise in wxluaref.html.</li></ul><li><h4><a name="When_and_how_should_you_delete_objects"></a>When and how should you delete objects?</h4></li><ul><li>You should read the section "C++ Classes CLASS_NAME" in the "Programming in wxLua" in the wxlua.html manual.</li><li>In short, all objects that you create that deal with graphics should be deleted as soon as they're no longer used. Functions that take a "const wxPen& pen" or any wxObject derived class that is passed to a function that is const and not a pointer* will make a refed copy of them and so you may delete them.</li><li>Use the wxLua added function delete() to delete them.</li><li>Use the function "table = wxlua.GetTrackedUserdata()" to get a table of items that are tracked and occasionally print them out while developing a program. </li></ul></ol><ol><ol> </ol></ol><ul> </ul> </ol></body></html> Index: changelog.txt =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/changelog.txt,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** changelog.txt 14 Jun 2007 01:23:09 -0000 1.36 --- changelog.txt 16 Jun 2007 06:21:43 -0000 1.37 *************** *** 100,103 **** --- 100,112 ---- - Fix mismatches between the bindings base classes and what they really are. + - Add back the treectrl to the Stack Dialog so you get a tree on the left + and the list on the right. + - Added functions to get the items that wxLua tracks (userdata) to know + if you need to garbage collect things + - Use qsort and bsearch to find the class member functions to run. + Combined with using integer items in lua's registry ~ %25 faster. + - Make wxLuaDebugData a real wxObject refed class that can !Ok(), before + it always created it's ref data even if it wasn't used. + version 2.8.0.0 (released 24/12/2006) -------------------------------------------------------------------- |