Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages
hugin1/ptbatcher/ProjectListBox.h
Go to the documentation of this file.00001 // -*- c-basic-offset: 4 -*- 00002 00027 #include <wx/listctrl.h> 00028 #include <wx/xrc/xh_listc.h> 00029 #include "ProjectArray.h" 00030 #include "Batch.h" 00031 00032 class ProjectListBox : public wxListCtrl 00033 { 00034 public: 00035 //Constructor 00036 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")); 00037 00038 //Appends project to list 00039 void AppendProject(Project* project); 00040 void ChangePrefix(int index, wxString newPrefix); 00041 void Deselect(int index); 00042 void Fill(Batch* batch); 00043 int GetIndex(int id); 00044 int GetProjectCountByPath(wxString path); 00045 int GetProjectId(int index); 00046 int GetSelectedIndex(); 00047 wxString GetSelectedProject(); 00049 wxString GetSelectedProjectPrefix(); 00050 wxString GetText(int row, int column); 00051 void ReloadProject(int index, Project* project); 00052 void Select(int index); 00053 void SetMissing(int index); 00054 void SwapProject(int index); 00055 bool UpdateStatus(int index, Project* project); 00056 00057 private: 00058 int m_selected; 00059 Batch* m_batch; 00060 IntArray columns; 00061 00062 wxString GetAttributeString(int i, Project* project); 00063 wxString GetLongerFormatName(std::string str); 00064 void OnColumnWidthChange(wxListEvent &event); 00065 void OnDeselect(wxListEvent &event); 00066 void OnSelect(wxListEvent &event); 00067 00068 enum ColumnName { 00069 ID, 00070 PROJECT, 00071 PREFIX, 00072 MODDATE, 00073 FORMAT, 00074 PROJECTION, 00075 SIZE, 00076 STATUS 00077 }; 00078 //options taken from enum in PanoramaOptions.h. Should it change 00079 //in the future, these arrays should be corrected also 00080 static const wxString fileFormat[]; 00081 static const wxString outputMode[]; 00082 static const wxString HDRMergeType[]; 00083 static const wxString blendingMechanism[]; 00084 static const wxString colorCorrection[]; 00085 00086 DECLARE_EVENT_TABLE() 00087 DECLARE_DYNAMIC_CLASS(ProjectListBox) 00088 }; 00089 00091 class ProjectListBoxXmlHandler : public wxListCtrlXmlHandler 00092 { 00093 DECLARE_DYNAMIC_CLASS(ProjectListBoxXmlHandler) 00094 00095 public: 00096 ProjectListBoxXmlHandler(); 00097 virtual wxObject *DoCreateResource(); 00098 virtual bool CanHandle(wxXmlNode *node); 00099 };
1.3.9.1