Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages
csscrbar.h
Go to the documentation of this file.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 __CS_CSSCRBAR_H__ 00021 #define __CS_CSSCRBAR_H__ 00022 00031 #include "csextern.h" 00032 00033 #include "cscomp.h" 00034 #include "csbutton.h" 00035 #include "cstimer.h" 00036 00038 #define CSSB_DEFAULTSIZE (3+3+9) 00039 00041 enum csScrollBarFrameStyle 00042 { 00044 cssfsThickRect, 00046 cssfsThinRect 00047 }; 00048 00050 struct csScrollBarStatus 00051 { 00053 int value, maxvalue; 00055 int size, maxsize; 00057 int step, pagestep; 00058 }; 00059 00061 enum 00062 { 00070 cscmdScrollBarSet = 0x00000600, 00078 cscmdScrollBarGetStatus, 00085 cscmdScrollBarValueChanged, 00092 cscmdScrollBarQueryValue, 00099 cscmdScrollBarSetValue 00100 }; 00101 00112 class CS_CSWS_EXPORT csScrollBar : public csComponent 00113 { 00115 csScrollBarFrameStyle FrameStyle; 00117 csButton *topleft, *botright, *scroller; 00119 csTimer *timer; 00121 int active_button; 00123 bool IsHorizontal; 00125 bool TrackScroller; 00127 int scrollerdx, scrollerdy; 00129 int activepixlen; 00131 static csPixmap *sprarrows[12]; 00133 static csPixmap *sprscroller[2]; 00135 csScrollBarStatus status; 00136 00137 public: 00139 csScrollBar (csComponent *iParent, csScrollBarFrameStyle iFrameStyle = cssfsThickRect); 00140 00142 virtual ~csScrollBar (); 00143 00145 virtual bool HandleEvent (iEvent &Event); 00146 00148 virtual bool SetRect (int xmin, int ymin, int xmax, int ymax); 00149 00151 virtual void SetState (int mask, bool enable); 00152 00157 00158 csScrollBarFrameStyle GetFrameStyle() 00159 { return FrameStyle; } 00160 00162 int GetActiveButton() 00163 { return active_button; } 00164 00166 bool GetIsHorizontal() 00167 { return IsHorizontal; } 00168 00170 csButton *GetScroller() 00171 { return scroller; } 00172 00174 csButton *GetTopLeft() 00175 { return topleft; } 00176 00178 csButton *GetBotRight() 00179 { return botright; } 00180 00182 virtual char *GetSkinName () 00183 { return "ScrollBar"; } 00184 00185 protected: 00187 void SetValue (int iValue); 00188 }; 00189 00192 #endif // __CS_CSSCRBAR_H__
Generated for Crystal Space by doxygen 1.3.9.1