BeforeScreenTip

T

Tony Bull

Please post any example(s) you have of how to use the BeforeScreenTip event.

Thank you,

Tony B.
 
T

Thao Moua [ms]

Here you go.
-------------------------
Private Sub ChartSpace1_BeforeScreenTip(ByVal TipText As
OWC10.ByRef, ByVal ContextObject As Object)
'only show screen tip for Points
If TypeName(ContextObject) = "ChPoint" Then
TipText.Value = "Series(" &
ContextObject.Parent.Index & ") Point(" &
ContextObject.Index & ")"
Else 'disable screen tip
TipText.Value = ""
End If
End Sub

Private Sub Form_Load()
ChartSpace1.BuildLitChart
ChartSpace1.AllowScreenTipEvents = True
ChartSpace1.DisplayScreenTips = True
End Sub
 
T

Tony Bull

Thanks Thao!

That just confirms what I suspected. I'm trying to programmatically
manipulate ScreenTips for an OWC 10 PivotTable using JavaScript and it's
just not working. I drop the following script into my <HEAD> tag:

<SCRIPT LANGUAGE="JavaScript" FOR="PivotTable" EVENT="BeforeScreenTip">

alert();

</SCRIPT>

....and when I mouse over a cell in the PivotTable, I get the alert but no
way to identify the object that generated the event (namely the cell; so
that I can change it's ScreenTip) or is there a way?

Thanks again!

Tony B.
 
T

Thao Moua [ms]

Your code should be
--------------------
<SCRIPT LANGUAGE="JavaScript" FOR="PivotTable"
EVENT="BeforeScreenTip(ScreenTipText, SourceObject)">

</SCRIPT>
--------------------
You can determine from the SourceObject what triggered
the screen tip event.

Thao Moua
OWC Webchart Support
 
T

Tony Bull

Thanks again for the idea but alas, it's not working.

When I do as you suggest, I get an error: "'ScreenTipText' is undefined"
which of course makes sense. I don't actually make a call to the function
in my VBScript using arguements. I include the script in my <HEAD> tag.

What I can put together from heuristic testing is that the browser listens
for a mouseover on the PivotTable. When the mouseover event is heard,
another event is generated - BeforeScreenTip - but there's no way to get at
which object generated the mouseover event that lead to BeforeScreenTip.

Can you suggest a way to find out what generated a mouseover event in a
PivotTable whenever one is generated? I've tried using attachEvent but that
can't be used for row members.

Regards,

Tony B.
 
G

Guest

The API is correct. Here's what your code should look
like.
----------------------------
<script language=jscript>
function PivotControl_BeforeScreenTip(ScreenTipText,
SourceObject){
try{
ScreenTipText.value = "your text here";
}
catch (e){
alert("error");
}
}
</script>
<SCRIPT LANGUAGE="JavaScript" FOR=PivotControl
EVENT="BeforeScreenTip(ScreenTipText, SourceObject)">
PivotControl_BeforeScreenTip(ScreenTipText,
SourceObject);
</SCRIPT>
-----------------
There is no way to determine what triggered what in an
event except the user. The BeforeScreenTip() event is
used to override/customize your own screen tip text for
the specific object underneath the cursor. The object is
determined from what the SourceObject is. Same applies
to the MouseMove() event which does nothing more than
listen if the mouse has been moved and thus report the
coordinates and any key press information to the user.

Thao Moua
OWC Webchart Support
-----Original Message-----
Thanks again for the idea but alas, it's not working.

When I do as you suggest, I get an
error: "'ScreenTipText' is undefined"
 
T

Tony Bull

This is EXACTLY the kind of example that should be included with the Web
Components documentation, both online and in the Toolpack.

Many thanks again Thao! It's just what I was looking for.

Tony B.
 
T

Tony Bull

Alright, for posterity's sake, I'm going to post my own solution (derived
through a great deal of help from Thao Muoa) for the problem I originally
posted on October 9th, 2003.

The original problem was:

<October 9th, 2003>
So, I like this handy trick where you can display member properties anywhere
you like. For instance, the following piece of code will put the value of
"Bill To Address" in the tool tip which the user will see on scroll-over:

<VBScript>

With pivotTable.ActiveView.FieldSets("Customer").Fields("Customer Name")
.MemberProperties("Bill To Address").DisplayIn =
c.plDisplayPropertyInScreenTip
.MemberProperties("Bill To Address").Caption = ""
End With

</VBScript>

The only problem is, I don't like that the PivotTable renders the value of
"Customer" in the tool tip too, like this:

John Smith (Customer)
1020 Main Rd.
Smithville, WA 98302

Is there any way to surpress the output of 'John Smith (Customer)'?

</October 9th, 2003>

And here's my solution (notice that script must be stuck in the HEAD tag):

###############################################
<HEAD>
<script language=jscript>
function Pivot_BeforeScreenTip(ScreenTipText,SourceObject){
try{
if(SourceObject.UniqueName != null) {
if (!SourceObject.UniqueName.indexOf("[Customer]")) {
/*
There is probably a better way to do this
(i.e. figure out where the first linebreak e.g.
CHAR(10) is)
but I I tried and tried and nothing came out.

This works, so we'll keep it for now.
*/
ScreenTipText.Value =
ScreenTipText.Value.substring(ScreenTipText.Value.indexOf(")")+2);
}
}
}catch (e) {
alert("There has been an error.");
}
}
</script>

<SCRIPT LANGUAGE="JavaScript" FOR=Pivot
EVENT="BeforeScreenTip(ScreenTipText, SourceObject)">
Pivot_BeforeScreenTip(ScreenTipText,SourceObject);
</SCRIPT>
</HEAD>

###############################################

Thanks again to Thao. Luv that Jscript!

Tony B.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top