OpenASIP  2.0
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. More...
 
OSEdAboutDialogoperator= (const OSEdAboutDialog &)
 Assignment not allowed. More...
 
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.

58  {
59  ID_ABOUT_TEXT = 11000,
60  ID_LINE
61  };

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 }

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 }

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 }

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 }

References ID_ABOUT_TEXT, OSEdTextGenerator::instance(), GUITextGenerator::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:
OSEdAboutDialog::ID_ABOUT_TEXT
@ ID_ABOUT_TEXT
Definition: OSEdAboutDialog.hh:59
OSEdConstants::APPLICATION_NAME
static const wxString APPLICATION_NAME
The name of the application.
Definition: OSEdConstants.hh:110
WxConversion::toWxString
static wxString toWxString(const std::string &source)
OSEdTextGenerator::TXT_ABOUT
@ TXT_ABOUT
About text.
Definition: OSEdTextGenerator.hh:161
WidgetTools::setLabel
static void setLabel(Texts::TextGenerator *generator, wxWindow *widget, int textID)
Definition: WidgetTools.cc:92
GUITextGenerator::instance
static GUITextGenerator * instance()
Definition: GUITextGenerator.cc:67
DialogPosition::getPosition
static wxPoint getPosition(Dialogs dialog)
Definition: DialogPosition.cc:49
GUITextGenerator
Definition: GUITextGenerator.hh:46
FindWindow
Definition: FindWindow.hh:49
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
DialogPosition::setPosition
static void setPosition(Dialogs dialog, wxPoint point)
Definition: DialogPosition.cc:63
Environment::bitmapsDirPath
static std::string bitmapsDirPath(const std::string &prog)
Definition: Environment.cc:201
OSEdConstants::OSED_COPYRIGHT
static const wxString OSED_COPYRIGHT
Copyright string.
Definition: OSEdConstants.hh:119
OSEdTextGenerator::TXT_ABOUT_DIALOG_TITLE
@ TXT_ABOUT_DIALOG_TITLE
About dialog title.
Definition: OSEdTextGenerator.hh:118
DialogPosition::DIALOG_ABOUT
@ DIALOG_ABOUT
About dialog.
Definition: DialogPosition.hh:57
OSEdAboutDialog::setTexts
void setTexts()
Definition: OSEdAboutDialog.cc:79
TRUE
const string TRUE
Value used for true in attribute and element values.
Definition: GUIOptionsSerializer.cc:65
FileSystem::DIRECTORY_SEPARATOR
static const std::string DIRECTORY_SEPARATOR
Definition: FileSystem.hh:189
OSEdAboutDialog::ID_LINE
@ ID_LINE
Definition: OSEdAboutDialog.hh:60
OSEdTextGenerator::instance
static OSEdTextGenerator & instance()
Definition: OSEdTextGenerator.cc:214
OSEdAboutDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: OSEdAboutDialog.cc:106
OSEdTextGenerator
Definition: OSEdTextGenerator.hh:42
OSEdConstants::LOGO_NAME
static const std::string LOGO_NAME
Name of the logo.
Definition: OSEdConstants.hh:116
WxConversion::toString
static std::string toString(const wxString &source)
GUITextGenerator::TXT_BUTTON_OK
@ TXT_BUTTON_OK
Label for OK button.
Definition: GUITextGenerator.hh:59