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

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

[Dotgnu-pnet-commits] CVS: pnetlib/samples FormsHello.cs,NONE,1.1 dummy


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/samples FormsHello.cs,NONE,1.1 dummy.cs,NONE,1.1 XHello.cs,1.4,1.5 ilrun.sh.in,1.3,1.4 samples.build,1.5,1.6
Date: Wed, 11 Jun 2003 03:07:21 -0400

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

Modified Files:
        XHello.cs ilrun.sh.in samples.build 
Added Files:
        FormsHello.cs dummy.cs 
Log Message:


Initial check-in of a "System.Windows.Forms" implementation (only "Control"
works right now); changes to Xsharp and System.Drawing to support Forms;
new "FormsHello" sample.


--- NEW FILE ---
/*
 * FormsHello.cs - Sample program for Forms.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software, you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY, without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program, if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

public class FormsHello
{
        private static void Paint(Object sender, PaintEventArgs e)
        {
                Graphics graphics = e.Graphics;
                Form form = (sender as Form);

                Pen pen = new Pen(Color.Black, 1.0f);
                graphics.DrawLine(pen, 0, 0, form.Width, form.Height);
                pen.Dispose();

                pen = new Pen(Color.Red, 2.0f);
                graphics.DrawRectangle(pen, 10, 10, form.Width - 20, 
form.Height - 20);
                pen.Dispose();

                Brush brush = new SolidBrush(Color.Yellow);
                graphics.FillPie(brush, 20, 20, 60, 60, 30.0f, 70.0f);
                brush.Dispose();

                Font font = new Font("Arial", 12);
                brush = new SolidBrush(Color.Blue);
                graphics.DrawString("Hello", font, brush, 30, 100);
                brush.Dispose();
                font.Dispose();

                brush = new HatchBrush
                        (HatchStyle.BackwardDiagonal, Color.Black, Color.White);
                graphics.FillEllipse(brush, 200, 40, 100, 100);
                brush.Dispose();
        }

        public static void Main(String[] args)
        {
                Form form = new Form();
                form.Width = 400;
                form.Height = 250;
                form.Text = "Forms Hello";
                form.Paint += new PaintEventHandler(Paint);
                Application.Run(form);
        }
}

--- NEW FILE ---
/* dummy main for compiling samples in profiles with insufficient features */

#if !CONFIG_REFLECTION

public class Dummy
{
        public static void Main(String[] args)
        {
                Console.WriteLine
                        ("This program won't work in the current pnetlib 
configuration.");
                Console.WriteLine
                        ("Recompile pnetlib with the correct profile 
settings.");
        }
}

#endif

Index: XHello.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/samples/XHello.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** XHello.cs   7 Jun 2003 05:40:07 -0000       1.4
--- XHello.cs   11 Jun 2003 07:07:19 -0000      1.5
***************
*** 19,24 ****
   */
  
- #if CONFIG_REFLECTION
- 
  using System;
  using Xsharp;
--- 19,22 ----
***************
*** 56,69 ****
  
  }; // class XHello
- 
- #else
- 
- public class XHello
- {
- 
-       // Stubbed out on platforms without Xsharp.
-       public static void Main(String[] args) {}
- 
- }; // class XHello
- 
- #endif
--- 54,55 ----

Index: ilrun.sh.in
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/samples/ilrun.sh.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** ilrun.sh.in 6 Jun 2003 10:46:45 -0000       1.3
--- ilrun.sh.in 11 Jun 2003 07:07:19 -0000      1.4
***************
*** 22,25 ****
  ILRUN="@ILRUN@"
  
! # Run the engine, with the assembly paths set correct.
! exec "$ILRUN" -L../runtime -L../I18N -L../DotGNU.SSL -L../System 
-L../System.Xml -L../Xsharp $*
--- 22,25 ----
  ILRUN="@ILRUN@"
  
! # Run the engine, with the assembly paths set correctly.
! exec "$ILRUN" -L../runtime -L../I18N -L../DotGNU.SSL -L../System 
-L../System.Xml -L../Xsharp -L../Xsharp/.libs -L../System.Drawing 
-L../System.Drawing.Xsharp -L../System.Windows.Forms -L../JScript -L../Basic 
-L../compat -L../System.Net.IrDA $*

Index: samples.build
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/samples/samples.build,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** samples.build       31 May 2003 10:50:56 -0000      1.5
--- samples.build       11 Jun 2003 07:07:19 -0000      1.6
***************
*** 184,188 ****
  
                        <sources>
!                               <file name="XHello.cs"/>
                        </sources>
  
--- 184,189 ----
  
                        <sources>
!                               <includes if="${CONFIG_REFLECTION}" 
name="XHello.cs"/>
!                               <file name="dummy.cs"/>
                        </sources>
  
***************
*** 200,203 ****
--- 201,232 ----
                </compile>
  
+               <!-- Build the FormsHello.exe program -->
+               <compile output="FormsHello.exe"
+                                target="exe"
+                                unsafe="true"
+                                nostdlib="true"
+                                optimize="true"
+                                debug="true">
+ 
+                       <sources>
+                               <includes if="${CONFIG_REFLECTION}" 
name="FormsHello.cs"/>
+                               <file name="dummy.cs"/>
+                       </sources>
+ 
+                       <references>
+                               <includes if="${CONFIG_REFLECTION}" 
name="../System.Windows.Forms/System.Windows.Forms.dll"/>
+                               <includes if="${CONFIG_REFLECTION}" 
name="../System.Drawing/System.Drawing.dll"/>
+                               <includes if="${CONFIG_REFLECTION}" 
name="../System/System.dll"/>
+                               <includes if="${CONFIG_REFLECTION}" 
name="../DotGNU.SSL/DotGNU.SSL.dll"/>
+                               <file name="../runtime/mscorlib.dll"/>
+                       </references>
+ 
+                       <arg compiler="cscc" value="-Wno-empty-input"/>
+                       <arg compiler="csc" value="/nowarn:626"/>
+                       <arg compiler="csc" value="/nowarn:649"/>
+                       <arg compiler="csc" value="/nowarn:168"/>
+                       <arg compiler="csc" value="/nowarn:67"/>
+                       <arg compiler="csc" value="/nowarn:169"/>
+               </compile>
        </target>
  </project>





reply via email to

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