1
//////////////////////////////////////////////////////////////////////////
3
// pgAdmin III - PostgreSQL Tools
4
// RCS-ID: $Id: gqbGraphSimple.h 7758 2009-03-26 20:49:59Z dpage $
5
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
6
// This software is released under the BSD Licence
8
// gqbGraphsimple.h - A simple Implementation of the Graphic Interface for GQB
10
//////////////////////////////////////////////////////////////////////////
12
#ifndef GQBGRAPHSIMPLE_H
13
#define GQBGRAPHSIMPLE_H
15
#include <wx/dcbuffer.h>
18
#include "gqb/gqbQueryObjs.h"
19
#include "gqb/gqbGraphBehavior.h"
21
// Create Array Objects used as base for gqbCollections
22
class gqbGraphSimple : public gqbGraphBehavior
26
void drawTable(wxBufferedDC& bdc, wxPoint *origin, gqbQueryObject *queryTable);
27
void drawTempJoinLine(wxBufferedDC& bdc, wxPoint &origin, wxPoint &end);
28
void calcAnchorPoint(gqbQueryJoin *join);
29
void drawJoin(wxBufferedDC& bdc, wxPoint& origin, wxPoint& dest, wxPoint& anchorUsed, bool selected, type_Join joinKind);
30
void UpdatePosObject(gqbQueryObject *queryTable, int x, int y, int cursorAdjustment);
31
gqbColumn* getColumnAtPosition(wxPoint *clickPoint, gqbQueryObject *queryTable, int sensibility=17);
32
bool clickOnJoin(gqbQueryJoin *join, wxPoint &pt, wxPoint &origin, wxPoint &dest);
33
int getTitleRowHeight();
36
wxFont normalFont, TableTitleFont;
37
wxBrush BackgroundLayer1, BackgroundLayer2, BackgroundTitle, selectedBrush;
38
int minTableWidth, minTableHeight;
39
int rowHeight, rowLeftMargin, rowRightMargin, rowTopMargin, lineClickThreshold;
41
wxBitmap imgSelBoxEmpty,imgSelBoxSelected;
42
bool insideLine(wxPoint &pt, wxPoint &p1, wxPoint &p2, int threshold);
43
double distanceToLine(wxPoint pt, wxPoint p1, wxPoint p2);
44
wxPoint findLineMiddle(wxPoint p1, wxPoint p2);