1 //////////////////////////////////////////////////////////////////////////
2 //
3 // pgAdmin III - PostgreSQL Tools
4 //
5 // Copyright (C) 2002 - 2016, The pgAdmin Development Team
6 // This software is released under the PostgreSQL Licence
7 //
8 // hdRectangleFigure.cpp - A simple rectangle figure
9 //
10 //////////////////////////////////////////////////////////////////////////
11
12 #include "pgAdmin3.h"
13
14 // wxWindows headers
15 #include <wx/wx.h>
16 #include <wx/dcbuffer.h>
17
18 // App headers
19 #include "hotdraw/figures/hdRectangleFigure.h"
20 #include "hotdraw/main/hdDrawingView.h"
21
hdRectangleFigure()22 hdRectangleFigure::hdRectangleFigure()
23 {
24 }
25
~hdRectangleFigure()26 hdRectangleFigure::~hdRectangleFigure()
27 {
28 }
29
basicDraw(wxBufferedDC & context,hdDrawingView * view)30 void hdRectangleFigure::basicDraw(wxBufferedDC &context, hdDrawingView *view)
31 {
32 hdRect copy = displayBox().gethdRect(view->getIdx());
33 view->CalcScrolledPosition(copy.x, copy.y, ©.x, ©.y);
34 context.DrawRectangle(copy);
35 }
36
basicDrawSelected(wxBufferedDC & context,hdDrawingView * view)37 void hdRectangleFigure::basicDrawSelected(wxBufferedDC &context, hdDrawingView *view)
38 {
39 hdRect copy = displayBox().gethdRect(view->getIdx());
40 view->CalcScrolledPosition(copy.x, copy.y, ©.x, ©.y);
41 context.DrawRectangle(copy);
42 }
43
setRectangle(hdMultiPosRect & rect)44 void hdRectangleFigure::setRectangle(hdMultiPosRect &rect)
45 {
46 basicDisplayBox = rect;
47 }
48
setSize(wxSize & size)49 void hdRectangleFigure::setSize(wxSize &size)
50 {
51 basicDisplayBox.SetSize(size);
52 }
53