02-09-2009 03:59 AM
Hey there,
I have got a problem as follows:
I want to write a script which loads the data, displays it in VIEW. After displaying the data the script shall switch to interaction and the user then shall have a band cursor with a fixed span width. The user shall move the band cursor to the part of the graph he wants to analyze and after that end the interaction.
Loading data and displaying it is not much of a problem. Same with getting the coordinates of the band cursor. But how do I make a band cursor with a fixed span width the user can’t change?
Thanks very much
alexander
02-09-2009 08:11 AM
Hi Abros
What version of DIAdem do you use?
If you use a Version 11 you can remove the icons for the other cursors.
BarManager.Bars("VIEWMain").UsedActionObjs.Remove("VIEWSetCrosshair")
BarManager.Bars("VIEWMain").UsedActionObjs.Remove("VIEWSetFrame")
To reset the toolbar again use
BarManager.Reset
But I think that is not exactly what you want to do. To "disable" the other typs of cursors and to set the cursor to a fixed width you have to write the following script, save it as a file and register the file as a user command (Select Settings»Options»Extensions»User Commands)
Sub SetBand(oCursor)
View.ActiveSheet.Cursor.Type = "Band"
If x1Pos <> View.ActiveSheet.Cursor.X1 then
View.ActiveSheet.Cursor.X2=View.ActiveSheet.Cursor.X1 + 200
Else
View.ActiveSheet.Cursor.X1=View.ActiveSheet.Cursor.X2 - 200
End If
x1Pos = view.ActiveSheet.Cursor.X1
End sub
Then you have to add the following lines to your script:
view.Events.OnCursorChanged = "SetBand"
Call Globaldim("x1Pos")
This small script calls the Usercommand "SetBand" each time you change the cursor.
To reset the OnCursorChanged event set it to an empty string:
view.Events.OnCursorChanged = "
Hope this helps.
Winfried
02-09-2009 08:32 AM
Hi winner,
thanks very much. I have DIAdem V11.
Your user command script does exacly what I was looking for.
alexander