From: John L. <jr...@us...> - 2007-12-13 00:47:59
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15370/wxLua/modules/wxluadebug/include Modified Files: wxldebug.h wxlstack.h Log Message: * Allowed using wxObject:DynamicCast() on an object and be able to use the object as both types. The problem was that wxEvent:GetEventObject() returned a wxObject which overwrote the wxWindow (perhaps) that you had as a userdata in Lua already. Additionally, if you delete an object all of the userdata that wrap it have their metatables cleared for safety. Functions renamed since they didn't do the same thing or behave the same. wxluaO_istrackedobject -> wxluaO_isgcobject wxluaO_addtrackedobject -> wxluaO_addgcobject wxluaO_removetrackedobject -> wxluaO_deletegcobject - Created a central luauserdata:delete() function for the bindings to reduce code. wxLua_wxluabind_delete(L) wxLuaStackDialog: You can expand both key and values of a table and more information is provided about items wxLua knows about. Index: wxldebug.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/include/wxldebug.h,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** wxldebug.h 4 Dec 2007 16:26:11 -0000 1.47 --- wxldebug.h 13 Dec 2007 00:47:52 -0000 1.48 *************** *** 27,35 **** enum wxLuaDebugItem_Type { ! WXLUA_DEBUGITEM_EXPANDABLE = 0x0200, // for wxLuaStackDialog ! WXLUA_DEBUGITEM_EXPANDED = 0x0400, // for wxLuaStackDialog ! WXLUA_DEBUGITEM_LUAREFED = 0x0800 // This item was created with a ! // new wxluaR_ref() reference ! // rather than using an existing one. }; --- 27,38 ---- enum wxLuaDebugItem_Type { ! WXLUA_DEBUGITEM_LOCALS = 0x0100, // This wxLuaDebugItem is the parent for local variables ! ! WXLUA_DEBUGITEM_EXPANDED = 0x0200, // for wxLuaStackDialog ! ! WXLUA_DEBUGITEM_IS_REFED = 0x1000, // This item was created with a new ! // wxluaR_ref() rather than using an existing one. ! WXLUA_DEBUGITEM_KEY_REF = 0x2000, // The ref is for the key ! WXLUA_DEBUGITEM_VALUE_REF = 0x4000, // The ref is for the value }; *************** *** 41,47 **** const wxString &itemValue, int itemValueType, const wxString &itemSource, ! int lua_ref, ! int idx = 0, ! int flag = 0); // The key has the typical meaning of the key in a Lua table --- 44,48 ---- const wxString &itemValue, int itemValueType, const wxString &itemSource, ! int lua_ref, int idx = 0, int flag = 0); // The key has the typical meaning of the key in a Lua table *************** *** 58,74 **** wxString GetSource() const { return m_itemSource; } ! int GetReference() const { return m_lua_ref; } // wxluaT_gettag() reference int GetIndex() const { return m_index; } // stack index or table level index int GetFlag() const { return m_flag; } // see wxLuaDebugItem_Type bool GetFlagBit(int mask) const { return WXLUA_HASBIT(m_flag, mask); } void SetFlag(int flag) { m_flag = flag; } void SetFlagBit(int bit, bool set) { m_flag = WXLUA_SETBIT(m_flag, bit, set); } ! void SetReference(int lua_ref) { m_lua_ref = lua_ref; } // only if you've wxluaR_unref()ed it // Get a human readable string for debugging wxString ToString() const { ! return wxString::Format(wxT("Key: '%s' KeyType: %d '%s' Value: '%s' ValueType: %d '%s' Ref: %d Idx: %d Flag: %d HasSrc: %d"), m_itemKey.c_str(), m_itemKeyType, GetKeyTypeString().c_str(), m_itemValue.c_str(), m_itemValueType, GetValueTypeString().c_str(), --- 59,80 ---- wxString GetSource() const { return m_itemSource; } ! int GetRef() const { return m_lua_ref; } // wxluaR_ref() reference int GetIndex() const { return m_index; } // stack index or table level index int GetFlag() const { return m_flag; } // see wxLuaDebugItem_Type bool GetFlagBit(int mask) const { return WXLUA_HASBIT(m_flag, mask); } + // If GetFlagBit(WXLUA_DEBUGITEM_KEY_REFED) try to convert GetKey() to a number + // else if GetFlagBit(WXLUA_DEBUGITEM_VALUE_REFED) try to convert GetValue() to a number + // Asserts if neither or both of the bits are set. + bool GetRefPtr(long& ptr) const; + void SetFlag(int flag) { m_flag = flag; } void SetFlagBit(int bit, bool set) { m_flag = WXLUA_SETBIT(m_flag, bit, set); } ! void SetRef(int lua_ref) { m_lua_ref = lua_ref; } // only if you've wxluaR_unref()ed it // Get a human readable string for debugging wxString ToString() const { ! return wxString::Format(wxT("Key: '%s' KeyType: %d '%s' Value: '%s' ValueType: %d '%s' Ref: %d Idx: %d Flag: %x HasSrc: %d"), m_itemKey.c_str(), m_itemKeyType, GetKeyTypeString().c_str(), m_itemValue.c_str(), m_itemValueType, GetValueTypeString().c_str(), *************** *** 155,159 **** // Ref this table if it hasn't been refed already, returns ref # or LUA_NOREF if not refed ! int RefTable(lua_State* L, int stack_idx, int* flag_type, wxArrayInt& references); // Sorting function for the wxLuaDebugItemArray, sorts by name --- 161,165 ---- // Ref this table if it hasn't been refed already, returns ref # or LUA_NOREF if not refed ! int RefTable(lua_State* L, int stack_idx, int* flag_type, int extra_flag, wxArrayInt& references); // Sorting function for the wxLuaDebugItemArray, sorts by name Index: wxlstack.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/include/wxlstack.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wxlstack.h 7 Dec 2007 02:13:14 -0000 1.15 --- wxlstack.h 13 Dec 2007 00:47:52 -0000 1.16 *************** *** 145,148 **** --- 145,159 ---- }; + // Columns in the wxListCtrl + enum + { + LIST_COL_KEY, + LIST_COL_LEVEL, + LIST_COL_KEY_TYPE, + LIST_COL_VALUE_TYPE, + LIST_COL_VALUE + }; + + // Draw the string centered in the bitmap virtual wxBitmap CreateBmpString(const wxBitmap& bmp, const wxString& s); *************** *** 221,224 **** --- 232,236 ---- wxImageList* m_imageList; // image list for listctrl wxColour m_typeColours[IMG__COUNT]; + int m_img_font_size; bool m_show_dup_expand_msg; |