~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/plugins/contrib/headerfixup/protocol.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
 
3
 * http://www.gnu.org/licenses/gpl-3.0.html
 
4
 *
 
5
 * $Revision$
 
6
 * $Id$
 
7
 * $HeadURL$
 
8
 */
 
9
 
 
10
#include "protocol.h"
 
11
 
 
12
//(*InternalHeaders(Protocol)
 
13
#include <wx/string.h>
 
14
#include <wx/intl.h>
 
15
//*)
 
16
 
 
17
#include <wx/event.h>
 
18
#include <wx/gdicmn.h>
 
19
#include <wx/utils.h>
 
20
#include <wx/window.h>
 
21
 
 
22
 
 
23
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
 
24
 
 
25
//(*IdInit(Protocol)
 
26
const long Protocol::ID_LBL_PROTOCOL = wxNewId();
 
27
const long Protocol::ID_TXT_PROTOCOL = wxNewId();
 
28
//*)
 
29
 
 
30
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
 
31
 
 
32
BEGIN_EVENT_TABLE(Protocol,wxScrollingDialog)
 
33
  //(*EventTable(Protocol)
 
34
  //*)
 
35
END_EVENT_TABLE()
 
36
 
 
37
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
 
38
 
 
39
Protocol::Protocol(wxWindow* parent,wxWindowID id)
 
40
{
 
41
  //(*Initialize(Protocol)
 
42
  Create(parent, wxID_ANY, _("Header Fixup - Protocol"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER, _T("wxID_ANY"));
 
43
  sizMain = new wxBoxSizer(wxVERTICAL);
 
44
  sizProtocol = new wxStaticBoxSizer(wxVERTICAL, this, _("Protocol"));
 
45
  lblProtocol = new wxStaticText(this, ID_LBL_PROTOCOL, _("Protocol for last operation:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_LBL_PROTOCOL"));
 
46
  sizProtocol->Add(lblProtocol, 0, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
 
47
  m_Protocol = new wxTextCtrl(this, ID_TXT_PROTOCOL, wxEmptyString, wxDefaultPosition, wxSize(480,240), wxTE_MULTILINE|wxTE_READONLY, wxDefaultValidator, _T("ID_TXT_PROTOCOL"));
 
48
  m_Protocol->SetToolTip(_("This is the full log of the parser operations."));
 
49
  sizProtocol->Add(m_Protocol, 1, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
 
50
  sizMain->Add(sizProtocol, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
 
51
  m_OK = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("wxID_OK"));
 
52
  m_OK->SetDefault();
 
53
  m_OK->SetToolTip(_("Click to exit the protocol and return to C::B."));
 
54
  sizMain->Add(m_OK, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
 
55
  SetSizer(sizMain);
 
56
  sizMain->Fit(this);
 
57
  sizMain->SetSizeHints(this);
 
58
  Center();
 
59
  
 
60
  Connect(wxID_OK,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&Protocol::OnBtnOKClick);
 
61
  //*)
 
62
}// Protocol
 
63
 
 
64
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
 
65
 
 
66
void Protocol::OnBtnOKClick(wxCommandEvent& event)
 
67
{
 
68
  EndModal(wxID_OK);
 
69
}// OnBtnOkClick
 
70
 
 
71
void Protocol::SetProtocol(const wxArrayString& Protocol)
 
72
{
 
73
    if (m_Protocol)
 
74
    {
 
75
        m_Protocol->Freeze();
 
76
 
 
77
        const size_t COUNT(Protocol.GetCount());
 
78
        for ( size_t i(0); i != COUNT; ++i )
 
79
        {
 
80
            if ( Protocol[i].StartsWith(wxT("+")) )
 
81
            {
 
82
                m_Protocol->SetDefaultStyle(wxTextAttr(wxNullColour,wxColour(130,255,130)));
 
83
                m_Protocol->AppendText(Protocol[i]);
 
84
            }
 
85
            else
 
86
            {
 
87
                m_Protocol->SetDefaultStyle(wxTextAttr(wxNullColour,*wxWHITE));
 
88
                m_Protocol->AppendText(Protocol[i]);
 
89
            }
 
90
        }
 
91
 
 
92
        m_Protocol->Thaw();
 
93
    }
 
94
}// SetProtocol