From: John L. <jr...@us...> - 2006-09-08 22:43:51
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26661/wxLua/modules/wxluadebug/src Modified Files: staktree.cpp wxldebug.cpp Log Message: add a few wxArray functions to wxLuaDebugData to make it easier to use use enum instead of define for wxwindow ids Index: wxldebug.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxldebug.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wxldebug.cpp 7 Sep 2006 22:42:19 -0000 1.17 --- wxldebug.cpp 8 Sep 2006 22:43:47 -0000 1.18 *************** *** 77,80 **** --- 77,82 ---- }; + #define M_DEBUGREFDATA ((wxLuaDebugDataRefData*)m_refData) + wxLuaDebugData::wxLuaDebugData() : wxObject() { *************** *** 82,92 **** } ! wxLuaDebugDataItemArray& wxLuaDebugData::GetDataArray() { return ((wxLuaDebugDataRefData*)m_refData)->m_dataArray; } ! const wxLuaDebugDataItemArray& wxLuaDebugData::GetDataArray() const { ! return ((wxLuaDebugDataRefData*)m_refData)->m_dataArray; } --- 84,111 ---- } ! wxLuaDebugDataItemArray& wxLuaDebugData::GetArray() { return ((wxLuaDebugDataRefData*)m_refData)->m_dataArray; } ! const wxLuaDebugDataItemArray& wxLuaDebugData::GetArray() const { ! return M_DEBUGREFDATA->m_dataArray; ! } ! ! size_t wxLuaDebugData::GetCount() const ! { ! wxCHECK_MSG(M_DEBUGREFDATA != NULL, 0, wxT("Invalid ref data")); ! return M_DEBUGREFDATA->m_dataArray.GetCount(); ! } ! wxLuaDebugDataItem* wxLuaDebugData::Item(size_t index) const ! { ! wxCHECK_MSG(M_DEBUGREFDATA != NULL, 0, wxT("Invalid ref data")); ! return M_DEBUGREFDATA->m_dataArray.Item(index); ! } ! void wxLuaDebugData::Add(wxLuaDebugDataItem* item) ! { ! wxCHECK_RET(M_DEBUGREFDATA != NULL, wxT("Invalid ref data")); ! wxCHECK_RET(item != NULL, wxT("Invalid wxLuaDebugDataItem")); ! M_DEBUGREFDATA->m_dataArray.Add(item); } *************** *** 95,104 **** wxLuaDebugData copyData; ! size_t idx, count = GetDataArray().Count(); for (idx = 0; idx < count; ++idx) { ! const wxLuaDebugDataItem *pOldData = GetDataArray().Item(idx); if (pOldData != NULL) ! copyData.GetDataArray().Add(new wxLuaDebugDataItem(*pOldData)); } --- 114,123 ---- wxLuaDebugData copyData; ! size_t idx, count = GetCount(); for (idx = 0; idx < count; ++idx) { ! const wxLuaDebugDataItem *pOldData = Item(idx); if (pOldData != NULL) ! copyData.Add(new wxLuaDebugDataItem(*pOldData)); } *************** *** 146,150 **** if (item != NULL) { ! GetDataArray().Add(item); count++; } --- 165,169 ---- if (item != NULL) { ! Add(item); count++; } *************** *** 195,199 **** if (item != NULL) { ! GetDataArray().Add(item); count++; } --- 214,218 ---- if (item != NULL) { ! Add(item); count++; } *************** *** 217,221 **** lua_pushvalue(L, LUA_GLOBALSINDEX); int nRef = wxlState.tinsert(-1); ! GetDataArray().Add(new wxLuaDebugDataItem(wxT("Globals"), wxT(""), wxT(""), wxT(""), nRef, 0)); references.Add(nRef); } --- 236,240 ---- lua_pushvalue(L, LUA_GLOBALSINDEX); int nRef = wxlState.tinsert(-1); ! Add(new wxLuaDebugDataItem(wxT("Globals"), wxT(""), wxT(""), wxT(""), nRef, 0)); references.Add(nRef); } *************** *** 252,256 **** if (item != NULL) { ! GetDataArray().Add(item); count++; } --- 271,275 ---- if (item != NULL) { ! Add(item); count++; } *************** *** 445,449 **** m_wxlState.GetGlobals(); int nRef = Ref(); ! debugData.GetDataArray().Add(new wxLuaDebugDataItem(wxT("Globals"), wxT(""), wxT(""), wxT(""), nRef, 0)); return debugData; } --- 464,468 ---- m_wxlState.GetGlobals(); int nRef = Ref(); ! debugData.Add(new wxLuaDebugDataItem(wxT("Globals"), wxT(""), wxT(""), wxT(""), nRef, 0)); return debugData; } Index: staktree.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/staktree.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** staktree.cpp 7 Sep 2006 22:42:19 -0000 1.27 --- staktree.cpp 8 Sep 2006 22:43:47 -0000 1.28 *************** *** 33,41 **** #endif - // Note the wxTR_ROW_LINES style: draws horizontal lines between items - #if !wxCHECK_VERSION(2, 3, 0) - #define wxTR_ROW_LINES 0 - #endif // !wxCHECK_VERSION(2, 3, 0) - // ---------------------------------------------------------------------------- // wxLuaStackDialog --- 33,36 ---- *************** *** 87,96 **** m_dismissButton = new wxButton(this, ID_WXLUA_STACKDIALOG_DISMISS_BUTTON, _("Cancel"), ! wxDefaultPosition, wxDefaultSize ! #if wxCHECK_VERSION(2, 3, 0) ! ,wxBU_EXACTFIT); ! #else ! ); ! #endif m_dismissButton->SetDefault(); --- 82,87 ---- m_dismissButton = new wxButton(this, ID_WXLUA_STACKDIALOG_DISMISS_BUTTON, _("Cancel"), ! wxDefaultPosition, wxDefaultSize, ! wxBU_EXACTFIT); m_dismissButton->SetDefault(); *************** *** 138,144 **** // set the frame icon - #if wxCHECK_VERSION(2, 3, 0) SetIcon(wxICON(LUA)); - #endif int nWidth, nHeight; --- 129,133 ---- *************** *** 166,173 **** m_stackComboBox->Clear(); ! size_t idx, count = debugData.GetDataArray().Count(); for (idx = 0; idx < count; ++idx) { ! const wxLuaDebugDataItem *item = debugData.GetDataArray().Item(idx); #if defined(__WXMAC__) // FIXME Mac is dying on the two parameter version...don't know how to fix. --- 155,162 ---- m_stackComboBox->Clear(); ! size_t idx, count = debugData.GetCount(); for (idx = 0; idx < count; ++idx) { ! const wxLuaDebugDataItem *item = debugData.Item(idx); #if defined(__WXMAC__) // FIXME Mac is dying on the two parameter version...don't know how to fix. *************** *** 178,182 **** } ! if (debugData.GetDataArray().Count() > 0) { m_stackComboBox->SetSelection(0); --- 167,171 ---- } ! if (debugData.GetCount() > 0) { m_stackComboBox->SetSelection(0); *************** *** 237,244 **** m_treeControl->AdjustRemoteScrollbars(); ! size_t idx, count = debugData.GetDataArray().Count(); for (idx = 0; idx < count; ++idx) { ! const wxLuaDebugDataItem *item = debugData.GetDataArray().Item(idx); int nOffset = (item->GetReference() != LUA_NOREF) ? 0 : 1; --- 226,233 ---- m_treeControl->AdjustRemoteScrollbars(); ! size_t idx, count = debugData.GetCount(); for (idx = 0; idx < count; ++idx) { ! const wxLuaDebugDataItem *item = debugData.Item(idx); int nOffset = (item->GetReference() != LUA_NOREF) ? 0 : 1; *************** *** 261,265 **** { wxLuaDebugData globalDebugData = m_luaInterface->GetGlobalData(); ! const wxLuaDebugDataItem *item = globalDebugData.GetDataArray().Item(0); wxTreeItemId treeNode = m_treeControl->AppendItem( rootItem, --- 250,254 ---- { wxLuaDebugData globalDebugData = m_luaInterface->GetGlobalData(); ! const wxLuaDebugDataItem *item = globalDebugData.Item(0); wxTreeItemId treeNode = m_treeControl->AppendItem( rootItem, *************** *** 421,425 **** { wxLuaDebugDataItem *item = new wxLuaDebugDataItem(names[n], wxT("wxLuaData"), wxString::Format(wxT("%d"), counts[n]), wxT(""), LUA_NOREF, pDebugDataItem->GetIndex() + 1); ! dataArr.GetDataArray().Add(item); } --- 410,414 ---- { wxLuaDebugDataItem *item = new wxLuaDebugDataItem(names[n], wxT("wxLuaData"), wxString::Format(wxT("%d"), counts[n]), wxT(""), LUA_NOREF, pDebugDataItem->GetIndex() + 1); ! dataArr.Add(item); } *************** *** 432,443 **** void wxLuaStackDialog::FillTableEntry(wxTreeItemId itemNode, const wxLuaDebugData& debugData) { ! if (debugData.GetDataArray().Count() == 0) m_treeControl->SetItemHasChildren(itemNode, false); else { ! size_t n, count = debugData.GetDataArray().Count(); for (n = 0; n < count; ++n) { ! const wxLuaDebugDataItem *item = debugData.GetDataArray().Item(n); int nOffset = (item->GetReference() != LUA_NOREF) ? 0 : 1; --- 421,432 ---- void wxLuaStackDialog::FillTableEntry(wxTreeItemId itemNode, const wxLuaDebugData& debugData) { ! if (debugData.GetCount() == 0) m_treeControl->SetItemHasChildren(itemNode, false); else { ! size_t n, count = debugData.GetCount(); for (n = 0; n < count; ++n) { ! const wxLuaDebugDataItem *item = debugData.Item(n); int nOffset = (item->GetReference() != LUA_NOREF) ? 0 : 1; |