Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csscrbar.h

00001 /*
00002     Crystal Space Windowing System: scroll bar class
00003     Copyright (C) 1998,1999 by Andrew Zabolotny <bit@eltech.ru>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 #ifndef __CSSCRBAR_H__
00021 #define __CSSCRBAR_H__
00022 
00023 #include "cscomp.h"
00024 #include "csbutton.h"
00025 #include "cstimer.h"
00026 
00028 #define CSSB_DEFAULTSIZE        (3+3+9)
00029 
00031 enum csScrollBarFrameStyle
00032 {
00034   cssfsThickRect,
00036   cssfsThinRect
00037 };
00038 
00040 struct csScrollBarStatus
00041 {
00043   int value, maxvalue;
00045   int size, maxsize;
00047   int step, pagestep;
00048 };
00049 
00051 enum
00052 {
00060   cscmdScrollBarSet = 0x00000600,
00068   cscmdScrollBarGetStatus,
00075   cscmdScrollBarValueChanged,
00082   cscmdScrollBarQueryValue,
00089   cscmdScrollBarSetValue
00090 };
00091 
00102 class csScrollBar : public csComponent
00103 {
00105   csScrollBarFrameStyle FrameStyle;
00107   csButton *topleft, *botright, *scroller;
00109   csTimer *timer;
00111   int active_button;
00113   bool IsHorizontal;
00115   bool TrackScroller;
00117   int scrollerdx, scrollerdy;
00119   int activepixlen;
00121   static csPixmap *sprarrows[12];
00123   static csPixmap *sprscroller[2];
00125   csScrollBarStatus status;
00126 
00127 public:
00129   csScrollBar (csComponent *iParent, csScrollBarFrameStyle iFrameStyle = cssfsThickRect);
00130 
00132   virtual ~csScrollBar ();
00133 
00135   virtual bool HandleEvent (iEvent &Event);
00136 
00138   virtual bool SetRect (int xmin, int ymin, int xmax, int ymax);
00139 
00141   virtual void SetState (int mask, bool enable);
00142 
00147 
00148   csScrollBarFrameStyle GetFrameStyle()
00149   { return FrameStyle; }
00150 
00152   int GetActiveButton()
00153   { return active_button; }
00154 
00156   bool GetIsHorizontal()
00157   { return IsHorizontal; }
00158 
00160   csButton *GetScroller()
00161   { return scroller; }
00162 
00164   csButton *GetTopLeft()
00165   { return topleft; }
00166 
00168   csButton *GetBotRight()
00169   { return botright; }
00170 
00172   virtual char *GetSkinName ()
00173   { return "ScrollBar"; }
00174 
00175 protected:
00177   void SetValue (int iValue);
00178 };
00179 
00180 #endif // __CSSCRBAR_H__

Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000