File: gqbGraphSimple.h

package info (click to toggle)
pgadmin3 1.20.0~beta2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 73,704 kB
  • ctags: 18,591
  • sloc: cpp: 193,786; ansic: 18,736; sh: 5,154; pascal: 1,120; yacc: 927; makefile: 516; lex: 421; xml: 126; perl: 40
file content (46 lines) | stat: -rw-r--r-- 1,794 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//////////////////////////////////////////////////////////////////////////
//
// pgAdmin III - PostgreSQL Tools
//
// Copyright (C) 2002 - 2014, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
// gqbGraphsimple.h - A simple Implementation of the Graphic Interface for GQB
//
//////////////////////////////////////////////////////////////////////////

#ifndef GQBGRAPHSIMPLE_H
#define GQBGRAPHSIMPLE_H

#include <wx/dcbuffer.h>

// App headers
#include "gqb/gqbQueryObjs.h"
#include "gqb/gqbGraphBehavior.h"

// Create Array Objects used as base for gqbCollections
class gqbGraphSimple : public gqbGraphBehavior
{
public:
	gqbGraphSimple();
	void drawTable(wxMemoryDC &bdc, wxPoint *origin, gqbQueryObject *queryTable);
	void drawTempJoinLine(wxMemoryDC &bdc, wxPoint &origin, wxPoint &end);
	void calcAnchorPoint(gqbQueryJoin *join);
	void drawJoin(wxMemoryDC &bdc, wxPoint &origin, wxPoint &dest, wxPoint &anchorUsed, bool selected, type_Join joinKind);
	void UpdatePosObject(gqbQueryObject *queryTable, int x, int y, int cursorAdjustment);
	gqbColumn *getColumnAtPosition(wxPoint *clickPoint, gqbQueryObject *queryTable, int sensibility = 17);
	bool clickOnJoin(gqbQueryJoin *join, wxPoint &pt, wxPoint &origin, wxPoint &dest);
	int getTitleRowHeight();

private:
	wxFont normalFont, TableTitleFont;
	wxBrush BackgroundLayer1, BackgroundLayer2, BackgroundTitle, selectedBrush;
	int minTableWidth, minTableHeight;
	int rowHeight, rowLeftMargin, rowRightMargin, rowTopMargin, lineClickThreshold;
	wxPen selectedPen;
	wxBitmap imgSelBoxEmpty, imgSelBoxSelected;
	bool insideLine(wxPoint &pt, wxPoint &p1, wxPoint &p2, int threshold);
	double distanceToLine(wxPoint pt, wxPoint p1, wxPoint p2);
	wxPoint findLineMiddle(wxPoint p1, wxPoint p2);
};
#endif