Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.8 KiB

//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============
9 years ago
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#pragma once
#ifndef VGUI_SLIDER2_H
4 years ago
#define VGUI_SLIDER2_H
9 years ago
#include <VGUI.h>
#include <VGUI_Panel.h>
#include <VGUI_Dar.h>
9 years ago
namespace vgui
{
enum MouseCode;
class IntChangeSignal;
class VGUIAPI Slider2 : public Panel
{
bool _vertical;
bool _dragging;
int _nobPos[2];
int _nobDragStartPos[2];
int _dragStartPos[2];
Dar<IntChangeSignal*> _intChangeSignalDar;
int _range[2];
int _value;
int _rangeWindow;
bool _rangeWindowEnabled;
int _buttonOffset;
public:
Slider2( int x, int y, int wide, int tall, bool vertical );
virtual void setValue( int value );
9 years ago
virtual int getValue();
virtual bool isVertical();
virtual void addIntChangeSignal( IntChangeSignal *s );
virtual void setRange( int min, int max );
virtual void getRange( int &min, int &max );
virtual void setRangeWindow( int rangeWindow );
virtual void setRangeWindowEnabled( bool state );
virtual void setSize( int wide, int tall );
virtual void getNobPos( int &min, int &max );
9 years ago
virtual bool hasFullRange();
virtual void setButtonOffset( int buttonOffset );
9 years ago
private:
virtual void recomputeNobPosFromValue();
virtual void recomputeValueFromNobPos();
public: // bullshit public
virtual void privateCursorMoved( int x, int y, Panel *panel );
virtual void privateMousePressed( MouseCode code, Panel *panel );
virtual void privateMouseReleased( MouseCode code, Panel *panel );
9 years ago
protected:
virtual void fireIntChangeSignal();
9 years ago
virtual void paintBackground();
};
}
9 years ago
#endif // VGUI_SLIDER2_H