dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] pnetlib/samples FormsTest.cs, 1.17, 1.18 XClockEmb


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnetlib/samples FormsTest.cs, 1.17, 1.18 XClockEmbed.cs, 1.2, 1.3
Date: Wed, 26 Nov 2003 01:07:13 +0000

Update of /cvsroot/dotgnu-pnet/pnetlib/samples
In directory subversions:/tmp/cvs-serv8863/samples

Modified Files:
        FormsTest.cs XClockEmbed.cs 
Log Message:


Fix some profile-related build issues.


Index: FormsTest.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/samples/FormsTest.cs,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** FormsTest.cs        8 Nov 2003 00:21:28 -0000       1.17
--- FormsTest.cs        26 Nov 2003 01:07:10 -0000      1.18
***************
*** 1043,1060 ****
                }
  
!               private void textBoxTest2a_TextChanged(object sender, EventArgs 
e)
!               {
!                       StringBuilder sb = new StringBuilder();
!                       for (int i = 0; i < textBoxTest2a.Text.Length; i++)
!                       {
!                               if (textBoxTest2a.Text[i] == '\n')
!                                       sb.Append("\\n\r\n");
!                               else if (textBoxTest2a.Text[i] == '\r')
!                                       sb.Append("\\r");
!                               else
!                                       sb.Append(textBoxTest2a.Text[i]);
!                       }
!                       textBoxTest2b.Text = sb.ToString();
! 
                }
  
--- 1043,1060 ----
                }
  
!               private void textBoxTest2a_TextChanged(object sender, EventArgs 
e)
!               {
!                       StringBuilder sb = new StringBuilder();
!                       for (int i = 0; i < textBoxTest2a.Text.Length; i++)
!                       {
!                               if (textBoxTest2a.Text[i] == '\n')
!                                       sb.Append("\\n\r\n");
!                               else if (textBoxTest2a.Text[i] == '\r')
!                                       sb.Append("\\r");
!                               else
!                                       sb.Append(textBoxTest2a.Text[i]);
!                       }
!                       textBoxTest2b.Text = sb.ToString();
! 
                }
  
***************
*** 2460,2486 ****
                }
  
!               
!               private void buttonImageSave_Click(object sender, EventArgs e)
!               {
!                       textBoxImageFileName.Text = 
textBoxImageFileName.Text.Trim();
!                       int i = textBoxImageFileName.Text.IndexOf('.');
!                       if (i>0)
!                               textBoxImageFileName.Text = 
textBoxImageFileName.Text.Substring(0,i);
!                       textBoxImageFileName.Text += ".bmp";
!                       /*
!                                               ImageCodecInfo 
bmpImageCodecInfo = null;
!                                               ImageCodecInfo[] encoders =  
ImageCodecInfo.GetImageEncoders();
!                                               for(int j = 0; j < 
encoders.Length; ++j)
!                                               {
!                                                       
//Console.WriteLine(encoders[j].MimeType);
!                                                       if(encoders[j].MimeType 
== "image/bmp")
!                                                       {
!                                                               
bmpImageCodecInfo = encoders[j];
!                                                               //break;
!                                                       }
!                                               }
!                       */
!                       if (imageNew != null)
!                               imageNew.Save(textBoxImageFileName.Text);
                }
  
--- 2460,2486 ----
                }
  
!               
!               private void buttonImageSave_Click(object sender, EventArgs e)
!               {
!                       textBoxImageFileName.Text = 
textBoxImageFileName.Text.Trim();
!                       int i = textBoxImageFileName.Text.IndexOf('.');
!                       if (i>0)
!                               textBoxImageFileName.Text = 
textBoxImageFileName.Text.Substring(0,i);
!                       textBoxImageFileName.Text += ".bmp";
!                       /*
!                                               ImageCodecInfo 
bmpImageCodecInfo = null;
!                                               ImageCodecInfo[] encoders =  
ImageCodecInfo.GetImageEncoders();
!                                               for(int j = 0; j < 
encoders.Length; ++j)
!                                               {
!                                                       
//Console.WriteLine(encoders[j].MimeType);
!                                                       if(encoders[j].MimeType 
== "image/bmp")
!                                                       {
!                                                               
bmpImageCodecInfo = encoders[j];
!                                                               //break;
!                                                       }
!                                               }
!                       */
!                       if (imageNew != null)
!                               imageNew.Save(textBoxImageFileName.Text);
                }
  
***************
*** 2536,2610 ****
                        if (imageOld != null)
                                r = new Region(new Rectangle(10, 25, 
imageOld.Width, imageOld.Height));
!                       imageOld = Image.FromFile(file);
!                       r.Union(new Rectangle(10, 25, imageOld.Width, 
imageOld.Height));
!                       r.Union(new Rectangle(0,0, 400, 25));
!                       textBoxImageWidth.Text = imageOld.Width.ToString();
!                       textBoxImageHeight.Text = imageOld.Height.ToString();
                        tabPage10.Invalidate(r, true);
                }
