00001 #ifndef _wxUIElements_vuBasicSubViewer_h_ 00002 #define _wxUIElements_vuBasicSubViewer_h_ 00003 00004 #include "vuGLCanvas.h" 00005 #include "General/vuMisc/vuString.h" 00006 #include <wx/dialog.h> 00007 #include <wx/wx.h> 00008 00010 00023 class vuBasicSubViewerCanvas; 00024 00025 class vuBasicSubViewer : public wxDialog 00026 { 00027 public: 00028 vuBasicSubViewer(wxWindow *parent, vuString title=""); 00029 ~vuBasicSubViewer(); 00030 00033 void init(bool showControl=true); 00034 00036 void redraw(); 00037 00038 void glOnMouse(wxMouseEvent &event); 00039 00040 // is the control gui visible? 00041 bool isControlVisible(); 00042 00043 // shows or hides the control gui (to the left or right of the canvas) 00044 void showControl(bool doShow=true); 00045 00046 protected: 00047 // following methods should be overridden by subclasses: 00048 00052 virtual vuBasicSubViewerCanvas *getCanvas() = 0; 00053 00057 virtual void addLeftRight(wxSizer *verSpacer, wxWindow *control) = 0; 00058 00059 protected: 00060 void showHideControl(); 00061 void makeCanvasSizeEqual(); 00062 00063 protected: 00065 bool TransferDataToWindow() {return true;} 00067 bool TransferDataFromWindow() {return true;} 00068 00069 protected: 00071 wxBoxSizer *m_MainSizer; 00072 wxWindow *m_ControlWindow; 00073 00075 /* 0 -> not visible, 00076 -1 -> left of canvas 00077 1 -> right of canvas 00078 */ 00079 int m_ControlPosition; 00080 bool m_IsMakeCanvasSizeEqual; 00081 }; 00082 00083 00084 00085 class vuBasicSubViewerCanvas : public vuGLCanvas 00086 { 00087 public: 00088 vuBasicSubViewerCanvas(vuBasicSubViewer *parent, wxWindowID id=-1); 00089 ~vuBasicSubViewerCanvas(); 00090 00091 protected: 00093 virtual void OnMouse(wxMouseEvent &ev); 00094 virtual void OnChar(wxKeyEvent &ev) {}; 00095 DECLARE_EVENT_TABLE() 00096 }; 00097 00098 #endif /* _wxUIElements_vuBasicSubViewer_h_ */