ASCROLL.H 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //===========================================================================//
  2. // Copyright (C) Microsoft Corporation. All rights reserved. //
  3. //===========================================================================//
  4. #ifndef ASCROLL_H
  5. #define ASCROLL_H
  6. #include "aSystem.h"
  7. #include "aButton.h"
  8. class mcScrollButton : public aAnimButton
  9. {
  10. public:
  11. virtual void render();
  12. unsigned long lightEdge;
  13. unsigned long darkEdge;
  14. unsigned long regularColor;
  15. };
  16. class aScrollBar : public aObject
  17. {
  18. public:
  19. aScrollBar();
  20. virtual long init(long xPos, long yPos, long w, long h);
  21. virtual void destroy();
  22. virtual void update();
  23. virtual void render();
  24. virtual int handleMessage( unsigned long message, unsigned long fromWho );
  25. void SetScrollMax(float newMax);
  26. void SetScrollPos(float newPos);
  27. float GetScrollMax(void){return scrollMax;};
  28. float GetScrollPos(void){return scrollPos;};
  29. long SetSrollInc( long newInc ){ scrollInc = newInc; } // amount you move for one arrow click
  30. long SetScrollPage(long newInc){ pageInc = newInc;} // amount you move if you click on the bar itself
  31. void ScrollUp(void);
  32. void ScrollPageUp(void);
  33. void ScrollDown(void);
  34. void ScrollPageDown(void);
  35. void SetScroll( long newScrollPos );
  36. void Enable( bool enable );
  37. protected:
  38. float scrollMax;
  39. float scrollPos;
  40. aAnimButton topButton;
  41. aAnimButton bottomButton;
  42. mcScrollButton scrollTab;
  43. long lastY;
  44. long scrollInc;
  45. long pageInc;
  46. unsigned long color;
  47. void ResizeAreas(void);
  48. };
  49. class mcScrollBar : public aScrollBar
  50. {
  51. public:
  52. long init ( long xPos, long yPos, long w, long h );
  53. virtual void resize(long w, long h);
  54. void setOrange();
  55. void setGreen();
  56. private:
  57. aAnimation orangeInfo[4];
  58. aAnimation greenInfo[4];
  59. };
  60. #endif