123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463 |
- #ifndef __SCRLBKGWND_H
- #define __SCRLBKGWND_H
- #include <tataki/canvas/canvas.h>
- #include <tataki/bitmap/autobitmap.h>
- #include <api/wnd/wndclass/labelwnd.h>
- #include <api/wnd/wndclass/scrollbar.h>
- #include <api/wnd/wndclass/sepwnd.h>
- #define SCRLBKGWND_PARENT LabelWnd
- /**
- Class
- @short
- @author Nullsoft
- @ver 1.0
- @see
- */
- class ScrlBkgWnd : public SCRLBKGWND_PARENT {
- protected:
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- ScrlBkgWnd();
- public:
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual ~ScrlBkgWnd();
-
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int onInit();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int onPaint(Canvas *c);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual void drawBackground(Canvas *canvas);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int onEraseBkgnd(HDC dc);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int childNotify(ifc_window *child, int msg, intptr_t param1, intptr_t param2);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int onResize();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual void getClientRect(RECT *r);
- // virtual void getNonClientRect(RECT *r);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int getHeaderHeight();
- virtual void timerCallback (int id);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual void onHScrollToggle(int set);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual void onVScrollToggle(int set);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual void onSetVisible(int show);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int wantHScroll() { return 1; }
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int wantVScroll() { return 1; }
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void makeWindowOverlayMask(api_region *r);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- SkinBitmap *getBgBitmap(void);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void setBgBitmap(const wchar_t *b);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void setBgColor(ARGB32 rgb);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual ARGB32 getBgColor(void);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int getContentsWidth(); // not safe to call getclientrect!
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual int getContentsHeight(); // not safe to call getclientrect!
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void setLineHeight(int h);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int getLinesPerPage();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int getScrollX();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int getScrollY();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int getScrollbarWidth();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual void scrollToY(int y, int signal=TRUE);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- virtual void scrollToX(int x, int signal=TRUE);
- protected:
- virtual void onScrollY(int y) { }
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void setSlidersPosition();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int needDoubleBuffer();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- bool needHScroll();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- bool needVScroll();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int getMaxScrollY();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- int getMaxScrollX();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void updateScrollY(bool smooth=false);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void updateScrollX(bool smooth=false);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void smoothScrollToY(int y);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void smoothScrollToX(int x);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void updateVScroll(int y);
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void updateHScroll(int x);
- AutoSkinBitmap bmp;
-
- int dbbuffer;
- bool inDestroy;
- ScrollBar hScroll;
- ScrollBar vScroll;
- SepWnd hSep;
- SepWnd vSep;
- ARGB32 bgColor;
- int scrollX;
- int scrollY;
- bool needSetSliders;
- bool wantsep;
- bool wantTileBg;
- int lineHeight;
- float smoothScrollYInc, smoothScrollXInc;
- float smoothScrollYCur, smoothScrollXCur;
- int smoothScrollYTimerCount, smoothScrollXTimerCount;
- int smoothYTimer, smoothXTimer;
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void killSmoothYTimer();
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void killSmoothXTimer();
- double lastratio;
- RECT smsqr;
-
- /**
- Method
-
- @see
- @ret
- @param
- */
- void _setSlidersPosition();
- int in_set_slider_position;
- };
- #endif
|