Exemple #1
0
		public ToothChartData() {
			ListToothGraphics=new ToothGraphicCollection();
			ColorBackground=Color.FromArgb(150,145,152);//defaults to gray
			ColorText=Color.White;
			ColorTextHighlight=Color.Red;
			ColorBackHighlight=Color.White;
			selectedTeeth=new List<string>();
			sizeControl=SizeOriginalDrawing;
			DrawingSegmentList=new List<ToothInitial>();
			CursorTool=CursorTool.Pointer;
			ColorDrawing=Color.Black;
			Font=new System.Drawing.Font(FontFamily.GenericSansSerif,8.25f);
			PointList=new List<Point>();
			ListPerioMeasure=new List<PerioMeasure>();
		}
Exemple #2
0
        public void SwitchTool(ToolType toolType)
        {
            if (toolType != ToolType.Move && ToolWhileMoveTool != null && ToolWhileMoveTool.GetToolType() == toolType)
            {
                ToolCurrent       = ToolWhileMoveTool;
                ToolWhileMoveTool = null;
                return;
            }
            ToolWhileMoveTool = null;

            if (ToolCurrent != null)
            {
                ToolCurrent.ResetUsedElements();
            }

            switch (toolType)
            {
            case ToolType.Brush:
                ToolCurrent = new BrushTool();
                break;

            case ToolType.Crop:
                ToolCurrent = new CropTool();
                break;

            case ToolType.Cursor:
                ToolCurrent = new CursorTool();
                break;

            case ToolType.Fill:
                ToolCurrent = new FillTool();
                break;

            case ToolType.Ellipse:
                ToolCurrent = new EllipseTool();
                break;

            case ToolType.Eraser:
                ToolCurrent = new EraserTool();
                break;

            case ToolType.ImportPng:
                ToolCurrent = new ImportTool();
                break;

            case ToolType.Flip:
                ToolCurrent = new FlipTool();
                break;

            case ToolType.Line:
                ToolCurrent = new LineTool();
                break;

            case ToolType.Zoom:
                ToolCurrent = new MoveZoomTool();
                break;

            case ToolType.Move:
                ToolWhileMoveTool = ToolCurrent;
                ToolCurrent       = new MoveZoomTool(false);
                break;

            case ToolType.Pipette:
                ToolCurrent = new PipetteTool();
                break;

            case ToolType.Rotate:
                ToolCurrent = new RotateTool();
                break;

            case ToolType.Rect:
                ToolCurrent = new RectangleTool();
                break;

            case ToolType.Stamp:
                ToolCurrent = new StampTool();
                break;

            default:
                break;
            }
        }
Exemple #3
0
        public void ChangeTool(CommandObject command)
        {
            ShapeBase shape;

            switch (_currentCommand = command.Command)
            {
            case DrawPadCommand.Selection:
                gdiArea.Cursor = _currentCursor = CursorTool.GetSelectionCursor();

                _drawingControl.ControlMode = ControlMode.Transformation;
                _drawingControl.SwitchToDirectTrans();
                break;

            case DrawPadCommand.DirectSelection:
                gdiArea.Cursor = _currentCursor = CursorTool.GetDirectSelectionCursor();

                _drawingControl.ControlMode = ControlMode.EditPoint;
                _drawingControl.SwitchToDirectTrans();
                break;

            case DrawPadCommand.DrawText:
                gdiArea.Cursor = _currentCursor = CursorTool.GetEditorCursor();
                break;

            case DrawPadCommand.DrawShape:
                shape = command.Reserve as ShapeBase;
                if (shape != null)
                {
                    _currentShape = shape.Clone();
                }
                gdiArea.Cursor = _currentCursor = CursorTool.GetShapeCursor();
                // init in drawing control
                _drawingControl.ControlMode = ControlMode.CreateShape;
                _drawingControl.LoadShape(_currentShape);
                // fire event for app manament
                if (GdiControlBoxLoad != null)
                {
                    GdiControlBoxLoad(this, EventArgs.Empty);
                }
                break;

            case DrawPadCommand.Brush:
                shape = command.Reserve as ShapeBase;
                if (shape != null)
                {
                    LoadCurrentShape(shape.Clone());
                }

                gdiArea.Cursor = _currentCursor = CursorTool.GetBrushCursor();

                // init in drawing control
                shape.OutlineWidth          = _outlineWidth;
                shape.OutlineColor          = _outlineColor;
                shape.OutlineDash           = _outlineDash;
                _drawingControl.ControlMode = ControlMode.CreateShape;
                _drawingControl.LoadShape(_currentShape, true);

                // fire event for app manament
                if (GdiControlBoxLoad != null)
                {
                    GdiControlBoxLoad(this, EventArgs.Empty);
                }
                break;

            case DrawPadCommand.Eraser:
                shape = command.Reserve as ShapeBase;
                if (shape != null)
                {
                    LoadCurrentShape(shape.Clone());
                }

                gdiArea.Cursor = _currentCursor = CursorTool.GetEraserCursor();

                _currentShape.OutlineColor  = Color.White;
                _drawingControl.ControlMode = ControlMode.CreateShape;
                _drawingControl.LoadShape(_currentShape, true);
                break;

            case DrawPadCommand.Bucket:
                gdiArea.Cursor = _currentCursor = CursorTool.GetBucketCursor();
                break;

            case DrawPadCommand.Crop:
                gdiArea.Cursor = _currentCursor = CursorTool.GetCropCursor();
                break;
            }
        }
