OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
AboutDialog Class Reference

#include <AboutDialog.hh>

Inheritance diagram for AboutDialog:
Inheritance graph
Collaboration diagram for AboutDialog:
Collaboration graph

Public Member Functions

 AboutDialog (wxWindow *parent)
 
virtual ~AboutDialog ()
 

Private Member Functions

wxSizer * createContents (wxWindow *parent, bool call_fit, bool set_sizer)
 
void setTexts ()
 

Detailed Description

Dialog with editor logo, name, version and copyright information.

Definition at line 18 of file AboutDialog.hh.

Constructor & Destructor Documentation

◆ AboutDialog()

AboutDialog::AboutDialog ( wxWindow *  parent)

The Constructor.

Parameters
parentParent window of the dialog.

Definition at line 52 of file AboutDialog.cc.

52 :
53 wxDialog(parent, -1, _T(""), wxDefaultPosition) {
54
55 createContents(this, true, true);
56
57 // set widget texts
58 setTexts();
59}
void setTexts()
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)

References createContents(), and setTexts().

Here is the call graph for this function:

◆ ~AboutDialog()

AboutDialog::~AboutDialog ( )
virtual

The Destructor.

Definition at line 64 of file AboutDialog.cc.

64 {
65}

Member Function Documentation

◆ createContents()

wxSizer * AboutDialog::createContents ( wxWindow *  parent,
bool  call_fit,
bool  set_sizer 
)
private

Creates contents of the dialog window. Initially generated with wxDesigner, the code will be cleaned up later.

Parameters
parentParent dialog of the contents.
call_fitIf true, fits sizer in dialog window.
set_sizerIf true, sets sizer as dialog's sizer.
Returns
Top level sizer of the contents.

Definition at line 98 of file AboutDialog.cc.

99 {
100
101 wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
102 wxBitmap logo;
103
104 wxString filename = WxConversion::toWxString(
106
107 logo.LoadFile(filename, wxBITMAP_TYPE_PNG);
108 wxStaticBitmap* dialogLogo = new wxStaticBitmap(parent, -1, logo);
109
110 item0->Add(dialogLogo, 0, wxALIGN_CENTER|wxALL, 5 );
111 wxBoxSizer *item3 = new wxBoxSizer( wxVERTICAL );
112 wxStaticText *item4 =
113 new wxStaticText(parent, -1, ProDeConstants::EDITOR_NAME,
114 wxDefaultPosition, wxDefaultSize, 0);
115 item3->Add( item4, 0, wxALIGN_CENTER|wxALL, 5 );
116 wxStaticText *item5 =
117 new wxStaticText(parent, -1, _T("OpenASIP ") +
119 wxDefaultPosition, wxDefaultSize, 0);
120 item3->Add( item5, 0, wxALIGN_CENTER|wxALL, 5 );
121 wxStaticText *item6 =
122 new wxStaticText(parent, -1,
124 wxDefaultPosition, wxDefaultSize, 0);
125 item3->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );
126 item0->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );
127 wxStaticLine *item7 =
128 new wxStaticLine(parent, -1, wxDefaultPosition,
129 wxSize(20,-1), wxLI_HORIZONTAL);
130 item0->Add( item7, 0, wxGROW|wxALL, 5 );
131 wxButton *item8 =
132 new wxButton(parent, wxID_OK, wxT("&OK"), wxDefaultPosition,
133 wxDefaultSize, 0);
134 item0->Add( item8, 0, wxALIGN_CENTER|wxALL, 5 );
135 if (set_sizer) {
136 parent->SetAutoLayout( TRUE );
137 parent->SetSizer( item0 );
138 if (call_fit)
139 {
140 item0->Fit( parent );
141 item0->SetSizeHints( parent );
142 }
143 }
144
145 return item0;
146}
const string TRUE
Value used for true in attribute and element values.
static const std::string EDITOR_LOGO_PATH
Location of the logo picture of the Editor.
static const wxString EDITOR_NAME
Full name of the Editor.
static const wxString EDITOR_COPYRIGHT_TEXT
Copyright text of the Editor.
static std::string bitmapsDirPath()
Definition ProDe.cc:427
static wxString toWxString(const std::string &source)

References ProDe::bitmapsDirPath(), ProDeConstants::EDITOR_COPYRIGHT_TEXT, ProDeConstants::EDITOR_LOGO_PATH, ProDeConstants::EDITOR_NAME, WxConversion::toWxString(), and TRUE.

Referenced by AboutDialog().

Here is the call graph for this function:

◆ setTexts()

void AboutDialog::setTexts ( )
private

Sets texts for widgets.

Definition at line 72 of file AboutDialog.cc.

72 {
75
76 // Dialog title
77 format fmt = prodeTexts->text(ProDeTextGenerator::TXT_ABOUT_DIALOG_TITLE);
78 string title = fmt.str();
80 SetTitle(WxConversion::toWxString(title));
81
82 // buttons
83 WidgetTools::setLabel(generator, FindWindow(wxID_OK),
85}
@ TXT_BUTTON_OK
Label for OK button.
static GUITextGenerator * instance()
static ProDeTextGenerator * instance()
@ TXT_ABOUT_DIALOG_TITLE
About dialog title.
virtual boost::format text(int textId)
static void setLabel(Texts::TextGenerator *generator, wxWindow *widget, int textID)
static std::string toString(const wxString &source)

References ProDeConstants::EDITOR_NAME, GUITextGenerator::instance(), ProDeTextGenerator::instance(), WidgetTools::setLabel(), Texts::TextGenerator::text(), WxConversion::toString(), WxConversion::toWxString(), ProDeTextGenerator::TXT_ABOUT_DIALOG_TITLE, and GUITextGenerator::TXT_BUTTON_OK.

Referenced by AboutDialog().

Here is the call graph for this function:

The documentation for this class was generated from the following files: