home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_2 / SIZECTRL / SIZ.DOC < prev    next >
Encoding:
Text File  |  1993-08-11  |  10.8 KB  |  225 lines

  1. SIZ Custom Control Version 1.00 for Microsoft Visual Basic V1.0 and V2.0
  2.                     (C) February 1993 by W. Raike
  3.  
  4. **** THIS SOFTWARE IS DISTRIBUTED AS SHAREWARE.  IT IS NOT FREE!
  5. **** IF YOU USE IT FOR MORE THAN A REASONABLE EVALUATION PERIOD,
  6. **** YOU ARE REQUIRED TO REGISTER AND PAY FOR IT.  SEE THE FILE 
  7. **** REGISTER.TXT ACCOMPANYING THIS FILE FOR INFORMATION ON HOW TO 
  8. **** REGISTER AND THE ADVANTAGES OF REGISTERING.
  9.  
  10. // BRIEF DESCRIPTION:
  11.  
  12. SIZ lets you add controls to your Visual Basic forms that a user
  13. can resize at run time by dragging corner "handles", or move by 
  14. dragging, without writing code.  SIZ controls also have some of the features
  15. of Picture Box controls in VB 1.0 or Image controls in VB 2.0.  Since 
  16. you can use these features to allow users to easily move and resize 
  17. other Visual Basic controls at runtime, you might want to use SIZ to 
  18. help create WYSIWYG form-design applications, or user-interface 
  19. design tools in the spirit of Visual Basic itself, to name just two 
  20. possible applications.  The enclosed demonstration programs give
  21. several examples; let me know what you can do with SIZ!
  22.  
  23. // INSTALLATION
  24.  
  25. The easiest way to install SIZ is to simply copy the file SIZ.VBX to 
  26. your Visual Basic directory.  Then, in order to include SIZ on your 
  27. Visual Basic toolbar, use the Add File command on Visual Basic's File 
  28. menu.  (Ctrl-F12 in VB 1.0, or Ctrl-D in VB 2.0)  If you make your 
  29. application into an EXE file, you will need to distribute SIZ.VBX 
  30. along with the EXE file and Visual Basic's runtime DLL (VBRUN100.DLL 
  31. or VBRUN200.DLL), and SIZ.VBX will also need to be copied into either 
  32. the user's WINDOWS\SYSTEM directory or into the same directory as 
  33. your application's EXE file.
  34.  
  35. Registered users will receive, in addition to their registered copy 
  36. of SIZ, an additional royalty-free runtime-only version of SIZ.VBX 
  37. which they can distribute along with their EXE applications.  The 
  38. runtime-only version does not show the pop-up copyright message box 
  39. that is displayed when this shareware version is loaded, and the 
  40. registered version (intended for design-time use) shows only an 
  41. unobtrusive copyright window that disappears by itself after about 
  42. two seconds. 
  43.  
  44. // SYSTEM REQUIREMENTS
  45.  
  46. SIZ is a custom control that works under Visual Basic.  SIZ supports 
  47. versions 1.0 and 2.0 of Visual Basic for Windows running under 
  48. Microsoft Windows 3.0 or later.  (It works much better with version 
  49. 2.0 of VB.)  SIZ is useless without a mouse.
  50.  
  51. // FEATURES:
  52.  
  53. 1. Handles
  54.  
  55. SIZ lets you create controls that can have "sizing handles" at 
  56. all four corners, and an optional border.  The handles look similar to 
  57. the ones Visual Basic displays at design time, but they function at 
  58. run time.  A user can resize the control simply by dragging a corner 
  59. handle to a new position.  Handles can be disabled either at design 
  60. time or under program control by setting the Handles property to 
  61. False.  When the Handles property is set to True (the default), black 
  62. handles (small squares) appear at the corners of the control, and the 
  63. mouse cursor changes whenever the user moves the mouse over a corner 
  64. handle to indicate that dragging a corner will resize the control.
  65.  
  66. 2. Automove property
  67.  
  68. By setting the Automove property to True (the default), you allow a 
  69. user to automatically move the control anywhere on your form by 
  70. dragging it with the mouse and then dropping it (releasing the mouse 
  71. button) at any desired position.  This saves you the hassle of 
  72. writing code to implement drag-and-drop movement for one or more 
  73. controls.  (For this to work, the control's DragMode property must 
  74. also be set to Manual, which is the default.  With DragMode set to 
  75. Automatic, Visual Basic dragging operates normally.)
  76.  
  77. 3. Picture property
  78.  
  79. You can load any bitmap into a SIZ control's Picture property, either 
  80. at design time by setting the Picture property to the name of a valid 
  81. bitmap or at runtime by calling Visual Basic's LoadPicture function.  
  82. When a user resizes a SIZ control by dragging one of the corner 
  83. handles, any bitmap currently assigned to the Picture property of the 
  84. control is automatically stretched or compressed to fit the new 
  85. dimensions of the control.  Under Visual Basic 2.0 or later, SIZ 
  86. includes support for 256-color bitmaps when the appropriate hardware 
  87. is present.  [Note: The author does not yet have access to 256-color 
  88. display hardware to test the latter feature adequately.]
  89.  
  90. 4. Resize event
  91.  
  92. You can respond to a user's actions in resizing or moving a SIZ 
  93. control.  Immediately after the user has released the mouse button 
  94. after such an action, Visual Basic fires a Resize event for the 
  95. control.  You can write code in the control's Resize event procedure 
  96. to handle the event.  The Corner parameter to the Resize event 
  97. procedure indicates what corner was moved: 0 indicates no corner 
  98. (i.e., drag-and-drop using Automove); 1, 2, 3 and 4 indicate the 
  99. northwest, northeast, southeast and southwest corners, respectively.
  100.  
  101. 5. Background color
  102.  
  103. When no bitmap is loaded into a SIZ control's Picture property, you 
  104. can set the BackColor property to color the control rectangle any 
  105. color you wish.
  106.  
  107. 6. Drawing or creating graphic images in a SIZ control
  108.  
  109. Although you can't use graphics methods to directly draw on a SIZ 
  110. control, you can do so in a Picture Box control (say, Picture1) whose 
  111. AutoRedraw property is set to true, and then use the statement 
  112. Siz1.Picture = Picture1.Image to transfer the contents of the Picture
  113. Box to the SIZ control, where they are retained and can be moved or 
  114. resized at runtime in the normal way.
  115.  
  116. 7. Superimposing or overlapping SIZ controls
  117.  
  118. Under Visual Basic 2.0 or later, where they are implemented as 
  119. graphical controls, SIZ controls can be superimposed or overlapped in 
  120. any way you like, and layers of superimposed or overlapped graphical 
  121. images are under full program control using the Zorder method.  
  122. Visual Basic 1.0 does not always display superimposed or overlapped 
  123. controls correctly.  (For example, try overlapping two Picture Box 
  124. controls with different background colors in various ways at design 
  125. time and see what happens at runtime!)  Since an attempt by a user to 
  126. overlap or superimpose several SIZ controls at runtime under Visual 
  127. Basic 1.0 can have confusing results, you may wish to inhibit such 
  128. actions by using appropriate Visual Basic code, for instance by 
  129. responding to the Resize event to inhibit or undo a resize or drag-
  130. drop operation.  (See the accompanying demonstration program VB1DEMO 
  131. for an example of how to do this; you can run it under either VB 1.0 
  132. or 2.0.)  Alternatively, you can use overlapped controls creatively 
  133. to allows users to move and resize other, conventional Visual Basic 
  134. controls, thus duplicating some of the functionality of Visual Basic 
  135. itself.  See the demonstration programs VB1DEMO and VB2DEMO for 
  136. examples of how to do this. 
  137.  
  138. 8.  Corner property
  139.  
  140. The Corner property, which is a read-only property, indicates when 
  141. the user moves the mouse over a corner handle.  You can use the value 
  142. of this property, typically during a MouseMove event, to obtain 
  143. further information about the status of the mouse within or over the 
  144. control even while a user is resizing or moving it.  A Corner 
  145. property value of 0 indicates that the mouse is not over a corner 
  146. handle; values of 1, 2, 3 and 4 indicate the northwest, northeast, 
  147. southeast and southwest corners respectively.
  148.  
  149. 9.  ScaleMode property
  150.  
  151. SIZ supports all standard ScaleMode values except for 0 (user-defined 
  152. scale mode), so you can set the control's ScaleMode property to match 
  153. that of its container, ensuring proper resize and drag-drop 
  154. (Automove) operation.  Note that failure to ensure that the control's 
  155. ScaleMode property matches that of its form or container control will 
  156. cause strange results during resizing or dragging.
  157.  
  158. //QUIRKS
  159.  
  160. 1.  Combinations of events
  161.  
  162. At run time, when a user resizes a SIZ control (or moves it in 
  163. Automove mode), MouseDown, MouseMove and MouseUp events are generated, 
  164. in addition to a Resize event.  The control "captures" the mouse 
  165. during these operations, so the control generates MouseMove, MouseUp 
  166. and Resize events even though the mouse may be outside the initial 
  167. boundaries of the control when these events take place.  However, a 
  168. Click event may or may not be generated, depending upon whether the 
  169. position of the mouse when the mouse button is released is inside or 
  170. outside the starting position of the control; that is, the boundaries 
  171. of the control before the resize or move operation began.
  172.  
  173. 2.  Sequence of events
  174.  
  175. At run time, when a user resizes a SIZ control (or moves it in 
  176. Automove mode), the sequence in which events are generated is as 
  177. follows:
  178.               MouseDown
  179.               MouseMove   (any number of these)
  180.               Resize          
  181.               MouseUp
  182.               Click       (may or may not occur; see above discussion)   
  183.  
  184. 3.  Drag outline during Automove
  185.  
  186. While a user is resizing a control (or moving it in Automove mode), 
  187. a rectangular outline indicating the control's new position is 
  188. displayed.  This works properly under Visual Basic 2.0, but under 
  189. Visual Basic 1.0 only the portion of the outline falling outside the 
  190. initial boundaries of the control (and of other controls) will be 
  191. visible.  This may be disconcerting while "shrinking" a control under 
  192. VB 1.0; the mouse cursor does, however, correctly indicate the 
  193. position into which the control is being moved or resized.  You 
  194. really should consider upgrading to VB 2.0 (or 3.0)!
  195.  
  196. // COPYRIGHT INFORMATION
  197.  
  198. International copyright, intellectual property rights and other 
  199. rights reserved for this program and all associated documentation by:          
  200.  
  201.                             William Raike   
  202.                             66 Simpson Rd.  
  203.                             Swanson         
  204.                             Auckland 8SW    
  205.                             NEW ZEALAND     
  206.  
  207. The author makes no warranties, express or implied, oral or written, 
  208. including any implied warranties of merchantability or fitness for a 
  209. particular purpose.  In no event shall the author be liable for any 
  210. damages whatsoever arising out of the use of either the shareware or 
  211. registered versions of this software.
  212.  
  213. See the file REGISTER.TXT accompanying this file for additional 
  214. information and restrictions regarding copying and distribution of 
  215. this software and all associated documentation.
  216.  
  217. SIZ was written in C using Borland C++ 3.0, and developed under 
  218. Microsoft MS-DOS 5.0 and Microsoft Windows 3.1 using Microsoft Visual 
  219. Basic Version 1.0 with the Control Development Kit, and Visual Basic
  220. Version 2.0 Professional Edition.  It has also been tested under
  221. MS-DOS Version 6.0.
  222.  
  223. SIZ is not compatible with Microsoft Visual C++ Version 1.0 due to
  224. inherent limitations of that product.
  225.