Volume 3: Programming with the Visio Object Model disclaimer


Review – Visio Drawing Control



Download 0.78 Mb.
Page35/36
Date29.01.2017
Size0.78 Mb.
#11974
1   ...   28   29   30   31   32   33   34   35   36

Review – Visio Drawing Control

Questions


  1. True or False. You can embed the Visio drawing control into an Excel VBA form.

  2. What is the key difference in working with Visio embedded as an OLE object versus with the Visio drawing control embedded in a Windows form.

  3. True or False. The Visio control is installed with the Visio application setup program and requires the Visio client application to initialize.

  4. What are the steps required to upgrade an application currently using the Visio 2003 Drawing Control to use the Visio 2007 Drawing Control?

  5. When using a Visio 2010 Drawing Control in a Windows Forms application the developer should:

    1. Program directly against the Visio object model

    2. Create a COM add-in for the host application and have the COM add-in listen for Visio events and then react to these events

    3. Host the drawing control in Visio and use VBA to create any necessary forms so that you have access to the Visio user interface

    4. Any of these methods will work

  6. When using a Visio 2010 Drawing Control in a Windows Forms application, how can the Windows application be made to listen to events triggered in Visio?

  7. A Visio drawing can be displayed in the drawing control by assigning the Src property of the control. What happens to any VBA code that is a part of that document.

  8. True or False. Since the drawing control cannot display the ShapeSheet window, you cannot program against the ShapeSheet in application that use the drawing control.

  9. True or False. There can only be a single document displayed in an application using the drawing control.

  10. What two properties of the drawing control can be used to get a reference to the Visio Application object?

  11. What property of the drawing control must be set in order to display an existing Visio drawing in the drawing control?

  12. True or False. When editing a drawing in an application using the drawing control you are working directly on that document and can update the document with the Save method.

  13. True or False. The Shape Data window cannot be displayed in an application hosting the Visio drawing control.

  14. True or False. Any host application can display Visio menus and toolbars if the NegotiateMenus and NegotiateToolbars properties of the drawing control are set to True.

  15. What Visio method can be combined with mouse events by the host application to locate a shape on the drawing surface.

Answers


  1. True. You cannot embed the drawing control into a Visio VBA form, but you can embed into VBA forms of other applications.

  2. As an embedded OLE object you are working with Visio’s own user interface. In working with the drawing control on a form there is no Visio UI. The developer must build the interface that is presented to the user.

  3. True

  4. The interfaces are the same so just rebuild the application.

  5. a.

  6. In the host application create an event sink and define the Visio events that are to be listened for.

  7. The drawing control does not support VBA. Any VBA code that is in the document cannot execute.

  8. False. Even though the ShapeSheet window cannot be displayed, you still have access to the Visio object model and therefore can get and set cells in the ShapeSheet.

  9. True. Only a single document can be displayed because of the drawing control’s single document interface.

  10. Document and Window properties.

  11. The Src property.

  12. False. You are always working on a copy of the document when using the drawing control and must use the SaveAs method to save changes to the drawing.

  13. False. The ShapeSheet an icon editing windows cannot be displayed, but the viewing windows can be controlled by the host application.

  14. False. The host application must also support OLE menu merging.

  15. SpatialSearch.



Adding the Office Fluent UI to an existing Add-in


Microsoft Office 2007 introduced a new user interface called the Fluent UI or Ribbon interface; however this new interface was not adopted in all of the Office 2007 applications. Visio 2007 and other Office 2007 applications continued to use the older CommandBars interface.

Now with the release of Microsoft Visio 2010, the Ribbon interface has been adopted allowing Visio solution developers to build rich Ribbon based interfaces for their Visio based solutions.

This adoption does pose some issues for the Visio solution developer as this is yet another user interface technology that is available via the Visio API, giving the Visio solution developer three choices, 1) UIObject 2) CommandBars 3) Ribbon. The UIObject is still available however it is recommened that solution developer not use this API as it could be deprecated in future releases. This is also the case for CommandBars as future development investments will now be focused on the Ribbon interface.

Visio solution developers that are creating new solutions specifically targeted for Visio 2010 should create their UI using the new Ribbon UI. Visio solution developers that currently maintain Visio 2003/2007 based solutions have a choice to make, migrate their solution to target Visio 2010 and create their UI using the Ribbons or upgrade their solution to target both Visio 2007 and Visio 2010 and manage both a CommandBars based UI and a new Ribbon based UI.





Figure 1 – the Add-Ins tab is a catch all for UIObject and CommandBar based UIs

This article will walk you thru the process of creating a Ribbon based interface for an existing Visio 2007 add-in, providing best practices for Ribbon item state management as well as best practices for supporting both CommandBar and Ribbon based UIs in one add-in.




Download 0.78 Mb.

Share with your friends:
1   ...   28   29   30   31   32   33   34   35   36




The database is protected by copyright ©ininet.org 2024
send message

    Main page