public RmlWidgetComponent(RmlView view, AnomalousMvcContext context, MyGUIViewHost viewHost)
            : base("Medical.GUI.AnomalousMvc.RmlView.RmlWidgetComponent.layout", viewHost)
        {
            this.context         = context;
            this.eventController = view.createRocketEventController(context, viewHost);

            rmlImage     = (ImageBox)widget;
            rocketWidget = new RocketWidget(rmlImage, viewHost.View.Transparent, false);
            imageHeight  = widget.Height;
            imageWidth   = widget.Width;

            if (view.RmlFile != null)
            {
                startRmlUpdate();
                if (view.RmlFile != null)
                {
                    rocketWidget.Context.ZoomLevel = view.ZoomLevel;
                    documentName = RocketInterface.createValidFileUrl(context.ResourceProvider.getFullFilePath(view.RmlFile));
                    using (ElementDocument document = rocketWidget.Context.LoadDocument(documentName))
                    {
                        if (document != null)
                        {
                            document.Show();
                            rocketWidget.removeFocus();
                            rocketWidget.renderOnNextFrame();
                        }
                    }
                }
                endRmlUpdate();
            }

            view._fireComponentCreated(this);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Reset the event controller back to generating debug events. This
 /// should be done when you are finished with what you needed to load
 /// with setEventController.
 /// </summary>
 public static void resetEventController()
 {
     rocketEventController = null;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Set an event controller to generate custom events when loading a document or other work.
 /// </summary>
 /// <param name="eventController">The event controller to generate custom events.</param>
 public static void setEventController(RocketEventController eventController)
 {
     rocketEventController = eventController;
 }