00001
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _CPIMAGESCOMBOBOX_H
00029 #define _CPIMAGESCOMBOBOX_H
00030
00031
00032
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