pgadmin3/hotdraw/handles/hdIHandle.cpp
2020-07-07 22:19:12 +05:00

47 lines
984 B
C++

//////////////////////////////////////////////////////////////////////////
//
// pgAdmin III - PostgreSQL Tools
//
// Copyright (C) 2002 - 2016, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
// hdIHandle.cpp - Base class for all Handles
//
//////////////////////////////////////////////////////////////////////////
#include "pgAdmin3.h"
// wxWindows headers
#include <wx/wx.h>
// App headers
#include "hotdraw/handles/hdIHandle.h"
#include "hotdraw/utilities/hdPoint.h"
hdIHandle::hdIHandle(hdIFigure *owner)
{
figureOwner = owner;
}
hdIHandle::~hdIHandle()
{
}
hdIFigure *hdIHandle::getOwner()
{
return figureOwner;
}
hdRect &hdIHandle::getDisplayBox(int posIdx)
{
hdPoint p = locate(posIdx);
displayBox.width = 0;
displayBox.height = 0;
displayBox.SetPosition(p);
displayBox.Inflate(size, size);
return displayBox;
}
bool hdIHandle::containsPoint(int posIdx, int x, int y)
{
return getDisplayBox(posIdx).Contains(x, y);
}