void view_ViewResized(ViewHost view)
            {
                if (!view.Animating || lastWorkingParentHeight == int.MinValue)
                {
                    bool  changeScale = false;
                    float ratio       = 1.0f;
                    if (displayManager.VectorMode)
                    {
                        IntSize2 rigidParentSize = view.Container.RigidParentWorkingSize;
                        if (rigidParentSize.Height != lastWorkingParentHeight)
                        {
                            ratio = rigidParentSize.Height / (float)Slideshow.BaseSlideScale * displayManager.AdditionalZoomMultiple;
                            lastWorkingParentHeight = rigidParentSize.Height;
                            changeScale             = true;
                        }
                    }
                    else if (lastWorkingParentHeight != int.MaxValue)
                    {
                        ratio                   = displayManager.AdditionalZoomMultiple;
                        changeScale             = true;
                        lastWorkingParentHeight = int.MaxValue;
                    }

                    if (changeScale)
                    {
                        foreach (var host in viewHosts.Values)
                        {
                            SlidePanel panel = masterStrategy.panels[host.View.ElementName];
                            host.changeScale(ratio);
                        }
                    }
                }
            }
            public IntSize2 layoutView(LayoutContainer layoutContainer, IntSize2 originalSize, MyGUIView view)
            {
                float ratio = 1.0f;

                if (displayManager.VectorMode)
                {
                    ratio = layoutContainer.RigidParentWorkingSize.Height / (float)Slideshow.BaseSlideScale;
                }
                ratio *= displayManager.AdditionalZoomMultiple;
                SlidePanel panel = masterStrategy.panels[view.ElementName];
                int        size  = (int)(ScaleHelper.Scaled(panel.Size) * ratio);

                switch (view.ElementName.LocationHint)
                {
                case ViewLocations.Left:
                    return(new IntSize2(size, originalSize.Height));

                case ViewLocations.Right:
                    return(new IntSize2(size, originalSize.Height));

                case ViewLocations.Top:
                    return(new IntSize2(originalSize.Width, size));

                case ViewLocations.Bottom:
                    return(new IntSize2(originalSize.Width, size));

                default:
                    return(new IntSize2(size, size));
                }
            }
        public SlidePanel getPanel(LayoutElementName name)
        {
            SlidePanel ret = null;

            if (panels.TryGetValue(name, out ret))
            {
                return(ret);
            }
            return(null);
        }
Пример #4
0
 public override bool applyToExisting(Slide slide, SlidePanel panel, bool overwriteContent, EditorResourceProvider resourceProvider)
 {
     if (panel is RmlSlidePanel)
     {
         if (overwriteContent)
         {
             ((RmlSlidePanel)panel).rmlFile = this.rmlFile;
         }
         return(base.applyToExisting(slide, panel, overwriteContent, resourceProvider));
     }
     return(false);
 }
        public SlideLayoutStrategy createDerivedStrategy(Slide destinationSlide, Slide thisPanelSlide, EditorResourceProvider resourceProvider, bool overwriteContent, bool createTemplates)
        {
            SlideLayoutStrategy       destinationSlideStrategy = destinationSlide.LayoutStrategy;
            BorderSlideLayoutStrategy copiedLayoutStrategy     = new BorderSlideLayoutStrategy();

            foreach (SlidePanel panel in panels.Values)
            {
                SlidePanel copiedPanel = destinationSlideStrategy.getPanel(panel.ElementName);
                if (copiedPanel != null) //Already exists in the destination, so duplicate it instead of creating a new one
                {
                    copiedPanel = copiedPanel.clone(destinationSlide, destinationSlide, createTemplates, resourceProvider);
                    panel.applyToExisting(destinationSlide, copiedPanel, overwriteContent, resourceProvider);
                }
                else
                {
                    copiedPanel = panel.clone(thisPanelSlide, destinationSlide, createTemplates, resourceProvider);
                }
                copiedLayoutStrategy.addPanel(copiedPanel);
            }
            return(copiedLayoutStrategy);
        }
Пример #6
0
        public override bool applyToExisting(Slide slide, SlidePanel panel, bool overwriteContent, EditorResourceProvider resourceProvider)
        {
            //Do the base version first, this will fix any filenames
            bool result = base.applyToExisting(slide, panel, overwriteContent, resourceProvider);

            if (result)
            {
                if (panel is RmlSlidePanel)
                {
                    String rmlPath = ((RmlSlidePanel)panel).getRmlFilePath(slide);
                    if (overwriteContent || !resourceProvider.exists(rmlPath))
                    {
                        resourceProvider.ResourceCache.add(new ResourceProviderTextCachedResource(rmlPath, Encoding.UTF8, Rml, resourceProvider));
                    }
                }
                else
                {
                    result = false;
                }
            }
            return(result);
        }
Пример #7
0
 public virtual bool applyToExisting(Slide slide, SlidePanel panel, bool overwriteContent, EditorResourceProvider resourceProvider)
 {
     panel.Size        = this.Size;
     panel.ElementName = this.ElementName;
     return(true);
 }
 public void addPanel(SlidePanel panel)
 {
     panels.Add(panel.ElementName, panel);
 }
Пример #9
0
 public void addPanel(SlidePanel panel)
 {
     layoutStrategy.addPanel(panel);
 }