~ubuntu-branches/ubuntu/wily/apparmor/wily

« back to all changes in this revision

Viewing changes to deprecated/management/profile-editor/src/AboutDialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-04-27 10:38:07 UTC
  • mfrom: (5.1.118 natty)
  • Revision ID: james.westby@ubuntu.com-20110427103807-ym3rhwys6o84ith0
Tags: 2.6.1-2
debian/copyright: clarify for some full organization names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*      AppArmor Profile Editor (C) 2006 Novell, Inc.
 
2
 *
 
3
 *      This program is free software; you can redistribute it and/or modify
 
4
 *      it under the terms of the GNU General Public License as published by
 
5
 *      the Free Software Foundation; either version 2 of the License, or
 
6
 *      (at your option) any later version.
 
7
 * 
 
8
 */
 
9
 
 
10
#include "wx/wxprec.h"
 
11
 
 
12
#ifndef WX_PRECOMP
 
13
#include "wx/wx.h"
 
14
#endif
 
15
 
 
16
#include <wx/wfstream.h>
 
17
#include "AboutDialog.h"
 
18
#include "opensuse_logo.xpm"
 
19
 
 
20
IMPLEMENT_DYNAMIC_CLASS(AboutDialog, wxDialog)
 
21
 
 
22
BEGIN_EVENT_TABLE(AboutDialog, wxDialog)
 
23
END_EVENT_TABLE()
 
24
 
 
25
AboutDialog::AboutDialog()
 
26
{
 
27
}
 
28
 
 
29
AboutDialog::AboutDialog(wxWindow* parent, 
 
30
                        wxWindowID id,
 
31
                        const wxString& caption,
 
32
                        const wxPoint& pos,
 
33
                        const wxSize& size,
 
34
                        long style)
 
35
{
 
36
    Create(parent, id, caption, pos, size, style);
 
37
}
 
38
 
 
39
bool AboutDialog::Create(wxWindow* parent,
 
40
                        wxWindowID id,
 
41
                        const wxString& caption,
 
42
                        const wxPoint& pos,
 
43
                        const wxSize& size,
 
44
                        long style)
 
45
{
 
46
        mpLogoBitmap = NULL;
 
47
        mpVersionStaticText = NULL;
 
48
        mpCopyrightStaticText = NULL;
 
49
        mpOkButtonSizer = NULL;
 
50
        mpOkButton = NULL;
 
51
 
 
52
        SetExtraStyle(GetExtraStyle() | wxWS_EX_BLOCK_EVENTS);
 
53
        wxDialog::Create(parent, id, caption, pos, size, style);
 
54
        
 
55
        CreateControls();
 
56
        GetSizer()->Fit(this);
 
57
        GetSizer()->SetSizeHints(this);
 
58
        Centre();
 
59
 
 
60
        return true;
 
61
}
 
62
 
 
63
void AboutDialog::CreateControls()
 
64
{
 
65
        SetBackgroundColour(wxColour(255, 255, 255));
 
66
        wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
 
67
        SetSizer(mainSizer);
 
68
        
 
69
        wxBitmap mpLogoBitmapBitmap(opensuse_logo_xpm);
 
70
        mpLogoBitmap = new wxStaticBitmap(this, 
 
71
                                        wxID_ANY,
 
72
                                        mpLogoBitmapBitmap, 
 
73
                                        wxDefaultPosition,
 
74
                                        wxSize(223, 137),
 
75
                                        0);
 
76
        mainSizer->Add(mpLogoBitmap, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
 
77
        
 
78
        mpVersionStaticText = new wxStaticText(this,
 
79
                                        wxID_ANY,
 
80
                                        VERSION_STRING, 
 
81
                                        wxDefaultPosition,
 
82
                                        wxDefaultSize,
 
83
                                        0);
 
84
        mainSizer->Add(mpVersionStaticText, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxADJUST_MINSIZE, 5);
 
85
        
 
86
        mpCopyrightStaticText = new wxStaticText(this, 
 
87
                                                wxID_ANY,
 
88
                                                _("(C) 2006 Novell, Inc\n"),
 
89
                                                wxDefaultPosition,
 
90
                                                wxDefaultSize,
 
91
                                                0);
 
92
        mainSizer->Add(mpCopyrightStaticText, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxADJUST_MINSIZE, 5);
 
93
        
 
94
        mpLicenseTextCtrl = new wxTextCtrl(this,
 
95
                                        wxID_ANY,
 
96
                                        _T(""), 
 
97
                                        wxDefaultPosition,
 
98
                                        wxSize(400, -1),
 
99
                                        wxTE_MULTILINE|wxTE_READONLY);
 
100
        mpLicenseTextCtrl->SetValue(GPL_STRING);
 
101
        mainSizer->Add(mpLicenseTextCtrl, 0, wxGROW|wxALL, 5);
 
102
 
 
103
        mpOkButtonSizer = new wxStdDialogButtonSizer;
 
104
        
 
105
        mainSizer->Add(mpOkButtonSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
 
106
        mpOkButton = new wxButton(this, 
 
107
                                wxID_OK,
 
108
                                _("&OK"),
 
109
                                wxDefaultPosition,
 
110
                                wxDefaultSize,
 
111
                                0);
 
112
        mpOkButtonSizer->AddButton(mpOkButton);
 
113
        mpOkButtonSizer->Realize();
 
114
}