Go to the documentation of this file.
35 #include <wx/docmdi.h>
37 #include <wx/docview.h>
38 #include <wx/cmdline.h>
39 #include <wx/imagpng.h>
40 #include <wx/splash.h>
41 #include <boost/format.hpp>
72 ProDe::
ProDe(): docManager_((wxDocManager*)NULL), options_(NULL) {
94 static const wxCmdLineEntryDesc cmdLineDesc[] = {
96 #if wxCHECK_VERSION(3, 0, 0)
97 { wxCMD_LINE_PARAM,
"",
"",
"file", wxCMD_LINE_VAL_STRING,
98 wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
100 { wxCMD_LINE_NONE,
"",
"",
"", wxCMD_LINE_VAL_STRING, 0}
102 { wxCMD_LINE_PARAM, _T(
""), _T(
""), _T(
"file"), wxCMD_LINE_VAL_STRING,
103 wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
105 { wxCMD_LINE_NONE, _T(
""), _T(
""), _T(
""), wxCMD_LINE_VAL_STRING, 0}
110 wxCmdLineParser parser(cmdLineDesc, argc, argv);
111 int parserStatus = parser.Parse();
112 if (parserStatus != 0) {
118 (void)
new wxDocTemplate((wxDocManager*)
docManager_,
119 _T(
"Architecture Definition"),
120 _T(
"*.adf;*.xml;*.cfg"), _T(
""),
121 _T(
"adf"), _T(
"Architecture Definition File"),
129 (void)
new wxDocTemplate((wxDocManager*)
docManager_,
130 _T(
"Processor Configuration"),
132 _T(
"cfg"), _T(
"Architecture Definition File"),
134 CLASSINFO(
MDFView), wxTEMPLATE_INVISIBLE);
137 (void)
new wxDocTemplate((wxDocManager*)
docManager_,
138 _T(
"Architecture Definition File"),
140 _T(
"xml"), _T(
"Architecture Definition File"),
142 CLASSINFO(
MDFView), wxTEMPLATE_INVISIBLE);
148 wxImage::AddHandler(
new wxPNGHandler);
162 bool erroneousOptions =
false;
171 <<
"Default options will be used." << endl;
172 erroneousOptions =
true;
175 if (erroneousOptions) {
188 wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE);
194 for (
unsigned int i = 0; i < parser.GetParamCount(); i++) {
195 wxString file = parser.GetParam(i);
196 wxDocument* doc =
docManager_->CreateDocument(file, wxDOC_SILENT);
200 std::cerr <<
"Improper file '"
202 <<
"' couldn't be opened."
205 std::cerr <<
"Cannot open file '"
static const std::string CMD_NAME_ZOOM_IN
Command name for the "Zoom In" command.
static const std::string CMD_NAME_EDIT_OPTIONS
Command name for the "Edit Options" command.
static const std::string CMD_NAME_SAVE_DOC
Command name for the "Save Document" command.
ProDeOptions * options() const
void setSourceFile(const std::string &fileName)
void setWindowSize(int width, int height)
void addToolbarButton(ToolbarButton *button)
MainFrame * mainFrame_
Main frame of the application.
void createDefaultOptions()
MainFrame * mainFrame() const
CommandRegistry * commandRegistry() const
static const std::string CMD_NAME_MODIFY_COMP
Command name for the "Modify Component" command.
static const std::string CMD_NAME_DELETE_COMP
Command name for the "Delete Component" command.
void setToolbarVisibility(bool visible)
static std::string bitmapsDirPath()
static const std::string CMD_NAME_PRINT
Command name for the "Print" command.
static const std::string CMD_NAME_PASTE
Command name for the "Paste" command.
static std::string bitmapsDirPath(const std::string &prog)
ObjectState * readState()
@ BOTH
Buttons contains text and icon.
void setUndoStackSize(int size)
void setSchemaFile(const std::string &fileName)
void setWindowPosition(int x, int y)
void setOptions(ProDeOptions *options)
void addSeparator(int position)
wxDocManager * docManager_
Manages multiple documents.
static const std::string CMD_NAME_QUIT
Command name for the "Quit" command.
static const std::string CMD_NAME_OPEN_DOC
Command name for the "Open Document" command.
void setFileName(const std::string &fileName)
void addKeyboardShortcut(KeyboardShortcut *shortcut)
CommandRegistry * commandRegistry_
editor command registry
const string TRUE
Value used for true in attribute and element values.
void setToolbarLayout(ToolbarLayout layout)
void setUseSchema(bool useSchema)
ProDeOptions * options_
editor options
wxDocManager * docManager() const
virtual void validate() const
static const std::string CMD_NAME_COPY
Command name for the "Copy" command.
std::string errorMessage() const
static const wxString EDITOR_NAME
Full name of the Editor.
static const std::string DIRECTORY_SEPARATOR
static MachInfoCmdLineOptions options
static const std::string CMD_NAME_UNDO
Command name for the "Undo" command.
static TCEString confPath(const std::string &fileName)
static const std::string CMD_NAME_ZOOM_OUT
Command name for the "Zoom Out" command.
static const std::string CMD_NAME_ZOOM_FIT_WIN
Command name for the "Fit Window" command.
static bool fileExists(const std::string fileName)
static const std::string CMD_NAME_CUT
Command name for the "Cut" command.
void setFullScreen(bool fullScreen)
static const std::string COMMAND_NAME
Command name string.
static std::string toString(const wxString &source)
static const std::string CMD_NAME_REDO
Command name for the "Redo" command.
static std::string dataDirPath(const std::string &prog)
static const std::string CMD_NAME_NEW_DOC
Command name for the "New Document" command.
static const std::string CMD_NAME_CLOSE_DOC
Command name for the "Close Document" command.
static char ** toCStringArray(size_t elements, wxChar **source)