This repository has been archived on 2023-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
MyGameFramework/lib/gwen/controls/gwen_dragger.h
Gered c5cdddbeaa initial commit
current versions of all of my basic framework sources, build configurations/scripts, and supporting assets
2013-01-31 12:53:05 -05:00

53 lines
1 KiB
C++

/*
GWEN
Copyright (c) 2010 Facepunch Studios
See license in Gwen.h
*/
#pragma once
#ifndef GWEN_CONTROLS_DRAGGER_H
#define GWEN_CONTROLS_DRAGGER_H
#include "gwen_base.h"
#include "../gwen.h"
#include "../gwen_skin.h"
namespace Gwen
{
namespace ControlsInternal
{
class GWEN_EXPORT Dragger : public Controls::Base
{
public:
GWEN_CONTROL( Dragger, Controls::Base );
virtual void OnMouseMoved( int x, int y, int deltaX, int deltaY );
virtual void OnMouseClickLeft( int x, int y, bool bDown );
virtual void Render( Skin::Base* skin );
virtual void SetTarget( Controls::Base* pBase ){ m_pTarget = pBase; }
virtual bool IsDepressed(){ return m_bDepressed; }
virtual void SetDoMove( bool b ){ m_bDoMove = b; }
virtual void OnMouseDoubleClickLeft( int x, int y );
Gwen::Event::Caller onDragged;
Gwen::Event::Caller onDragStart;
Gwen::Event::Caller onDoubleClickLeft;
protected:
bool m_bDepressed;
Gwen::Point m_HoldPos;
Controls::Base* m_pTarget;
bool m_bDoMove;
};
}
}
#endif