Example #1
0
 /// <summary>
 /// 当前的构造函数,初始化当前的绘制
 /// </summary>
 /// <param name="dc"></param>
 public SubArrayCommandTip(DrawingControl dc, TextTip tip)
     : base(dc, tip)
 {
     sublineGeometry = new SublineGeometry();
     sublineGeometry.SublineOffset = 0;
     sublineGeometry.ShowSize      = true;
 }
Example #2
0
 /// <summary>
 /// 当前的构造函数,初始化当前的绘制
 /// </summary>
 /// <param name="dc"></param>
 public SubMirrorCommandTip(DrawingControl dc, TextTip tip)
     : base(dc, tip)
 {
     sublineGeometry = new SublineGeometry();
     sublineGeometry.SublineOffset = 0;
     sublineGeometry.ShowSize      = false;
 }
Example #3
0
        public DrawPad()
        {
            InitializeComponent();

            Zoom = 1;

            _shapeDrawer    = new ShapeDrawer();
            _filler         = new Filler();
            _drawingControl = new DrawingControl();
            _drawingControl.SetShapDrawer(_shapeDrawer);
            _drawingControl.ShapeCreated += DrawingControl_ShapeCreated;

            _textControl              = new TextControl(gdiArea);
            _textControl.TextCreated += TextControl_TextCreated;
            _textControl.TextChanged += TextControl_TextChanged;

            _currentCommand = DrawPadCommand.None;
            _currentShape   = null;

            _outlineWidth = 2F;
            _outlineColor = Color.Black;
            _outlineDash  = DashStyle.Solid;
            _fillColor    = Color.Transparent;
            _textFont     = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 0);

            _shapeArea = 0;
        }
Example #4
0
        public Form1()
        {
            InitializeComponent();
            DrawingControl.SetDoubleBuffered(dataGridView1);
            this.Load += Form1_Load;
            dataGridView1.CellClick      += DataGridView1_CellClick;
            dataGridView1.EditMode        = DataGridViewEditMode.EditProgrammatically;
            dataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.Sunken;

            var lifeRules = new Func <int, bool, bool>((p, state) =>
            {
                if (p == 3)
                {
                    return(true);
                }
                else
                if (p == 2)
                {
                    return(state);
                }
                else
                {
                    return(false);
                }
            });
        }
Example #5
0
 public AddVertexAction(DrawingControl control)
 {
     _control = control;
     Visible = false;
     RePaint = true;
     IsToAll = true;
 }
Example #6
0
 public AddVertexAction(DrawingControl control)
 {
     _control = control;
     Visible  = false;
     RePaint  = true;
     IsToAll  = true;
 }
Example #7
0
        public FishshopForm()
        {
            Inventory.OnCannotBeBought += CannotBeBought;
            Inventory.OnCanBeBought    += CanBeBought;
            Load += RodButton_Click;


            InitializeComponent();
            DrawingControl.SetDoubleBuffered(dataGridView1);


            topButtons = panel1.Controls.OfType <PictureBox>().ToList();


            displayedLabels = new List <Label> {
                NameOfItem, Description, MaxWeight, Price,
            };

            leftButtons = new List <PictureBox> {
                RodButton,
                ReelButton,
                LineButton,
                HookButton,
                BaitButton,
                CormButton,
                AccessoriesButton,
                PrivateButton
            };

            leftLabels = new List <Label> {
                rodLabel, reelLabel, lineLabel, hookLabel, cormLabel, baitLabel
            };
        }
Example #8
0
 /// <summary>
 /// 当前的构造函数,初始化当前的绘制
 /// </summary>
 /// <param name="dc"></param>
 public SubBeamTip(DrawingControl dc, TextTip tip) : base(dc, tip)
 {
     sublineGeometry          = new SublineGeometry();
     sublineGeometry.ShowSize = false;
     Tip.TipChanged          += tip_TipChanged;
     Tip.TipCompleted        += tip_TipCompleted;
 }
