home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / bubble.zip / BUBBLE.INF (.txt) < prev    next >
OS/2 Help File  |  1995-09-13  |  10KB  |  176 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
  3.  
  4. Introduction 
  5.  
  6. The Hint Bubble control is brought to you by Secant Technologies, makers of 
  7. ObjectPM, ObjectPM Control Pack, and other fine OS/2 software.  It is a 
  8. "teaser" in hopes of generating interest in us and our software packages.  We 
  9. also hope to generate an interest in OS/2 custom -controls, as there is a lack 
  10. of them in the marketplace.  It is provided with a "C" interface only.  You can 
  11. go ahead and wrap it in OWL, ICLUI, ObjectPM, or whatever, or possibly look for 
  12. the Hint Bubble and wrappers in the next release of the ObjectPM Control Pack. 
  13. Give us some feedback at info@secant.com about the Hint Bubble or other custom 
  14. controls you would like to see. 
  15.  
  16. Come and see us at http://www.secant.com 
  17.  
  18.  
  19. ΓòÉΓòÉΓòÉ 2. Hint Bubble Custom Control ΓòÉΓòÉΓòÉ
  20.  
  21.  
  22. ΓòÉΓòÉΓòÉ 2.1. Hint Bubble Description ΓòÉΓòÉΓòÉ
  23.  
  24. Hint Bubble Custom Control 
  25.  
  26. The Hint Bubble control can be attached to any other control to display some 
  27. helpful information about the control.  It is often used in toolbars where the 
  28. array of icons can become confusing.  It normally pops up after some specified 
  29. time when the user keeps the mouse pointer over the control.  As can be seen 
  30. below, the Hint Bubble consists of a bubble area in which text is displayed and 
  31. a triangular piece leading from the attached control.  The positioning of the 
  32. "point" of the triangular piece can be specified absolutely or by mouse pointer 
  33. position.  Also, the "side" on which the bubble appears can be specified 
  34. through style flags.  You do not need to specify a size for the control, as it 
  35. automatically sizes based upon the text it is to display.  You can insert line 
  36. breaks in the hint text by embedding "\n" in the text.  The text will then be 
  37. displayed as multiple lines in the bubble area. 
  38.  
  39. What to put in the .RC file 
  40.  
  41. When designing a dialog, specify "HINTBUBBLE" for the class name of any Hint 
  42. Bubble control you would like to use as in: 
  43.  
  44.     CONTROL "Hint Text", 101, 8, 23, 153, 36, "HINTBUBBLE", WS_VISIBLE
  45.  
  46. What it looks like 
  47.  
  48.  
  49. ΓòÉΓòÉΓòÉ 2.2. Hint Bubble C Interface ΓòÉΓòÉΓòÉ
  50.  
  51. Hint Bubble C Interface 
  52.  
  53. This section describes the messages, styles, notification codes and structures 
  54. needed for the C language interface to the Hint Bubble Custom Control. 
  55.  
  56.  
  57. ΓòÉΓòÉΓòÉ 2.2.1. Hint Bubble Class Name ΓòÉΓòÉΓòÉ
  58.  
  59. Hint Bubble Class Name 
  60.  
  61. The class name of the Hint Bubble control to use in the WinCreateWindow() OS/2 
  62. API call is "HINTBUBBLE" This is also the class name you must use when putting 
  63. a Hint Bubble in a dialog box as in: 
  64.  
  65.     CONTROL "Hint Text", 101, 8, 23, 153, 36, "HINTBUBBLE"
  66.  
  67.  
  68. ΓòÉΓòÉΓòÉ 2.2.2. Hint Bubble Styles ΓòÉΓòÉΓòÉ
  69.  
  70. Hint Bubble Styles 
  71.  
  72. The following style bits may be logically OR'ed together along with the normal 
  73. WS_* style bits: 
  74.  
  75. Style                   Description 
  76. HBS_BOTTOM              Bubble appears below the attached control 
  77. HBS_TOP                 Bubble appears above the attached control 
  78. HBS_LEFT                Bubble appears to the left of the attached control 
  79. HBS_RIGHT               Bubble appears to the right of the attached control 
  80. HBS_CENTERTEXT          Text is centered based upon the widest line 
  81. HBS_USEMOUSEPOS         Bubble appears at the mouse position instead of the 
  82.                         position specified in the control data. 
  83. HBS_HIDEONMOVE          After the hint bubble is shown, it is hidden when the 
  84.                         user moves the mouse.  It is redisplayed again after 
  85.                         the delay time is the user keeps the mouse over the 
  86.                         attached control. 
  87. HBS_SHOWONCE            Only meaningful when used with HBS_HIDEONMOVE. Prevents 
  88.                         the bubble from being shown again after the user moves 
  89.                         the mouse, even if the user keeps the mouse over the 
  90.                         control. 
  91.  
  92.  
  93. ΓòÉΓòÉΓòÉ 2.2.3. Hint Bubble Structures ΓòÉΓòÉΓòÉ
  94.  
  95. Hint Bubble Structures 
  96.  
  97. Control Data 
  98.  
  99. The control data can be used to set and retrieve the attached control, bubble 
  100. "point" position and delay in milliseconds before the bubble is displayed. 
  101.  
  102. typedef struct {
  103.     long    cb;         // size of the struct
  104.     HWND    linkedCtl;  // window handle of the linked control
  105.     long    linkX;      // x position of bubble "point"
  106.     long    linkY;      // y position of bubble "point"
  107.     long    delay;      // delay in milliseconds before display
  108.     long    hidedelay;  // delay in milliseconds before hiding the bubble
  109.                         // after displaying it.  0=as long as it is
  110.                         // over the attached control
  111. } HBUBBLECTLDATA;
  112. typedef HBUBBLECTLDATA *PHBUBBLECTLDATA;
  113.  
  114.  
  115. ΓòÉΓòÉΓòÉ 2.2.4. Hint Bubble Presentation Parameters ΓòÉΓòÉΓòÉ
  116.  
  117. Hint Bubble Presentation Parameters 
  118.  
  119. The Hint Bubble uses the following presentation parameters to set its colors 
  120. (please note that the equivalent RGB PP_* can also be used - EG 
  121. PP_FOREGROUNDCOLOR vs PP_FOREGROUNDCOLORINDEX): 
  122.  
  123. PP_*                                    Description (Default) 
  124. PP_FOREGROUNDCOLORINDEX                 Hint text (RGB 255,255,255 - white) 
  125. PP_BACKGROUNDCOLORINDEX                 Background  (RGB 0,130,130 - 
  126.                                         blue-green) 
  127. PP_FONTNAMESIZE                         Font ("System Propertional.10") 
  128.  
  129.  
  130. ΓòÉΓòÉΓòÉ 2.2.5. WM_SETWINDOWPARAMS ΓòÉΓòÉΓòÉ
  131.  
  132. WM_SETWINDOWPARAMS 
  133.  
  134. All operations on the control are done through its control data.  For instance 
  135. to link to a control, you would do the following: 
  136.  
  137.     WNDPARAMS       wp;
  138.     HBUBBLECTLDATA  data;
  139.  
  140.     data.cb = sizeof (HBUBBLECTLDATA);  // set the size
  141.     data.linkedCtl = hwnd;              // handle of attached control
  142.     data.linkX = 10;                    // set "point" to position
  143.     data.linkY = 10;                    // (10,10)
  144.     data.delay = 1000;                  // wait 1 second before showing
  145.     data.hidedelay = 3000;              // hide again after 3 seconds
  146.  
  147.     wp.fsStatus = WPM_CTLDATA;
  148.     wp.pCtlData = (void *)&data;
  149.  
  150.     // and set it
  151.     WinSendMsg(hintHwnd, WM_SETWINDOWPARAMS, (MPARAM)&wp, NULL);
  152.  
  153. Arguments 
  154.  
  155. mp1   Pointer to a WNDPARAMS structure containing the hint bubble control data. 
  156.  
  157. mp2   Not used, should be 0. 
  158.  
  159. Return Value 
  160.  
  161. TRUE if successful, FALSE if not. 
  162.  
  163.  
  164. ΓòÉΓòÉΓòÉ 2.2.6. void HintBubbleRegister(HAB hab); ΓòÉΓòÉΓòÉ
  165.  
  166. void HintBubbleRegister(HAB hab); 
  167.  
  168. Registers the Hint Bubble control with OS/2 and must be called before any 
  169. instances of a Hint Bubble control can be created (with WinCreateWindow() or on 
  170. a dialog). 
  171.  
  172. Arguments 
  173.  
  174. hab   Handle to the anchor block from the WinInitialize() OS/2 API call. 
  175.  
  176.