00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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__