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