Patch #2522 2008-07-19 19:13

tpetrov

switch frame on dbl-click in backtrace-window
Download
2522-switch_frame_o.patch (1.6 KB)
Category
Plugin::Refinement
Status
Out of date
Close date
2010-08-22 07:33
Assigned to
mortenmacfly
Index: src/plugins/debuggergdb/backtracedlg.cpp
===================================================================
--- src/plugins/debuggergdb/backtracedlg.cpp    (revision 5142)
+++ src/plugins/debuggergdb/backtracedlg.cpp    (working copy)
@@ -110,12 +110,10 @@
 
 void BacktraceDlg::OnJump(wxCommandEvent& event)
 {
-    wxListEvent evt;
-    OnDblClick(evt);
-}
+// removed tpetrov
+//    wxListEvent evt;
+//    OnDblClick(evt);
 
-void BacktraceDlg::OnDblClick(wxListEvent& event)
-{
     wxListCtrl* lst = XRCCTRL(*this, "lstTrace", wxListCtrl);
     if (lst->GetSelectedItemCount() == 0)
         return;
@@ -136,6 +134,32 @@
         m_pDbg->SyncEditor(file, atoi(line.mb_str()), false);
 }
 
+void BacktraceDlg::OnDblClick(wxListEvent& event)
+{
+    wxCommandEvent evt;
+    OnSwitchFrame(evt);
+
+// moved to OnJump, by tpetrov
+//    wxListCtrl* lst = XRCCTRL(*this, "lstTrace", wxListCtrl);
+//    if (lst->GetSelectedItemCount() == 0)
+//        return;
+//
+//    // find selected item index
+//    int index = lst->GetNextItem(-1,
+//                                 wxLIST_NEXT_ALL,
+//                                 wxLIST_STATE_SELECTED);
+//
+//    wxListItem info;
+//    info.m_itemId = index;
+//    info.m_mask = wxLIST_MASK_TEXT;
+//    info.m_col = 3;
+//    wxString file = lst->GetItem(info) ? info.m_text : _T("");
+//    info.m_col = 4;
+//    wxString line = lst->GetItem(info) ? info.m_text : _T("");
+//    if (!file.IsEmpty() && !line.IsEmpty())
+//        m_pDbg->SyncEditor(file, atoi(line.mb_str()), false);
+}
+
 void BacktraceDlg::OnSave(wxCommandEvent& event)
 {
     wxFileDialog dlg(this,
killerbot 2008-12-29 11:47

can you give some more information please.

If I am not mistaken this functionality already exists in CB.

tpetrov 2008-12-31 12:24

The default behaviour in C::B on doulbe clicking is to go to the file:line, but the frame is not switched, the frame should be switched manually with "context menu -> switch to frame". This patch makes the default to be switch frame and if you want to go to file:line you can use the context menu.