pns_debug_tool: Add combobox to select IDE (CLion / VS Code)
This commit is contained in:
parent
7cc663ad77
commit
366d8ecb73
File diff suppressed because it is too large
Load Diff
|
@ -153,7 +153,7 @@ PNS_LOG_VIEWER_FRAME::PNS_LOG_VIEWER_FRAME( wxFrame* frame ) :
|
|||
wxITEM_NORMAL );
|
||||
m_listPopupMenu->Append( ID_LIST_SHOW_ALL, wxT( "Show all" ), wxT( "" ), wxITEM_NORMAL );
|
||||
m_listPopupMenu->Append( ID_LIST_SHOW_NONE, wxT( "Show none" ), wxT( "" ), wxITEM_NORMAL );
|
||||
m_listPopupMenu->Append( ID_LIST_DISPLAY_LINE, wxT( "Go to line in vs code" ), wxT( "" ), wxITEM_NORMAL );
|
||||
m_listPopupMenu->Append( ID_LIST_DISPLAY_LINE, wxT( "Go to line in IDE" ), wxT( "" ), wxITEM_NORMAL );
|
||||
|
||||
m_itemList->Connect( m_itemList->GetId(), wxEVT_TREELIST_ITEM_CONTEXT_MENU,
|
||||
wxMouseEventHandler( PNS_LOG_VIEWER_FRAME::onListRightClick ), nullptr,
|
||||
|
@ -611,15 +611,20 @@ void PNS_LOG_VIEWER_FRAME::onListRightClick( wxMouseEvent& event )
|
|||
wxString filename = m_itemList->GetItemText(selectedItems.back(), 2);
|
||||
wxString line = m_itemList->GetItemText(selectedItems.back(), 4);
|
||||
|
||||
//todo: add IDE selection somewhere in the GUI
|
||||
// clion:
|
||||
//wxExecute( wxString::Format( "clion --line %s %s", line, m_filenameToPathMap[filename] ) );
|
||||
|
||||
if( !filename.empty() && !line.empty() )
|
||||
wxExecute( wxString::Format("code --goto %s:%s", m_filenameToPathMap[filename], line) );
|
||||
}
|
||||
{
|
||||
wxString filepath = m_filenameToPathMap[filename];
|
||||
|
||||
return;
|
||||
switch( m_ideChoice->GetCurrentSelection() )
|
||||
{
|
||||
case 0: wxExecute( wxString::Format( "code --goto %s:%s", filepath, line ) ); return;
|
||||
case 1: wxExecute( wxString::Format( "clion --line %s %s", line, filepath ) ); return;
|
||||
default: return;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
|
||||
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -80,11 +80,28 @@ PNS_LOG_VIEWER_FRAME_BASE::PNS_LOG_VIEWER_FRAME_BASE( wxWindow* parent, wxWindow
|
|||
|
||||
m_algoStatus = new wxStaticText( this, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_algoStatus->Wrap( -1 );
|
||||
m_algoStatus->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
|
||||
m_algoStatus->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
||||
|
||||
fgSizer3->Add( m_algoStatus, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_ideLabel = new wxStaticText( this, wxID_ANY, wxT("Select your IDE:"), wxPoint( -1,-1 ), wxDefaultSize, 0 );
|
||||
m_ideLabel->Wrap( -1 );
|
||||
m_ideLabel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
||||
|
||||
fgSizer3->Add( m_ideLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
wxString m_ideChoiceChoices[] = { wxT("VS Code"), wxT("CLion") };
|
||||
int m_ideChoiceNChoices = sizeof( m_ideChoiceChoices ) / sizeof( wxString );
|
||||
m_ideChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ideChoiceNChoices, m_ideChoiceChoices, 0 );
|
||||
m_ideChoice->SetSelection( 0 );
|
||||
m_ideChoice->SetToolTip( wxT("Select IDE for go to line functionality") );
|
||||
|
||||
fgSizer3->Add( m_ideChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
|
||||
m_mainSizer->Add( fgSizer3, 0, wxEXPAND, 5 );
|
||||
|
||||
m_viewSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
|
||||
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -23,6 +23,7 @@
|
|||
#include <wx/slider.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/treelist.h>
|
||||
#include <wx/statusbr.h>
|
||||
|
@ -53,6 +54,8 @@ class PNS_LOG_VIEWER_FRAME_BASE : public wxFrame
|
|||
wxCheckBox* m_chkThinLines;
|
||||
wxCheckBox* m_showVertices;
|
||||
wxStaticText* m_algoStatus;
|
||||
wxStaticText* m_ideLabel;
|
||||
wxChoice* m_ideChoice;
|
||||
wxBoxSizer* m_viewSizer;
|
||||
wxTreeListCtrl* m_itemList;
|
||||
wxStatusBar* m_statusBar;
|
||||
|
@ -74,7 +77,7 @@ class PNS_LOG_VIEWER_FRAME_BASE : public wxFrame
|
|||
|
||||
public:
|
||||
|
||||
PNS_LOG_VIEWER_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("P&S Log Viewer"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
|
||||
PNS_LOG_VIEWER_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("P&S Log Viewer"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 1045,574 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
|
||||
|
||||
~PNS_LOG_VIEWER_FRAME_BASE();
|
||||
|
||||
|
|
Loading…
Reference in New Issue