File: cppcheckreportbasepage.cpp

package info (click to toggle)
codelite 6.1.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 48,992 kB
  • ctags: 43,502
  • sloc: cpp: 334,263; ansic: 18,441; xml: 4,713; yacc: 2,653; lex: 2,449; python: 1,188; sh: 385; makefile: 40
file content (136 lines) | stat: -rw-r--r-- 6,340 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
//////////////////////////////////////////////////////////////////////
// This file was auto-generated by codelite's wxCrafter Plugin
// wxCrafter project file: cppcheckreportbasepage.wxcp
// Do not modify this file by hand!
//////////////////////////////////////////////////////////////////////

#include "cppcheckreportbasepage.h"


// Declare the bitmap loading function
extern void wxCBCB5InitBitmapResources();

static bool bBitmapLoaded = false;


CppCheckReportBasePage::CppCheckReportBasePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
    : wxPanel(parent, id, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxCBCB5InitBitmapResources();
        bBitmapLoaded = true;
    }
    
    wxBoxSizer* bSizer5 = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(bSizer5);
    
    wxBoxSizer* mainSizer = new wxBoxSizer(wxHORIZONTAL);
    
    bSizer5->Add(mainSizer, 1, wxEXPAND, 5);
    
    wxBoxSizer* bSizer41 = new wxBoxSizer(wxVERTICAL);
    
    mainSizer->Add(bSizer41, 1, wxEXPAND, 5);
    
    m_stc = new wxStyledTextCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0);
    // Configure the fold margin
    m_stc->SetMarginType     (4, wxSTC_MARGIN_SYMBOL);
    m_stc->SetMarginMask     (4, wxSTC_MASK_FOLDERS);
    m_stc->SetMarginSensitive(4, true);
    m_stc->SetMarginWidth    (4, 0);
    
    // Configure the tracker margin
    m_stc->SetMarginWidth(1, 0);
    
    // Configure the symbol margin
    m_stc->SetMarginType (2, wxSTC_MARGIN_SYMBOL);
    m_stc->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS));
    m_stc->SetMarginWidth(2, 16);
    m_stc->SetMarginSensitive(2, true);
    
    // Configure the line numbers margin
    m_stc->SetMarginType(0, wxSTC_MARGIN_NUMBER);
    m_stc->SetMarginWidth(0,0);
    
    // Configure the line symbol margin
    m_stc->SetMarginType(3, wxSTC_MARGIN_FORE);
    m_stc->SetMarginMask(3, 0);
    m_stc->SetMarginWidth(3,0);
    // Select the lexer
    m_stc->SetLexer(wxSTC_LEX_NULL);
    // Set default font / styles
    m_stc->StyleClearAll();
    m_stc->SetWrapMode(1);
    m_stc->SetIndentationGuides(0);
    m_stc->SetKeyWords(0, wxT(""));
    m_stc->SetKeyWords(1, wxT(""));
    m_stc->SetKeyWords(2, wxT(""));
    m_stc->SetKeyWords(3, wxT(""));
    m_stc->SetKeyWords(4, wxT(""));
    
    bSizer41->Add(m_stc, 1, wxALL|wxEXPAND, 5);
    
    wxBoxSizer* bSizer4 = new wxBoxSizer(wxVERTICAL);
    
    mainSizer->Add(bSizer4, 0, wxEXPAND, 5);
    
    m_buttonClear = new wxButton(this, wxID_CLEAR, _("&Clear"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_buttonClear->SetToolTip(_("Clear the CppCheck report view"));
    
    bSizer4->Add(m_buttonClear, 0, wxALL|wxEXPAND, 5);
    
    m_buttonStop = new wxButton(this, wxID_STOP, _("&Stop"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_buttonStop->SetDefault();
    m_buttonStop->SetToolTip(_("Stop the curreny analysis"));
    
    bSizer4->Add(m_buttonStop, 0, wxALL|wxEXPAND, 5);
    
    m_staticLine10 = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxLI_HORIZONTAL);
    
    bSizer4->Add(m_staticLine10, 0, wxALL|wxEXPAND, 5);
    
    m_buttonUp = new wxButton(this, wxID_UP, _("Up"), wxDefaultPosition, wxSize(-1,-1), 0);
    m_buttonUp->SetToolTip(_("Move to previous error"));
    
    bSizer4->Add(m_buttonUp, 0, wxALL|wxEXPAND, 5);
    
    m_buttonDown = new wxButton(this, wxID_DOWN, _("Down"), wxDefaultPosition, wxSize(-1,-1), 0);
    m_buttonDown->SetToolTip(_("Move to next error"));
    
    bSizer4->Add(m_buttonDown, 0, wxALL|wxEXPAND, 5);
    
    SetSizeHints(482,238);
    if ( GetSizer() ) {
         GetSizer()->Fit(this);
    }
    Centre(wxBOTH);
    // Connect events
    m_stc->Connect(wxEVT_STC_STYLENEEDED, wxStyledTextEventHandler(CppCheckReportBasePage::OnStyleNeeded), NULL, this);
    m_stc->Connect(wxEVT_STC_DOUBLECLICK, wxStyledTextEventHandler(CppCheckReportBasePage::OnOpenFile), NULL, this);
    m_buttonClear->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CppCheckReportBasePage::OnClearReport), NULL, this);
    m_buttonClear->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CppCheckReportBasePage::OnClearReportUI), NULL, this);
    m_buttonStop->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CppCheckReportBasePage::OnStopChecking), NULL, this);
    m_buttonStop->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CppCheckReportBasePage::OnStopCheckingUI), NULL, this);
    m_buttonUp->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CppCheckReportBasePage::OnUp), NULL, this);
    m_buttonUp->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CppCheckReportBasePage::OnUpUI), NULL, this);
    m_buttonDown->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CppCheckReportBasePage::OnDown), NULL, this);
    m_buttonDown->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CppCheckReportBasePage::OnDownUI), NULL, this);
    
}

CppCheckReportBasePage::~CppCheckReportBasePage()
{
    m_stc->Disconnect(wxEVT_STC_STYLENEEDED, wxStyledTextEventHandler(CppCheckReportBasePage::OnStyleNeeded), NULL, this);
    m_stc->Disconnect(wxEVT_STC_DOUBLECLICK, wxStyledTextEventHandler(CppCheckReportBasePage::OnOpenFile), NULL, this);
    m_buttonClear->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CppCheckReportBasePage::OnClearReport), NULL, this);
    m_buttonClear->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CppCheckReportBasePage::OnClearReportUI), NULL, this);
    m_buttonStop->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CppCheckReportBasePage::OnStopChecking), NULL, this);
    m_buttonStop->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CppCheckReportBasePage::OnStopCheckingUI), NULL, this);
    m_buttonUp->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CppCheckReportBasePage::OnUp), NULL, this);
    m_buttonUp->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CppCheckReportBasePage::OnUpUI), NULL, this);
    m_buttonDown->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CppCheckReportBasePage::OnDown), NULL, this);
    m_buttonDown->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CppCheckReportBasePage::OnDownUI), NULL, this);
    
}