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 #if wxCHECK_VERSION(2,9,0)
00036     wxDECLARE_EVENT(EVT_IMAGE_ADD,wxCommandEvent);
00037     wxDECLARE_EVENT(EVT_IMAGE_DEL,wxCommandEvent);
00038 #else
00039 #if _WINDOWS && defined Hugin_shared
00040     DECLARE_LOCAL_EVENT_TYPE(EVT_IMAGE_ADD,-1)
00041     DECLARE_LOCAL_EVENT_TYPE(EVT_IMAGE_DEL,-1)
00042 #else
00043     DECLARE_EVENT_TYPE(EVT_IMAGE_ADD,-1)
00044     DECLARE_EVENT_TYPE(EVT_IMAGE_DEL,-1)
00045 #endif
00046 #endif
00047 
00070 class ImagesList: public wxListCtrl, public HuginBase::PanoramaObserver
00071 {
00072 public:
00073     ImagesList();
00074 
00075     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"));
00076 
00077     void Init(HuginBase::Panorama * pano);
00078    
00079     virtual ~ImagesList(void) ;
00080 
00083     virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet & imgNr);
00084     virtual void panoramaChanged(HuginBase::Panorama &pano) {};
00085 
00093     virtual void CreateItem(unsigned int imgNr);
00094 
00097     virtual void UpdateItem(unsigned int imgNr);
00098     
00104     virtual void UpdatePartNumbersForItem(unsigned int imgNr);
00105     
00111     virtual void RemoveItem(unsigned int imgNr);
00112 
00117     void SelectSingleImage(unsigned int imgNr);
00123     void SelectImageRange(unsigned int imgStart,unsigned int imgEnd);
00124 
00126     void SelectImages(const HuginBase::UIntSet imgs);
00127 
00129     void SelectAll();
00130 
00132     void DeselectAll();
00133 
00135     const HuginBase::UIntSet & GetSelected() const;
00136 
00137 protected:
00138     // the model
00139     HuginBase::Panorama * pano;
00140     
00141     // image variable group information
00142     HuginBase::StandardImageVariableGroups * variable_groups;
00143 
00144     // update selected map
00145     void OnItemSelected ( wxListEvent & e );
00146     // update selected map
00147     void OnItemDeselected ( wxListEvent & e );
00148     // save the column width when changed
00149     void OnColumnWidthChange( wxListEvent & e );
00151     void OnChar( wxKeyEvent & e);
00152 
00154     //void createIcon(wxBitmap & bitmap, unsigned int imgNr, unsigned int size);
00155 
00156     HuginBase::UIntSet selectedItems;
00157 
00158     // image icons.
00159     wxImageList *m_smallIcons;
00160     int m_iconHeight;
00161     int m_degDigits;
00162     int m_distDigits;
00163     int m_pixelDigits;
00164 
00165     // propagate list selections/deselections to client.
00166     bool m_notifyParents;
00167     bool m_singleSelect;
00168 
00169     //for saving column width
00170     wxString m_configClassName;
00171     DECLARE_EVENT_TABLE()
00172     DECLARE_DYNAMIC_CLASS(ImagesList)
00173 };
00174 
00177 class ImagesListMask : public ImagesList
00178 {
00179 public:
00180     ImagesListMask();
00181 
00182     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"));
00183 
00184     void Init(HuginBase::Panorama * pano);
00185 
00188     virtual void UpdateItem(unsigned int imgNr);
00190     void SetSingleSelect(bool isSingleSelect);
00191 
00192     DECLARE_DYNAMIC_CLASS(ImagesListMask)
00193 };
00194 
00196 class ImagesListMaskXmlHandler : public wxXmlResourceHandler
00197 {
00198     DECLARE_DYNAMIC_CLASS(ImagesListMaskXmlHandler)
00199 
00200     public:
00201         ImagesListMaskXmlHandler();
00202         virtual wxObject *DoCreateResource();
00203         virtual bool CanHandle(wxXmlNode *node);
00204 };
00205 
00206 
00207 #endif // _LIST_H

Generated on 28 Aug 2015 for Hugintrunk by  doxygen 1.4.7