OpenASIP  2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HDBEditor Class Reference

#include <HDBEditor.hh>

Inheritance diagram for HDBEditor:
Inheritance graph
Collaboration diagram for HDBEditor:
Collaboration graph

Public Member Functions

 HDBEditor ()
 
virtual ~HDBEditor ()
 
virtual bool OnInit ()
 
virtual int OnExit ()
 
HDBEditorMainFramemainFrame () const
 
HDBBrowserWindowbrowser () const
 

Private Member Functions

 HDBEditor (const HDBEditor &)
 Copying not allowed. More...
 
HDBEditoroperator= (const HDBEditor &)
 Assignment not allowed. More...
 
void createDefaultOptions ()
 

Private Attributes

HDBEditorMainFramemainFrame_
 Main window of the application. More...
 

Detailed Description

Main class for HDBEditor.

Initializes the application.

Definition at line 48 of file HDBEditor.hh.

Constructor & Destructor Documentation

◆ HDBEditor() [1/2]

HDBEditor::HDBEditor ( )

Constructor.

Definition at line 45 of file HDBEditor.cc.

45  : mainFrame_(NULL) {
46 }

◆ ~HDBEditor()

HDBEditor::~HDBEditor ( )
virtual

Destructor.

Definition at line 51 of file HDBEditor.cc.

51  {
52 }

◆ HDBEditor() [2/2]

HDBEditor::HDBEditor ( const HDBEditor )
private

Copying not allowed.

Member Function Documentation

◆ browser()

HDBBrowserWindow * HDBEditor::browser ( ) const

Returns pointer to the browser window of the application main frame.

Returns
Browser window of the mainframe.

Definition at line 135 of file HDBEditor.cc.

135  {
136  return mainFrame_->browser();
137 }

References HDBEditorMainFrame::browser(), and mainFrame_.

Here is the call graph for this function:

◆ createDefaultOptions()

void HDBEditor::createDefaultOptions ( )
private

◆ mainFrame()

HDBEditorMainFrame & HDBEditor::mainFrame ( ) const

Returns the main frame of the application.

Returns
The main frame of the application.

Definition at line 124 of file HDBEditor.cc.

124  {
125  return *mainFrame_;
126 }

References mainFrame_.

◆ OnExit()

int HDBEditor::OnExit ( )
virtual

Deletes the application level dynamic objects not handled by wxWindows.

This function is called when application is about to exit.

Returns
0.

Definition at line 113 of file HDBEditor.cc.

113  {
114  return 0;
115 }

◆ OnInit()

bool HDBEditor::OnInit ( )
virtual

Initializes the application.

Creates mainframe as well as reads the configure file.

Returns
True.

Definition at line 62 of file HDBEditor.cc.

62  {
63 
65 
66  mainFrame_ = new HDBEditorMainFrame(_T("HDB Editor"),
67  wxPoint(50, 50), wxSize(900, 500));
68 
69  // parse command line
70  static const wxCmdLineEntryDesc cmdLineDesc[] = {
71 #if wxCHECK_VERSION(3,0,0)
72  { wxCMD_LINE_PARAM, "", "", "file", wxCMD_LINE_VAL_STRING,
73  wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
74 
75  { wxCMD_LINE_NONE, "", "", "", wxCMD_LINE_VAL_STRING, 0}
76 #else
77  { wxCMD_LINE_PARAM, _T(""), _T(""), _T("file"), wxCMD_LINE_VAL_STRING,
78  wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
79 
80  { wxCMD_LINE_NONE, _T(""), _T(""), _T(""), wxCMD_LINE_VAL_STRING, 0}
81 #endif
82  };
83 
84  wxCmdLineParser parser(cmdLineDesc, argc, argv);
85  int parserStatus = parser.Parse();
86  if (parserStatus != 0) {
87  return false;
88  }
89 
90  // open documents given in command line
91  for (unsigned int i = 0; i < parser.GetParamCount(); i++) {
92  wxString file = parser.GetParam(i);
93  std::string fileName = WxConversion::toString(file);
94  if (!FileSystem::fileExists(fileName)) {
95  std::cerr << "File '" << fileName << "' not found." << std::endl;
96  } else {
97  mainFrame_->setHDB(fileName);
98  }
99  }
100  mainFrame_->Show(true);
101  SetTopWindow(mainFrame_);
102  return true;
103 }

References FileSystem::fileExists(), Application::initialize(), mainFrame_, HDBEditorMainFrame::setHDB(), WxConversion::toCStringArray(), and WxConversion::toString().

Here is the call graph for this function:

◆ operator=()

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

Assignment not allowed.

Member Data Documentation

◆ mainFrame_

HDBEditorMainFrame* HDBEditor::mainFrame_
private

Main window of the application.

Definition at line 67 of file HDBEditor.hh.

Referenced by browser(), mainFrame(), and OnInit().


The documentation for this class was generated from the following files:
HDBEditorMainFrame::setHDB
bool setHDB(const std::string &hdbFile)
Definition: HDBEditorMainFrame.cc:252
HDBEditor::mainFrame_
HDBEditorMainFrame * mainFrame_
Main window of the application.
Definition: HDBEditor.hh:67
HDBEditorMainFrame
Definition: HDBEditorMainFrame.hh:50
FileSystem::fileExists
static bool fileExists(const std::string fileName)
Application::initialize
static void initialize()
Definition: Application.cc:99
HDBEditorMainFrame::browser
HDBBrowserWindow * browser() const
Definition: HDBEditorMainFrame.cc:335
WxConversion::toString
static std::string toString(const wxString &source)
WxConversion::toCStringArray
static char ** toCStringArray(size_t elements, wxChar **source)
Definition: WxConversion.cc:123