DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Control VIEW cursor with SUD Dialog

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.Smiley Surprised

 

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

0 Kudos
Message 1 of 2
(3,509 Views)

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

0 Kudos
Message 2 of 2
(3,459 Views)