当前位置: 首页>>代码示例>>C#>>正文


C# SchetsEditor.SchetsControl类代码示例

本文整理汇总了C#中SchetsEditor.SchetsControl的典型用法代码示例。如果您正苦于以下问题:C# SchetsControl类的具体用法?C# SchetsControl怎么用?C# SchetsControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SchetsControl类属于SchetsEditor命名空间,在下文中一共展示了SchetsControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MuisVast

 public override void MuisVast(SchetsControl s, Point p)
 {
     //Verwijder een element
     s.acties.Gum(p);
     //Redraw vanuit de acties
     s.RedrawFromActions();
 }
开发者ID:tennapel,项目名称:schetseditor,代码行数:7,代码来源:Tools.cs

示例2: SchetsWin

        public SchetsWin()
        {
            ISchetsTool[] deTools = { new PenTool(),
                                      new LijnTool(),
                                      new RechthoekTool(),
                                      new VolRechthoekTool(),
                                      new EllipseTool(),
                                      new FilledEllipseTool(),
                                      new TekstTool(),
                                      new GumTool(),
                                      new MoveTool() };
            String[] deKleuren = { "Black", "White", "Red", "Green", "Blue"
                                 , "Yellow", "Magenta", "Cyan", "Other"
                                 };

            this.ClientSize = new Size(780, 575);
            huidigeTool = deTools[0];

            schetscontrol = new SchetsControl();
            schetscontrol.Location = new Point(64, 10);
            schetscontrol.MouseDown += (object o, MouseEventArgs mea) =>
                                       {
                                           if(mea.Button != MouseButtons.Left) return;
                                           vast = true;
                                           huidigeTool.MuisVast(schetscontrol, mea.Location);
                                       };
            schetscontrol.MouseMove += (object o, MouseEventArgs mea) =>
                                       {
                                           if(vast)
                                               huidigeTool.MuisDrag(schetscontrol, mea.Location);
                                       };
            schetscontrol.MouseUp += (object o, MouseEventArgs mea) =>
                                       {
                                           if(mea.Button != MouseButtons.Left)
                                           {
                                               if(!vast)
                                                   showContextMenu(mea.Location);
                                               return;
                                           }
                                           vast = false;
                                           huidigeTool.MuisLos(schetscontrol, mea.Location);
                                       };
            schetscontrol.KeyPress += (object o, KeyPressEventArgs kpea) =>
                                       {
                                           huidigeTool.Letter(schetscontrol, kpea.KeyChar);
                                       };
            this.Controls.Add(schetscontrol);

            menuStrip = new MenuStrip();
            menuStrip.Visible = false;
            this.Controls.Add(menuStrip);
            this.maakFileMenu();
            this.maakToolMenu(deTools);
            this.maakAktieMenu(deKleuren);
            this.maakToolButtons(deTools);
            this.maakAktieButtons(deKleuren);
            this.Resize += this.veranderAfmeting;
            this.veranderAfmeting(null, null);
            this.FormClosing += SchetsWin_FormClosing;
        }
开发者ID:CasWiddershoven,项目名称:schets-plus,代码行数:60,代码来源:SchetsWin.cs

示例3: SchetsWin

        public SchetsWin()
        {
            ISchetsTool[] deTools = { new PenTool()
                                    , new LijnTool()
                                    , new RechthoekTool()
                                    , new CirkelTool()
                                    , new VolCirkelTool()
                                    , new VolRechthoekTool()
                                    , new TekstTool()
                                    , new GumTool()
                                    };
            String[] deKleuren = { "Black", "Red", "Green", "Blue"
                                 , "Yellow", "Magenta", "Cyan"
                                 };

            this.ClientSize = new Size(700, 549);
            huidigeTool = deTools[0];

            schetscontrol = new SchetsControl();
            schetscontrol.Location = new Point(64, 10);
            schetscontrol.MouseDown += (object o, MouseEventArgs mea) =>
                                       { veranderd = true; };
            schetscontrol.MouseDown += (object o, MouseEventArgs mea) =>
                                       {
                                           vast = true;
                                           huidigeTool.MuisVast(schetscontrol, mea.Location);
                                       };
            schetscontrol.MouseMove += (object o, MouseEventArgs mea) =>
                                       {
                                           if (vast)
                                               huidigeTool.MuisDrag(schetscontrol, mea.Location);
                                       };
            schetscontrol.MouseUp += (object o, MouseEventArgs mea) =>
                                     {
                                         if (vast)
                                             huidigeTool.MuisLos(schetscontrol, mea.Location);
                                         vast = false;
                                     };
            schetscontrol.KeyPress += (object o, KeyPressEventArgs kpea) =>
                                      {
                                          huidigeTool.Letter(schetscontrol, kpea.KeyChar);
                                      };
            this.Controls.Add(schetscontrol);

            menuStrip = new MenuStrip();
            menuStrip.Visible = false;
            this.Controls.Add(menuStrip);
            this.maakFileMenu();
            this.maakToolMenu(deTools);
            this.maakActieMenu(deKleuren);
            this.maakToolButtons(deTools);
            this.maakActieButtons(deKleuren);
            this.Resize += this.veranderAfmeting;
            this.FormClosing += this.Afsluitvrager;
            this.veranderAfmeting(null, null);
        }
