當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。