!               
!               private void buttonImageLoad24bpp_Click(object sender, 
EventArgs e)
!               {
!                       LoadImage("test.bmp");
!               }
! 
!               private void buttonImageLoad16bpp_Click(object sender, 
EventArgs e)
!               {
!                       LoadImage("test 16bpp.bmp");
!               }
! 
!               private void buttonImageLoad15bpp_Click(object sender, 
EventArgs e)
!               {
!                       LoadImage("test 15bpp.bmp");
!               }
! 
!               private void buttonImageLoad8bpp_Click(object sender, EventArgs 
e)
!               {
!                       LoadImage("test 8bpp.bmp");
!               }
! 
!               private void buttonImageLoad4bpp_Click(object sender, EventArgs 
e)
!               {
!                       LoadImage("test 4bpp.bmp");
!               }
! 
!               private void buttonImageLoad1bpp_Click(object sender, EventArgs 
e)
!               {
!                       LoadImage("test 1bpp.bmp");
!               }
! 
!               private void buttonImageLoad32bppIcon_Click(object sender, 
EventArgs e)
!               {
!                       LoadImage("test.ico");
!               }
! 
!               private void buttonImageConvert24bpp_Click(object sender, 
EventArgs e)
!               {
!                       
ConvertImage(System.Drawing.Imaging.PixelFormat.Format24bppRgb);
!               }
! 
!               private void buttonImageConvert16bpp_Click(object sender, 
EventArgs e)
!               {
!                       
ConvertImage(System.Drawing.Imaging.PixelFormat.Format16bppRgb565);
!               }
! 
!               private void buttonImageConvert15bpp_Click(object sender, 
EventArgs e)
!               {
!                       
ConvertImage(System.Drawing.Imaging.PixelFormat.Format16bppRgb555);
!               }
! 
!               private void buttonImageConvert8bpp_Click(object sender, 
EventArgs e)
!               {
!                       
ConvertImage(System.Drawing.Imaging.PixelFormat.Format8bppIndexed);
!               }
! 
!               private void buttonImageConvert4bpp_Click(object sender, 
EventArgs e)
!               {
!                       
ConvertImage(System.Drawing.Imaging.PixelFormat.Format4bppIndexed);
!               }
! 
!               private void buttonImageConvert1bpp_Click(object sender, 
EventArgs e)
!               {
!                       
ConvertImage(System.Drawing.Imaging.PixelFormat.Format1bppIndexed);
                }
  
--- 2536,2610 ----
                        if (imageOld != null)
                                r = new Region(new Rectangle(10, 25, 
imageOld.Width, imageOld.Height));
!                       imageOld = Image.FromFile(file);
!                       r.Union(new Rectangle(10, 25, imageOld.Width, 
imageOld.Height));
!                       r.Union(new Rectangle(0,0, 400, 25));
!                       textBoxImageWidth.Text = imageOld.Width.ToString();
!                       textBoxImageHeight.Text = imageOld.Height.ToString();
                        tabPage10.Invalidate(r, true);
                }
!               
!               private void buttonImageLoad24bpp_Click(object sender, 
EventArgs e)
!               {
!                       LoadImage("test.bmp");
!               }
! 
!               private void buttonImageLoad16bpp_Click(object sender, 
EventArgs e)
!               {
!                       LoadImage("test 16bpp.bmp");
!               }
! 
!               private void buttonImageLoad15bpp_Click(object sender, 
EventArgs e)
!               {
!                       LoadImage("test 15bpp.bmp");
!               }
! 
!               private void buttonImageLoad8bpp_Click(object sender, EventArgs 
e)
!               {
!                       LoadImage("test 8bpp.bmp");
!               }
! 
!               private void buttonImageLoad4bpp_Click(object sender, EventArgs 
e)
!               {
!                       LoadImage("test 4bpp.bmp");
!               }
! 
!               private void buttonImageLoad1bpp_Click(object sender, EventArgs 
e)
!               {
!                       LoadImage("test 1bpp.bmp");
!               }
! 
!               private void buttonImageLoad32bppIcon_Click(object sender, 
EventArgs e)
!               {
!                       LoadImage("test.ico");
!               }
! 
!               private void buttonImageConvert24bpp_Click(object sender, 
EventArgs e)
!               {
!                       
ConvertImage(System.Drawing.Imaging.PixelFormat.Format24bppRgb);
!               }
! 
!               private void buttonImageConvert16bpp_Click(object sender, 
EventArgs e)
!               {
!                       
ConvertImage(System.Drawing.Imaging.PixelFormat.Format16bppRgb565);
!               }
! 
!               private void buttonImageConvert15bpp_Click(object sender, 
EventArgs e)
!               {
!                       
ConvertImage(System.Drawing.Imaging.PixelFormat.Format16bppRgb555);
!               }
! 
!               private void buttonImageConvert8bpp_Click(object sender, 
EventArgs e)
!               {
!                       
ConvertImage(System.Drawing.Imaging.PixelFormat.Format8bppIndexed);
!               }
! 
!               private void buttonImageConvert4bpp_Click(object sender, 
EventArgs e)
!               {
!                       
ConvertImage(System.Drawing.Imaging.PixelFormat.Format4bppIndexed);
!               }
! 
!               private void buttonImageConvert1bpp_Click(object sender, 
EventArgs e)
!               {
!                       
ConvertImage(System.Drawing.Imaging.PixelFormat.Format1bppIndexed);
                }
  
