ImagesList.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00026 #ifndef _IMAGESLIST_H
00027 #define _IMAGESLIST_H
00028 
00029 
00030 #include "panodata/Panorama.h"
00031 #include <panodata/StandardImageVariableGroups.h>
00032 //#include "hugin/MainFrame.h"
00033 
00034 //declare 2 event types to communicate with parent about adding/deleting images
00035     wxDECLARE_EVENT(EVT_IMAGE_ADD,wxCommandEvent);
00036     wxDECLARE_EVENT(EVT_IMAGE_DEL,wxCommandEvent);
00037 
00060 class ImagesList: public wxListCtrl, public HuginBase::PanoramaObserver
00061 {
00062 public:
00063     ImagesList();
00064 
00065     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"));
00066 
00067     void Init(HuginBase::Panorama * pano);
00068    
00069     virtual ~ImagesList(void) ;
00070 
00073     virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet & imgNr);
00074     virtual void panoramaChanged(HuginBase::Panorama &pano) {};
00075 
00083     virtual void CreateItem(unsigned int imgNr);
00084 
00087     virtual void UpdateItem(unsigned int imgNr);
00088     
00094     virtual void UpdatePartNumbersForItem(unsigned int imgNr);
00095     
00101     virtual void RemoveItem(unsigned int imgNr);
00102 
00107     void SelectSingleImage(unsigned int imgNr);
00113     void SelectImageRange(unsigned int imgStart,unsigned int imgEnd);
00114 
00116     void SelectImages(const HuginBase::UIntSet imgs);
00117 
00119     void SelectAll();
00120 
00122     void DeselectAll();
00123 
00125     const HuginBase::UIntSet & GetSelected() const;
00126 
00127 protected:
00128     // the model
00129     HuginBase::Panorama * pano;
00130     
00131     // image variable group information
00132     HuginBase::StandardImageVariableGroups * variable_groups;
00133 
00134     // update selected map
00135     void OnItemSelected ( wxListEvent & e );
00136     // update selected map
00137     void OnItemDeselected ( wxListEvent & e );
00138     // save the column width when changed
00139     void OnColumnWidthChange( wxListEvent & e );
00141     void OnChar( wxKeyEvent & e);
00142 
00144     //void createIcon(wxBitmap & bitmap, unsigned int imgNr, unsigned int size);
00145 
00146     HuginBase::UIntSet selectedItems;
00147 
00148     // image icons.
00149     wxImageList *m_smallIcons;
00150     int m_iconHeight;
00151     int m_degDigits;
00152     int m_distDigits;
00153     int m_pixelDigits;
00154 
00155     // propagate list selections/deselections to client.
00156     bool m_notifyParents;
00157     bool m_singleSelect;
00158 
00159     //for saving column width
00160     wxString m_configClassName;
00161     DECLARE_EVENT_TABLE()
00162     DECLARE_DYNAMIC_CLASS(ImagesList)
00163 };
00164 
00167 class ImagesListMask : public ImagesList
00168 {
00169 public:
00170     ImagesListMask();
00171 
00172     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"));
00173 
00174     void Init(HuginBase::Panorama * pano);
00175 
00178     virtual void UpdateItem(unsigned int imgNr);
00180     void SetSingleSelect(bool isSingleSelect);
00181 
00182     DECLARE_DYNAMIC_CLASS(ImagesListMask)
00183 };
00184 
00186 class ImagesListMaskXmlHandler : public wxXmlResourceHandler
00187 {
00188     DECLARE_DYNAMIC_CLASS(ImagesListMaskXmlHandler)
00189 
00190     public:
00191         ImagesListMaskXmlHandler();
00192         virtual wxObject *DoCreateResource();
00193         virtual bool CanHandle(wxXmlNode *node);
00194 };
00195 
00196 
00197 #endif // _LIST_H

Generated on 29 Jun 2016 for Hugintrunk by  doxygen 1.4.7