Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CATGUI/CATSlider.h Source File

CATSlider.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 /// \file CATSlider.h
00003 /// \brief Slider control for GUI
00004 /// \ingroup CATGUI
00005 ///
00006 /// Copyright (c) 2003-2008 by Michael Ellison.
00007 /// See COPYING.txt for the \ref gaslicense License (MIT License).
00008 ///
00009 // $Author: mikeellison $
00010 // $Date: 2008-01-24 06:27:32 -0600 (Thu, 24 Jan 2008) $
00011 // $Revision:   $
00012 // $NoKeywords: $
00013 //
00014 //
00015 //---------------------------------------------------------------------------
00016 #ifndef _GGSlider_H_
00017 #define _GGSlider_H_
00018 
00019 #include "CATControl.h"
00020 
00021 class CATSlider;
00022 class CATFilter;
00023 
00024 enum CATSLIDER_STYLE
00025 {
00026     CATSLIDER_VERTICAL,
00027     CATSLIDER_HORIZONTAL
00028 };
00029 
00030 /// \class CATSlider CATSlider.h
00031 /// \brief Slider control for GUI
00032 /// \ingroup CATGUI
00033 class CATSlider : public CATControl
00034 {
00035 public:
00036     /// CATSlider constructor (inherited from CATControl->CATXMLObject)
00037     /// \param element - Type name ("Button")
00038     /// \param attribs - attribute information for the window
00039     /// \param parent - parent XML object (should be a "Window" element)
00040     /// \param rootDir - root directory of skin
00041     CATSlider(     const CATString&             element, 
00042         const CATString&             rootDir);
00043 
00044     virtual ~CATSlider();          
00045     // Tracked mouse events - only called when the control is initially pressed
00046     virtual void   TrackMouseMove(const CATPOINT& point, bool leftButton, CATMODKEY modKey);
00047     virtual void   TrackMouseDown(const CATPOINT& point, CATMODKEY modKey);      
00048     virtual void   TrackMouseRelease(const CATPOINT& point, CATMODKEY modKey);      
00049 
00050     // Mouse wheel over control, but not already tracked
00051 
00052     virtual void         OnMouseWheel(  const CATPOINT& point,
00053         CATFloat32        wheelMove,
00054         CATMODKEY           modKey);
00055 
00056     virtual void   OnKeyDown(const CATKeystroke& keystroke);
00057     virtual void   OnKeyPress(const CATKeystroke& keystroke);
00058     virtual void   Draw(CATImage* image, const CATRect& dirtyRect);      
00059 
00060     /// Load() loads the skin in
00061     virtual        CATResult Load(  CATPROGRESSCB               progressCB   = 0,
00062         void*                           progressParam= 0,
00063         CATFloat32                      progMin      = 0.0f,
00064         CATFloat32                      progMax      = 1.0f);
00065 
00066     /// Slider styles
00067     virtual CATSLIDER_STYLE  GetSliderStyle();
00068     virtual void            SetSliderStyle(CATSLIDER_STYLE style);
00069 
00070     virtual CATString GetHint() const;
00071 
00072     /// OnMouseDoubleClick() is called the mouse is double clicked.
00073     ///
00074     /// \param modKey - Key state modifiers for ctrl/shift/alt/etc.
00075     virtual void         OnMouseDoubleClick(  CATMODKEY modKey);
00076 
00077     virtual void   TrackMouseTimer(CATMODKEY modKey);
00078 
00079 #ifdef _WIN32
00080     virtual CATUInt32     GetAccessRole() {return CAT_ROLE_SYSTEM_SLIDER;}
00081 #endif //_WIN32
00082 
00083 protected:      
00084     /// ParseAttributes() parses the known attributes for an object.
00085     virtual CATResult ParseAttributes();
00086 
00087     CATSLIDER_STYLE fSliderStyle;
00088     bool           fCommandTrack;
00089     CATImage*       fImageSlide;
00090     CATImage*       fImageSlideDisabled;
00091     CATImage*       fImageSlideFocus;
00092     CATImage*       fImageOn;
00093     CATInt32         fSlideOffset;
00094     CATVALUE_TYPE   fValueType;
00095     CATFloat32          fLastTarget;
00096 };
00097 
00098 #endif // _GGSlider_H_
00099 
00100 

Generated on Mon Feb 11 04:09:56 2008 for Game Accessibility Suite by doxygen 1.5.4