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 // ddScrollBarHandle.h - A handle for a table figure that allow to scroll it when table is not in full size
9 //
10 //////////////////////////////////////////////////////////////////////////
11 
12 #ifndef DDSCROLLBARHANDLE_H
13 #define DDSCROLLBARHANDLE_H
14 
15 #include "hotdraw/handles/hdIHandle.h"
16 #include "hotdraw/handles/hdLocatorHandle.h"
17 #include "hotdraw/utilities/hdRect.h"
18 #include "hotdraw/utilities/hdPoint.h"
19 #include "dd/dditems/figures/ddTableFigure.h"
20 
21 
22 class ddScrollBarHandle : public hdLocatorHandle
23 {
24 public:
25 	ddScrollBarHandle(ddTableFigure *owner, hdILocator *scrollBarLocator , wxSize &size);
26 	~ddScrollBarHandle();
27 
28 
29 	virtual void draw(wxBufferedDC &context, hdDrawingView *view);
30 	virtual hdPoint &locate(int posIdx);
31 	virtual wxCursor createCursor();
32 	virtual void invokeStart(hdMouseEvent &event, hdDrawingView *view);
33 	virtual void invokeStep(hdMouseEvent &event, hdDrawingView *view);
34 	virtual void invokeEnd(hdMouseEvent &event, hdDrawingView *view);
35 	virtual hdRect &getDisplayBox(int posIdx);
36 protected:
37 private:
38 	hdPoint pointLocate;
39 	hdILocator *scrollLocator;
40 	ddTableFigure *table;
41 	wxBitmap upBitmap, downBitmap;
42 	wxSize barSize;
43 	int anchorY;
44 
45 };
46 #endif
47