Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages
hugin1/hugin/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, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 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 00038 00039 using namespace std; 00040 using namespace PT; 00041 00043 class CPImagesComboBox : public wxOwnerDrawnComboBox 00044 { 00045 public: 00047 virtual void OnDrawItem(wxDC& dc, 00048 const wxRect& rect, 00049 int item, 00050 int WXUNUSED(flags)) const; 00052 void CalcCPDistance(Panorama * pano); 00054 void SetRefImage(Panorama * pano, unsigned int newRefImg) 00055 { 00056 refImage=newRefImg; 00057 CalcCPDistance(pano); 00058 }; 00060 const unsigned int GetRefImage() 00061 { 00062 return refImage; 00063 }; 00064 protected: 00066 void OnMouseWheel(wxMouseEvent & e); 00068 void OnKeyDown(wxKeyEvent & e); 00069 private: 00070 unsigned int refImage; 00071 std::vector<double> CPConnection; 00072 std::vector<unsigned int> CPCount; 00073 void Init(); 00074 void SelectNext(int step = 1); 00075 void SelectPrev(int step = 1); 00076 void NotifyParent(); 00077 00078 DECLARE_EVENT_TABLE() 00079 DECLARE_DYNAMIC_CLASS(CPImagesComboBox) 00080 }; 00081 00083 class CPImagesComboBoxXmlHandler : public wxOwnerDrawnComboBoxXmlHandler 00084 { 00085 DECLARE_DYNAMIC_CLASS(CPImagesComboBoxXmlHandler) 00086 00087 public: 00089 CPImagesComboBoxXmlHandler(); 00091 virtual wxObject *DoCreateResource(); 00093 virtual bool CanHandle(wxXmlNode *node); 00094 }; 00095 00096 #endif
1.3.9.1