1 2 3 #ifndef _NASSI_DIAGRAM_H_INCLUDED 4 #define _NASSI_DIAGRAM_H_INCLUDED 5 6 // For compilers that support precompilation, includes <wx/wx.h> 7 #include <wx/wxprec.h> 8 9 #ifndef WX_PRECOMP 10 #include <wx/wx.h> 11 #endif 12 13 14 #include <wx/scrolwin.h> 15 #include <wx/caret.h> 16 #include <wx/dnd.h> 17 18 #include "bricks.h" 19 20 21 class NassiView; 22 class HooverDrawlet; 23 24 25 class NassiDiagramWindow: public wxScrolledWindow 26 { 27 friend class TextCtrl; 28 public: 29 NassiDiagramWindow(wxWindow *parent, NassiView *view); 30 ~NassiDiagramWindow(); 31 private: 32 NassiDiagramWindow(const NassiDiagramWindow &p); 33 NassiDiagramWindow &operator=(const NassiDiagramWindow &rhs); 34 private: OnDraw(wxDC &)35 void OnDraw(wxDC& /*dc*/){} //virtual 36 void OnMouseWheel(wxMouseEvent& event); 37 void OnMouseLeftUp(wxMouseEvent &event); 38 void OnMouseLeftDown(wxMouseEvent &event); 39 void OnMouseRightDown(wxMouseEvent &event); 40 void OnMouseRightUp(wxMouseEvent& event); 41 void OnMouseMove(wxMouseEvent &event); 42 void OnEnter(wxMouseEvent &event); 43 void OnLeave(wxMouseEvent &event); 44 void OnKeyDown(wxKeyEvent &event); 45 void OnChar(wxKeyEvent &event); 46 47 void RemoveDrawlet(wxDC &dc); 48 49 void OnErase(wxEraseEvent &event); 50 void OnPaint(wxPaintEvent &event); 51 void PaintBackground(wxDC &dc); 52 void Draw(wxDC &dc); 53 HasFocus()54 bool HasFocus(){return this == this->FindFocus();} 55 void OnKillFocus(wxFocusEvent &event); 56 void OnSetFocus(wxFocusEvent &event); 57 58 private: 59 NassiView *m_view; 60 HooverDrawlet *m_hd; 61 62 public: 63 wxDragResult OnDrop(const wxPoint &pt, NassiBrick *brick, wxString strc, wxString strs, wxDragResult def); 64 wxDragResult OnDragOver(const wxPoint &pt, wxDragResult def, bool HasNoBricks); 65 void OnDragLeave(); 66 void OnDragEnter(); 67 68 protected: 69 DECLARE_EVENT_TABLE() 70 }; 71 72 73 74 #endif 75