NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
packagedialog.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 NumeRe: Framework fuer Numerische Rechnungen
3 Copyright (C) 2019 Erik Haenel et al.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17******************************************************************************/
18
19#ifndef PACKAGEDIALOG_HPP
20#define PACKAGEDIALOG_HPP
21
22#include <wx/wx.h>
23#include <wx/propgrid/propgrid.h>
24#include "../terminal/terminal.hpp"
25#include "../IconManager.h"
26
27#include <set>
28#include <string>
29
30
31
36class PackageDialog : public wxDialog
37{
38 private:
39 wxPropertyGrid* m_packageProperties;
40 wxListView* m_fileList;
44
45 void OnAutoDetect(wxCommandEvent& event);
46 void OnAddItems(wxCommandEvent& event);
47 void OnRemoveItems(wxCommandEvent& event);
48 void OnLoadProjectFile(wxCommandEvent& event);
49 void OnSaveProjectFile(wxCommandEvent& event);
50 void OnCreatePackage(wxCommandEvent& event);
51 void OnAbort(wxCommandEvent& event);
52 void OnPropGridChange(wxPropertyGridEvent& event);
53 void OnClose(wxCloseEvent& event);
54
55 void SaveOnClose();
56
57 void autoDetect(const wxArrayString& mainfiles);
58 void followBranch(const std::string& sFile, std::set<std::string>& fileSet);
59 void findLayoutDependencies(const std::string& sFile, std::set<std::string>& fileSet);
60
61 void saveProjectFile(const wxString& filename);
62 void markUnsaved();
63 bool isSaved();
64
65 public:
66 PackageDialog(wxWindow* parent, NumeReTerminal* terminal, IconManager* icons);
67
68 void loadProjectFile(const wxString& filename);
69 void setMainFile(const wxString& mainfile);
70 wxArrayString getProcedures();
71 wxString getInstallInfo();
72 wxString getPackageName();
73 wxString getPackageIdentifier();
74 wxString getPackageVersion();
75 wxString getDocFile();
76 bool includeDocs();
77 bool isPlugin();
78
79 DECLARE_EVENT_TABLE()
80};
81
82#endif // PACKAGEDIALOG_HPP
83
84
The terminal class for the GUI. It's a specialisation of the GenericTerminal.
Definition: terminal.hpp:46
This class represents a dialog for creating a package from a set of procedures.
wxArrayString getProcedures()
This member function will create a string array containing the procedure files, which are currently p...
void loadProjectFile(const wxString &filename)
Loads a NumeRe package project file to memory and updates the UI correspondingly.
PackageDialog(wxWindow *parent, NumeReTerminal *terminal, IconManager *icons)
Constructor.
void OnRemoveItems(wxCommandEvent &event)
This is the event handler for the remove files button.
void OnClose(wxCloseEvent &event)
Event handler, which is called, when the user closes the dialog.
void OnAutoDetect(wxCommandEvent &event)
This is the event handler for the autodetect button.
void saveProjectFile(const wxString &filename)
Saves a prepared package configuration as a NumeRe package project file to the HDD.
wxListView * m_fileList
wxPropertyGrid * m_packageProperties
wxString getPackageIdentifier()
This member function returns the package identifier, which is constructed from the name and only cont...
IconManager * m_icons
void setMainFile(const wxString &mainfile)
This function can be used to insert the current mainfile to the dialog. Used by the main window,...
wxString getInstallInfo()
This member function will create the install information section of the package based upon the setted...
bool includeDocs()
This member function returns whether the user selected the "include docs" property.
void autoDetect(const wxArrayString &mainfiles)
This function autodetects the dependencies of the passed files by calling the PackageDialog::followBr...
void OnLoadProjectFile(wxCommandEvent &event)
Button event handler to load an existing project file.
void findLayoutDependencies(const std::string &sFile, std::set< std::string > &fileSet)
This member function uses the event procedures of a window layout file to create a dependency tree fo...
void OnCreatePackage(wxCommandEvent &event)
Called upon clicking on "Create package" button. Will ask for saving the project.
void OnAddItems(wxCommandEvent &event)
This is the event handler for the add files button.
void OnAbort(wxCommandEvent &event)
Called upon clicking on "Cancel" button. Will ask for saving the project.
NumeReTerminal * m_terminal
void followBranch(const std::string &sFile, std::set< std::string > &fileSet)
This function will recursively call itself to detect a whole branch of file dependencies.
void markUnsaved()
Marks the current project as modified.
wxString getPackageName()
This member function returns the name of the package, as been set by the user.
void OnPropGridChange(wxPropertyGridEvent &event)
Event handler for all property grid changes.
bool isSaved()
Returns true, if the current project is in a saved state.
void SaveOnClose()
Evaluates, whether the current project has been saved and prompt the user a saving dialog,...
void OnSaveProjectFile(wxCommandEvent &event)
Button event handler to save a prepared package setting to a project file.
wxString getPackageVersion()
Returns the version of the defined package as a simple string.
bool isPlugin()
This member function returns, whether the user selected a plugin type as install type.
wxString getDocFile()
Returns the user-chosen documentation file.