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 "panoinc.h"
00033 #include "panoinc_WX.h"
00034 #include "wx/odcombo.h"
00035 #include "wx/xrc/xh_odcombo.h"
00036 
00038 class CPImagesComboBox : public wxOwnerDrawnComboBox
00039 {
00040 public:
00042     virtual void OnDrawItem(wxDC& dc,
00043                             const wxRect& rect,
00044                             int item,
00045                             int WXUNUSED(flags)) const;
00047     void CalcCPDistance(HuginBase::Panorama * pano);
00049     void SetRefImage(HuginBase::Panorama * pano, unsigned int newRefImg)
00050     {
00051         refImage=newRefImg;
00052         CalcCPDistance(pano);
00053     };
00055     const unsigned int GetRefImage()
00056     {
00057         return refImage;
00058     };
00059 protected:
00061     void OnMouseWheel(wxMouseEvent & e);
00063     void OnKeyDown(wxKeyEvent & e);
00064 private:
00065     unsigned int refImage;
00066     std::vector<double> CPConnection;
00067     std::vector<unsigned int> CPCount;
00068     void Init();
00069     void SelectNext(int step = 1);
00070     void SelectPrev(int step = 1);
00071     void NotifyParent();
00072 
00073     DECLARE_EVENT_TABLE()
00074     DECLARE_DYNAMIC_CLASS(CPImagesComboBox)
00075 };
00076 
00078 class CPImagesComboBoxXmlHandler : public wxOwnerDrawnComboBoxXmlHandler
00079 {
00080     DECLARE_DYNAMIC_CLASS(CPImagesComboBoxXmlHandler)
00081 
00082 public:
00084     CPImagesComboBoxXmlHandler();
00086     virtual wxObject *DoCreateResource();
00088     virtual bool CanHandle(wxXmlNode *node);
00089 };
00090 
00091 #endif

Generated on 26 May 2017 for Hugintrunk by  doxygen 1.4.7