PointInSectionByAbsolutePoint() public method

public PointInSectionByAbsolutePoint ( PointD absolutePoint ) : PointD
absolutePoint Cairo.PointD
return Cairo.PointD
コード例 #1
0
ファイル: ImageTool.cs プロジェクト: modesto/monoreports
        public override void CreateNewControl(SectionView sectionView)
        {
            var startPoint = sectionView.PointInSectionByAbsolutePoint (designService.StartPressPoint.X, designService.StartPressPoint.Y);

            MonoReports.Model.Controls.Image img = new MonoReports.Model.Controls.Image(){ Location = new MonoReports.Model.Point (startPoint.X, startPoint.Y), Width = 50, Height=50};
            ImageView imageView = sectionView.CreateControlView (img) as ImageView;
            sectionView.Section.Controls.Add (img);
            imageView.ParentSection = sectionView;
            designService.SelectedControl = imageView;
        }
コード例 #2
0
ファイル: TextBlockTool.cs プロジェクト: modesto/monoreports
        public override void CreateNewControl(SectionView sectionView)
        {
            var startPoint = sectionView.PointInSectionByAbsolutePoint (designService.StartPressPoint.X, designService.StartPressPoint.Y);

            var tb = new TextBlock { Location = new MonoReports.Model.Point (startPoint.X, startPoint.Y), Text="text", FontName="Helvetica", FontSize=11, Size = new Size(70,14) };

            TextBlockView textBlockView = sectionView.CreateControlView (tb) as TextBlockView;

            sectionView.Section.Controls.Add (tb);
            textBlockView.ParentSection = sectionView;
            designService.SelectedControl = textBlockView;
        }
コード例 #3
0
ファイル: SubreportTool.cs プロジェクト: modesto/monoreports
        public override void CreateNewControl(SectionView sectionView)
        {
            var startPoint = sectionView.PointInSectionByAbsolutePoint (designService.StartPressPoint.X, designService.StartPressPoint.Y);

            var subreport = new SubReport {
                Location = new MonoReports.Model.Point (startPoint.X, startPoint.Y),
                Size = new Size(50,20),
                BackgroundColor = new MonoReports.Model.Color(0.5,0.5,0.5)
            };
            SubreportView subreportView = sectionView.CreateControlView (subreport) as SubreportView;
            sectionView.Section.Controls.Add (subreport);
            subreportView.ParentSection = sectionView;
            designService.SelectedControl = subreportView;
        }
コード例 #4
0
        public override void CreateNewControl(SectionView sectionView)
        {
            var startPoint = sectionView.PointInSectionByAbsolutePoint (designService.StartPressPoint.X, designService.StartPressPoint.Y);

            var l = createLine(startPoint.X,startPoint.Y);
            var lineView = sectionView.CreateControlView (l);
            sectionView.Section.Controls.Add (l);
            lineView.ParentSection = sectionView;
            designService.SelectedControl = lineView;
        }
コード例 #5
0
        public override void OnMouseDown()
        {
            currentSection = designService.SelectedControl != null ? designService.SelectedControl.ParentSection : null;
            if (designService.SelectedControl != null) {
                lineDistance = 6 - designService.Zoom;
                line = designService.SelectedControl.ControlModel as Line;
                var location = line.Location;
                var startPoint = currentSection.PointInSectionByAbsolutePoint (designService.StartPressPoint);

                Cairo.PointD startDistance = new Cairo.PointD ( location.X - startPoint.X,  location.Y - startPoint.Y);
                Cairo.PointD endDistance = new Cairo.PointD (line.End.X - startPoint.X,line.End.Y - startPoint.Y);

                if (startDistance.X < lineDistance && startDistance.X > -lineDistance && startDistance.Y < lineDistance && startDistance.Y > -lineDistance) {
                    startPointHit = true;
                } else {
                    if (endDistance.X < lineDistance && endDistance.X > -lineDistance && endDistance.Y < lineDistance && endDistance.Y > -lineDistance)
                        endPointHit = true;
                }
            }
        }
コード例 #6
0
ファイル: LineTool.cs プロジェクト: elsupergomez/monoreports
 public override ControlViewBase CreateNewControl(SectionView sectionView)
 {
     var startPoint = sectionView.PointInSectionByAbsolutePoint (designService.StartPressPoint.X, designService.StartPressPoint.Y);
     var l = createLine(startPoint.X,startPoint.Y);
     return AddControl(sectionView, l);
 }
コード例 #7
0
ファイル: ImageTool.cs プロジェクト: elsupergomez/monoreports
 public override ControlViewBase CreateNewControl(SectionView sectionView)
 {
     var startPoint = sectionView.PointInSectionByAbsolutePoint (designService.StartPressPoint.X, designService.StartPressPoint.Y);
     MonoReports.Model.Controls.Image img = new MonoReports.Model.Controls.Image(){ Location = new MonoReports.Model.Point (startPoint.X, startPoint.Y), Width = 2.cm(), Height=1.cm()};
     return AddControl(sectionView,img);
 }
コード例 #8
0
 public override ControlViewBase CreateNewControl(SectionView sectionView)
 {
     var startPoint = sectionView.PointInSectionByAbsolutePoint (designService.StartPressPoint.X, designService.StartPressPoint.Y);
     var tb = new TextBlock { Location = new MonoReports.Model.Point (startPoint.X, startPoint.Y), Text=Catalog.GetString("text") };
     return AddControl(sectionView, tb);
 }