~ubuntu-branches/ubuntu/hardy/codeblocks/hardy-backports

« back to all changes in this revision

Viewing changes to src/sdk/genericmultilinenotesdlg.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2008-07-17 04:39:23 UTC
  • Revision ID: james.westby@ubuntu.com-20080717043923-gmsy5cwkdjswghkm
Tags: upstream-8.02
ImportĀ upstreamĀ versionĀ 8.02

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 Lesser General Public License, version 3
 
3
 * http://www.gnu.org/licenses/lgpl-3.0.html
 
4
 *
 
5
 * $Revision$
 
6
 * $Id$
 
7
 * $HeadURL$
 
8
 */
 
9
 
 
10
#include "sdk_precomp.h"
 
11
 
 
12
#ifndef CB_PRECOMP
 
13
    #include <wx/xrc/xmlres.h>
 
14
#endif
 
15
 
 
16
#include "genericmultilinenotesdlg.h"
 
17
#include <wx/textctrl.h>
 
18
 
 
19
BEGIN_EVENT_TABLE(GenericMultiLineNotesDlg, wxDialog)
 
20
    //
 
21
END_EVENT_TABLE()
 
22
 
 
23
GenericMultiLineNotesDlg::GenericMultiLineNotesDlg(wxWindow* parent, const wxString& caption, const wxString& notes, bool readOnly)
 
24
    : m_Notes(notes),
 
25
    m_ReadOnly(readOnly)
 
26
{
 
27
    //ctor
 
28
    wxXmlResource::Get()->LoadDialog(this, parent, _T("dlgGenericMultiLineNotes"));
 
29
    SetTitle(caption);
 
30
 
 
31
    XRCCTRL(*this, "txtNotes", wxTextCtrl)->SetValue(m_Notes);
 
32
    XRCCTRL(*this, "txtNotes", wxTextCtrl)->SetEditable(!m_ReadOnly);
 
33
 
 
34
    if (m_ReadOnly)
 
35
    {
 
36
        wxWindow* win = FindWindowById(wxID_OK, this);
 
37
        if (win)
 
38
            win->Enable(false);
 
39
    }
 
40
}
 
41
 
 
42
GenericMultiLineNotesDlg::~GenericMultiLineNotesDlg()
 
43
{
 
44
    //dtor
 
45
}
 
46
 
 
47
void GenericMultiLineNotesDlg::EndModal(int retCode)
 
48
{
 
49
    if (retCode == wxID_OK)
 
50
        m_Notes = XRCCTRL(*this, "txtNotes", wxTextCtrl)->GetValue();
 
51
    wxDialog::EndModal(retCode);
 
52
}