Example #9
0
        public virtual void GoFullScreenClient(Server server, bool isTopMostWindow)
        {
            RdpClient client    = server.Client;
            Rectangle rectangle = Screen.GetBounds(client.Control);

            if (Program.Preferences.UseMultipleMonitors && (rectangle.Height < client.MsRdpClient.DesktopHeight || rectangle.Width < client.MsRdpClient.DesktopWidth))
            {
                int      num        = 0;
                int      num2       = 65535;
                Screen[] allScreens = Screen.AllScreens;
                foreach (Screen screen in allScreens)
                {
                    num += screen.Bounds.Width;
                    num2 = Math.Min(screen.Bounds.Height, num2);
                }
                num       = Math.Min(num, RdpClient.MaxDesktopWidth);
                num2      = Math.Min(num2, RdpClient.MaxDesktopHeight);
                rectangle = new Rectangle(0, 0, num, num2);
            }
            _savedBounds      = base.Bounds;
            _savedBorderStyle = base.FormBorderStyle;
            DrawingControl.SuspendDrawing(this);
            SuspendLayout();
            base.FormBorderStyle = FormBorderStyle.None;
            SetMainMenuVisibility(show: false);
            SetBounds(rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height);
            server.SetClientSizeProperties();
            client.Control.Bounds = new Rectangle(0, 0, base.Width, base.Height);
            ResumeLayout();
            base.TopMost = isTopMostWindow;
            client.Control.Show();
            DrawingControl.ResumeDrawing(this);
            BringToFront();
            Activate();
        }
        /// <summary>
        /// This event fires when the user, using the Zoom Tool, has clicked on the Canvas. The normal Changed event is suppressed,
        /// and this one fires instead. The CanvasPane should be scrolled such that the click point is centered on the screen, and the new Zoom Level
        /// set.
        /// </summary>
        private void Document_ClickZoom(object sender, ZoomEventArgs e)
        {
            _settingZoom   = true;
            _settingScroll = true;

            DrawingControl.SuspendDrawing(pnlWorkspace);

            float OldZoom = _Document.Scaling.Zoom.GetValueOrDefault();

            // Perform the changes to zoom
            _Document.Scaling.Zoom = e.ZoomLevel;

            SetCanvasSize();
            SetCanvasPosition();

            // Regenerate the composite background image with the correct zoom scale
            //_Document.Background.Set();

            PointF ZoomPoint = e.ZoomPoint;
            SizeF  Size      = _Document.Scaling.CanvasSizeF;

            // Convert the zoom point from old zoom, to the new value.
            // We do this because the Zoom event has already fired by the time this event fires, and we need to scale the
            // point accordingly
            ZoomPoint   = new PointF((ZoomPoint.X / OldZoom) * e.ZoomLevel, (ZoomPoint.Y / OldZoom) * e.ZoomLevel);
            OldZoom     = e.ZoomLevel;
            _hScrollPct = ZoomPoint.X / Size.Width;
            _vScrollPct = ZoomPoint.Y / Size.Height;

            _settingScroll = false;
            _settingZoom   = false;

            SetScrollPercent();
            DrawingControl.ResumeDrawing(pnlWorkspace);
        }
 public static CodeExpression GetDrawItemExpression(DrawingControl dc)
 {
     if (dc != null)
     {
         DrawingItem di = dc.Item as DrawingItem;
         if (di != null)
         {
             DrawDataRepeater ddp = di.Container as DrawDataRepeater;
             if (ddp != null)
             {
                 //((item type)<repeater name>[<drawing item name>])
                 TypeMappingAttribute tma = null;
                 object[]             vs  = dc.GetType().GetCustomAttributes(typeof(TypeMappingAttribute), true);
                 if (vs != null && vs.Length > 0)
                 {
                     tma = vs[0] as TypeMappingAttribute;
                 }
                 if (tma != null)
                 {
                     CodeFieldReferenceExpression repeater = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), ddp.Name);
                     CodeIndexerExpression        cie      = new CodeIndexerExpression(repeater, new CodePrimitiveExpression(dc.Name));
                     CodeCastExpression           cce      = new CodeCastExpression(tma.MappedType, cie);
                     return(cce);
                 }
             }
         }
     }
     return(null);
 }
Example #12
0
        /// <summary>
        /// 当前的构造函数
        /// </summary>
        /// <param name="dc"></param>
        public ActionTip(DrawingControl dc)
        {
            DrawingControl = dc;

            textTip             = new TextTip();
            textTip.Placement   = PlacementMode.RelativePoint;
            textTip.ESCPressed += textTip_ESCPressed;
        }
        public UpdateControlBoxAction(DrawingControl control)
        {
            _control = control;

            Visible = false;
            RePaint = true;
            IsToAll = true;
        }
