123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423 |
- #ifndef __SCROLLBAR_H
- #define __SCROLLBAR_H
- #include <api/wnd/virtualwnd.h>
- #include <tataki/region/region.h>
- #include <api/wnd/usermsg.h>
- #include <tataki/bitmap/autobitmap.h>
- #define SCROLLBAR_FULL 65535
- #define POS_NONE 0
- #define POS_LEFT 1
- #define POS_BUTTON 2
- #define POS_RIGHT 3
- #define PAGE_NONE 0
- #define PAGE_DOWN 1
- #define PAGE_UP 2
- #define DEFAULT_HEIGHT 16
- #define SCROLLBAR_PARENT VirtualWnd
- /**
- Class
- @short
- @author Nullsoft
- @ver 1.0
- @see
- */
- class ScrollBar : public SCROLLBAR_PARENT {
- public:
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- ScrollBar();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual ~ScrollBar();
- virtual int onMouseMove (int x, int y);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int onLeftButtonDown(int x, int y);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int onLeftButtonUp(int x, int y);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int onRightButtonDown(int x, int y);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int onRightButtonUp(int x, int y);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int onMouseWheelUp(int clicked, int lines);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int onMouseWheelDown(int clicked, int lines);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int onPaint(Canvas *canvas);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int onResize();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int onInit();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual void timerCallback(int id);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int wantDoubleClicks() { return 0; };
-
- virtual int onSetPosition(bool smooth=false);
- virtual int onSetFinalPosition();
- void setBitmaps(wchar_t *left, wchar_t *lpressed, wchar_t *lhilite,
- wchar_t *right, wchar_t *rpressed, wchar_t *rhilite,
- wchar_t *button, wchar_t *bpressed, wchar_t *bhilite);
-
- void setBackgroundBitmaps(const wchar_t *left, const wchar_t *middle, const wchar_t *right);
- void setPosition(int pos);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int getPosition();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int getHeight();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void setHeight(int newheight);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void setNPages(int n);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void gotoPage(int n);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void setUpDownValue(int newupdown);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void setVertical(bool isvertical);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int getWidth();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual void freeResources();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual void reloadResources();
- private:
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void deleteResources();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int getMousePosition();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void calcOverlapping();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void calcXPosition();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void calcPosition();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void handlePageUpDown();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int checkPageUpDown();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void handleUpDown();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int checkUpDown();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int pageUp();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int pageDown();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int upDown(int which);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void setPrivatePosition(int pos, bool signal=true, bool smooth=false);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void loadBmps();
- AutoSkinBitmap bmpleft, bmplpressed, bmplhilite,
- bmpright, bmprpressed, bmprhilite,
- bmpbutton, bmpbpressed, bmpbhilite,
- bmpbackgroundleft, bmpbackgroundmiddle, bmpbackgroundright;
- RegionI *leftrgn, *rightrgn, *buttonrgn;
- int position;
- int moving;
- int lefting;
- int righting;
- int clicked;
- int buttonx;
- int curmouseposition;
- int clickmouseposition;
- int height;
- int shiftleft, shiftright;
- POINT clickpos;
- int clickbuttonx;
- int pageing;
- int firstdelay;
- int timer;
- int npages;
- int pageway;
- int updown;
- int timer2;
- int insetpos;
- int vertical;
- int lastx, lasty;
- };
- #endif
|