ultimatepp/bazaar/CtrlPos/CtrlPos.h
kohait 0e787eb5f6 bazaar: AutoScroller scope simplification, CtrlFinder filter bugfix, CtrlPos: filter bugfix and SPACE key deselection
git-svn-id: svn://ultimatepp.org/upp/trunk@3859 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2011-09-13 16:45:17 +00:00

57 lines
1.4 KiB
C++

#ifndef _CtrlPos_CtrlPos_h_
#define _CtrlPos_CtrlPos_h_
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#include <RectCtrl/RectCtrl.h>
#include <LogPosCtrl/LogPosCtrl.h>
#include <CtrlFinder/CtrlFinder.h>
//for some helpers
#include <CtrlMover/CtrlMover.h>
class CtrlPos : public CtrlFinder
{
public:
typedef CtrlPos CLASSNAME;
typedef CtrlFinder V;
enum
{
NEST = 0x100,
};
CtrlPos();
virtual void Paint(Draw& w);
virtual void LeftDown(Point p, dword keyflags);
virtual void MouseMove(Point p, dword keyflags);
virtual void LeftUp(Point p, dword keyflags);
virtual void RightDown(Point p, dword keyflags);
virtual void MouseWheel(Point p, int zdelta, dword keyflags);
virtual void LeftDouble(Point p, dword flags);
virtual bool Key(dword key, int count);
virtual void Updated();
virtual Rect GetVoidRect() const { return Ctrl::GetVoidRect(); }
void SetStyle(const RectCtrl::Style& s) { style = &s; Refresh(); }
static void DrawAlignHandle(Draw& w, const Rect& _r, const Rect& r, const Ctrl::LogPos& pos, const Color& col);
static bool GetAlignMode(const Rect& _r, const Rect& r, const Point& pp, Ctrl::LogPos& pos, int handsize);
void DrawHintFrame(Draw& w, const Ctrl& g, const Ctrl& q, const Color& hintcol);
Callback WhenLeftDouble;
protected:
const RectCtrl::Style* style;
Point g;
Point xp;
Ctrl::LogPos xpos;
int mode;
bool pressed;
bool moving;
Image ci;
};
#endif