OpenASIP  2.0
HDBEditorAboutDialog.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file HDBEditorAboutDialog.cc
26  *
27  * Definition of HDBEditorAboutDialog class.
28  *
29  * @author Veli-Pekka J��skel�inen 2005 (vjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #include "HDBEditorAboutDialog.hh"
34 #include "tce_config.h"
35 #include "WxConversion.hh"
36 #include "HDBEditorConstants.hh"
37 
38 /**
39  * The Constructor.
40  *
41  * @param parent Parent window of the dialog.
42  */
44  wxDialog(parent, -1, _T("About HDB Editor"), wxDefaultPosition) {
45 
46  createContents(this, true, true);
47  dynamic_cast<wxStaticText*>(FindWindow(ID_TEXT_PROGRAM_VERSION))->SetLabel(
48  _T("OpenASIP ") + WxConversion::toWxString(VERSION));
49 }
50 
51 /**
52  * The Destructor.
53  */
55 }
56 
57 
58 /**
59  * Creates contents of the dialog window. Code generated by wxDesigner.
60  *
61  * @param parent Parent dialog of the contents.
62  * @param call_fit If true, fits sizer in dialog window.
63  * @param set_sizer If true, sets sizer as dialog's sizer.
64  * @return Top level sizer of the contents.
65  */
66 wxSizer*
68  wxWindow *parent, bool call_fit, bool set_sizer) {
69 
70  wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
71 
72  item0->Add( 20, 20, 0, wxALIGN_CENTER|wxALL, 5 );
73 
74  wxStaticText *item1 = new wxStaticText( parent, ID_TEXT_PROGRAM_NAME, wxT("HDB Editor"), wxDefaultPosition, wxDefaultSize, 0 );
75  item1->SetFont( wxFont( 25, wxROMAN, wxNORMAL, wxNORMAL ) );
76  item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
77 
78  wxStaticText *item2 = new wxStaticText( parent, ID_TEXT_PROGRAM_VERSION, wxT("Version ?.??"), wxDefaultPosition, wxDefaultSize, 0 );
79  item0->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );
80 
81  wxStaticText *item3 = new wxStaticText( parent, ID_TEXT_PROGRAM_COPYRIGHT, HDBEditorConstants::HDB_EDITOR_COPYRIGHT,
82  wxDefaultPosition, wxDefaultSize, 0 );
83  item0->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );
84 
85  item0->Add( 20, 20, 0, wxALIGN_CENTER|wxALL, 5 );
86 
87  wxStaticLine *item4 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(200,-1), wxLI_HORIZONTAL );
88  item0->Add( item4, 0, wxGROW|wxALL, 5 );
89 
90  wxButton *item5 = new wxButton( parent, wxID_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0 );
91  item0->Add( item5, 0, wxALIGN_CENTER|wxALL, 5 );
92 
93  if (set_sizer)
94  {
95  parent->SetSizer( item0 );
96  if (call_fit)
97  item0->SetSizeHints( parent );
98  }
99 
100  return item0;
101 }
WxConversion::toWxString
static wxString toWxString(const std::string &source)
HDBEditorAboutDialog::HDBEditorAboutDialog
HDBEditorAboutDialog(wxWindow *parent)
Definition: HDBEditorAboutDialog.cc:43
HDBEditorAboutDialog::ID_LINE
@ ID_LINE
Definition: HDBEditorAboutDialog.hh:55
HDBEditorAboutDialog::~HDBEditorAboutDialog
virtual ~HDBEditorAboutDialog()
Definition: HDBEditorAboutDialog.cc:54
HDBEditorConstants.hh
HDBEditorAboutDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: HDBEditorAboutDialog.cc:67
FindWindow
Definition: FindWindow.hh:49
HDBEditorAboutDialog::ID_TEXT_PROGRAM_NAME
@ ID_TEXT_PROGRAM_NAME
Definition: HDBEditorAboutDialog.hh:52
HDBEditorAboutDialog::ID_TEXT_PROGRAM_COPYRIGHT
@ ID_TEXT_PROGRAM_COPYRIGHT
Definition: HDBEditorAboutDialog.hh:54
HDBEditorConstants::HDB_EDITOR_COPYRIGHT
static const wxString HDB_EDITOR_COPYRIGHT
Copyright string.
Definition: HDBEditorConstants.hh:109
HDBEditorAboutDialog::ID_TEXT_PROGRAM_VERSION
@ ID_TEXT_PROGRAM_VERSION
Definition: HDBEditorAboutDialog.hh:53
WxConversion.hh
HDBEditorAboutDialog.hh