Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Using point and click – PB Docs 2017 – PowerBuilder Library

Using point and click – PB Docs 2017

Using
point and click

Users can click graphs during execution. The DataWindow control
provides a method called ObjectAtPointer that stores information about
what was clicked. You can use this method in a number of ways in mouse
events. For example, with the ObjectAtPointer information, you can call
other graph methods to report to the user the value of the clicked data
point. This section shows you how.

Mouse events and graphs

To cause actions when a user clicks a graph, you might:

  • PowerBuilder

    Write a Clicked script for the DataWindow control

You should call ObjectAtPointer in the first statement of the
event’s code.

Using ObjectAtPointer

ObjectAtPointer works differently in PowerBuilder.

PowerBuilder

ObjectAtPointer has this syntax:

ObjectAtPointer does these things:

  • Returns the kind of object the user clicked

    The object is identified by a grObjectType enumerated value. For
    example, if the user clicks on a data point, ObjectAtPointer returns
    TypeData!. If the user clicks on the graph’s title, ObjectAtPointer
    returns TypeTitle!.

    For a list of object values, see DataWindow
    Constants
    in DataWindow Reference.
    In PowerBuilder, you can also open the Browser and click the
    Enumerated tab.

  • Stores the number of the series the pointer was over in the
    variable seriesNumber, which is an argument passed by reference

  • Stores the number of the data point in the variable dataNumber,
    also an argument passed by reference

Example

Assume there is a graph named gr_sales in the DataWindow control
dw_sales. The following code for the control’s MouseDown event displays a
message box:

  • If the user clicks on a series (that is, if ObjectAtPointer
    returns 1), the message box shows the name of the series clicked on.
    The example uses the method GetSeriesName to get the series name,
    given the series number stored by ObjectAtPointer.

  • If the user clicks on a data point (that is, if ObjectAtPointer
    returns 2), the message box lists the name of the series and the value
    clicked on. The example uses GetDataNumber to get the data’s value,
    given the data’s series and data point number.

PowerBuilder

This code is for the Clicked event:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x