Example #14
0
        public LoadControlBoxAction()
        {
            _control = null;

            Visible = false;
            RePaint = true;
            IsToAll = true;
        }
Example #15
0
        public UpdateControlBoxAction(DrawingControl control)
        {
            _control = control;

            Visible = false;
            RePaint = true;
            IsToAll = true;
        }
Example #16
0
 /// <summary>
 /// 当前的构造函数,初始化当前的绘制
 /// </summary>
 /// <param name="dc"></param>
 public SubArcTip(DrawingControl dc, TextTip tip)
     : base(dc, tip)
 {
     sublineGeometry = new SublineGeometry();
     sublineGeometry.SublineOffset = 0;
     sublineGeometry.ShowSize      = true;
     Tip.TipChanged   += tip_TipChanged;
     Tip.TipCompleted += tip_TipCompleted;
 }
        public GeometryWrapper(DrawingControl owner, BaseRectangleGeometry geometry)
        {
            m_DC       = owner;
            m_Geometry = geometry;

            if (m_Geometry != null)
            {
                m_Geometry.Wrapper = this;
            }
        }
Example #18
0
 /// <summary>
 /// 当前的构造函数,初始化当前的绘制
 /// </summary>
 /// <param name="dc"></param>
 public SubOffsetCommandTip(DrawingControl dc, TextTip tip)
     : base(dc, tip)
 {
     sublineHGeometry = new SublineGeometry();
     sublineHGeometry.SublineOffset = 0;
     sublineVGeometry = new SublineGeometry();
     sublineVGeometry.SublineOffset = 0;
     sublineJGeometry = new SublineGeometry();
     sublineJGeometry.SublineOffset = 0;
 }
Example #19
0
 private void SpatialControl_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     _camChanged = false;
     DrawingControl.Viewport.Camera.Changed += Camera_Changed;
     DrawingControl.ZoomSelected();
     DrawingControl.Viewport.Camera.Changed -= Camera_Changed;
     if (!_camChanged)
     {
         DrawingControl.ClipBaseSelected(0.15);
     }
 }
Example #20
0
        /// <summary>
        /// 当前的构造函数,初始化当前的绘制
        /// </summary>
        /// <param name="dc"></param>
        public SubEllipseTip(DrawingControl dc, TextTip tip) : base(dc, tip)
        {
            sublineHGeometry = new SublineGeometry();
            sublineHGeometry.SublineOffset = 0;
            sublineVGeometry = new SublineGeometry();
            sublineVGeometry.SublineOffset = 0;
            sublineVGeometry.ShowSize      = false;

            Tip.TipChanged   += tip_TipChanged;
            Tip.TipCompleted += tip_TipCompleted;
        }
Example #21
0
 /// <summary>
 /// 当前的构造函数,初始化当前的绘制
 /// </summary>
 /// <param name="dc"></param>
 public SubRotateCommandTip(DrawingControl dc, TextTip tip)
     : base(dc, tip)
 {
     sublineHGeometry = new SublineGeometry();
     sublineHGeometry.SublineOffset = 0;
     sublineHGeometry.ShowSize      = false;
     sublineVGeometry = new SublineGeometry();
     sublineVGeometry.SublineOffset = 0;
     sublineVGeometry.ShowSize      = false;
     angleGeometry = new AngleGeometry();
 }
Example #22
0
 public virtual void LeaveFullScreenClient(Server server)
 {
     DrawingControl.SuspendDrawing(this);
     SuspendLayout();
     base.FormBorderStyle = _savedBorderStyle;
     SetMainMenuVisibility();
     base.Bounds = _savedBounds;
     ResumeLayout();
     base.TopMost = false;
     DrawingControl.ResumeDrawing(this);
     server.SetClientSizeProperties();
     Activate();
 }
        private void LoadSheets(DataGridView dataGridView)
        {
            DrawingControl.SetDoubleBuffered(dataGridView);
            DrawingControl.SuspendDrawing(dataGridView);

            foreach (ViewSheet viewSheet in viewSheets_ENTIRE_PROJECT)
            {
                string number = viewSheet.SheetNumber;
                string name   = viewSheet.Name;
                dataGridView.Rows.Add(number, name, false);
            }

            DrawingControl.ResumeDrawing(dataGridView);
        }
