Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ProjectListBox.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
2 
27 #include <wx/listctrl.h>
28 #include <wx/xrc/xh_listc.h>
29 #include "ProjectArray.h"
30 #include "Batch.h"
31 
32 class ProjectListBox : public wxListCtrl
33 {
34 public:
35  //Constructor
36  bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = wxT("panel"));
37 
38  //Appends project to list
39  void AppendProject(Project* project);
40  void ChangePrefix(int index, wxString newPrefix);
41  void ChangeUserDefined(int index, wxString newUserDefined);
42  void Deselect(int index);
43  void Fill(Batch* batch);
44  int GetIndex(int id);
45  int GetProjectCountByPath(wxString path);
46  int GetProjectId(int index);
48  wxString GetText(int row, int column);
49  void ReloadProject(int index, Project* project);
50  void Select(int index);
51  void SetMissing(int index);
52  void SwapProject(int index);
53  bool UpdateStatus(int index, Project* project);
54 
55 protected:
56  void OnContextMenu(wxContextMenuEvent& e);
57  void OnChar(wxKeyEvent& e);
58  void OnChangePrefix(wxCommandEvent& e);
59  void OnResetProject(wxCommandEvent& e);
60  void OnEditProject(wxCommandEvent& e);
61  void OnRemoveProject(wxCommandEvent& e);
62  void OnChangeUserDefined(wxCommandEvent& e);
63 
64 private:
66  IntArray columns;
67 
68  wxString GetAttributeString(int i, Project* project);
69  wxString GetLongerFormatName(std::string str);
70  void OnColumnWidthChange(wxListEvent& event);
71 
73  {
74  ID,
83  };
84  //options taken from enum in PanoramaOptions.h. Should it change
85  //in the future, these arrays should be corrected also
86  static const wxString fileFormat[];
87  static const wxString outputMode[];
88  static const wxString HDRMergeType[];
89  static const wxString blendingMechanism[];
90 
91  DECLARE_EVENT_TABLE()
92  DECLARE_DYNAMIC_CLASS(ProjectListBox)
93 };
94 
96 class ProjectListBoxXmlHandler : public wxListCtrlXmlHandler
97 {
98  DECLARE_DYNAMIC_CLASS(ProjectListBoxXmlHandler)
99 
100 public:
102  virtual wxObject* DoCreateResource();
103  virtual bool CanHandle(wxXmlNode* node);
104 };
void OnResetProject(wxCommandEvent &e)
static const wxString outputMode[]
void OnChangeUserDefined(wxCommandEvent &e)
void SetMissing(int index)
int GetProjectCountByPath(wxString path)
void Deselect(int index)
static const wxString HDRMergeType[]
void AppendProject(Project *project)
wxString GetText(int row, int column)
void OnEditProject(wxCommandEvent &e)
void ChangePrefix(int index, wxString newPrefix)
void ChangeUserDefined(int index, wxString newUserDefined)
std::set< unsigned int > UIntSet
Definition: PanoramaData.h:51
int GetIndex(int id)
void Select(int index)
void OnContextMenu(wxContextMenuEvent &e)
bool UpdateStatus(int index, Project *project)
void OnRemoveProject(wxCommandEvent &e)
Definition: Batch.h:48
void OnChangePrefix(wxCommandEvent &e)
wxString GetLongerFormatName(std::string str)
static const wxString blendingMechanism[]
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxT("panel"))
HuginBase::UIntSet GetSelectedProjects()
wxString GetAttributeString(int i, Project *project)
static const wxString fileFormat[]
Batch processor for Hugin.
void ReloadProject(int index, Project *project)
void OnChar(wxKeyEvent &e)
Batch processor for Hugin.
void Fill(Batch *batch)
IntArray columns
void OnColumnWidthChange(wxListEvent &event)
int GetProjectId(int index)
void SwapProject(int index)