Пример #1
0
        private void InitFormControls()
        {
            // create the second view and attach it to the document
            NDrawingView secondView = new NDrawingView();

            secondView.Grid.Visible = false;
            secondView.GlobalVisibility.ShowPorts = false;
            secondView.Size     = new Size(300, this.Height / 2);
            secondView.Dock     = DockStyle.Top;
            secondView.Document = document;

            // create the third view and attach it to the document
            NDrawingView thirdView = new NDrawingView();

            thirdView.Grid.Visible = false;
            thirdView.GlobalVisibility.ShowPorts = false;
            thirdView.Dock     = DockStyle.Fill;
            thirdView.Document = document;

            // create a splitter
            Splitter splitter = new Splitter();

            splitter.Dock = DockStyle.Top;

            // update the form controls
            Controls.Clear();
            Controls.Add(thirdView);
            Controls.Add(splitter);
            Controls.Add(secondView);
        }
            /// <summary>
            /// Executes the command action.
            /// </summary>
            /// <param name="target"></param>
            /// <param name="parameter"></param>
            public override void Execute(NNode target, object parameter)
            {
                NDrawingView drawingView = GetDrawingView(target);

                NMessageBox.Show("Drawing Custom Command executed!", "Custom Command", ENMessageBoxButtons.OK,
                                 ENMessageBoxIcon.Information);
            }
Пример #3
0
        protected override NWidget CreateExampleContent()
        {
            // create a library browser that displays all predefined shape factories
            m_LibraryBrowser = new NLibraryBrowser();
            m_LibraryBrowser.AddPredefinedShapeFactories();
            m_LibraryBrowser.NavigationBar.SelectedIndex = 2;
            m_LibraryBrowser.LibraryViewType             = ENLibraryViewType.Thumbnails;
            m_LibraryBrowser.LibrariesFolder             = @"E:\Nevron.MyDrawClipartTest\LibrariesNDX";

            // create pan and zoom
            m_PanAndZoom = new NPanAndZoomView();
            m_PanAndZoom.PreferredSize = new Nov.Graphics.NSize(150, 150);

            // create side bar
            m_SideBar = new NSideBar();

            // create a drawing view
            m_DrawingView = new NDrawingView();
            m_DrawingView.HorizontalPlacement = ENHorizontalPlacement.Fit;
            m_DrawingView.VerticalPlacement   = ENVerticalPlacement.Fit;
            m_DrawingDocument = m_DrawingView.Document;

            // bind components to drawing view
            m_LibraryBrowser.DrawingView = m_DrawingView;
            m_PanAndZoom.DrawingView     = m_DrawingView;
            m_SideBar.DrawingView        = m_DrawingView;

            // create splitters
            NSplitter libraryPanSplitter = new NSplitter();

            libraryPanSplitter.Orientation   = ENHVOrientation.Vertical;
            libraryPanSplitter.SplitMode     = ENSplitterSplitMode.OffsetFromFarSide;
            libraryPanSplitter.Pane1.Content = m_LibraryBrowser;
            libraryPanSplitter.Pane2.Content = m_PanAndZoom;

            NSplitter leftSplitter = new NSplitter();

            leftSplitter.Orientation   = ENHVOrientation.Horizontal;
            leftSplitter.SplitMode     = ENSplitterSplitMode.OffsetFromNearSide;
            leftSplitter.SplitOffset   = 370;
            leftSplitter.Pane1.Content = libraryPanSplitter;
            leftSplitter.Pane2.Content = m_DrawingView;

            NSplitter rightSplitter = new NSplitter();

            rightSplitter.Orientation   = ENHVOrientation.Horizontal;
            rightSplitter.SplitMode     = ENSplitterSplitMode.OffsetFromFarSide;
            rightSplitter.SplitOffset   = 370;
            rightSplitter.Pane1.Content = leftSplitter;
            rightSplitter.Pane2.Content = m_SideBar;

            // Create the ribbon UI
            NDiagramRibbonBuilder builder = new NDiagramRibbonBuilder();

            return(builder.CreateUI(rightSplitter, m_DrawingView));
        }
