DBHots v1.01 Jun 95

Description The DBHots control is used to create invisible, clickable areas typically located above certain regions of an underlying picture.
File Name DBHOTS.VBX
Object Type DBHots
Remarks DBHots' areas can be of any shape (editable with the right mouse button in design mode) and can use custom cursors (i.e. not limited to VB's 12 standard cursors).
About This control was developed by Dan Byström. For more information, contact me at e-mail: "dan.bystrom@visual-design.se" or phone: +46 708 68 65 78 (no support calls, please). I would be happy to discuss development of customised VBX'es or OCX'es for you.
Distribution You have the right to do whatever you want with DBHots, as long as you don't attempt to modify any of its code. "Do whatever you want" includes using DBHots in your own commercial applications and/or distributing it for free.
When the control is loaded in design mode a message is sometimes displayed. This message may not be removed or changed in any way. Anyway, the message won't ever appear at run-time.
I'm giving DBHots away for free. If you should decide to use it in an application of yours, this means that I have saved you a whole lot of trouble, time and $$$ doing it yourself. Therefore I think a nice gesture would be to include some sort of credit in your application's about box and/or documentation. You could include the name of the VBX, my name and my e-mail address. I would be glad if you did this. Anyway - happy VB programming with DBHots!

Revision Feb 95:Beta release.
history v 1.0Version info raised - no program changes.
v 1.01BUGFIX: The DLL was marked to be fixed in memory. It's not fixed now!

Properties

*Area*CCHotX*CCHotY *CustomCursor
DragIconDragModeEnabled Height
IndexLeftMousePointer Name
TagTopWidth

* = The property applies only to DBHots.

Events

ClickDblClickDragDrop DragOver
MouseDownMouseMoveMouseUp

Area Property

Description
This property may be used at run-time to alter the hot-spot shape. This is normally done visually in design mode.

Remarks
This property is a string of 4-digit hexadecimal number pairs. The coordinates are always scaled so that ($0000,$0000) refers to the upper left corner (of the bounding rectangle) and ($1000,$1000) refers to the lower right corner.

Data Type
String


CCHotX & CCHotY Properties

Description
Determines the hot-spot position of the custom cursor. Note that the term hot-spot in this case has nothing to do with the hot-spots discussed everywhere else in this document.

Remarks
These properties are used only when a new cursor is loaded. To change the current cursor's hot-spot it is necessary to reload the CustomCursor property.

Data Type
Integer


CustomCursor Property

Description
Sets a custom cursor shape to use when the mouse is moved over the hot-spot area. CustomCursor takes precedence over the MousePointer property.

Remarks
Just like the DragIcon property, the cursors must be saved as icons in an .ICO file. This is because VB handles .ICO files by default, but not .CUR files. This property is somewhat more restrictive than DragIcon; only the white color in the icon translates to white color in the cursor - all other colors translate to black.

Data Type
Picture (Icon only)


DBHotsVersion Function

Description
This function may be used to investigate the version of the system's DBHOTS.VBX and supplying the user with an appropriate error message if an old version is found.

Remarks
The major version number is returned in the high byte and the minor version number is returned in the low byte. For an example, refer to the last section of this document.

Data Type
Integer


Usage in design mode

In design mode the shape of the hot-spot may be altered by using the right mouse button. The following operations are supported:

Dragging with right mouse buttonThe corner closest to the mouse pointer is moved to the new location. The mouse cursor shape changes while this operation is performed. If no corner is reasonably close when the button is depressed, no action is performed.
Right mouse button click + Ctrl keyA new corner is inserted at the location of the mouse. The corner is inserted on the line with its middle closest to the mouse cursor position.
Right mouse button click + Shift keyThe corner closest to the mouse pointer is deleted. If no corner is reasonably close when the button is depressed, no action is performed.

Also note that the bounding rectangle, the largest area that can be used, is somewhat smaller than the properties Left, Top, Height and Width indicates. Four pixels on each side to be exact.

Usage at run-time

No special consideration is needed at run-time.

Version control

The following code shows an easy way to check the version of DBHOTS.VBX before it is accessed by VB. In a global module, put the following declaration:

Declare Function DBHotsVersion Lib "dbhots.vbx" () As Integer

Then use a Sub Main() as your program's entry point:

Sub Main()
If DBHotsVersion() < &H101& Then MsgBox "Your DBHOTS.VBX is too old for this program!", 16 : End
'Load your main form here
End Sub

###