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

#include <OSEdAboutDialog.hh>

Inheritance diagram for OSEdAboutDialog:
Inheritance graph
Collaboration diagram for OSEdAboutDialog:
Collaboration graph

Public Member Functions

 OSEdAboutDialog (wxWindow *parent)
 
virtual ~OSEdAboutDialog ()
 

Private Types

enum  { ID_ABOUT_TEXT = 11000 , ID_LINE }
 

Private Member Functions

 OSEdAboutDialog (const OSEdAboutDialog &)
 Copying not allowed.
 
OSEdAboutDialogoperator= (const OSEdAboutDialog &)
 Assignment not allowed.
 
wxSizer * createContents (wxWindow *parent, bool call_fit, bool set_sizer)
 
void setTexts ()
 

Detailed Description

About dialog of the application.

Definition at line 41 of file OSEdAboutDialog.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Widget ids.

Enumerator
ID_ABOUT_TEXT 
ID_LINE 

Definition at line 58 of file OSEdAboutDialog.hh.

Constructor & Destructor Documentation

◆ OSEdAboutDialog() [1/2]

OSEdAboutDialog::OSEdAboutDialog ( wxWindow *  parent)
explicit

Constructor.

Parameters
parentParent window.

Definition at line 56 of file OSEdAboutDialog.cc.

56 :
57 wxDialog(parent, -1, _T(""),
59 wxDefaultSize) {
60
61 createContents(this, true, true);
62 setTexts();
63}
static wxPoint getPosition(Dialogs dialog)
@ DIALOG_ABOUT
About dialog.
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)

References createContents(), and setTexts().

Here is the call graph for this function:

◆ ~OSEdAboutDialog()

OSEdAboutDialog::~OSEdAboutDialog ( )
virtual

Destructor.

Definition at line 68 of file OSEdAboutDialog.cc.

68 {
69 int x, y;
70 GetPosition(&x, &y);
71 wxPoint point(x, y);
73}
static void setPosition(Dialogs dialog, wxPoint point)

References DialogPosition::DIALOG_ABOUT, and DialogPosition::setPosition().

Here is the call graph for this function:

◆ OSEdAboutDialog() [2/2]

OSEdAboutDialog::OSEdAboutDialog ( const OSEdAboutDialog )
private

Copying not allowed.

Member Function Documentation

◆ createContents()

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

Creates the contents of the dialog.

Parameters
parentParent window.
call_fitIf true fits the contents inside the dialog.
set_sizerIf true, sets the sizer as dialog contents.
Returns
The created sizer.

Definition at line 106 of file OSEdAboutDialog.cc.

107 {
108
109 wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
110 wxBitmap logo;
111
112 string dir = Environment::bitmapsDirPath(
114
115 string fileName = dir + FileSystem::DIRECTORY_SEPARATOR +
117
118 logo.LoadFile(WxConversion::toWxString(fileName), wxBITMAP_TYPE_PNG);
119 wxStaticBitmap* dialogLogo = new wxStaticBitmap(parent, -1, logo);
120
121 item0->Add(dialogLogo, 0, wxALIGN_CENTER|wxALL, 5 );
122 wxBoxSizer *item3 = new wxBoxSizer( wxVERTICAL );
123 wxStaticText *item4 =
124 new wxStaticText(parent, ID_ABOUT_TEXT, wxT("Operation Set Editor"),
125 wxDefaultPosition, wxDefaultSize, 0);
126 item3->Add( item4, 0, wxALIGN_CENTER|wxALL, 5 );
127 wxStaticText *item5 =
128 new wxStaticText(parent, -1, _T("OpenASIP ") + WxConversion::toWxString(VERSION),
129 wxDefaultPosition, wxDefaultSize, 0);
130 item3->Add( item5, 0, wxALIGN_CENTER|wxALL, 5 );
131
132 wxStaticText *item6 =
133 new wxStaticText(parent, -1, OSEdConstants::OSED_COPYRIGHT,
134 wxDefaultPosition, wxDefaultSize, 0);
135 item3->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );
136
137 item0->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );
138 wxStaticLine *item7 =
139 new wxStaticLine(parent, -1, wxDefaultPosition,
140 wxSize(20,-1), wxLI_HORIZONTAL);
141 item0->Add( item7, 0, wxGROW|wxALL, 5 );
142 wxButton *item8 =
143 new wxButton(parent, wxID_OK, wxT("&OK"), wxDefaultPosition,
144 wxDefaultSize, 0);
145 item0->Add( item8, 0, wxALIGN_CENTER|wxALL, 5 );
146 if (set_sizer) {
147 parent->SetAutoLayout( TRUE );
148 parent->SetSizer( item0 );
149 if (call_fit)
150 {
151 item0->Fit( parent );
152 item0->SetSizeHints( parent );
153 }
154 }
155
156 return item0;
157}
const string TRUE
Value used for true in attribute and element values.
static std::string bitmapsDirPath(const std::string &prog)
static const std::string DIRECTORY_SEPARATOR
static const std::string LOGO_NAME
Name of the logo.
static const wxString APPLICATION_NAME
The name of the application.
static const wxString OSED_COPYRIGHT
Copyright string.
static wxString toWxString(const std::string &source)
static std::string toString(const wxString &source)

References OSEdConstants::APPLICATION_NAME, Environment::bitmapsDirPath(), FileSystem::DIRECTORY_SEPARATOR, ID_ABOUT_TEXT, OSEdConstants::LOGO_NAME, OSEdConstants::OSED_COPYRIGHT, WxConversion::toString(), WxConversion::toWxString(), and TRUE.

Referenced by OSEdAboutDialog().

Here is the call graph for this function:

◆ operator=()

OSEdAboutDialog & OSEdAboutDialog::operator= ( const OSEdAboutDialog )
private

Assignment not allowed.

◆ setTexts()

void OSEdAboutDialog::setTexts ( )
private

Sets the texts for the dialog.

Definition at line 79 of file OSEdAboutDialog.cc.

79 {
80
83
84 // title
85 format fmt = osedTexts.text(OSEdTextGenerator::TXT_ABOUT_DIALOG_TITLE);
86 SetTitle(WxConversion::toWxString(fmt.str()));
87
88 // static texts
91
92 // buttons
93 WidgetTools::setLabel(&guiTexts, FindWindow(wxID_OK),
95}
@ TXT_BUTTON_OK
Label for OK button.
static GUITextGenerator * instance()
static OSEdTextGenerator & instance()
@ TXT_ABOUT_DIALOG_TITLE
About dialog title.
virtual boost::format text(int textId)
static void setLabel(Texts::TextGenerator *generator, wxWindow *widget, int textID)

References ID_ABOUT_TEXT, GUITextGenerator::instance(), OSEdTextGenerator::instance(), WidgetTools::setLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), OSEdTextGenerator::TXT_ABOUT, OSEdTextGenerator::TXT_ABOUT_DIALOG_TITLE, and GUITextGenerator::TXT_BUTTON_OK.

Referenced by OSEdAboutDialog().

Here is the call graph for this function:

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