Tiled Picture Object

Finding Graph Data with the Mouse

Introduction

 

Finding Objects with the Mouse


 

Before Flipper objects or graph data can be found with the mouse, the GraphRecord property must be set to True. When this property is True, anything that is added to the Flipper control is stored in a buffer so that it can be found with the mouse button.

 

Finding Objects

 

Any object added to the Flipper control can be "found" with a mouse click. The method that determines which mouse button can be used to find Flipper objects or data is the ObjectFindButton method.

 

When ObjectFindButton is set to 1, the left mouse button is used to find objects/data. The right mouse button's value is 2.

 

Whenever a Flipper object is clicked on by the ObjectFindButton, and GraphRecord is True, the FoundObject event gets called. It is passed an object source, object class, object number, and object reference.

 

An object is any part of a graph, other than graph data, or a graphical object created with ObjectTextAdd, ObjectRectAdd, or ObjectPictAdd.

 

The object source is the number of the current graph when the object was added. The object class is an ID indicating the type of object that was found. The number of the object when it was added to the control is returned in the object number parameter. Lastly, the object reference is the number for the object associated with an axis, like AxisScales and AxisTitles.

 

To test this event out, let's quickly make a rectangle, a circle, and display the bubbles.bmp again.

 

Before the graphics are displayed, we should set GraphRecord to True, and make the left mouse button the active button for finding objects.

FlpGrf.GraphRecord = True
FlpGrf.ObjectFindButton 1
FlpGrf.ObjectRectAdd 1, 10, 10, 20, 20
FlpGrf.ObjectRectAdd 4, 30, 10, 40, 20
FlpGrf.ObjectPictAdd "c:\windows\bubbles.bmp", 50, 10, 80, 50, 0, 0, 0, 1

 

Next, add the following code in the FoundObject event.

Select Case ObjectClass
Case 30
 MsgBox "You clicked on the rectangle."
Case 33
 MsgBox "You clicked on the circle."
Case 50
 MsgBox "You clicked on the bitmap."
End Select

 

Now run your program, and click near the borders of the objects. A message box will display, telling you what you have clicked on.

 

images/tut44.png



Tiled Picture Object Finding Graph Data with the Mouse

 

 

Last modified on: Friday, August 16, 2002