开发者ID:jorit1290,项目名称:SchetsEnScheef,代码行数:56,代码来源:SchetsWin.cs

示例4: MuisVast

 public void MuisVast(SchetsControl s, Point p)
 {
     IElement element = s.Schets.GetElement(p);
     if (p != null)
     {
         s.Schets.Elementen.Remove(element);
         s.Schets.Vernieuw();
         s.Invalidate();
     }
 }
开发者ID:arjanadriaanse,项目名称:imp-p3,代码行数:10,代码来源:Tools.cs

示例5: SchetsWin

        public SchetsWin()
        {
            ISchetsTool[] deTools = { new PenTool()
                                    , new LijnTool()
                                    , new RechthoekTool()
                                    , new VolRechthoekTool()
                                    , new TekstTool()
                                    , new GumTool()
                                    , new OvaalTool()
                                    , new VolOvaalTool()
                                    , new VerplaatsTool()

                                    };

            this.ClientSize = new Size(750, 600);
            huidigeTool = deTools[0];

            schetscontrol = new SchetsControl();
            schetscontrol.Location = new Point(109, 10);
            schetscontrol.MouseDown += (object o, MouseEventArgs mea) =>
                                       {
                                           vast = true;
                                           huidigeTool.MuisVast(schetscontrol, mea.Location);
                                       };
            schetscontrol.MouseMove += (object o, MouseEventArgs mea) =>
                                       {
                                           if (vast)
                                               huidigeTool.MuisDrag(schetscontrol, mea.Location);
                                       };
            schetscontrol.MouseUp += (object o, MouseEventArgs mea) =>
                                     {
                                         if (vast)
                                             huidigeTool.MuisLos(schetscontrol, mea.Location);
                                         vast = false;
                                     };
            schetscontrol.KeyPress += (object o, KeyPressEventArgs kpea) =>
                                      {
                                          huidigeTool.Letter(schetscontrol, kpea.KeyChar);
                                      };
            this.Controls.Add(schetscontrol);

            menuStrip = new MenuStrip();
            menuStrip.Visible = false;
            this.Controls.Add(menuStrip);
            this.maakFileMenu();
            this.maakToolMenu(deTools);
            this.maakAktieMenu();
            this.maakToolButtons(deTools);
            this.maakAktieButtons();
            this.Resize += this.veranderAfmeting;
            this.veranderAfmeting(null, null);
        }
开发者ID:arjanadriaanse,项目名称:imp-p3,代码行数:52,代码来源:SchetsWin.cs

示例6: Letter

 public override void Letter(SchetsControl s, char c)
 {
     LetterElement letter;
     if (c >= 32)
     {
         letter = new LetterElement(startpunt, kwast, c);
         s.VoegElementToe(letter);
         Graphics gr = s.MaakBitmapGraphics();
         letter.teken(gr);
         SizeF sz = letter.Grootte;
         startpunt.X += (int)sz.Width;
     }
 }
开发者ID:RutgerBos,项目名称:RutgerBos.Tram-Simulation,代码行数:13,代码来源:Tools.cs

示例7: SaveActies

 public static void SaveActies(string filename, SchetsControl sc)
 {
     List<Element> e = sc.acties.Elementen;
     using (StreamWriter s = new StreamWriter(filename))
     {
         s.WriteLine(sc.Schets.Bitmap.Size.Width.ToString() + "," + sc.Schets.Bitmap.Size.Height.ToString());
         for (int i = 0; i < e.Count; i++)
         {
             //Element naar string converteren
             s.WriteLine(e[i].ToString());
         }
     }
 }
开发者ID:tennapel,项目名称:schetseditor,代码行数:13,代码来源:ActiesFile.cs

示例8: MuisLos

 public override void MuisLos(SchetsControl s, Point p)
 {
     for (int i = s.LayerList.Count - 1; i >= 0; i--)
     {
         if (s.LayerList[i].Item1.Collision(s, i, p))
         {
             s.LayerList.RemoveAt(i);
             s.RefreshList();
             s.Invalidate();
             break;
         }
     }
 }
开发者ID:Dylrak,项目名称:SchetsEditor,代码行数:13,代码来源:Tools.cs

