home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / rexx / library2 / gbmrexx / scroll.h < prev    next >
C/C++ Source or Header  |  1993-01-15  |  3KB  |  77 lines

  1. /*
  2.  
  3. SCROLL.H  Interface to Scroller control
  4.  
  5. (C) 14/1/93 IBM, by A.Key
  6.  
  7. The scroller control has a class name of WC_SCROLL.
  8. It consists of a window with a horizontal and/or vertical scrollbar(s).
  9. You create another window with the scroller as its owner and parent.
  10. The scroller arranges to position the child window in such a way as to
  11. show the part selected by the scroll bar(s).
  12.  
  13. Notifying the scroller :-
  14.     After creating/destroying the child window you must use SCM_CHILD.
  15.     After changing the size of the child window you must use SCM_SIZE.
  16.  
  17. The scrollbars will be created depending on the SCS_HSCROLL and SCS_VSCROLL
  18. window style flags. The assumption is that the child window can repaint itself
  19. as fast as it is moved interactively by the scrollbars. If this is not true,
  20. the SCS_HSLOW and SCS_VSLOW styles may be used to make the slider only move
  21. the child when the scrollbars reach their final position.
  22.  
  23. When the page up/down/left/right keys are used the scrollbars will by default
  24. attempt to move one tenth of their total range. This can be overridden by
  25. adding the SCS_HPAGE and SCS_VPAGE styles. In this case you are notified using
  26. SCN_HPAGE and SCN_VPAGE, when you should return the step to use. The range of
  27. the scrollbar and the amount visible at any one time are supplied in mp2.
  28.  
  29. If the child is so small it will not cover the area of the scroller window,
  30. the scrollbars are disabled. By default the child is positioned at the
  31. bottom left of the scroller. This can be overridden using the SCS_HCENTRE and
  32. SCS_VCENTRE window styles.
  33.  
  34. The scrollbars will be created with window ID's of SCID_HSCROLL and
  35. SCID_VSCROLL, so you can use WinWindowFromID(hwndScroller, SCID_HSCROLL) etc.
  36.  
  37. How to get/and set colours :-
  38.  
  39.     WinSendMsg(hwnd, SCM_SETCOLORS, MPFROMP(&sccols), NULL);
  40.     WinSendMsg(hwnd, SCM_QUERYCOLORS, MPFROMP(&sccols), NULL);
  41.  
  42. */
  43.  
  44. #define    WC_SCROLL    "AutoScroller"    /* Name of window class              */
  45.  
  46. #define    SCS_HSCROLL    0x0001L        /* Has a left/right slider           */
  47. #define    SCS_VSCROLL    0x0002L        /* Has an up/down slider             */
  48. #define    SCS_HSLOW    0x0004L        /* Move only occurs after horz slide */
  49. #define    SCS_VSLOW    0x0008L        /* Move only occurs after vert slide */
  50. #define    SCS_HPAGE    0x0010L        /* Ask owner for page width          */
  51. #define    SCS_VPAGE    0x0020L        /* Ask owner for page height         */
  52. #define    SCS_HCENTRE    0x0040L        /* When not wide, centre widthways   */
  53. #define    SCS_VCENTRE    0x0080L        /* When not tall, centre heightways  */
  54.  
  55. #define    SCM_CHILD     WM_USER    /* mp1=hwndChild or NULL             */
  56. #define    SCM_SIZE    (WM_USER+1)    /* Nothing passed in                 */
  57. #define    SCM_SETCOLORS    (WM_USER+2)    /* Set colors used by control        */
  58. #define    SCM_QUERYCOLORS    (WM_USER+3)    /* Query colors used by control      */
  59.  
  60. #define    SCN_HPAGE    1        /* mp2=MPFROM2SHORT(cxRange,cxPage)  */
  61. #define    SCN_VPAGE    2        /* mp2=MPFROM2SHORT(cyRange,cyPage)  */
  62.  
  63. #define    SCID_HSCROLL    1        /* Horizontal bar will have this ID  */
  64. #define    SCID_VSCROLL    2        /* Vertical bar will have this ID    */
  65. #define    SCID_SQUARE    3        /* The static square in the corner   */
  66.  
  67. typedef struct _SCROLLCOLORS /* sccols */
  68.     {
  69.     LONG lColorBlank;
  70.     } SCROLLCOLORS;
  71.  
  72. #ifndef _SCROLL_
  73.  
  74. extern BOOL _System RegisterScrollClass(HAB hab);
  75.  
  76. #endif
  77.