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 // ddAddFkLocator.cpp - Locate table add fk relationship button inside a table.
9 //
10 //////////////////////////////////////////////////////////////////////////
11 
12 #include "pgAdmin3.h"
13 
14 // wxWindows headers
15 #include <wx/wx.h>
16 
17 // App headers
18 #include "dd/dditems/locators/ddAddFkLocator.h"
19 #include "dd/dditems/figures/ddTableFigure.h"
20 
ddAddFkLocator()21 ddAddFkLocator::ddAddFkLocator()
22 {
23 }
24 
~ddAddFkLocator()25 ddAddFkLocator::~ddAddFkLocator()
26 {
27 }
28 
locate(int posIdx,hdIFigure * owner)29 hdPoint &ddAddFkLocator::locate(int posIdx, hdIFigure *owner)
30 {
31 	if(owner)
32 	{
33 		ddTableFigure *table = (ddTableFigure *) owner;
34 		locatePoint.x = table->getTitleRect().GetBottomRight(posIdx).x - 10;
35 		locatePoint.y = table->getTitleRect().GetBottomRight(posIdx).y - 9;
36 		return locatePoint;
37 	}
38 	locatePoint.x = 0;
39 	locatePoint.y = 0;
40 	return locatePoint;
41 }
42