Debian Codegraph @

DatabaseExplorer/OneArrow.cpp

raw
1 //////////////////////////////////////////////////////////////////////////////
2 //////////////////////////////////////////////////////////////////////////////
3 //
4 // copyright : (C) 2014 Eran Ifrah
5 // file name : OneArrow.cpp
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 #include "OneArrow.h"
27
28 // arrow shape
29 static const wxRealPoint arrow1[2] = {wxRealPoint(5,4), wxRealPoint(5,-4)};
30 static const wxRealPoint arrow2[2] = {wxRealPoint(10,4), wxRealPoint(10,-4)};
31
32 XS_IMPLEMENT_CLONABLE_CLASS(OneArrow, wxSFSolidArrow);
33
34 OneArrow::OneArrow(void)
35 {
36 }
37 OneArrow::OneArrow(const OneArrow& obj): wxSFSolidArrow(obj)
38 {
39 }
40 OneArrow::OneArrow(wxSFShapeBase* parent):wxSFSolidArrow(parent)
41 {
42 }
43 OneArrow::~OneArrow()
44 {
45 }
46
47 void OneArrow::Draw(const wxRealPoint& from, const wxRealPoint& to, wxDC& dc)
48 {
49 wxPoint rarrow1[2];
50 wxPoint rarrow2[2];
51
52
53 TranslateArrow( rarrow1, arrow1, 2, from, to );
54 TranslateArrow( rarrow2, arrow2, 2, from, to );
55
56 dc.SetPen(m_Pen);
57 dc.SetBrush(wxNullBrush);
58 dc.DrawLines(2, rarrow1);
59 dc.DrawLines(2, rarrow2);
60 dc.SetBrush(wxNullBrush);
61 dc.SetPen(wxNullPen);
62 }