| 1 |
////////////////////////////////////////////////////////////////////////////// |
| 2 |
////////////////////////////////////////////////////////////////////////////// |
| 3 |
// |
| 4 |
// copyright : (C) 2014 Eran Ifrah |
| 5 |
// file name : FrameCanvas.h |
| 6 |
// |
| 7 |
// ------------------------------------------------------------------------- |
| 8 |
// A |
| 9 |
// _____ _ _ _ _ |
| 10 |
// / __ \ | | | | (_) | |
| 11 |
// | / \/ ___ __| | ___| | _| |_ ___ |
| 12 |
// | | / _ \ / _ |/ _ \ | | | __/ _ ) |
| 13 |
// | \__/\ (_) | (_| | __/ |___| | || __/ |
| 14 |
// \____/\___/ \__,_|\___\_____/_|\__\___| |
| 15 |
// |
| 16 |
// F i l e |
| 17 |
// |
| 18 |
// This program is free software; you can redistribute it and/or modify |
| 19 |
// it under the terms of the GNU General Public License as published by |
| 20 |
// the Free Software Foundation; either version 2 of the License, or |
| 21 |
// (at your option) any later version. |
| 22 |
// |
| 23 |
////////////////////////////////////////////////////////////////////////////// |
| 24 |
////////////////////////////////////////////////////////////////////////////// |
| 25 |
|
| 26 |
#ifndef FRAMECANVAS_H |
| 27 |
#define FRAMECANVAS_H |
| 28 |
|
| 29 |
#include "ErdPanel.h" |
| 30 |
#include <wx/wx.h> |
| 31 |
#include <wx/list.h> |
| 32 |
#include "wx/wxsf/ShapeCanvas.h" // Base class: wxSFShapeCanvas |
| 33 |
#include <wx/wxsf/DiagramManager.h> |
| 34 |
#include <wx/hashmap.h> |
| 35 |
#include <wx/clipbrd.h> |
| 36 |
|
| 37 |
#ifdef DBL_MYSQL |
| 38 |
#include "../Main/MySqlDbAdapter.h" |
| 39 |
#endif |
| 40 |
|
| 41 |
#include "TableSettings.h" |
| 42 |
#include "ViewSettings.h" |
| 43 |
#include "IDbAdapter.h" |
| 44 |
#include "DnDTableShape.h" |
| 45 |
|
| 46 |
class ErdPanel; |
| 47 |
/*! \brief Frame canvas. */ |
| 48 |
class FrameCanvas : public wxSFShapeCanvas { |
| 49 |
|
| 50 |
public: |
| 51 |
FrameCanvas() { |
| 52 |
; |
| 53 |
} |
| 54 |
FrameCanvas(wxSFDiagramManager* manager,IDbAdapter* dbAdapter, wxPanel* parentPanel, wxWindowID id); |
| 55 |
virtual ~FrameCanvas(); |
| 56 |
virtual void OnConnectionFinished(wxSFLineShape* connection); |
| 57 |
virtual void OnKeyDown(wxKeyEvent& event); |
| 58 |
virtual void OnRightDown(wxMouseEvent& event); |
| 59 |
virtual void OnLeftDown(wxMouseEvent& event); |
| 60 |
virtual void OnLeftDoubleClick(wxMouseEvent& event); |
| 61 |
virtual PRECONNECTIONFINISHEDSTATE OnPreConnectionFinished(wxSFLineShape* connection); |
| 62 |
virtual void OnDrop(wxCoord x, wxCoord y, wxDragResult def, const ShapeList& dropped); |
| 63 |
|
| 64 |
virtual void OnPaste(const ShapeList& pasted); |
| 65 |
|
| 66 |
void OnPopupClick(wxCommandEvent &evt); |
| 67 |
|
| 68 |
wxString GetSqlScript(); |
| 69 |
void UpdateERD(); |
| 70 |
|
| 71 |
protected: |
| 72 |
ErdPanel* m_pParentPanel; |
| 73 |
IDbAdapter* m_pDbAdapter; |
| 74 |
wxSFShapeBase *m_pSelectedShape; |
| 75 |
|
| 76 |
wxString m_srcCol; |
| 77 |
wxString m_dstCol; |
| 78 |
wxPoint m_mousePos; |
| 79 |
|
| 80 |
}; |
| 81 |
|
| 82 |
#endif // FRAMECANVAS_H |