***************
*** 2675,2703 ****
                }
  
!               private void comboBoxMeasureItem(object sender, 
MeasureItemEventArgs e)
!               {
!                       e.ItemWidth = (e.Index * 10) % 100;
!                       e.ItemHeight = (e.Index * 30 + 10) % 50;
!               }
! 
!               private void comboBoxDrawItem(object sender, DrawItemEventArgs 
e)
!               {
!                       if (e.Index % 5 == 0)
!                       {
!                               e.DrawBackground();
!                       }
!                       else
!                       {
!                               using (Brush b = new 
SolidBrush(Color.FromArgb((e.Index * 20 + 128) % 256, 160, 160)))
!                                       e.Graphics.FillRectangle(b, e.Bounds);
!                       }
!                       if (e.Index % 10 == 9)
!                       {
!                               e.DrawFocusRectangle();
!                       }
!                       String s = e.State.ToString() + " ";
!                       using (Brush b = new SolidBrush(Color.FromArgb(128, 
(e.Index * 20) % 128, 128)))
!                               e.Graphics.DrawString(s + s,e.Font, b, 
e.Bounds);
!                       e.Graphics.DrawRectangle(SystemPens.ControlText, 
e.Bounds);
                }
  
--- 2675,2703 ----
                }
  
!               private void comboBoxMeasureItem(object sender, 
MeasureItemEventArgs e)
!               {
!                       e.ItemWidth = (e.Index * 10) % 100;
!                       e.ItemHeight = (e.Index * 30 + 10) % 50;
!               }
! 
!               private void comboBoxDrawItem(object sender, DrawItemEventArgs 
e)
!               {
!                       if (e.Index % 5 == 0)
!                       {
!                               e.DrawBackground();
!                       }
!                       else
!                       {
!                               using (Brush b = new 
SolidBrush(Color.FromArgb((e.Index * 20 + 128) % 256, 160, 160)))
!                                       e.Graphics.FillRectangle(b, e.Bounds);
!                       }
!                       if (e.Index % 10 == 9)
!                       {
!                               e.DrawFocusRectangle();
!                       }
!                       String s = e.State.ToString() + " ";
!                       using (Brush b = new SolidBrush(Color.FromArgb(128, 
(e.Index * 20) % 128, 128)))
!                               e.Graphics.DrawString(s + s,e.Font, b, 
e.Bounds);
!                       e.Graphics.DrawRectangle(SystemPens.ControlText, 
e.Bounds);
                }
  
***************
*** 2773,2790 ****
                private void AddTransformsTest(Control c)
                {
!                       transformTestPoints = new PointF[24]
!                       {
!                               new PointF(5, 0), new PointF(25, 0),
!                               new PointF(25, 0), new PointF(30, 5),
!                               new PointF(30, 5), new PointF(30, 25),
!                               new PointF(30, 25), new PointF(25, 30),
!                               new PointF(25, 30), new PointF(5, 30),
!                               new PointF(5, 30), new PointF(0, 25),
!                               new PointF(0, 25), new PointF(0, 5),
!                               new PointF(0, 5), new PointF(5, 0),
!                               new PointF(15, 10), new PointF(15, 15),
!                               new PointF(5, 20), new PointF(10, 25),
!                               new PointF(10, 25), new PointF(20, 25),
!                               new PointF(20, 25), new PointF(25, 20),
                        };
  
--- 2773,2790 ----
                private void AddTransformsTest(Control c)
                {
!                       transformTestPoints = new PointF[24]
!                       {
!                               new PointF(5, 0), new PointF(25, 0),
!                               new PointF(25, 0), new PointF(30, 5),
!                               new PointF(30, 5), new PointF(30, 25),
!                               new PointF(30, 25), new PointF(25, 30),
!                               new PointF(25, 30), new PointF(5, 30),
!                               new PointF(5, 30), new PointF(0, 25),
!                               new PointF(0, 25), new PointF(0, 5),
!                               new PointF(0, 5), new PointF(5, 0),
!                               new PointF(15, 10), new PointF(15, 15),
!                               new PointF(5, 20), new PointF(10, 25),
!                               new PointF(10, 25), new PointF(20, 25),
!                               new PointF(20, 25), new PointF(25, 20),
                        };
  
***************
*** 2802,2810 ****
                }
  
!               private void t_Tick(object sender, EventArgs e)
!               {
!                       if (tabControl1.SelectedTab == tabPage15)
!                               using (Graphics g = tabPage15.CreateGraphics())
!                                       TransformsTestDraw(g);
                }
  
--- 2802,2810 ----
                }
  