Example #24
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            dgvSharedParameters.Rows.Clear();

            List <string> sharedParamList = SharedParameterList();

            DrawingControl.SetDoubleBuffered(dgvSharedParameters);
            DrawingControl.SuspendDrawing(dgvSharedParameters);

            if (myRevitDoc.IsFamilyDocument)
            {
                List <string> familyParamList = FamilyParameters();

                foreach (string item in sharedParamList)
                {
                    char[]   chrSeparator = new char[] { '\t' };
                    string[] arrValues    = item.Split(chrSeparator, StringSplitOptions.None);

                    string paramName  = arrValues[1];
                    string paramType  = arrValues[2];
                    string paramGroup = arrValues[3];

                    if (!familyParamList.Contains(paramName))
                    {
                        dgvSharedParameters.Rows.Add(paramName, paramGroup, paramType, "", "");
                    }
                }
            }
            else
            {
                List <string> projectParamList = ProjectParameterList();

                foreach (string item in sharedParamList)
                {
                    char[]   chrSeparator = new char[] { '\t' };
                    string[] arrValues    = item.Split(chrSeparator, StringSplitOptions.None);

                    string paramName  = arrValues[1];
                    string paramType  = arrValues[2];
                    string paramGroup = arrValues[3];

                    if (!projectParamList.Contains(paramName))
                    {
                        dgvSharedParameters.Rows.Add(paramName, paramGroup, paramType, "", "", "");
                    }
                }
            }

            DrawingControl.ResumeDrawing(dgvSharedParameters);
        }
Example #25
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="dc"></param>
 public MessageTip(DrawingControl dc)
 {
     this.DrawingControl     = dc;
     this.Width              = 300;
     this.Height             = 60;
     this.PlacementTarget    = dc;
     this.Placement          = PlacementMode.Center;
     this.AllowsTransparency = true;
     this.Child              = texttip;
     this.StaysOpen          = false;
     this.PopupAnimation     = PopupAnimation.Slide;
     this.IsOpen             = false;
     timer.Elapsed          += timer_Elapsed;
 }
Example #26
0
        private void LoadSelectionDetails(int scrollAt = -1)
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                DrawingControl.SuspendDrawing(pMovieDetailsContainer);

                var selectedMovieData = (MovieShortInfo)dgvMoviesList.SelectedRows[0].DataBoundItem;

                var opRes = DAL.LoadMTD(selectedMovieData.Id, true);

                if (!opRes.Success)
                {
                    MsgBox.Show(string.Format("The following error occurred while loading the file details:{0}{0}{1}", Environment.NewLine, opRes.CustomErrorMessage),
                                "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                var prevInstance = pMovieDetailsContainer.Controls.Find("ucMovieInfo", false);

                if (prevInstance.Any())
                {
                    ((ucMovieInfo)prevInstance[0]).RefreshControls(DAL.CurrentMTD);
                }
                else
                {
                    var ucMovieInfo = new ucMovieInfo(false)
                    {
                        Dock = DockStyle.Top
                    };
                    ucMovieInfo.RefreshControls(DAL.CurrentMTD);

                    pMovieDetailsContainer.Controls.Add(ucMovieInfo);
                    ucMovieInfo.BringToFront();
                }
            }
            finally
            {
                if (scrollAt > -1)
                {
                    pMovieDetailsContainer.VerticalScroll.Value = scrollAt;
                }

                SetSaveButtonState(false);

                DrawingControl.ResumeDrawing(pMovieDetailsContainer);
                Cursor = Cursors.Default;
            }
        }
Example #27
0
        private void PrintPageHandler(object sender, PrintPageEventArgs e)
        {
            var printCanvas = new DrawingControl();

            printCanvas.Height = e.PrintableArea.Height;
            printCanvas.Width  = e.PrintableArea.Width;
            printCanvas.LoadDrawing(DrawingSerializer.SaveDrawing(drawingHost.CurrentDrawing));

            var savedScaleSetting = DynamicGeometry.Settings.ScaleTextWithDrawing;

            DynamicGeometry.Settings.ScaleTextWithDrawing = true;   // Must be true for text to appear as expected.
            printCanvas.Drawing.Recalculate();
            DynamicGeometry.Settings.ScaleTextWithDrawing = savedScaleSetting;

            e.PageVisual = printCanvas;
        }
