CPListFrame.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00024 #ifndef _CPLISTFRAME_H
00025 #define _CPLISTFRAME_H
00026 
00027 #include <wx/xrc/xh_listc.h>
00028 #include <vector>
00029 
00030 class MainFrame;
00031 
00033 struct CPListItem
00034 {
00035     size_t globalIndex;
00036     size_t localNumber;
00037 };
00038 
00043 class CPListCtrl : public wxListView, public HuginBase::PanoramaObserver
00044 {
00045 public:
00046     CPListCtrl();
00047     ~CPListCtrl();
00048     bool Create(wxWindow *parent,
00049         wxWindowID id = wxID_ANY,
00050         const wxPoint& pos = wxDefaultPosition,
00051         const wxSize& size = wxDefaultSize,
00052         long style = wxLC_REPORT | wxLC_VIRTUAL,
00053         const wxValidator& validator = wxDefaultValidator,
00054         const wxString& name = wxListCtrlNameStr);
00055 
00056     void Init(HuginBase::Panorama* pano);
00057     virtual void panoramaChanged(HuginBase::Panorama &pano);
00058     virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet& changed) {};
00060     void DeleteSelected();
00062     void SelectDistanceThreshold(double threshold);
00064     void SelectAll();
00065 protected:
00067     virtual wxString OnGetItemText(long item, long column) const;
00069     void OnCPListSelectionChanged(wxListEvent & e);
00071     void OnCPListHeaderClick(wxListEvent & e);
00073     void OnColumnWidthChange(wxListEvent & e);
00075     void OnChar(wxKeyEvent& e);
00076 private:
00077     void UpdateInternalCPList();
00078     void SortInternalList(bool isAscending);
00079 
00080     HuginBase::Panorama* m_pano;
00081     // current sorting column
00082     int m_sortCol;
00083     bool m_sortAscend;
00084     bool m_onlyActiveImages = false;
00085     std::vector<CPListItem> m_internalCPList;
00086     std::map<std::string, int> m_localIds;
00087 
00088     DECLARE_EVENT_TABLE()
00089     DECLARE_DYNAMIC_CLASS(CPListCtrl)
00090 };
00091 
00093 class CPListCtrlXmlHandler : public wxListCtrlXmlHandler
00094 {
00095     DECLARE_DYNAMIC_CLASS(CPListCtrlXmlHandler)
00096 
00097 public:
00099     CPListCtrlXmlHandler();
00101     virtual wxObject *DoCreateResource();
00103     virtual bool CanHandle(wxXmlNode *node);
00104 };
00105 
00106 class CPListFrame : public wxFrame
00107 {
00108 public:
00111     CPListFrame(wxFrame* parent, HuginBase::Panorama & pano);
00112         
00115     virtual ~CPListFrame();
00116 
00117 protected:
00118     void OnDeleteButton(wxCommandEvent & e);
00119     void OnSelectButton(wxCommandEvent & e);
00120     void OnClose(wxCloseEvent& event);
00121 private:
00122     CPListCtrl* m_list;
00123     HuginBase::Panorama& m_pano;
00124     // needed for receiving events.
00125     DECLARE_EVENT_TABLE();
00126 };
00127 
00128 
00129 
00130 #endif // _CPLISTFRAME_H

Generated on 24 Jul 2016 for Hugintrunk by  doxygen 1.4.7