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     HuginBase::UIntSet GetSelectedProjects();
00047     wxString GetText(int row, int column);
00048     void ReloadProject(int index, Project* project);
00049     void Select(int index);
00050     void SetMissing(int index);
00051     void SwapProject(int index);
00052     bool UpdateStatus(int index, Project* project);
00053 
00054 protected:
00055     void OnContextMenu(wxContextMenuEvent& e);
00056     void OnChangePrefix(wxCommandEvent& e);
00057     void OnResetProject(wxCommandEvent& e);
00058     void OnEditProject(wxCommandEvent& e);
00059     void OnRemoveProject(wxCommandEvent& e);
00060 
00061 private:
00062     Batch* m_batch;
00063     IntArray columns;
00064 
00065     wxString GetAttributeString(int i, Project* project);
00066     wxString GetLongerFormatName(std::string str);
00067     void OnColumnWidthChange(wxListEvent& event);
00068 
00069     enum ColumnName
00070     {
00071         ID,
00072         PROJECT,
00073         PREFIX,
00074         MODDATE,
00075         FORMAT,
00076         PROJECTION,
00077         SIZE,
00078         STATUS
00079     };
00080     //options taken from enum in PanoramaOptions.h. Should it change
00081     //in the future, these arrays should be corrected also
00082     static const wxString fileFormat[];
00083     static const wxString outputMode[];
00084     static const wxString HDRMergeType[];
00085     static const wxString blendingMechanism[];
00086     static const wxString colorCorrection[];
00087 
00088     DECLARE_EVENT_TABLE()
00089     DECLARE_DYNAMIC_CLASS(ProjectListBox)
00090 };
00091 
00093 class ProjectListBoxXmlHandler : public wxListCtrlXmlHandler
00094 {
00095     DECLARE_DYNAMIC_CLASS(ProjectListBoxXmlHandler)
00096 
00097 public:
00098     ProjectListBoxXmlHandler();
00099     virtual wxObject* DoCreateResource();
00100     virtual bool CanHandle(wxXmlNode* node);
00101 };

Generated on 16 Oct 2017 for Hugintrunk by  doxygen 1.4.7