csws/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 "cscomp.h" 00032 #include "csbutton.h" 00033 #include "cstimer.h" 00034 00036 #define CSSB_DEFAULTSIZE (3+3+9) 00037 00039 enum csScrollBarFrameStyle 00040 { 00042 cssfsThickRect, 00044 cssfsThinRect 00045 }; 00046 00048 struct csScrollBarStatus 00049 { 00051 int value, maxvalue; 00053 int size, maxsize; 00055 int step, pagestep; 00056 }; 00057 00059 enum 00060 { 00068 cscmdScrollBarSet = 0x00000600, 00076 cscmdScrollBarGetStatus, 00083 cscmdScrollBarValueChanged, 00090 cscmdScrollBarQueryValue, 00097 cscmdScrollBarSetValue 00098 }; 00099 00110 class csScrollBar : public csComponent 00111 { 00113 csScrollBarFrameStyle FrameStyle; 00115 csButton *topleft, *botright, *scroller; 00117 csTimer *timer; 00119 int active_button; 00121 bool IsHorizontal; 00123 bool TrackScroller; 00125 int scrollerdx, scrollerdy; 00127 int activepixlen; 00129 static csPixmap *sprarrows[12]; 00131 static csPixmap *sprscroller[2]; 00133 csScrollBarStatus status; 00134 00135 public: 00137 csScrollBar (csComponent *iParent, csScrollBarFrameStyle iFrameStyle = cssfsThickRect); 00138 00140 virtual ~csScrollBar (); 00141 00143 virtual bool HandleEvent (iEvent &Event); 00144 00146 virtual bool SetRect (int xmin, int ymin, int xmax, int ymax); 00147 00149 virtual void SetState (int mask, bool enable); 00150 00155 00156 csScrollBarFrameStyle GetFrameStyle() 00157 { return FrameStyle; } 00158 00160 int GetActiveButton() 00161 { return active_button; } 00162 00164 bool GetIsHorizontal() 00165 { return IsHorizontal; } 00166 00168 csButton *GetScroller() 00169 { return scroller; } 00170 00172 csButton *GetTopLeft() 00173 { return topleft; } 00174 00176 csButton *GetBotRight() 00177 { return botright; } 00178 00180 virtual char *GetSkinName () 00181 { return "ScrollBar"; } 00182 00183 protected: 00185 void SetValue (int iValue); 00186 }; 00187 00190 #endif // __CS_CSSCRBAR_H__
Generated for Crystal Space by doxygen 1.2.18