!               private void t_Tick(object sender, EventArgs e)
!               {
!                       if (tabControl1.SelectedTab == tabPage15)
!                               using (Graphics g = tabPage15.CreateGraphics())
!                                       TransformsTestDraw(g);
                }
  
***************
*** 2820,2862 ****
                        {
  
!                               int mid = (Height-50)/2;
!                               if (mid > (Width-10)/2)
!                                       mid = (Width-10)/2;
!                               
!                               PointF[] f = 
(PointF[])transformTestPoints.Clone();
!                               g.RotateTransform(transformRotation);
!                               g.TranslateTransform(transformX, transformY);
!                               g.ScaleTransform(transformScaleX, 
transformScaleY);
!                               g.TransformPoints(CoordinateSpace.Page,
!                                       CoordinateSpace.World,
!                                       f);
! 
!                               using (Brush b = new 
SolidBrush(Color.CadetBlue))
!                               {
!                                       g.FillEllipse(b, -20, -20, 20, 10);
!                                       g.DrawString("Hello", Font, b, 0, 0);
!                               }
!                               g.ResetTransform();
! 
!                               if (transformX < -200 || transformX > 200)
!                               {
!                                       transformXOffset = -transformXOffset;
!                                       transformScaleXOffset = 
-transformScaleXOffset;
!                               }
! 
!                               if (transformY < -200 || transformY > 200)
!                               {
!                                       transformYOffset = -transformYOffset;
!                                       transformScaleYOffset = 
-transformScaleYOffset;
!                               }
! 
!                               for (int i = 0; i < transformTestPoints.Length; 
i+=2)
!                                       g.DrawLine(p, f[i].X + mid, f[i].Y + 
mid, f[i+1].X + mid, f[i+1].Y + mid);
! 
!                               transformX += transformXOffset;
!                               transformY += transformYOffset;
!                               transformRotation += transformRotationOffSet;
!                               transformScaleX += transformScaleXOffset;
!                               transformScaleY += transformScaleYOffset;
  
                                /*                              Font f = new 
Font("Arial", 6);
--- 2820,2862 ----
                        {
  
!                               int mid = (Height-50)/2;
!                               if (mid > (Width-10)/2)
!                                       mid = (Width-10)/2;
!                               
!                               PointF[] f = 
(PointF[])transformTestPoints.Clone();
!                               g.RotateTransform(transformRotation);
!                               g.TranslateTransform(transformX, transformY);
!                               g.ScaleTransform(transformScaleX, 
transformScaleY);
!                               g.TransformPoints(CoordinateSpace.Page,
!                                       CoordinateSpace.World,
!                                       f);
! 
!                               using (Brush b = new 
SolidBrush(Color.CadetBlue))
!                               {
!                                       g.FillEllipse(b, -20, -20, 20, 10);
!                                       g.DrawString("Hello", Font, b, 0, 0);
!                               }
!                               g.ResetTransform();
! 
!                               if (transformX < -200 || transformX > 200)
!                               {
!                                       transformXOffset = -transformXOffset;
!                                       transformScaleXOffset = 
-transformScaleXOffset;
!                               }
! 
!                               if (transformY < -200 || transformY > 200)
!                               {
!                                       transformYOffset = -transformYOffset;
!                                       transformScaleYOffset = 
-transformScaleYOffset;
!                               }
! 
!                               for (int i = 0; i < transformTestPoints.Length; 
i+=2)
!                                       g.DrawLine(p, f[i].X + mid, f[i].Y + 
mid, f[i+1].X + mid, f[i+1].Y + mid);
! 
!                               transformX += transformXOffset;
!                               transformY += transformYOffset;
!                               transformRotation += transformRotationOffSet;
!                               transformScaleX += transformScaleXOffset;
!                               transformScaleY += transformScaleYOffset;
  
                                /*                              Font f = new 
Font("Arial", 6);
***************
*** 3032,3076 ****
                        propertyGrid.DumpPropsToConsole();*/
  
!               }
! 
!               private void AddPictureBoxTest(Control c)
!               {
!                       pictureBox1 = new PictureBox();
!                       pictureBox1.BorderStyle = BorderStyle.Fixed3D;
!                       pictureBox1.Bounds = new Rectangle(10,10,100,100);
!                       pictureBox1.Image = Image.FromFile("test.bmp");
!                       c.Controls.Add(pictureBox1);
!                       pictureBox2 = new PictureBox();
!                       pictureBox2.BorderStyle = BorderStyle.FixedSingle;
!                       pictureBox2.Bounds = new Rectangle(150,10,100,100);
!                       pictureBox2.Image = pictureBox1.Image;
!                       c.Controls.Add(pictureBox2);
!                       pictureBox3 = new PictureBox();
!                       pictureBox3.BorderStyle = BorderStyle.FixedSingle;
!                       pictureBox3.SizeMode = PictureBoxSizeMode.CenterImage;
!                       pictureBox3.Bounds = new Rectangle(10,150,120,120);
!                       pictureBox3.Image =  pictureBox1.Image;
!                       c.Controls.Add(pictureBox3);
!                       pictureBox4 = new PictureBox();
!                       pictureBox4.BorderStyle = BorderStyle.FixedSingle;
!                       pictureBox4.SizeMode = PictureBoxSizeMode.AutoSize;
!                       pictureBox4.Bounds = new Rectangle(150,150,120,100);
!                       pictureBox4.Image =  pictureBox1.Image;
!                       c.Controls.Add(pictureBox4);
!                       pictureBox5 = new PictureBox();
!                       pictureBox5.BorderStyle = BorderStyle.FixedSingle;
!                       pictureBox5.SizeMode = PictureBoxSizeMode.StretchImage;
!                       pictureBox5.Bounds = new Rectangle(10,300,120,140);
!                       pictureBox5.Image =  pictureBox1.Image;
!                       c.Controls.Add(pictureBox5);
!               }
! 
!               private void AddControlPaintTest(Control c)
!               {
!                       c.Paint+=new PaintEventHandler(ControlPaintTest_Paint);
!               }
! 
!               private void ControlPaintTest_Paint(object sender, 
PaintEventArgs e)
!               {
                        Graphics g = e.Graphics;
                        boundsX = boundsY = boundsPad;
--- 3032,3076 ----
                        propertyGrid.DumpPropsToConsole();*/
  
!               }
! 
!               private void AddPictureBoxTest(Control c)
!               {
!                       pictureBox1 = new PictureBox();
!                       pictureBox1.BorderStyle = BorderStyle.Fixed3D;
!                       pictureBox1.Bounds = new Rectangle(10,10,100,100);
!                       pictureBox1.Image = Image.FromFile("test.bmp");
!                       c.Controls.Add(pictureBox1);
!                       pictureBox2 = new PictureBox();
!                       pictureBox2.BorderStyle = BorderStyle.FixedSingle;
!                       pictureBox2.Bounds = new Rectangle(150,10,100,100);
!                       pictureBox2.Image = pictureBox1.Image;
!                       c.Controls.Add(pictureBox2);
!                       pictureBox3 = new PictureBox();
!                       pictureBox3.BorderStyle = BorderStyle.FixedSingle;
!                       pictureBox3.SizeMode = PictureBoxSizeMode.CenterImage;
!                       pictureBox3.Bounds = new Rectangle(10,150,120,120);
!                       pictureBox3.Image =  pictureBox1.Image;
!                       c.Controls.Add(pictureBox3);
!                       pictureBox4 = new PictureBox();
!                       pictureBox4.BorderStyle = BorderStyle.FixedSingle;
!                       pictureBox4.SizeMode = PictureBoxSizeMode.AutoSize;
!                       pictureBox4.Bounds = new Rectangle(150,150,120,100);
!                       pictureBox4.Image =  pictureBox1.Image;
!                       c.Controls.Add(pictureBox4);
!                       pictureBox5 = new PictureBox();
!                       pictureBox5.BorderStyle = BorderStyle.FixedSingle;
!                       pictureBox5.SizeMode = PictureBoxSizeMode.StretchImage;
!                       pictureBox5.Bounds = new Rectangle(10,300,120,140);
!                       pictureBox5.Image =  pictureBox1.Image;
!                       c.Controls.Add(pictureBox5);
!               }
! 
!               private void AddControlPaintTest(Control c)
!               {
!                       c.Paint+=new PaintEventHandler(ControlPaintTest_Paint);
!               }
! 
!               private void ControlPaintTest_Paint(object sender, 
PaintEventArgs e)
!               {
                        Graphics g = e.Graphics;
                        boundsX = boundsY = boundsPad;
***************
*** 3172,3185 ****
                                ControlPaint.DrawFocusRectangle(g, new 
Rectangle(b.X, b.Y, 20, 20), Color.Green, Color.Yellow);
                        }
