ultimatepp/bazaar/CtrlPos/CtrlPos.h
kohait 58bb5f1dc7 bazaar: CtrlPos major bugfixes, properly drag controls into others using ALT and changing order using wheel
git-svn-id: svn://ultimatepp.org/upp/trunk@3297 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2011-03-22 18:54:35 +00:00

51 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>
#include <Gen/Gen.h>
//for some helpers
#include <CtrlMover/CtrlMover.h>
class CtrlPos : public CtrlFinder
{
public:
typedef CtrlPos CLASSNAME;
typedef CtrlFinder V;
CtrlPos();
virtual void Clear();
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 State(int reason);
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);
static void DrawHintFrame(Draw& w, const Ctrl& g, const Ctrl& q, const Color& hintcol);
protected:
const RectCtrl::Style* style;
Point g;
Point xp;
Ctrl::LogPos xpos;
int mode;
bool pressed;
bool moving;
Image ci;
};
#endif