From: John L. <jr...@us...> - 2006-05-15 04:48:41
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3872/wxLua/modules/wxluadebug/src Modified Files: splttree.cpp staktree.cpp Log Message: cleanup the app wxlua editor, don't try to run all the notebook pages at once make lconsole available for app wxLua use wxCmdLineParser in app wxlua push full args in app wxlua fix splittree to scroll child for generic treectrl in 2.6.3 Index: splttree.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/splttree.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** splttree.cpp 7 Mar 2006 11:53:42 -0000 1.9 --- splttree.cpp 15 May 2006 04:48:37 -0000 1.10 *************** *** 170,173 **** --- 170,196 ---- } + void wxRemotelyScrolledTreeCtrl::DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const + { + int vx = 0, vy = 0; + GetViewStart(&vx, &vy); + + int pixelsPerUnitX = 0, pixelsPerUnitY = 0; + GetScrollPixelsPerUnit(&pixelsPerUnitX, &pixelsPerUnitY); + + if (xx) *xx = x - vx*pixelsPerUnitX; + if (yy) *yy = y - vy*pixelsPerUnitY; + } + void wxRemotelyScrolledTreeCtrl::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const + { + int vx = 0, vy = 0; + GetViewStart(&vx, &vy); + + int pixelsPerUnitX = 0, pixelsPerUnitY = 0; + GetScrollPixelsPerUnit(&pixelsPerUnitX, &pixelsPerUnitY); + + if (xx) *xx = x + vx*pixelsPerUnitX; + if (yy) *yy = y + vy*pixelsPerUnitY; + } + // In case we're using the generic tree control. *************** *** 180,186 **** if (IsKindOf(CLASSINFO(wxGenericTreeCtrl))) { - wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this; ! int x1, y1, x2, y2; win->wxGenericTreeCtrl::GetViewStart(& x1, & y1); * x = x1; * y = y1; --- 203,208 ---- if (IsKindOf(CLASSINFO(wxGenericTreeCtrl))) { wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this; ! int x1 = 0, y1 = 0, x2 = 0, y2 = 0; win->wxGenericTreeCtrl::GetViewStart(& x1, & y1); * x = x1; * y = y1; *************** *** 234,238 **** #if USE_GENERIC_TREECTRL if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl))) ! #endif { UINT sbCode = SB_THUMBPOSITION; --- 256,260 ---- #if USE_GENERIC_TREECTRL if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl))) ! #endif // USE_GENERIC_TREECTRL { UINT sbCode = SB_THUMBPOSITION; *************** *** 240,244 **** #if !wxCHECK_VERSION(2,5,0) MSWDefWindowProc((WXUINT) WM_VSCROLL, MAKELONG(sbCode, posVert), (WXHWND) vertScrollBar); ! #else MSWDefWindowProc((WXUINT) WM_VSCROLL, MAKELONG(sbCode, posVert), (WXLPARAM) vertScrollBar); #endif // wxCHECK_VERSION(2,5,0) --- 262,266 ---- #if !wxCHECK_VERSION(2,5,0) MSWDefWindowProc((WXUINT) WM_VSCROLL, MAKELONG(sbCode, posVert), (WXHWND) vertScrollBar); ! #else // wxCHECK_VERSION(2,5,0) MSWDefWindowProc((WXUINT) WM_VSCROLL, MAKELONG(sbCode, posVert), (WXLPARAM) vertScrollBar); #endif // wxCHECK_VERSION(2,5,0) *************** *** 246,251 **** #if USE_GENERIC_TREECTRL else ! #endif ! #endif #if USE_GENERIC_TREECTRL || !defined(__WXMSW__) { --- 268,274 ---- #if USE_GENERIC_TREECTRL else ! #endif // USE_GENERIC_TREECTRL ! #endif // __WXMSW__ ! #if USE_GENERIC_TREECTRL || !defined(__WXMSW__) { *************** *** 357,361 **** } else ! #endif { // This is for the wxMSW tree control --- 380,384 ---- } else ! #endif // USE_GENERIC_TREECTRL || !defined(__WXMSW__) { // This is for the wxMSW tree control *************** *** 597,601 **** dc.Blit(0, 0, clientSize.x, clientSize.y, &tempDC, 0, 0); tempDC.SelectObject(wxNullBitmap); - } --- 620,623 ---- Index: staktree.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/staktree.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** staktree.cpp 14 May 2006 17:45:05 -0000 1.24 --- staktree.cpp 15 May 2006 04:48:37 -0000 1.25 *************** *** 8,15 **** ///////////////////////////////////////////////////////////////////////////// - // ---------------------------------------------------------------------------- - // headers - // ---------------------------------------------------------------------------- - #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "staktree.h" --- 8,11 ---- *************** *** 27,30 **** --- 23,27 ---- #include "wx/imaglist.h" + #include "wx/artprov.h" #include "wxluadebug/include/staktree.h" #include "wxlua/include/internal.h" *************** *** 42,106 **** #endif // !wxCHECK_VERSION(2, 3, 0) - #if !defined(__WXMSW__) || wxUSE_XPM_IN_MSW - /* Closed folder */ - static char * icon1_xpm[] = - { - /* width height ncolors chars_per_pixel */ - "16 16 6 1", - /* colors */ - " s None c None", - ". c #000000", - "+ c #c0c0c0", - "@ c #808080", - "# c #ffff00", - "$ c #ffffff", - /* pixels */ - " ", - " @@@@@ ", - " @#+#+#@ ", - " @#+#+#+#@@@@@@ ", - " @$$$$$$$$$$$$@.", - " @$#+#+#+#+#+#@.", - " @$+#+#+#+#+#+@.", - " @$#+#+#+#+#+#@.", - " @$+#+#+#+#+#+@.", - " @$#+#+#+#+#+#@.", - " @$+#+#+#+#+#+@.", - " @$#+#+#+#+#+#@.", - " @@@@@@@@@@@@@@.", - " ..............", - " ", - " " - }; - - /* File */ - static char * icon2_xpm[] = - { - /* width height ncolors chars_per_pixel */ - "16 16 3 1", - /* colors */ - " s None c None", - ". c #000000", - "+ c #ffffff", - /* pixels */ - " ", - " ........ ", - " .++++++.. ", - " .+.+.++.+. ", - " .++++++.... ", - " .+.+.+++++. ", - " .+++++++++. ", - " .+.+.+.+.+. ", - " .+++++++++. ", - " .+.+.+.+.+. ", - " .+++++++++. ", - " .+.+.+.+.+. ", - " .+++++++++. ", - " ........... ", - " ", - " " - }; - #endif - // ---------------------------------------------------------------------------- // wxLuaStackDialog --- 39,42 ---- *************** *** 110,116 **** BEGIN_EVENT_TABLE(wxLuaStackDialog, wxDialog) EVT_SIZE(wxLuaStackDialog::OnSizeWindow) ! EVT_COMBOBOX(ID_WXLUA_STACKDIALOG_COMBO, wxLuaStackDialog::OnSelectStack) ! EVT_TREE_ITEM_EXPANDING(ID_WXLUA_STACKDIALOG_STACKTREE, wxLuaStackDialog::OnItemExpanding) ! EVT_BUTTON(ID_WXLUA_STACKDIALOG_DISMISS_BUTTON, wxLuaStackDialog::OnCloseDialog) END_EVENT_TABLE() --- 46,53 ---- BEGIN_EVENT_TABLE(wxLuaStackDialog, wxDialog) EVT_SIZE(wxLuaStackDialog::OnSizeWindow) ! ! EVT_COMBOBOX( ID_WXLUA_STACKDIALOG_COMBO, wxLuaStackDialog::OnSelectStack) ! EVT_TREE_ITEM_EXPANDING(ID_WXLUA_STACKDIALOG_STACKTREE, wxLuaStackDialog::OnItemExpanding) ! EVT_BUTTON( ID_WXLUA_STACKDIALOG_DISMISS_BUTTON, wxLuaStackDialog::OnCloseDialog) END_EVENT_TABLE() *************** *** 135,175 **** if (!wxDialog::Create(parent, ID_WXLUA_STACKDIALOG, title, pos, size, ! wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL | wxRESIZE_BORDER)) return false; ! m_stackComboBox = new wxComboBox( this, ! ID_WXLUA_STACKDIALOG_COMBO, wxEmptyString, ! wxPoint(0, 0), ! wxDefaultSize, ! 0, ! NULL, wxCB_DROPDOWN | wxCB_READONLY); m_scrolledWindow = new wxSplitterScrolledWindow(this, ID_WXLUA_STACKDIALOG_SCRWIN, ! wxDefaultPosition, ! wxDefaultSize, wxNO_BORDER | wxCLIP_CHILDREN | wxVSCROLL); ! #if wxCHECK_VERSION(2, 3, 0) ! m_dismissButton = new wxButton(this, ! ID_WXLUA_STACKDIALOG_DISMISS_BUTTON, _("Cancel"), ! wxDefaultPosition, ! wxDefaultSize, ! wxBU_EXACTFIT); #else ! m_dismissButton = new wxButton(this, ! ID_WXLUA_STACKDIALOG_DISMISS_BUTTON, ! _("Cancel"), ! wxDefaultPosition, ! wxDefaultSize); #endif m_dismissButton->SetDefault(); m_treeSplitter = new wxThinSplitterWindow(m_scrolledWindow, ID_WXLUA_STACKDIALOG_SPLITWIN, ! wxDefaultPosition, ! wxDefaultSize, wxSP_3DBORDER | wxCLIP_CHILDREN); m_treeSplitter->SetSashSize(2); --- 72,102 ---- if (!wxDialog::Create(parent, ID_WXLUA_STACKDIALOG, title, pos, size, ! wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL | wxMAXIMIZE_BOX | wxRESIZE_BORDER)) return false; ! m_stackComboBox = new wxComboBox( this, ID_WXLUA_STACKDIALOG_COMBO, wxEmptyString, ! wxPoint(0, 0), wxDefaultSize, ! 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); m_scrolledWindow = new wxSplitterScrolledWindow(this, ID_WXLUA_STACKDIALOG_SCRWIN, ! wxDefaultPosition, wxDefaultSize, wxNO_BORDER | wxCLIP_CHILDREN | wxVSCROLL); ! 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(); + m_treeSplitter = new wxThinSplitterWindow(m_scrolledWindow, ID_WXLUA_STACKDIALOG_SPLITWIN, ! wxDefaultPosition, wxDefaultSize, wxSP_3DBORDER | wxCLIP_CHILDREN); m_treeSplitter->SetSashSize(2); *************** *** 177,188 **** m_treeControl = new wxLuaStackTree(m_treeSplitter, ID_WXLUA_STACKDIALOG_STACKTREE, ! wxDefaultPosition, ! wxDefaultSize, ! wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxNO_BORDER | wxTR_ROW_LINES ); m_valueSplitter = new wxThinSplitterWindow(m_treeSplitter, ID_WXLUA_STACKDIALOG_VALUE_SPLITWIN, ! wxDefaultPosition, ! wxDefaultSize, wxSP_NOBORDER | wxCLIP_CHILDREN); m_valueSplitter->SetSashSize(2); --- 104,113 ---- m_treeControl = new wxLuaStackTree(m_treeSplitter, ID_WXLUA_STACKDIALOG_STACKTREE, ! wxDefaultPosition, wxDefaultSize, ! wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxNO_BORDER | wxTR_ROW_LINES); // | wxTR_HIDE_ROOT ); m_valueSplitter = new wxThinSplitterWindow(m_treeSplitter, ID_WXLUA_STACKDIALOG_VALUE_SPLITWIN, ! wxDefaultPosition, wxDefaultSize, wxSP_NOBORDER | wxCLIP_CHILDREN); m_valueSplitter->SetSashSize(2); *************** *** 190,202 **** m_firstValueWindow = new wxLuaStackDataWindow(m_valueSplitter, ID_WXLUA_STACKDIALOG_VALUE_WIN1, ! wxDefaultPosition, ! wxDefaultSize, wxNO_BORDER); m_secondValueWindow = new wxLuaStackDataWindow(m_valueSplitter, ID_WXLUA_STACKDIALOG_VALUE_WIN2, ! wxDefaultPosition, ! wxDefaultSize, ! wxNO_BORDER, ! false); m_treeSplitter->SetSashPosition(25); --- 115,124 ---- m_firstValueWindow = new wxLuaStackDataWindow(m_valueSplitter, ID_WXLUA_STACKDIALOG_VALUE_WIN1, ! wxDefaultPosition, wxDefaultSize, wxNO_BORDER); m_secondValueWindow = new wxLuaStackDataWindow(m_valueSplitter, ID_WXLUA_STACKDIALOG_VALUE_WIN2, ! wxDefaultPosition, wxDefaultSize, ! wxNO_BORDER, false); m_treeSplitter->SetSashPosition(25); *************** *** 254,258 **** const wxLuaDebugDataItem *item = pSortedList->Item(idx); #if defined(__WXMAC__) ! // Mac is dying on the two parameter version...don't know how to fix. m_stackComboBox->Append(item->GetName()); #else --- 176,180 ---- const wxLuaDebugDataItem *item = pSortedList->Item(idx); #if defined(__WXMAC__) ! // FIXME Mac is dying on the two parameter version...don't know how to fix. m_stackComboBox->Append(item->GetName()); #else *************** *** 328,335 **** { const wxLuaDebugDataItem *item = pSortedList->Item(idx); ! ! int nOffset = 1; ! if (item->GetReference() != LUA_NOREF) ! nOffset = 0; wxTreeItemId treeNode = m_treeControl->AppendItem(rootItem, --- 250,254 ---- { const wxLuaDebugDataItem *item = pSortedList->Item(idx); ! int nOffset = (item->GetReference() != LUA_NOREF) ? 0 : 1; wxTreeItemId treeNode = m_treeControl->AppendItem(rootItem, *************** *** 368,372 **** } ! m_treeControl->Expand(rootItem); } --- 287,291 ---- } ! m_treeControl->Expand(rootItem); //not if wxTR_HIDE_ROOT } *************** *** 435,439 **** } } ! else if (m_luaInterface->GetwxLuaState().Ok() && ((pDebugData->GetName() == _("Tracked List")) || (pDebugData->GetName() == _("Event Handler List")) || --- 354,359 ---- } } ! else if (!m_luaInterface->IsDebugServer() && ! m_luaInterface->GetwxLuaState().Ok() && ((pDebugData->GetName() == _("Tracked List")) || (pDebugData->GetName() == _("Event Handler List")) || *************** *** 536,543 **** { const wxLuaDebugDataItem *item = pSortedList->Item(n); ! ! int nOffset = 1; ! if (item->GetReference() != LUA_NOREF) ! nOffset = 0; wxTreeItemId treeNode = m_treeControl->AppendItem(itemNode, --- 456,460 ---- { const wxLuaDebugDataItem *item = pSortedList->Item(n); ! int nOffset = (item->GetReference() != LUA_NOREF) ? 0 : 1; wxTreeItemId treeNode = m_treeControl->AppendItem(itemNode, *************** *** 550,554 **** } } ! m_treeControl->Expand(itemNode); } --- 467,473 ---- } } ! ! //if (itemNode != m_treeControl->GetRootItem()) not if wxTR_HIDE_ROOT ! m_treeControl->Expand(itemNode); } *************** *** 566,586 **** END_EVENT_TABLE() ! wxLuaStackTree::wxLuaStackTree( wxWindow *parent, ! wxWindowID id, ! const wxPoint &pt, ! const wxSize &sz, ! long style) : wxRemotelyScrolledTreeCtrl(parent, id, pt, sz, style) { m_imageList = new wxImageList(16, 16, true); ! #if !defined(__WXMSW__) // || wxUSE_XPM_IN_MSW ! m_imageList->Add(wxIcon(icon1_xpm)); ! m_imageList->Add(wxIcon(icon2_xpm)); ! #elif defined(__WXMSW__) ! m_imageList->Add(wxIcon(wxT("wxICON_SMALL_CLOSED_FOLDER"), wxBITMAP_TYPE_ICO_RESOURCE)); ! m_imageList->Add(wxIcon(wxT("wxICON_SMALL_FILE"), wxBITMAP_TYPE_ICO_RESOURCE)); ! #else ! #error "Sorry, we don't have icons available for this platform." ! #endif SetImageList(m_imageList); } --- 485,497 ---- END_EVENT_TABLE() ! wxLuaStackTree::wxLuaStackTree( wxWindow *parent, wxWindowID id, ! const wxPoint &pt, const wxSize &sz, ! long style) : wxRemotelyScrolledTreeCtrl(parent, id, pt, sz, style) { m_imageList = new wxImageList(16, 16, true); ! m_imageList->Add(wxArtProvider::GetIcon(wxART_FOLDER, wxART_TOOLBAR, wxSize(16,16))); ! m_imageList->Add(wxArtProvider::GetIcon(wxART_NORMAL_FILE, wxART_TOOLBAR, wxSize(16,16))); ! //m_imageList->Add(wxArtProvider::GetIcon(wxART_FOLDER_OPEN, wxART_TOOLBAR, wxSize(16,16))); SetImageList(m_imageList); } *************** *** 600,611 **** END_EVENT_TABLE() ! wxLuaStackDataWindow::wxLuaStackDataWindow(wxWindow *parent, ! wxWindowID id, ! const wxPoint &pos, ! const wxSize &sz, ! long style, ! bool fFirst): ! wxTreeCompanionWindow(parent, id, pos, sz, style), ! m_fFirst(fFirst) { SetBackgroundColour(*wxWHITE); --- 511,518 ---- END_EVENT_TABLE() ! wxLuaStackDataWindow::wxLuaStackDataWindow(wxWindow *parent, wxWindowID id, ! const wxPoint &pos, const wxSize &sz, ! long style, bool fFirst) ! :wxTreeCompanionWindow(parent, id, pos, sz, style), m_fFirst(fFirst) { SetBackgroundColour(*wxWHITE); *************** *** 618,638 **** wxLuaDebugDataItem *itemData = (wxLuaDebugDataItem *) m_treeControl->GetItemData(id); - dc.SetTextForeground(*wxBLACK); - dc.SetBackgroundMode(wxTRANSPARENT); - - int textWidth, textHeight = 0; if (itemData != NULL) { if (m_fFirst) dc.GetTextExtent(itemData->GetType(), &textWidth, &textHeight); else dc.GetTextExtent(itemData->GetValue(), &textWidth, &textHeight); - } ! int x = 5; ! int y = rect.GetY() + wxMax(0, (rect.GetHeight() - textHeight) / 2); - if (itemData != NULL) - { if (m_fFirst) dc.DrawText(itemData->GetType(), x, y); --- 525,544 ---- wxLuaDebugDataItem *itemData = (wxLuaDebugDataItem *) m_treeControl->GetItemData(id); if (itemData != NULL) { + dc.SetTextForeground(*wxBLACK); + dc.SetBackgroundMode(wxTRANSPARENT); + + int textWidth, textHeight = 0; + if (m_fFirst) dc.GetTextExtent(itemData->GetType(), &textWidth, &textHeight); else dc.GetTextExtent(itemData->GetValue(), &textWidth, &textHeight); ! int x = 5; ! int y = (rect.GetHeight() - textHeight) / 2; // try to center it, else pin to top ! y = rect.GetY() + wxMax(0, y); if (m_fFirst) dc.DrawText(itemData->GetType(), x, y); |