示例9: MuisLos

        public override void MuisLos(SchetsControl s, Point p)
        {
            base.MuisLos(s, p);

            var buffer = s.Schets.buffer;
            for (var i = buffer.Count - 1; i >= 0; i--)
            {
                var geometry = buffer[i];
                if (geometry.Bevat(p))
                {
                    buffer.RemoveAt(i);
                    s.Schets.Herteken();
                    s.Invalidate();
                    break;
                }
            }
        }
开发者ID:jorit1290,项目名称:SchetsEnScheef,代码行数:17,代码来源:Tools.cs

示例10: SchetsWin

        public SchetsWin()
        {
            this.ClientSize = new Size(700, 600);
            huidigeTool = deTools[0];

            schetscontrol = new SchetsControl();
            schetscontrol.Location = new Point(64, 10);
            schetscontrol.MouseDown += (object o, MouseEventArgs mea) =>
                                       {   vast=true;
                                           huidigeTool.MuisVast(schetscontrol, mea.Location);
                                       };
            schetscontrol.MouseMove += (object o, MouseEventArgs mea) =>
                                       {   if (vast)
                                           huidigeTool.MuisDrag(schetscontrol, mea.Location);
                                       };
            schetscontrol.MouseUp   += (object o, MouseEventArgs mea) =>
                                       {   if (vast)
                                           huidigeTool.MuisLos (schetscontrol, mea.Location);
                                           vast = false;
                                       };
            schetscontrol.KeyPress +=  (object o, KeyPressEventArgs kpea) =>
                                       {   huidigeTool.Letter  (schetscontrol, kpea.KeyChar);
                                       };
            this.Controls.Add(schetscontrol);

            menuStrip = new MenuStrip();
            menuStrip.Visible = false;
            this.Controls.Add(menuStrip);
            this.maakFileMenu();
            this.maakEditMenu();
            this.maakToolMenu(deTools);
            this.maakAktieMenu();
            this.maakToolButtons(deTools);
            this.maakAktieButtons();
            this.Resize += this.veranderAfmeting;
            this.veranderAfmeting(null, null);
        }
开发者ID:tennapel,项目名称:schetseditor,代码行数:37,代码来源:SchetsWin.cs

示例11: Collision

        public override bool Collision(SchetsControl s, int i, Point p)
        {
            double dx, dy, x0, y0, x1, y1, x2, y2, k;
            x0 = s.LayerList[i].Item3.X;
            y0 = s.LayerList[i].Item3.Y;
            x1 = s.LayerList[i].Item4.X;
            y1 = s.LayerList[i].Item4.Y;
            x2 = p.X; y2 = p.Y;
            dx = x1 - x0;
            dy = y1 - y0;

            k = ((x2 - x0) * dx + (y2 - y0) * dy) / (dx * dx + dy * dy);
            if (k > 1)
            {
                k = 1;
            }
            else if (k < 0)
            {
                k = 0;
            }
            dx = (x0 + k * dx) - x2;
            dy = (y0 + k * dy) - y2;
            return dx * dx + dy * dy <= bound * bound * 4;
        }
开发者ID:Dylrak,项目名称:SchetsEditor,代码行数:24,代码来源:Tools.cs

示例12: LetterVirtueel

 //Variant die geen element toevoegt
 public override void LetterVirtueel(SchetsControl s, char c)
 {
     if (c >= 32)
     {
         Graphics gr = s.MaakBitmapGraphics();
         Font font = new Font("Tahoma", 40);
         string tekst = c.ToString();
         SizeF sz =
         gr.MeasureString(tekst, font, this.startpunt, StringFormat.GenericTypographic);
         gr.DrawString(tekst, font, kwast,
                                       this.startpunt, StringFormat.GenericTypographic);
         // gr.DrawRectangle(Pens.Black, startpunt.X, startpunt.Y, sz.Width, sz.Height);
         startpunt.X += (int)sz.Width;
         s.Invalidate();
     }
 }
开发者ID:tennapel,项目名称:schetseditor,代码行数:17,代码来源:Tools.cs

示例13: Letter

 public override void Letter(SchetsControl s, char c)
 {
     this.LetterVirtueel(s, c);
     if (c != ' ')
         s.acties.AddChar(c);
 }
开发者ID:tennapel,项目名称:schetseditor,代码行数:6,代码来源:Tools.cs

示例14: MuisVirtueel

 //Variant van de startfunctie die geen element toevoegd, voor het verborgen hertekenen
 public void MuisVirtueel(SchetsControl s, Point p)
 {
     startpunt = p;
 }
开发者ID:tennapel,项目名称:schetseditor,代码行数:5,代码来源:Tools.cs

示例15: MuisLos

 public virtual void MuisLos(SchetsControl s, Point p)
 {
     kwast = new SolidBrush(s.PenKleur);
 }
开发者ID:tennapel,项目名称:schetseditor,代码行数:4,代码来源:Tools.cs


注:本文中的SchetsEditor.SchetsControl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。