Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EditOutputIniDialog.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
10 /* This is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This software is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public
21  * License along with this software. If not, see
22  * <http://www.gnu.org/licenses/>.
23  *
24  */
25 
26 #ifndef _EDITOUTPUTINIDIALOG_H
27 #define _EDITOUTPUTINIDIALOG_H
28 
29 #include "panoinc_WX.h"
30 #include <wx/propgrid/propgrid.h>
31 #include <wx/propgrid/manager.h>
32 
34 class EditOutputIniDialog : public wxDialog
35 {
36 public:
38  EditOutputIniDialog(wxWindow* parent);
41 
42 protected:
44  void OnOk(wxCommandEvent& e);
46  void OnContextMenu(wxContextMenuEvent& e);
48  void OnAddSection(wxCommandEvent& e);
50  void OnRenameSection(wxCommandEvent& e);
52  void OnAddCondition(wxCommandEvent& e);
53 
54 private:
56  void ReadIni();
58  void WriteIni();
60  wxFileName GetIniFileName();
62  wxArrayString GetSections() const;
64  wxArrayString GetChildren(wxPGProperty* prop) const;
66  void BuildAddContextMenu(wxMenu& menu, wxPGProperty* category, const bool addSeparator);
68  void AddKey(wxPGProperty* section, const wxString& key, const wxString& value);
69 
70  wxPropertyGridManager* m_grid;
71  wxPGProperty* m_currentSection;
72 };
73 
74 
75 #endif //_EDITOUTPUTINIDIALOG_H
void ReadIni()
read the ini file and populate the control
void OnAddSection(wxCommandEvent &e)
add a new section
wxArrayString GetSections() const
return wxArrayString with all sections
wxPGProperty * m_currentSection
EditOutputIniDialog(wxWindow *parent)
Constructor, constructs dialog; restore last uses settings, size and position.
wxPropertyGridManager * m_grid
void BuildAddContextMenu(wxMenu &menu, wxPGProperty *category, const bool addSeparator)
function to build context menu with all missing entries
wxArrayString GetChildren(wxPGProperty *prop) const
return wxArrayString with all sub-entries of given wxPGProperty
wxFileName GetIniFileName()
return the filename of the default ini file
void OnContextMenu(wxContextMenuEvent &e)
right click handler, show popup menu
Dialog for editing user defined output settings (ini file)
void OnOk(wxCommandEvent &e)
save ini and close dialog
void OnAddCondition(wxCommandEvent &e)
adds a new condition to list
void AddKey(wxPGProperty *section, const wxString &key, const wxString &value)
add key with value to wxPropertyGrid, generate if necessary all sub properties
include file for the hugin project
void OnRenameSection(wxCommandEvent &e)
renames a new section
~EditOutputIniDialog()
destructor, saves size and position
void WriteIni()
write the ini to disc