Пример #4
0
        private void CreateSourceView()
        {
            if (sourceView == null)
            {
                // begin view init
                sourceView = new NDrawingView();
                sourceView.BeginInit();

                sourceView.Dock   = DockStyle.Fill;
                sourceView.Parent = sourceViewPanel;

                // begin document init
                sourceDocument = new NDrawingDocument();
                sourceDocument.BeginInit();
                sourceDocument.BackgroundStyle.FillStyle = new NColorFillStyle(Color.FromArgb(70, Color.RoyalBlue));

                // attach document to view
                sourceView.Document = sourceDocument;
            }
            else
            {
                // begin view init
                sourceView.BeginInit();

                // begin document init
                sourceDocument.BeginInit();
                sourceDocument.ActiveLayer.RemoveAllChildren();
            }

            sourceView.AllowDrop = true;
            sourceView.HorizontalRuler.Visible    = false;
            sourceView.VerticalRuler.Visible      = false;
            sourceView.GlobalVisibility.ShowPorts = false;

            string[] toolNames = new string[] { NDWFR.ToolCreateGuideline,
                                                NDWFR.ToolHandle,
                                                NDWFR.ToolMove,
                                                NDWFR.ToolSelector,
                                                NDWFR.ToolContextMenu,
                                                NDWFR.ToolKeyboard,
                                                NDWFR.ToolInplaceEdit };

            sourceView.Controller.Tools.SingleEnableTools(toolNames);

            CreateSourceScene();

            // end document init
            sourceDocument.EndInit();

            // end view init
            sourceView.EndInit();
        }
