⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compilermessages.cpp

📁 非常好用的可移植的多平台C/C++源代码编辑器
💻 CPP
字号:
#include <sdk.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include <manager.h>
#include <messagemanager.h>
#include "compilererrors.h"
#include "compilermessages.h"

/*int idMessagesList = wxNewId();*/

BEGIN_EVENT_TABLE(CompilerMessages, SimpleListLog)

END_EVENT_TABLE()

CompilerMessages::CompilerMessages(wxNotebook* parent, const wxString& title, int numCols, int widths[], const wxArrayString& titles)
    : SimpleListLog(parent, title, numCols, widths, titles)
{
	//ctor
    int id = m_pList->GetId();
    Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_SELECTED,
            (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
            &CompilerMessages::OnClick);
    Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_ACTIVATED,
            (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
            &CompilerMessages::OnDoubleClick);
}

CompilerMessages::~CompilerMessages()
{
	//dtor
}

void CompilerMessages::FocusError(int nr)
{
    m_pList->SetItemState(nr, wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED, wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED);
    m_pList->EnsureVisible(nr);
}

void CompilerMessages::OnClick(wxCommandEvent& event)
{
    // single and double-click, behave the same

    // a compiler message has been clicked
    // go to the relevant file/line
    if (m_pList->GetSelectedItemCount() == 0 || !m_pErrors)
        return;

    // find selected item index
    int index = m_pList->GetNextItem(-1,
                                     wxLIST_NEXT_ALL,
                                     wxLIST_STATE_SELECTED);

    // call the CompilerErrors* ptr; it 'll do all the hard work ;)
    m_pErrors->GotoError(index);
}

void CompilerMessages::OnDoubleClick(wxCommandEvent& event)
{
    // single and double-click, behave the same
    OnClick(event);
    return;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -