CPImagesComboBox.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00012 /*  This is free software; you can redistribute it and/or
00013  *  modify it under the terms of the GNU General Public
00014  *  License as published by the Free Software Foundation; either
00015  *  version 2 of the License, or (at your option) any later version.
00016  *
00017  *  This software is distributed in the hope that it will be useful,
00018  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020  *  Lesser General Public License for more details.
00021  *
00022  *  You should have received a copy of the GNU General Public
00023  *  License along with this software. If not, see
00024  *  <http://www.gnu.org/licenses/>.
00025  *
00026  */
00027 
00028 #ifndef _CPIMAGESCOMBOBOX_H
00029 #define _CPIMAGESCOMBOBOX_H
00030 
00031 // standard wx include
00032 //#include <config.h>
00033 #include "panoinc.h"
00034 #include "panoinc_WX.h"
00035 #include "wx/odcombo.h"
00036 #include "wx/xrc/xh_odcombo.h"
00037 
00039 class CPImagesComboBox : public wxOwnerDrawnComboBox
00040 {
00041 public:
00043     virtual void OnDrawItem(wxDC& dc,
00044                             const wxRect& rect,
00045                             int item,
00046                             int WXUNUSED(flags)) const;
00048     void CalcCPDistance(HuginBase::Panorama * pano);
00050     void SetRefImage(HuginBase::Panorama * pano, unsigned int newRefImg)
00051     {
00052         refImage=newRefImg;
00053         CalcCPDistance(pano);
00054     };
00056     const unsigned int GetRefImage()
00057     {
00058         return refImage;
00059     };
00060 protected:
00062     void OnMouseWheel(wxMouseEvent & e);
00064     void OnKeyDown(wxKeyEvent & e);
00065 private:
00066     unsigned int refImage;
00067     std::vector<double> CPConnection;
00068     std::vector<unsigned int> CPCount;
00069     void Init();
00070     void SelectNext(int step = 1);
00071     void SelectPrev(int step = 1);
00072     void NotifyParent();
00073 
00074     DECLARE_EVENT_TABLE()
00075     DECLARE_DYNAMIC_CLASS(CPImagesComboBox)
00076 };
00077 
00079 class CPImagesComboBoxXmlHandler : public wxOwnerDrawnComboBoxXmlHandler
00080 {
00081     DECLARE_DYNAMIC_CLASS(CPImagesComboBoxXmlHandler)
00082 
00083 public:
00085     CPImagesComboBoxXmlHandler();
00087     virtual wxObject *DoCreateResource();
00089     virtual bool CanHandle(wxXmlNode *node);
00090 };
00091 
00092 #endif

Generated on 4 May 2016 for Hugintrunk by  doxygen 1.4.7