A few questions about Drawing Control and Delphi

M

Mr Anderson

I'm using the Drawing Control of Visio 2003 in combination with Delphi 7 and
I got some problems with my Delphi-application:

1. I can't drag and drop any master shapes from the stencil-window onto my
empty drawing. My document is NOT readonly. What can I do???
2. I opened a self-made drawing with a self-made stencil. The stencil has 5
Master Shapes on it. However, the Document.Masters.Count is zero so I can't
access any of the Masters.Items. What might be wrong???
3. My Mainmenu disappears an appears again when I alternating click a Button
and the Drawing Control-component. Whats wrong again???
4. How can I gain access to the userdefined Custom Properties of my Shapes?
5. How can I catch an event like Clicking or Doubleclicking a Shape?

Hope someone can help me :)
 
D

David Parker [Visio MVP]

I am not a Delphi programmer, but I suggest you buy Graham Wideman's book
"Visio 2003 Developers Survial Guide"

Masters in your stencil do not necessarily equal masters in your document.
A master in your docment gets created the first time you dop the master from
your stencil
 
M

Mr Anderson

OK, now I understand. Masters are created by dropping a master shape onto my
document. Thanks for the help.

But what about my drag&drop-problem and the custom properties? I don't think
this is Delphi-specific, is it? How can I gain access to the properties by
code?

Hope some can help me, I need these urgent problems to be solved!
 
D

David Parker [Visio MVP]

Graham's book has a drag'n'drop example in the Visio client (and he is a
Delphi prorammer!)
 
M

Mr Anderson

Thanks for the Literature-Hint.

I found out the thing about gaining access to my Custom Properties myself.
It works like:

Edit1.Text :=
DrawingControl1.Document.Pages[1].Shapes[1].Cells['Prop.TestProperty'].Formula;

Now I have some other questions:

In my stencil-window I opened 3 Stencils each in a seperate frame. So there
is no need to leave the normal stencil-window named "Shapes" with its
dropdown-list "Search for shapes..." opened. I want to close it automatically
on startup and only leave the other ones open. How can I do this? Does there
exist a property like "StencilWindowVisible" or a method "CloseStencilWindow"
somewhere?

In my application, there is the custom properties-window always visible on
the workspace. I want it to be docked to the bottom of the workspace at
startup. How can I determine the custom-properties-window-alignment?
 
D

David Parker [Visio MVP]

Here's the answer to the first question:

'// <summary>This procedure closes the "Shape Search" window.
'// </summary>
'// <param name="activeWindow">The drawing window</param>
Private Sub closeShapeSearchWindow(ByVal activeWindow As Window)

Dim windowCount As Short
Dim index As Short
Dim currentWindow As Window
Dim documentWindow As Window
Dim childWindows As Windows
Dim childWindowIndex As Short

Try
If (activeWindow.Type = VisWinTypes.visDrawing) _
And (activeWindow.SubType = VisWinTypes.visPageWin) Then
activeWindow.Windows.ItemFromID( _
VisWinTypes.visWinIDShapeSearch).Visible = False
End If
Catch err As System.Runtime.InteropServices.COMException
LogException(err)
DisplayException(visioApplication, err)
End Try
End Sub

Mr Anderson said:
Thanks for the Literature-Hint.

I found out the thing about gaining access to my Custom Properties myself.
It works like:

Edit1.Text :=
DrawingControl1.Document.Pages[1].Shapes[1].Cells['Prop.TestProperty'].Formula;

Now I have some other questions:

In my stencil-window I opened 3 Stencils each in a seperate frame. So
there
is no need to leave the normal stencil-window named "Shapes" with its
dropdown-list "Search for shapes..." opened. I want to close it
automatically
on startup and only leave the other ones open. How can I do this? Does
there
exist a property like "StencilWindowVisible" or a method
"CloseStencilWindow"
somewhere?

In my application, there is the custom properties-window always visible on
the workspace. I want it to be docked to the bottom of the workspace at
startup. How can I determine the custom-properties-window-alignment?


David Parker said:
 
G

gaz-mac

Have you figured out the answer to your original problem?
I have been looking for the answer for months. I have posted this one before
but did not get an answer. I am able to drag and drop on my dev machine but
it will not work on any other machine I put my software on. I am using D5.
 

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