! 
!               }
! 
!               private void AddControlPaintTest2(Control c)
!               {
!                       c.Paint+=new PaintEventHandler(ControlPaintTest2_Paint);
!               }
! 
!               private void ControlPaintTest2_Paint(object sender, 
PaintEventArgs e)
!               {
                        Graphics g = e.Graphics;
                        boundsX = boundsY = boundsPad;
--- 3172,3185 ----
                                ControlPaint.DrawFocusRectangle(g, new 
Rectangle(b.X, b.Y, 20, 20), Color.Green, Color.Yellow);
                        }
! 
!               }
! 
!               private void AddControlPaintTest2(Control c)
!               {
!                       c.Paint+=new PaintEventHandler(ControlPaintTest2_Paint);
!               }
! 
!               private void ControlPaintTest2_Paint(object sender, 
PaintEventArgs e)
!               {
                        Graphics g = e.Graphics;
                        boundsX = boundsY = boundsPad;
***************
*** 3293,3298 ****
                                        g.FillRectangle(bc, b);
                        }
! 
!               }
                private Rectangle NextBoundsPaint(Graphics g, string text)
                {
--- 3293,3298 ----
                                        g.FillRectangle(bc, b);
                        }
! 
!               }
                private Rectangle NextBoundsPaint(Graphics g, string text)
                {
***************
*** 3310,3429 ****
                        g.DrawString(text, new Font("Arial", 
7),SystemBrushes.ControlLightLight, r.X, r.Bottom);
                        return r;
!               }
! 
!               private void AddResXTest(Control c)
!               {
!                       int height = 400;
!                       int width = 300;
!                       buttonResXWrite = new Button();
!                       buttonResXWrite.Location = new Point(20, height - 40);
!                       buttonResXWrite.Text = "Write ResX";
!                       buttonResXWrite.Click+=new 
EventHandler(buttonResXWrite_Click);
!                       buttonResXRead = new Button();
!                       buttonResXRead.Location = new 
Point(buttonResXRead.Right + 20, height - 40);
!                       buttonResXRead.Text = "Read ResX";
!                       buttonResXRead.Click+=new 
EventHandler(buttonResXRead_Click);
!                       textBoxResXData = new TextBox();
!                       textBoxResXData.Multiline = true;
!                       textBoxResXData.Bounds = new Rectangle(10, 10, width - 
10, height - 50);
!                       textBoxResXData.ReadOnly = true;
!                       c.Controls.AddRange(new Control[3] {textBoxResXData, 
buttonResXWrite, buttonResXRead});
!               }
! 
!               private void buttonResXWrite_Click(object sender, EventArgs e)
!               {
!                       ResXResourceWriter w = new 
ResXResourceWriter("test.resx");
!                       w.AddResource("my string", "Hello");
!                       w.AddResource("my color", Color.Red);
!                       w.AddResource("my byte array", new Byte[3] { 255, 254, 
253 });
!                       w.Generate();
!                       w.Close();
!               }
! 
!               private void buttonResXRead_Click(object sender, EventArgs e)
!               {
!                       ResXResourceSet rs = new ResXResourceSet("test.resx");
!                       textBoxResXData.AppendText("my string:" + 
rs.GetObject("my string") + "\r\n");
!                       textBoxResXData.AppendText("my color:" + 
rs.GetObject("my color") + "\r\n");
!                       byte[] b = (byte[])rs.GetObject("my byte array") ;
!                       textBoxResXData.AppendText("my byte array:" + 
b.ToString()+ "\r\n");
!                       textBoxResXData.AppendText("{" + b[0] +"," + b[1]+"," + 
b[2]+"}");
!               }
! 
!               private void AddImageListTest(Control c)
!               {
!                       imageList1 = new ImageList();
! 
!                       int height = 400;
!                       buttonImageListWrite = new Button();
!                       buttonImageListWrite.Location = new Point(20, height - 
40);
!                       buttonImageListWrite.Text = "Add Image";
!                       buttonImageListWrite.Click+=new 
EventHandler(buttonImageListWrite_Click);
!                       c.Controls.Add(buttonImageListWrite);
!                       buttonImageListRead = new Button();
!                       buttonImageListRead.Location = new 
Point(buttonImageListWrite.Right + 20, height - 40);
!                       buttonImageListRead.Text = "Read Image";
!                       buttonImageListRead.Click+=new 
EventHandler(buttonImageListRead_Click);
!                       c.Controls.Add(buttonImageListRead);
!                       labelImageListSize = new Label();
!                       labelImageListSize.Bounds = new 
Rectangle(buttonImageListRead.Right + 20, height - 40, 28, 20);
!                       labelImageListSize.Text = "Size";
!                       c.Controls.Add(labelImageListSize);
!                       textBoxImageListSize = new TextBox();
!                       textBoxImageListSize.Bounds = new 
Rectangle(labelImageListSize.Right + 20, height - 40, 30, 20);
!                       textBoxImageListSize.Text = 
imageList1.ImageSize.Width.ToString();
!                       c.Controls.Add(textBoxImageListSize);
!                       labelImageListColorDepth = new Label();
!                       labelImageListColorDepth.Bounds = new 
Rectangle(textBoxImageListSize.Right + 20, height - 40, 40, 20);
!                       labelImageListColorDepth.Text = "Depth";
!                       c.Controls.Add(labelImageListColorDepth);
!                       textBoxImageListColorDepth = new TextBox();
!                       textBoxImageListColorDepth.Bounds = new 
Rectangle(labelImageListColorDepth.Right + 20, height - 40, 30, 20);
!                       textBoxImageListColorDepth.Text = 
((int)imageList1.ColorDepth).ToString();
!                       c.Controls.Add(textBoxImageListColorDepth);
!                       buttonImageListSet = new Button();
!                       buttonImageListSet.Bounds = new 
Rectangle(textBoxImageListColorDepth.Right + 20, height - 40, 50, 22);
!                       buttonImageListSet.Text = "Set";
!                       buttonImageListSet.Click+=new 
EventHandler(buttonImageListSet_Click);
!                       c.Controls.Add(buttonImageListSet);
! 
!                       c.Paint+=new PaintEventHandler(c_Paint);
! 
!                       //ResourceManager resources = new 
ResourceManager(typeof(FormsTest));
!                       
!                       //object o = resources.GetObject("hearts.ImageStream");
!                       //imageList1.ImageStream = 
(System.Windows.Forms.ImageListStreamer)o;
!               }
! 
!               private void buttonImageListWrite_Click(object sender, 
EventArgs e)
!               {
!                       //imageList1.Images.Add(new Bitmap("test 1bpp.bmp"));
!                       //imageList1.Images.Add(new Bitmap("test 4bpp.bmp"));
!                       //imageList1.Images.Add(new Bitmap("test 8bpp.bmp"));
!                       imageList1.Images.Add(new Bitmap("test.bmp"));
!                       Invalidate(true);
!               }
!               private void buttonImageListRead_Click(object sender, EventArgs 
e)
!               {
!                       Console.WriteLine(imageList1.Images.Count);
!               }
! 
!               private void c_Paint(object sender, PaintEventArgs e)
!               {
!                       int x = 10;
!                       for (int i = 0; i < imageList1.Images.Count; i++)
!                       {
!                               imageList1.Draw(e.Graphics,x,10, i);
!                               x += imageList1.Images[i].Width + 10;
!                       }
!               }
! 
!               private void buttonImageListSet_Click(object sender, EventArgs 
e)
!               {
!                       int s = int.Parse(textBoxImageListSize.Text);
!                       imageList1.ImageSize = new Size(s,s );
!                       imageList1.ColorDepth = 
(ColorDepth)int.Parse(textBoxImageListColorDepth.Text);
!                       Invalidate(true);
!               }
        }
  }
