示例#1
0
 public ViewChangeButtons(CentricView viewport, PreviousViewports invoker, Control control)
     : base()
 {
     canvas = control;
     InitializeComponent(viewport, invoker);
     currentActionButton = arrowToggle;
 }
示例#2
0
        public ZoomOutAction(CentricView view, Point point)
            : base(view)
        {
            Debug.Assert(point != null, "Location is needed to zoom out!");

            location = point;
        }
示例#3
0
        public MoveAction(CentricView view, Point point)
            : base(view)
        {
            Debug.Assert(point != null, "Difference of points is needed to moving!");

            difference = point;
        }
示例#4
0
            protected ButtonType(CentricView view, PreviousViewports invokerView)
            {
                Debug.Assert(view != null, "Viewport must be valid!");
                Debug.Assert(invokerView != null, "Invoker must be valid!");

                viewport = view;
                invoker  = invokerView;
            }
示例#5
0
 public ArrowButton(CentricView viewport, PreviousViewports invoker) : base(viewport, invoker)
 {
 }
示例#6
0
 private void InitializeComponent(CentricView viewport, PreviousViewports invoker)
 {
     arrowToggle   = new Button();
     zoomInToggle  = new Button();
     zoomOutToggle = new Button();
     moveToggle    = new Button();
     SuspendLayout();
     //
     // arrowToggle
     //
     arrowToggle.Anchor                = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Right);
     arrowToggle.BackColor             = SystemColors.ButtonHighlight;
     arrowToggle.BackgroundImage       = Properties.Resources.Arrow;
     arrowToggle.BackgroundImageLayout = ImageLayout.Center;
     arrowToggle.Location              = new Point(0, 0);
     arrowToggle.Name                    = "arrowToggle";
     arrowToggle.Size                    = new Size(36, 36);
     arrowToggle.TabIndex                = 0;
     arrowToggle.Tag                     = new ArrowButton(viewport, invoker);
     arrowToggle.UseMnemonic             = false;
     arrowToggle.UseVisualStyleBackColor = false;
     arrowToggle.Click                  += new EventHandler(ArrowToggleClick);
     //
     // zoomInToggle
     //
     zoomInToggle.Anchor                = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Right);
     zoomInToggle.BackgroundImage       = Properties.Resources.ZoomIn;
     zoomInToggle.BackgroundImageLayout = ImageLayout.Center;
     zoomInToggle.Location              = new Point(38, 0);
     zoomInToggle.Name        = "zoomInToggle";
     zoomInToggle.Size        = new Size(36, 36);
     zoomInToggle.TabIndex    = 1;
     zoomInToggle.Tag         = new ZoomInButton(viewport, invoker);
     zoomInToggle.UseMnemonic = false;
     zoomInToggle.Click      += new EventHandler(ZoomInToggleClick);
     //
     // zoomOutToggle
     //
     zoomOutToggle.Anchor                = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Right);
     zoomOutToggle.BackgroundImage       = Properties.Resources.ZoomOut;
     zoomOutToggle.BackgroundImageLayout = ImageLayout.Center;
     zoomOutToggle.Location              = new Point(76, 0);
     zoomOutToggle.Name        = "zoomOutToggle";
     zoomOutToggle.Size        = new Size(36, 36);
     zoomOutToggle.TabIndex    = 2;
     zoomOutToggle.Tag         = new ZoomOutButton(viewport, invoker);
     zoomOutToggle.UseMnemonic = false;
     zoomOutToggle.Click      += new EventHandler(ZoomOutToggleClick);
     //
     // moveToggle
     //
     moveToggle.Anchor                = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Right);
     moveToggle.BackgroundImage       = Properties.Resources.Drag;
     moveToggle.BackgroundImageLayout = ImageLayout.Center;
     moveToggle.Location              = new Point(114, 0);
     moveToggle.Name        = "dragToggle";
     moveToggle.Size        = new Size(36, 36);
     moveToggle.TabIndex    = 3;
     moveToggle.Tag         = new MoveButton(viewport, invoker);
     moveToggle.UseMnemonic = false;
     moveToggle.Click      += new EventHandler(DragToggleClick);
     //
     // ViewChange
     //
     Anchor = (AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Bottom)
                              | AnchorStyles.Left)
                             | AnchorStyles.Right);
     Controls.Add(moveToggle);
     Controls.Add(zoomOutToggle);
     Controls.Add(zoomInToggle);
     Controls.Add(arrowToggle);
     Name = "ViewChangeButtons";
     Text = string.Empty;
     Size = new Size(150, 36);
     ResumeLayout(false);
     PerformLayout();
 }
示例#7
0
 public ZoomOutButton(CentricView viewport, PreviousViewports invoker)
     : base(viewport, invoker)
 {
 }
示例#8
0
        protected ViewChange(CentricView view)
        {
            Debug.Assert(view != null, "We need viewport to change it!");

            Viewport = view;
        }