Example #28
0
        private void lbSwitchToSimpleFilter_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                DrawingControl.SuspendDrawing(scMovies.Panel1);

                pBasicFilter.Visible = true;
                pAdvFilter.Visible   = false;

                ResetAdvancedFilter();
            }
            finally
            {
                DrawingControl.ResumeDrawing(scMovies.Panel1);
            }
        }
Example #29
0
        public DrawingVisualizeRoot()
        {
            MusicModule = new MusicModule();
            var resourceLoader = ResourceLoader.OfCopiedResources();

            DrawingModule = new DrawingModule(resourceLoader);

            Application    = new Application();
            DrawingControl = new DrawingControl();
            MainWindow     = new Window
            {
                Content = DrawingControl,
                Width   = 1200, Height = 900,
                Left    = 100, Top = 50
            };
        }
        /// <summary>
        /// Occurs when the Document has finished loading. Reformat the display with the proper settings.
        /// </summary>
        private void Document_Loaded(object sender, EventArgs e)
        {
            DrawingControl.SuspendDrawing(pnlWorkspace);
            SetCanvasSize();
            SetCanvasPosition();

            // Regenerate the composite background image with the correct zoom scale
            //CanvasPane.BackColor = _Document.Background.Color;
            //_Document.Background.Set();

            if (_Document.Scaling.Zoom > Scaling.MIN_ZOOM)
            {
                SetScrollPercent();
            }
            DrawingControl.ResumeDrawing(pnlWorkspace);
            CanvasPane.Refresh();
        }
Example #31
0
 /// <summary>
 /// 初始化当前界面
 /// </summary>
 private void InitializeComponent()
 {
     DrawingControl = new DrawingControl();
     DrawingControl.ActionEstablish += DrawingControl_ActionEstablish;
     DrawingControl.ActionStart     += DrawingControl_ActionStart;
     DrawingControl.ActionRuning    += DrawingControl_ActionRuning;
     DrawingControl.ActionTerminal  += DrawingControl_ActionTerminal;
     DrawingControl.ActionComplete  += DrawingControl_ActionComplete;
     DrawingControl.SelectChanged   += DrawingControl_SelectChanged;
     DrawingControl.Deleted         += DrawingControl_Deleted;
     DrawingControl.Picked          += DrawingControl_Picked;
     DrawingControl.FunctionalEvent += DrawingControl_FunctionalEvent;
     DrawingControl.RightMenuEvent  += DrawingControl_RightMenuEvent;
     this.Loaded           += Explorer_Loaded;
     DrawingControl.Prompt += DrawingControl_Prompt;
     this.Children.Add(DrawingControl);
 }
Example #32
0
        private void cxmnuExclude_Click(object sender, EventArgs e)
        {
            TaskDialog td = new TaskDialog("Exclude Parameter");

            td.MainInstruction = "Are you sure you want to exclude the selected parameters from insertion?";
            td.CommonButtons   = TaskDialogCommonButtons.Yes | TaskDialogCommonButtons.No;

            if (td.Show() == TaskDialogResult.Yes)
            {
                DrawingControl.SetDoubleBuffered(dgvSharedParameters);
                DrawingControl.SuspendDrawing(dgvSharedParameters);

                foreach (DataGridViewRow row in dgvSharedParameters.SelectedRows)
                {
                    dgvSharedParameters.Rows.Remove(row);
                }

                DrawingControl.ResumeDrawing(dgvSharedParameters);
            }
        }
        private void ColorRows()
        {
            DrawingControl.SetDoubleBuffered(dgvSheets);
            DrawingControl.SuspendDrawing(dgvSheets);

            foreach (DataGridViewRow row in dgvSheets.Rows)
            {
                bool set = bool.Parse(row.Cells["Set"].Value.ToString());

                if (set)
                {
                    row.DefaultCellStyle.BackColor = System.Drawing.Color.LightGreen;
                }
                else
                {
                    row.DefaultCellStyle.BackColor = System.Drawing.Color.White;
                }
            }

            DrawingControl.ResumeDrawing(dgvSheets);
        }
 public UpdateTextControlAction(DrawingControl control)
     : this()
 {
     _control = control;
 }
Example #35
0
 public LoadControlBoxAction(DrawingControl control)
     : this()
 {
     _control = control;
 }