--- 3310,3433 ----
                        g.DrawString(text, new Font("Arial", 
7),SystemBrushes.ControlLightLight, r.X, r.Bottom);
                        return r;
!               }
! 
!               private void AddResXTest(Control c)
!               {
!                       int height = 400;
!                       int width = 300;
!                       buttonResXWrite = new Button();
!                       buttonResXWrite.Location = new Point(20, height - 40);
!                       buttonResXWrite.Text = "Write ResX";
!                       buttonResXWrite.Click+=new 
EventHandler(buttonResXWrite_Click);
!                       buttonResXRead = new Button();
!                       buttonResXRead.Location = new 
Point(buttonResXRead.Right + 20, height - 40);
!                       buttonResXRead.Text = "Read ResX";
!                       buttonResXRead.Click+=new 
EventHandler(buttonResXRead_Click);
!                       textBoxResXData = new TextBox();
!                       textBoxResXData.Multiline = true;
!                       textBoxResXData.Bounds = new Rectangle(10, 10, width - 
10, height - 50);
!                       textBoxResXData.ReadOnly = true;
!                       c.Controls.AddRange(new Control[3] {textBoxResXData, 
buttonResXWrite, buttonResXRead});
!               }
! 
!               private void buttonResXWrite_Click(object sender, EventArgs e)
!               {
!               #if !ECMA_COMPAT && CONFIG_SERIALIZATION
!                       ResXResourceWriter w = new 
ResXResourceWriter("test.resx");
!                       w.AddResource("my string", "Hello");
!                       w.AddResource("my color", Color.Red);
!                       w.AddResource("my byte array", new Byte[3] { 255, 254, 
253 });
!                       w.Generate();
!                       w.Close();
!               #endif
!               }
! 
!               private void buttonResXRead_Click(object sender, EventArgs e)
!               {
!               #if !ECMA_COMPAT && CONFIG_SERIALIZATION
!                       ResXResourceSet rs = new ResXResourceSet("test.resx");
!                       textBoxResXData.AppendText("my string:" + 
rs.GetObject("my string") + "\r\n");
!                       textBoxResXData.AppendText("my color:" + 
rs.GetObject("my color") + "\r\n");
!                       byte[] b = (byte[])rs.GetObject("my byte array") ;
!                       textBoxResXData.AppendText("my byte array:" + 
b.ToString()+ "\r\n");
!                       textBoxResXData.AppendText("{" + b[0] +"," + b[1]+"," + 
b[2]+"}");
!               #endif
!               }
! 
!               private void AddImageListTest(Control c)
!               {
!                       imageList1 = new ImageList();
! 
!                       int height = 400;
!                       buttonImageListWrite = new Button();
!                       buttonImageListWrite.Location = new Point(20, height - 
40);
!                       buttonImageListWrite.Text = "Add Image";
!                       buttonImageListWrite.Click+=new 
EventHandler(buttonImageListWrite_Click);
!                       c.Controls.Add(buttonImageListWrite);
!                       buttonImageListRead = new Button();
!                       buttonImageListRead.Location = new 
Point(buttonImageListWrite.Right + 20, height - 40);
!                       buttonImageListRead.Text = "Read Image";
!                       buttonImageListRead.Click+=new 
EventHandler(buttonImageListRead_Click);
!                       c.Controls.Add(buttonImageListRead);
!                       labelImageListSize = new Label();
!                       labelImageListSize.Bounds = new 
Rectangle(buttonImageListRead.Right + 20, height - 40, 28, 20);
!                       labelImageListSize.Text = "Size";
!                       c.Controls.Add(labelImageListSize);
!                       textBoxImageListSize = new TextBox();
!                       textBoxImageListSize.Bounds = new 
Rectangle(labelImageListSize.Right + 20, height - 40, 30, 20);
!                       textBoxImageListSize.Text = 
imageList1.ImageSize.Width.ToString();
!                       c.Controls.Add(textBoxImageListSize);
!                       labelImageListColorDepth = new Label();
!                       labelImageListColorDepth.Bounds = new 
Rectangle(textBoxImageListSize.Right + 20, height - 40, 40, 20);
!                       labelImageListColorDepth.Text = "Depth";
!                       c.Controls.Add(labelImageListColorDepth);
!                       textBoxImageListColorDepth = new TextBox();
!                       textBoxImageListColorDepth.Bounds = new 
Rectangle(labelImageListColorDepth.Right + 20, height - 40, 30, 20);
!                       textBoxImageListColorDepth.Text = 
((int)imageList1.ColorDepth).ToString();
!                       c.Controls.Add(textBoxImageListColorDepth);
!                       buttonImageListSet = new Button();
!                       buttonImageListSet.Bounds = new 
Rectangle(textBoxImageListColorDepth.Right + 20, height - 40, 50, 22);
!                       buttonImageListSet.Text = "Set";
!                       buttonImageListSet.Click+=new 
EventHandler(buttonImageListSet_Click);
!                       c.Controls.Add(buttonImageListSet);
! 
!                       c.Paint+=new PaintEventHandler(c_Paint);
! 
!                       //ResourceManager resources = new 
ResourceManager(typeof(FormsTest));
!                       
!                       //object o = resources.GetObject("hearts.ImageStream");
!                       //imageList1.ImageStream = 
(System.Windows.Forms.ImageListStreamer)o;
!               }
! 
!               private void buttonImageListWrite_Click(object sender, 
EventArgs e)
!               {
!                       //imageList1.Images.Add(new Bitmap("test 1bpp.bmp"));
!                       //imageList1.Images.Add(new Bitmap("test 4bpp.bmp"));
!                       //imageList1.Images.Add(new Bitmap("test 8bpp.bmp"));
!                       imageList1.Images.Add(new Bitmap("test.bmp"));
!                       Invalidate(true);
!               }
!               private void buttonImageListRead_Click(object sender, EventArgs 
e)
!               {
!                       Console.WriteLine(imageList1.Images.Count);
!               }
! 
!               private void c_Paint(object sender, PaintEventArgs e)
!               {
!                       int x = 10;
!                       for (int i = 0; i < imageList1.Images.Count; i++)
!                       {
!                               imageList1.Draw(e.Graphics,x,10, i);
!                               x += imageList1.Images[i].Width + 10;
!                       }
!               }
! 
!               private void buttonImageListSet_Click(object sender, EventArgs 
e)
!               {
!                       int s = int.Parse(textBoxImageListSize.Text);
!                       imageList1.ImageSize = new Size(s,s );
!                       imageList1.ColorDepth = 
(ColorDepth)int.Parse(textBoxImageListColorDepth.Text);
!                       Invalidate(true);
!               }
        }
  }

Index: XClockEmbed.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/samples/XClockEmbed.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** XClockEmbed.cs      1 Nov 2003 03:30:23 -0000       1.2
--- XClockEmbed.cs      26 Nov 2003 01:07:11 -0000      1.3
***************
*** 24,27 ****
--- 24,28 ----
  public class XClockEmbed : TopLevelWindow
  {
+ #if CONFIG_EXTENDED_DIAGNOSTICS
        // Main entry point.
        public static void Main(String[] args)
***************
*** 51,54 ****
--- 52,60 ----
                embed.Resize(width, height);
        }
+ #else
+       public XClockEmbed(String title, int width, int height)
+               : base(title, width, height) {}
+       public static void Main(String[] args) {}
+ #endif
  
  }; // class XClockEmbed





reply via email to

[Prev in Thread] Current Thread [Next in Thread]