BTTNCUR.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:8k
源码类别:

Windows编程

开发平台:

Visual C++

  1. /*
  2.  * BTTNCUR.H
  3.  * Buttons & Cursors
  4.  *
  5.  * Public include file for the Button Images and Cursor DLL,
  6.  * including structures, definitions, and function prototypes.
  7.  *
  8.  * Copyright (c)1992-1995 Microsoft Corporation, All Rights Reserved
  9.  *
  10.  * Kraig Brockschmidt, Microsoft
  11.  * Internet  :  kraigb@microsoft.com
  12.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  13.  */
  14. #ifndef _BTTNCUR_H_
  15. #define _BTTNCUR_H_
  16. #ifdef __cplusplus
  17. extern "C"
  18.     {
  19. #endif
  20. //Standard image bitmap
  21. //WARNING:  Obsolete.  Use the return from UIToolDisplayData
  22. #define IDB_STANDARDIMAGES              400
  23. //New values for display types
  24. #define IDB_STANDARDIMAGESMIN           400
  25. #define IDB_STANDARDIMAGES96            400
  26. #define IDB_STANDARDIMAGES72            401
  27. #define IDB_STANDARDIMAGES120           402
  28. //Image indices inside the standard bitmap.
  29. #define TOOLIMAGE_MIN                   0
  30. #define TOOLIMAGE_EDITCUT               0
  31. #define TOOLIMAGE_EDITCOPY              1
  32. #define TOOLIMAGE_EDITPASTE             2
  33. #define TOOLIMAGE_FILENEW               3
  34. #define TOOLIMAGE_FILEOPEN              4
  35. #define TOOLIMAGE_FILESAVE              5
  36. #define TOOLIMAGE_FILEPRINT             6
  37. #define TOOLIMAGE_HELP                  7
  38. #define TOOLIMAGE_HELPCONTEXT           8
  39. #define TOOLIMAGE_MAX                   8
  40. //Additional Standard Cursors as defined in the UI Design Guide.
  41. #define IDC_NEWUICURSORMIN              500
  42. #define IDC_RIGHTARROW                  500
  43. #define IDC_CONTEXTHELP                 501
  44. #define IDC_MAGNIFY                     502
  45. #define IDC_NODROP                      503
  46. #define IDC_TABLETOP                    504
  47. #define IDC_HSIZEBAR                    505
  48. #define IDC_VSIZEBAR                    506
  49. #define IDC_HSPLITBAR                   507
  50. #define IDC_VSPLITBAR                   508
  51. #define IDC_SMALLARROWS                 509
  52. #define IDC_LARGEARROWS                 510
  53. #define IDC_HARROWS                     511
  54. #define IDC_VARROWS                     512
  55. #define IDC_NESWARROWS                  513
  56. #define IDC_NWSEARROWS                  514
  57. #define IDC_NEWUICURSORMAX              514
  58. //Standard sizes for toolbar buttons and bitmaps on display types
  59. //WARNING:  These are obsolete for version 1.0 compatibility/
  60. #define TOOLBUTTON_STDWIDTH             24
  61. #define TOOLBUTTON_STDHEIGHT            22
  62. #define TOOLBUTTON_STDIMAGEWIDTH        16
  63. #define TOOLBUTTON_STDIMAGEHEIGHT       15
  64. /*
  65.  * Applications can call UIToolDisplayData to get the particular
  66.  * values to use for the current display instead of using these
  67.  * values directly.  However, if the application has the aspect
  68.  * ratio already then these are available for them.
  69.  */
  70. //Sizes for 72 DPI (EGA)
  71. #define TOOLBUTTON_STD72WIDTH           24
  72. #define TOOLBUTTON_STD72HEIGHT          16
  73. #define TOOLBUTTON_STD72IMAGEWIDTH      16
  74. #define TOOLBUTTON_STD72IMAGEHEIGHT     11
  75. //Sizes for 96 DPI (VGA)
  76. #define TOOLBUTTON_STD96WIDTH           24
  77. #define TOOLBUTTON_STD96HEIGHT          22
  78. #define TOOLBUTTON_STD96IMAGEWIDTH      16
  79. #define TOOLBUTTON_STD96IMAGEHEIGHT     15
  80. //Sizes for 120 DPI (8514/a)
  81. #define TOOLBUTTON_STD120WIDTH          32
  82. #define TOOLBUTTON_STD120HEIGHT         31
  83. #define TOOLBUTTON_STD120IMAGEWIDTH     24
  84. #define TOOLBUTTON_STD120IMAGEHEIGHT    23
  85. //Sizes of a standard button bar depending on the display
  86. #define CYBUTTONBAR72                   23
  87. #define CYBUTTONBAR96                   29
  88. #define CYBUTTONBAR120                  38
  89. /*
  90.  * The low-word of the state contains the display state where each
  91.  * value is mutually exclusive and contains one or more grouping
  92.  * bits.  Each group represents buttons that share some sub-state
  93.  * in common.
  94.  *
  95.  * The high-order byte controls which colors in the source bitmap,
  96.  * black, white, gray, and dark gray, are to be converted into the
  97.  * system colors COLOR_BTNTEXT, COLOR_HILIGHT, COLOR_BTNFACE, and
  98.  * COLOR_BTNSHADOW.  Any or all of these bits may be set to allow
  99.  * the application control over specific colors.
  100.  *
  101.  * The actual state values are split into a command group and an
  102.  * attribute group.  Up, mouse down, and disabled states are
  103.  * identical, but only attributes can have down, down disabled,
  104.  * and indeterminate states.
  105.  *
  106.  * BUTTONGROUP_BLANK is defined so an application can draw only the
  107.  * button without an image in the up, down, mouse down, or
  108.  * indeterminate state, that is, BUTTONGROUP_BLANK is inclusive
  109.  * with BUTTONGROUP_DOWN and BUTTONGROUP_LIGHTFACE.
  110.  */
  111. #define BUTTONGROUP_DOWN                0x0001
  112. #define BUTTONGROUP_ACTIVE              0x0002
  113. #define BUTTONGROUP_DISABLED            0x0004
  114. #define BUTTONGROUP_LIGHTFACE           0x0008
  115. #define BUTTONGROUP_BLANK               0x0010
  116. //Command buttons only
  117. #define COMMANDBUTTON_UP                (BUTTONGROUP_ACTIVE)
  118. #define COMMANDBUTTON_MOUSEDOWN         (BUTTONGROUP_ACTIVE     
  119.                                         | BUTTONGROUP_DOWN)
  120. #define COMMANDBUTTON_DISABLED          (BUTTONGROUP_DISABLED)
  121. //Attribute buttons only
  122. #define ATTRIBUTEBUTTON_UP              (BUTTONGROUP_ACTIVE)
  123. #define ATTRIBUTEBUTTON_MOUSEDOWN       (BUTTONGROUP_ACTIVE     
  124.                                         | BUTTONGROUP_DOWN)
  125. #define ATTRIBUTEBUTTON_DISABLED        (BUTTONGROUP_DISABLED)
  126. #define ATTRIBUTEBUTTON_DOWN            (BUTTONGROUP_ACTIVE     
  127.                                         | BUTTONGROUP_DOWN      
  128.                                         | BUTTONGROUP_LIGHTFACE)
  129. #define ATTRIBUTEBUTTON_INDETERMINATE   (BUTTONGROUP_ACTIVE     
  130.                                         | BUTTONGROUP_LIGHTFACE)
  131. #define ATTRIBUTEBUTTON_DOWNDISABLED    (BUTTONGROUP_DISABLED   
  132.                                         | BUTTONGROUP_DOWN      
  133.                                         | BUTTONGROUP_LIGHTFACE)
  134. //Blank buttons only
  135. #define BLANKBUTTON_UP                  (BUTTONGROUP_ACTIVE 
  136.                                         | BUTTONGROUP_BLANK)
  137. #define BLANKBUTTON_DOWN                (BUTTONGROUP_ACTIVE 
  138.                                         | BUTTONGROUP_BLANK 
  139.                                         | BUTTONGROUP_DOWN  
  140.                                         | BUTTONGROUP_LIGHTFACE)
  141. #define BLANKBUTTON_MOUSEDOWN           (BUTTONGROUP_ACTIVE 
  142.                                         | BUTTONGROUP_BLANK 
  143.                                         | BUTTONGROUP_DOWN)
  144. #define BLANKBUTTON_INDETERMINATE       (BUTTONGROUP_ACTIVE 
  145.                                         | BUTTONGROUP_BLANK 
  146.                                         | BUTTONGROUP_LIGHTFACE)
  147. /*
  148.  * Specific bits to prevent conversions of specific colors to
  149.  * system colors.  If an application uses this newer library
  150.  * and never specified any bits, then they benefit from color
  151.  * conversion automatically.
  152.  */
  153. #define PRESERVE_BLACK                  0x0100
  154. #define PRESERVE_DKGRAY                 0x0200
  155. #define PRESERVE_LTGRAY                 0x0400
  156. #define PRESERVE_WHITE                  0x0800
  157. #define PRESERVE_ALL                    (PRESERVE_BLACK     
  158.                                         | PRESERVE_DKGRAY   
  159.                                         | PRESERVE_LTGRAY   
  160.                                         | PRESERVE_WHITE)
  161. #define PRESERVE_NONE                   0   //Backwards compatible
  162. //Structure for UIToolConfigureForDisplay
  163. typedef struct tagTOOLDISPLAYDATA
  164.     {
  165.     UINT        uDPI;       //Display driver DPI
  166.     UINT        cyBar;      //Vertical size for a bar w/ buttons.
  167.     UINT        cxButton;   //Dimensions of a button.
  168.     UINT        cyButton;
  169.     UINT        cxImage;    //Dimensions of bitmap image
  170.     UINT        cyImage;
  171.     UINT        uIDImages;  //Standard resource ID for images
  172.     } TOOLDISPLAYDATA, FAR *LPTOOLDISPLAYDATA;
  173. //Public functions
  174. HCURSOR WINAPI UICursorLoad(UINT);
  175. BOOL    WINAPI UIToolConfigureForDisplay(LPTOOLDISPLAYDATA);
  176. BOOL    WINAPI UIToolButtonDraw(HDC, int, int, int, int, HBITMAP
  177.             , int, int, int, UINT, LPTOOLDISPLAYDATA);
  178. #ifdef __cplusplus
  179.     }
  180. #endif
  181. #endif //_BTTNCUR_H_