Пример #5
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public NPuzzleAnimationRenderPage()
        {
            DrawingView            = new NDrawingView();
            DrawingView.ViewLayout = CanvasLayout.Stretch;

            NImageResponse swfResponse = new NImageResponse();

            swfResponse.ImageFormat          = new NSwfImageFormat();
            swfResponse.StreamImageToBrowser = true;
            DrawingView.ServerSettings.BrowserResponseSettings.DefaultResponse = swfResponse;

            // init document
            CreateScene();

            this.DrawingView.SizeToContent();
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        public NFlashRedirectRenderPage()
        {
            DrawingView = new NDrawingView();

            NImageResponse swfResponse = new NImageResponse();

            swfResponse.ImageFormat          = new NSwfImageFormat();
            swfResponse.StreamImageToBrowser = true;
            DrawingView.ServerSettings.BrowserResponseSettings.DefaultResponse = swfResponse;

            // init document
            NDrawingDocument document = DrawingView.Document;

            document.BeginInit();
            CreateScene(document);
            document.EndInit();

            DrawingView.SizeToContent();
        }
Пример #7
0
		/// <summary>
		/// 
		/// </summary>
		private void InitializeDiagramExamplesComponents()
		{
			NDiagramExamplesDockManager dockManager = (NDiagramExamplesDockManager)this.DockManager;

			// create the view
			view = new NDrawingView();
			view.Dock = System.Windows.Forms.DockStyle.Fill;

			// create the document
			document = new NDrawingDocument();
			view.Document = document;

			// create the event log
			eventLogControl = new NEventLogUC();
			dockManager.EventLogPanel.Controls.Add(eventLogControl);
			eventLogControl.Dock = System.Windows.Forms.DockStyle.Fill;
			eventLogControl.Form = this;

			// create the property browser
			propertyBrowser = new NPropertyBrowser();
			propertyBrowser.Dock = System.Windows.Forms.DockStyle.Fill;
			propertyBrowser.View = view;
			dockManager.DiagramExplorerPanel.Controls.Add(propertyBrowser);

			// create the diagram designer panel
			Panel designerPanel = new Panel();
			designerPanel.Dock = System.Windows.Forms.DockStyle.Fill;
			designerPanel.Controls.Add(view);
			dockManager.DiagramDesignerPanel.Controls.Add(designerPanel);

			// create the command bars manager
			commandBarsManager = new NDiagramCommandBarsManager();
			commandBarsManager.View = view;
			commandBarsManager.ParentControl = designerPanel;

			// create the status bar
			NDiagramStatusBar statusBar = new NDiagramStatusBar();
			statusBar.Visible = false;
			statusBar.View = view;
			commandBarsManager.StatusBar = statusBar;
			Controls.Add(statusBar);
		}
Пример #8
0
        protected override NWidget CreateExampleContent()
        {
            // Create a simple drawing
            m_DrawingView     = new NDrawingView();
            m_DrawingDocument = m_DrawingView.Document;

            m_DrawingView.Document.HistoryService.Pause();
            try
            {
                InitDiagram();
            }
            finally
            {
                m_DrawingView.Document.HistoryService.Resume();
            }

            // Create and execute a ribbon UI builder
            m_RibbonBuilder = new NDiagramRibbonBuilder();
            return(m_RibbonBuilder.CreateUI(m_DrawingView));
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        public NXamlExportRenderPage()
        {
            DrawingView            = new NDrawingView();
            DrawingView.ViewLayout = CanvasLayout.Stretch;

            NImageResponse xamlResponse = new NImageResponse();

            xamlResponse.ImageFormat          = new NXamlImageFormat();
            xamlResponse.StreamImageToBrowser = true;
            DrawingView.ServerSettings.BrowserResponseSettings.DefaultResponse = xamlResponse;

            // init document
            NDrawingDocument document = this.DrawingView.Document;

            document.BeginInit();
            CreateScene(document);
            document.EndInit();

            this.DrawingView.SizeToContent();
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        public NWorldCup2006RenderPage()
        {
            FLAGS = null;
            InitImages();

            DrawingView            = new NDrawingView();
            DrawingView.ViewLayout = CanvasLayout.Stretch;

            NImageResponse swfResponse = new NImageResponse();

            swfResponse.ImageFormat          = new NSwfImageFormat();
            swfResponse.StreamImageToBrowser = true;
            DrawingView.ServerSettings.BrowserResponseSettings.DefaultResponse = swfResponse;

            // init document
            NDrawingDocument document = DrawingView.Document;

            document.BeginInit();
            CreateScene(document);
            document.EndInit();

            DrawingView.SizeToContent();
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        public NPdfExportRenderPage()
        {
            DrawingView            = new NDrawingView();
            DrawingView.ViewLayout = CanvasLayout.Normal;

            string format = HttpContext.Current.Request.QueryString["format"];

            if (format == "pdf")
            {
                // Create a pdf image format
                NPdfImageFormat imageFormat = new NPdfImageFormat();
                imageFormat.PageSize    = new NSizeF(GetSizeInPoints("PageWidth"), GetSizeInPoints("PageHeight"));
                imageFormat.PageMargins = new NMarginsF(GetSizeInPoints("MarginsLeft"), GetSizeInPoints("MarginsTop"),
                                                        GetSizeInPoints("MarginsRight"), GetSizeInPoints("MarginsBottom"));
                imageFormat.ZoomPercent = GetFloat("ZoomPercent");
                if (GetBoolean("FitToPage"))
                {
                    imageFormat.Layout = PagedLayout.FitToPages;
                }

                // Override the default response
                NImageResponse imageResponse = new NImageResponse();
                imageResponse.ImageFormat          = imageFormat;
                imageResponse.StreamImageToBrowser = true;
                DrawingView.ServerSettings.BrowserResponseSettings.DefaultResponse = imageResponse;
            }

            // init document
            NDrawingDocument document = this.DrawingView.Document;

            document.BeginInit();
            CreateScene(document);
            document.EndInit();

            this.DrawingView.SizeToContent();
        }