12-01-2010 09:52 AM
Hello,
I've developed a little SUD dialog and sticked into the bottom of VIEW. I the TopArea I've "CurveChart2D".
With the dialog I want to change the cursor type and mode (see code below)
If I try to change the cursor from this script (the script is inside the embedded VIEW dialog I get the message of DIAdem "error"
If I try now to change the cursor with the VIEW buttons I get the message "Schwerwiegender Fehler".
In fact this little script crash DIAdem. I've to restart.
If I use the Dialog standalone (not as a part of VIEW), everything works fine.
I believe the problem is, that you can't change something from an ActiveArea (Dialog in Area : 2) inside an InactiveArea (2D Graph in Area :1)
But this works (graph change something inside the dialog)
Sub ViewConnector_EventCursorPosChanged(ByRef This) 'Erzeugter Event-Handler
'todo change the label and value controls for the different cursor and trim methods
edtXPosVal.Text = View.ActiveSheet.Cursor.X1
edtYPosVal.Text = View.ActiveSheet.Cursor.Y1
edtChnPos.Text = View.ActiveSheet.Cursor.P1
End Sub
So the point is,
1. how is it possible to control VIEW with an embedded SUD dialog?
2. The script engine shouldn't crash DIAdem. It should just abort or shouldn't be executable.
Sub Button1_EventClick(ByRef This) 'Erzeugter Event-Handler
iTrimMethod = rdbtnTrimMethods.Value
Dim oSheets
Dim oChart
oSheets = View.Sheets
sSheetName = View.ActiveSheet.Name
Select Case iTrimMethod
Case 0
MsgBox View.ActiveSheet.Name & " Index= " & View.ActiveSheet.Index
Set oChart = View.Sheets(View.ActiveSheet.Name).Areas("Area : 1").DisplayObj
View.Sheets(View.ActiveSheet.Name).Cursor.Type = "Crosshair"
View.Sheets(View.ActiveSheet.Name).Cursor.Mode = "GraphPoints"
View.Refresh
Case 1
MsgBox View.ActiveSheet.Name & " Index= " & View.ActiveSheet.Index
View.ActiveSheet.Areas(1).Active = True
View.Sheets(View.ActiveSheet.Name).Cursor.Type = "Band"
View.Sheets(View.ActiveSheet.Name).Cursor.Mode = "GraphPoints"
View.Refresh
Case 2
MsgBox View.ActiveSheet.Name & " Index= " & View.ActiveSheet.Index
View.ActiveSheet.Areas(1).Active = True
View.Sheets(View.ActiveSheet.Name).Cursor.Type = "Crosshair"
View.Sheets(View.ActiveSheet.Name).Cursor.Mode = "GraphPoints"
View.Refresh
End Select
End Sub
Best regards
Thomas Plöger
BASF Catalysts Germany GmbH
12-08-2010 01:08 AM
Hallo Mr. Plöger,
I've double-checked the described behavior. In general, the script code you've developed is OK. But there was a bug in DIAdem that causes the problem. It will be fixed with the DIAdem 2010 service pack that we can provide soon.
Greetings
WalterRick