Exemple #4
0
 public InterpolatingLine(ChartView BaseChart)
 {
     annotation     = new Annotation();
     cursor         = new CursorTool();
     this.BaseChart = BaseChart;
 }
Exemple #5
0
        public SnapCursorToolTip()
        {
            // Values to Series
            series.FillSampleValues();
            tChart1.Chart.Series.Add(series);

            // Chart settings
            tChart1.Chart.Aspect.View3D          = false;
            tChart1.Chart.Panel.Gradient.Visible = false;
            tChart1.Chart.Legend.Visible         = false;
            tChart1.Chart.Panel.Color            = Color.White;
            tChart1.Chart.Walls.Back.Transparent = true;
            tChart1.Chart.SubHeader.Visible      = true;
            tChart1.Chart.SubHeader.Text         = "";

            // Use of the Chart events :
            tChart1.Chart.ClickBackground += TChart1_ClickBackground;
            tChart1.Chart.ScrollMod       += TChart1_ScrollMod;
            tChart1.Chart.Zoomed          += TChart1_Zoomed;
            tChart1.Chart.UndoneZoom      += TChart1_UndoneZoom;
            series.ClickPointer           += Series_ClickPointer;
            //tChart1.ClickSeries += TChart1_ClickSeries;
            //tChart1.AfterDraw += TChart1_AfterDraw;
            //tChart1.Scroll += TChart1_Scroll;

            series.ClickTolerance = 10;

            // Panning and Scroll modes
            tChart1.Chart.Zoom.Active    = true;
            tChart1.Chart.Panning.Active = true;
            tChart1.Chart.Panning.Allow  = ScrollModes.Horizontal;


            // Use of the Cursor Tool
            cursor                      = new CursorTool(tChart1.Chart.chart);
            cursor.SnapChange          += Cursor_SnapChange;
            cursor.CursorClickTolerance = 1000;
            cursor.Style                = CursorToolStyles.Both;
            cursor.Snap                 = true;
            cursor.Series               = series;
            cursor.FollowMouse          = true;
            cursor.FastCursor           = true;
            cursor.Pen.Visible          = false;
            // In the case to Active the CursorTool Panning ScrollMode has to be set to None
            ////tChart1.Panning.Allow = ScrollModes.None;
            cursor.Active = false;
            //cursor.Change += Cursor_Change;

            // Use of Annotation Tool
            annotation                 = new Annotation(tChart1.Chart.chart);
            annotation.Active          = false;
            annotation.Shape.Font.Size = 16;
            annotation.TextAlign       = TextAlignment.Center;

            // Axes settings
            tChart1.Chart.Axes.Left.Increment         = tChart1.Chart.Axes.Left.Maximum / 10;
            tChart1.Chart.Axes.Left.Labels.Font.Size -= 4;

            // Them settings
            tChart1.Chart.setTheme(ThemeType.Flat);

            // Header settings
            tChart1.Chart.Header.Font.Size = 11;

            tChart1.WidthRequest  = 400;
            tChart1.HeightRequest = 500;

            Content = new StackLayout
            {
                Children =
                {
                    tChart1,
                },
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
            };

            // property like userinteraction for ios enabling scrollview to scroll over the chart.
            // chartView.InputTransparent = true;
        }