My Project
GUISlider.h
1 #pragma once
2 using namespace std;
3 #include "GUIBase.h"
4 namespace ParaEngine
5 {
9  class CGUISlider : public CGUIBase
10  {
11  public:
12  CGUISlider();
13 
14  virtual BOOL ContainsPoint( const POINT &pt );
15  virtual bool CanHaveFocus() { return (m_bIsVisible && m_bIsEnabled); }
16 
17  virtual void UpdateRects();
18  virtual void InitObject(const char * strObjectName, const char * alignment, int x, int y, int width, int height);
19 
20  virtual HRESULT Render(GUIState* pGUIState,float fElapsedTime);
21  virtual bool OnChange(const char* code=NULL);
22 
23  virtual IObject* Clone()const;
24  virtual void Clone(IObject *pobj)const;
25  static void StaticInit();
26 
27  //virtual bool MsgProc(CGUIEvent *event=NULL);
28  virtual bool MsgProc(MSG* event);
29 
30  void SetValue( int nValue );
31  int GetValue() const { return m_nValue; };
32 
33  void GetRange( int &nMin, int &nMax ) const { nMin = m_nMin; nMax = m_nMax; }
34  void SetRange( int nMin, int nMax );
35 
36  void SetLinkedObject(CGUIBase* obj){m_Linked=obj;}
37  virtual const IType* GetType()const{return m_type;}
38 
39  protected:
40  static const IType* m_type;
41  void SetValueInternal( int nValue );
42  int ValueFromPos( int x );
43 
44  int m_nValue;
45 
46  int m_nMin;
47  int m_nMax;
48 
49  int m_nDragX; // Mouse position at start of drag
50  int m_nDragOffset; // Drag offset from the center of the button
51  int m_nButtonX;
52 
53  bool m_bPressed;
54  CGUIBase* m_Linked;
55  private:
56  int m_nOldValue;
57  };
58 }
Definition: GUISlider.h:9
IType is for type information and validating It contains type information of an object.
Definition: Type.h:75
Definition: EventBinding.h:22
different physics engine has different winding order.
Definition: EventBinding.h:32
Definition: PEtypes.h:116
base object for all 2D GUI objects (1) 2D GUI object are not tested against view frustum, instead it is controlled by visibility tag automatically or through user input.
Definition: GUIBase.h:54
base class for object, such as CBaseObject, IAttributeObject, GUI object.
Definition: PERef.h:287
It's used as parameter to Render method of each GUI object.
Definition: GUIState.h:16
Definition: inftrees.h:24