示例#9
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     canvas            = new PictureBox();
     canvas.Size       = new Size(530, 528);
     viewport          = new CentricView(canvas.Width, canvas.Height, 0, 0, 1);
     invoker           = new PreviousViewports();
     viewChangeButtons = new WmsViewer.ViewChangeButtons(viewport, invoker, canvas);
     newWmsButton      = new Button();
     layerSettings     = new WmsViewer.LayerSettings(canvas);
     wmsSettings       = new WmsViewer.WmsSettings(canvas);
     layers            = new TreeView();
     statusBar         = new StatusStrip();
     coordinatesLabel  = new ToolStripStatusLabel();
     ((ISupportInitialize)canvas).BeginInit();
     statusBar.SuspendLayout();
     SuspendLayout();
     //
     // canvas
     //
     canvas.Anchor = (AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Bottom)
                                     | AnchorStyles.Left) | AnchorStyles.Right);
     canvas.BackColor   = Color.White;
     canvas.Location    = new Point(0, 0);
     canvas.Name        = "canvas";
     canvas.TabIndex    = 0;
     canvas.TabStop     = false;
     canvas.Paint      += new PaintEventHandler(CanvasRedraw);
     canvas.MouseClick += new MouseEventHandler(CanvasMouseClick);
     canvas.MouseEnter += new EventHandler(CanvasEnter);
     canvas.MouseDown  += new MouseEventHandler(CanvasMouseDown);
     canvas.MouseUp    += new MouseEventHandler(CanvasMouseUp);
     canvas.MouseWheel += new MouseEventHandler(CanvasMouseWheel);
     canvas.Resize     += new EventHandler(CanvasResize);
     //
     // viewChangeButtons
     //
     viewChangeButtons.Anchor   = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Right);
     viewChangeButtons.Location = new Point(532, 4);
     viewChangeButtons.Name     = "viewChangeButtons1";
     viewChangeButtons.Size     = new Size(150, 36);
     viewChangeButtons.TabIndex = 8;
     viewChangeButtons.Text     = string.Empty;
     //
     // newWmsButton
     //
     newWmsButton.Anchor   = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Right);
     newWmsButton.Location = new Point(686, 11);
     newWmsButton.Name     = "newWmsButton";
     newWmsButton.Size     = new Size(73, 23);
     newWmsButton.TabIndex = 4;
     newWmsButton.Text     = Properties.Resources.NewWms;
     newWmsButton.Click   += new EventHandler(NewWmsButtonClick);
     //
     // layerSettings
     //
     layerSettings.Anchor      = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Right);
     layerSettings.BorderStyle = BorderStyle.FixedSingle;
     layerSettings.Enabled     = false;
     layerSettings.Location    = new Point(531, 216);
     layerSettings.MinimumSize = new Size(228, 236);
     layerSettings.Name        = "layerSettings";
     layerSettings.Size        = new Size(228, 236);
     layerSettings.TabIndex    = 6;
     //
     // wmsSettings
     //
     wmsSettings.Anchor      = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Right);
     wmsSettings.BorderStyle = BorderStyle.FixedSingle;
     wmsSettings.Enabled     = false;
     wmsSettings.Location    = new Point(531, 46);
     wmsSettings.MinimumSize = new Size(228, 164);
     wmsSettings.Name        = "wmsSettings";
     wmsSettings.Size        = new Size(228, 164);
     wmsSettings.TabIndex    = 5;
     //
     // layers
     //
     layers.Anchor       = (AnchorStyles)((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Right);
     layers.CheckBoxes   = true;
     layers.Location     = new Point(531, 458);
     layers.Name         = "layers";
     layers.Size         = new Size(228, 68);
     layers.TabIndex     = 7;
     layers.AfterCheck  += new TreeViewEventHandler(LayersNodeChecked);
     layers.AfterSelect += new TreeViewEventHandler(LayersSelectChanged);
     layers.KeyDown     += new KeyEventHandler(LayersKeyDown);
     //
     // statusBar
     //
     statusBar.Items.AddRange(new ToolStripItem[] {
         coordinatesLabel
     });
     statusBar.Location = new Point(0, 527);
     statusBar.Name     = "statusBar";
     statusBar.Size     = new Size(760, 22);
     statusBar.TabIndex = 0;
     //
     // coordinatesLabel
     //
     coordinatesLabel.Name = "coordinatesLabel";
     coordinatesLabel.Size = new Size(0, 17);
     //
     // ViewerWindow
     //
     AutoScaleDimensions = new SizeF(6F, 13F);
     AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     ClientSize          = new Size(760, 549);
     Controls.Add(statusBar);
     Controls.Add(layers);
     Controls.Add(layerSettings);
     Controls.Add(wmsSettings);
     Controls.Add(viewChangeButtons);
     Controls.Add(newWmsButton);
     Controls.Add(canvas);
     Icon         = Properties.Resources.Main;
     KeyPreview   = true;
     MinimumSize  = new Size(768, 576);
     Name         = "ViewerWindow";
     Text         = Properties.Resources.ApplicationTitle;
     FormClosing += new FormClosingEventHandler(ViewerWindowClosing);
     KeyDown     += new KeyEventHandler(ViewerWindowKeyDown);
     Load        += new EventHandler(ViewerWindowInit);
     ((ISupportInitialize)canvas).EndInit();
     statusBar.ResumeLayout(false);
     statusBar.PerformLayout();
     ResumeLayout(false);
     PerformLayout();
 }