Ejemplo n.º 1
0
        /// <summary>Initialises a new <see cref="NiceClosePanel"/> instance.</summary>
        public NiceClosePanel()
            : base()
        {
            _closeButton = new System.Windows.Forms.Button();
            _closeButton.Name = "_closeButton";
            _closeButton.Size = new System.Drawing.Size(8, 8);
            _closeButton.Text = "X";
            _closeButton.Tag = "notranslate";
            _closeButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            // This is a small 8×8 PNG that contains a black X on a transparent background
            _closeButton.Image = new Bitmap(new MemoryStream(new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 8, 0, 0, 0, 8, 8, 6, 0, 0, 0, 196, 15, 190, 139, 0, 0, 0, 89, 73, 68, 65, 84, 40, 83, 99, 96, 128, 0, 126, 40, 141, 76, 113, 194, 56, 32, 198, 109, 32, 246, 64, 146, 53, 0, 178, 239, 1, 177, 16, 76, 204, 24, 200, 120, 2, 85, 4, 146, 124, 142, 166, 1, 172, 14, 164, 232, 37, 16, 191, 195, 38, 9, 82, 0, 210, 249, 6, 138, 145, 173, 3, 235, 70, 54, 22, 217, 58, 176, 36, 27, 16, 95, 69, 51, 22, 164, 8, 197, 145, 112, 47, 33, 249, 4, 44, 6, 0, 149, 131, 14, 219, 10, 117, 71, 99, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }));
            _closeButton.Margin = new System.Windows.Forms.Padding(0);
            _closeButton.Padding = new System.Windows.Forms.Padding(0, 0, 2, 2);
            _closeButton.TabIndex = 0;
            _closeButton.TabStop = false;

            Controls.Add(_closeButton);
            Resize += new EventHandler(resize);
            Paint += new PaintEventHandler(paint);
            _closeButton.Click += new EventHandler(fireCloseClicked);

            // This is a workaround which appears to be necessary in Mono. Otherwise the button does not appear until the first time the level list is resized.
            Timer t = new Timer { Interval = 100 };
            t.Tick += (s, e) => { resize(s, e); t.Enabled = false; };
            t.Enabled = true;
        }
Ejemplo n.º 2
0
        //*********************************************************
        //   constructor class for main program.  Event handlers
        //   are actually linked to menu items here.
        //   Also: paint and print functions display and print
        //   results.
        //*********************************************************
        public CWTForm()
        {
            Text = "CWT";
            FormBorderStyle = FormBorderStyle.FixedDialog;
            Size = new System.Drawing.Size(600, 600);

            image_width = 512;
            image_height = 256;
            sigma = 4.0;
            omega = 1.0;
            upper_freq = 5000;//128.0;
            lower_freq = 20;//4.0;
            //signal_data = new Double[16384];
            signal_data = new Double[55120];
            image_data = new Double[image_width*image_height]; //131072
            bmp = new Bitmap(image_width,image_height,System.Drawing.Imaging.PixelFormat.Format32bppPArgb);

            Setup_Menu();

            Paint += new PaintEventHandler(Form_Paint);
            printMenuItem.Click += new EventHandler(MenuItem_Clicked);
            fileopenMenuItem.Click += new EventHandler(MenuItem_Clicked);
            exportEPSMenuItem.Click += new EventHandler(MenuItem_Clicked);
            exitMenuItem.Click += new EventHandler(MenuItem_Clicked);
            spectrogramMenuItem.Click += new EventHandler(MenuItem_Clicked);
            waveletMenuItem.Click += new EventHandler(MenuItem_Clicked);
            helpMenu.Click += new EventHandler(MenuItem_Clicked);
        }
Ejemplo n.º 3
0
        public VoiceToolstripButton(VoiceService voices)
        {
            Voices = voices;

            ToolTipText = "Voice Chat";

            Paint += new PaintEventHandler(VoiceToolstripButton_Paint);

            ButtonClick += new EventHandler(VoiceToolstripButton_ButtonClick);
            MouseDown += new MouseEventHandler(VoiceToolstripButton_MouseDown);
            MouseUp += new MouseEventHandler(VoiceToolstripButton_MouseUp);
            OffButton = new ToolStripMenuItem("Off", Res.VoiceRes.VoiceOff, OffButton_Clicked);
            VoiceActivatedButton = new ToolStripMenuItem("Voice Activated", Res.VoiceRes.VoiceVAD, VoiceActivatedButton_Clicked);
            PushtoTalkButton = new ToolStripMenuItem("Push to Talk", Res.VoiceRes.VoicePTT, PushtoTalkButton_Clicked);
            MuteButton = new ToolStripMenuItem("Mute", Res.VoiceRes.VoiceMute, MuteButton_Clicked);
            SettingsButton = new ToolStripMenuItem("Settings", Res.VoiceRes.VoiceSettings, SettingsButton_Clicked);

            DropDownItems.Add(OffButton);
            DropDownItems.Add(VoiceActivatedButton);
            DropDownItems.Add(PushtoTalkButton);
            DropDownItems.Add(MuteButton);
            DropDownItems.Add(SettingsButton);

            WindowID = Voices.Core.RndGen.Next();

            Voices.RegisterWindow(WindowID, new VolumeUpdateHandler(VoiceService_VolumeUpdate));

            OffButton.PerformClick();
        }
        public FractalView()
        {
            fractalImageCacheInvalidated = true;

            MouseClick += new MouseEventHandler(GAPictureBox_Click);
            Paint += new PaintEventHandler(GAPanel_Paint);
        }
        /// <summary>
        /// Initialize a new instance of the DropDockingIndicatorsSquare class.
        /// </summary>
        /// <param name="paletteDragDrop">Drawing palette.</param>
        /// <param name="renderer">Drawing renderer.</param>
        /// <param name="showLeft">Show left hot area.</param>
        /// <param name="showRight">Show right hot area.</param>
        /// <param name="showTop">Show top hot area.</param>
        /// <param name="showBottom">Show bottom hot area.</param>
        /// <param name="showMiddle">Show middle hot area.</param>
        public DropDockingIndicatorsSquare(IPaletteDragDrop paletteDragDrop, 
                                           IRenderer renderer,
							               bool showLeft, bool showRight,
							               bool showTop, bool showBottom,
                                           bool showMiddle)
        {
            _paletteDragDrop = paletteDragDrop;
            _renderer = renderer;

            // Initialize the drag data that indicators which docking indicators are needed
            _dragData = new RenderDragDockingData(showLeft, showRight, showTop, showBottom, showMiddle);

            // Ask the renderer to measure the sizing of the indicators that are displayed
            _renderer.RenderGlyph.MeasureDragDropDockingGlyph(_dragData, _paletteDragDrop, PaletteDragFeedback.Square);

            // Setup window so that it is transparent to the Silver color and does not have any borders etc...
            BackColor = Color.Silver;
            ClientSize = _dragData.DockWindowSize;
            ControlBox = false;
            FormBorderStyle = FormBorderStyle.None;
            Location = new Point(100, 200);
            MaximizeBox = false;
            MinimizeBox = false;
            MinimumSize = Size.Empty;
            Name = "DropIndicators";
            ShowInTaskbar = false;
            SizeGripStyle = SizeGripStyle.Hide;
            StartPosition = FormStartPosition.Manual;
            Text = "DropIndicators";
            TransparencyKey = System.Drawing.Color.Silver;
            Paint += new PaintEventHandler(DropIndicators_Paint);
        }
Ejemplo n.º 6
0
 public ColorButton()
 {
     MouseEnter += new EventHandler(OnMouseEnter);
     MouseLeave += new EventHandler(OnMouseLeave);
     MouseUp += new MouseEventHandler(OnMouseUp);
     Paint += new PaintEventHandler(ButtonPaint);
 }
Ejemplo n.º 7
0
        public RayCastForm()
        {
            InitializeComponent();
            UpdateWorker.WorkerReportsProgress = true;
            UpdateWorker.WorkerSupportsCancellation = true;

            RenderGraphics=this.CreateGraphics();

            for (int i = 0; i <=10; i++)
            {
                rSolidBrush = new SolidBrush(Color.FromArgb(i*25, 0, 0));
                solidBrushes.Add(rSolidBrush);
                pens.Add(new Pen(rSolidBrush));
            }

            int ix = 0;
            //RPen = new Pen(GetBrushFromList(solidBrushes,10));
            RPen = GetPenFromList(pens, 10);

            MyRayCast=new CRayCast(this.Width,this.Height);
            MyRayCast.InitRayCast();
            GeneratePens();
            mPen = new Pen(new SolidBrush(Color.White));
            backpen = new Pen(new SolidBrush(Color.Red));

            backpen.DashStyle=DashStyle.Dash;
            UpdateWorker.RunWorkerAsync();

            Paint +=new PaintEventHandler(RayCastForm_Paint);

            //RenderGraphics.Dispose();
        }
Ejemplo n.º 8
0
        /// <summary> The Constructor for our application</summary>
        MyForm()
        {
            //Initial settings for our Form window
            Size = new Size(400, 300);
            Text = " Collision on Either Side";
            BackColor = Color.Black;
            CenterToScreen();

            /// <remarks>Turn on double-buffering to eliminate flickering </remarks>
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);

            /// <remarks>Create Paint Event Handler:
            /// fired every time Windows says it's time to repaint the Form. </remarks>
            Paint += new PaintEventHandler(DrawStuff);

            /// <remarks>Creates a new mouse movement event handler </remarks>
            MouseMove += new MouseEventHandler(MouseMoveUpdate);

            ZoneLeft = ZoneX - (ZoneWidth / 2); // The left side is half the Width to the left of Center
            ZoneRight = ZoneX + (ZoneWidth / 2); // Half the Width to the right
            ZoneTop = ZoneY - (ZoneHeight / 2); // obviously this must turn seaweed into fertilizer
            ZoneBottom = ZoneY + (ZoneHeight / 2);
        }
Ejemplo n.º 9
0
        public Outline(Point center)
        {
            var sideLength = 50;
            center.Offset(-sideLength / 2, -sideLength/2);
            nodes.Add(PanAndZoom.fromLocalToGlobal(center));

            center.Offset(0, sideLength);
            nodes.Add(PanAndZoom.fromLocalToGlobal(center));

            center.Offset(sideLength, 0);
            nodes.Add(PanAndZoom.fromLocalToGlobal(center));

            center.Offset(0, -sideLength);
            nodes.Add(PanAndZoom.fromLocalToGlobal(center));

            //parent.Controls.Add(this);
            //BringToFront();

            foreach(var n in nodes){
                var marker = new VertexMarker();
                marker.setPosition(n);
                marker.MouseClick += new MouseEventHandler(deleteMarker);
                markers.Add(marker);

                marker.BringToFront();

                var c = new CreaterMarker();
                c.MouseClick += new MouseEventHandler(createMarker);
                //parent.Controls.Add(c);
                creaters.Add(c);
            }
            paintEvent = new PaintEventHandler(paint);
        }
        public RichTextBoxBordered()
        {
            InitializeComponent();

            Paint += new PaintEventHandler(UserControl1_Paint);
            Resize += new EventHandler(UserControl1_Resize);
        }
Ejemplo n.º 11
0
        public Game()
        {
            InitializeComponent();

            SetStyle(
                ControlStyles.UserPaint |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.DoubleBuffer |
                ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.AllPaintingInWmPaint,
                true
            );

            Image roadImage = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Racemap.bmp"));
            BackgroundImage = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Racemapv3.bmp"));
            roadBitmap = new Bitmap(roadImage);
            //BackgroundImage = roadImage; //DEBUG

            player = new System.Media.SoundPlayer();
            player.SoundLocation = Path.Combine(Environment.CurrentDirectory, "music.wav");
            player.LoadAsync();

            nyanPlayer = new System.Media.SoundPlayer();
            nyanPlayer.SoundLocation = Path.Combine(Environment.CurrentDirectory, "nyan.wav");
            nyanPlayer.LoadAsync();

            Paint += new PaintEventHandler(PaintHandler);

            Init();
        }
Ejemplo n.º 12
0
		public BasicForm()
		{
			Version v = System.Environment.Version;

			if (v.Major < 2)
			{
				this.SetStyle(ControlStyles.DoubleBuffer, true);
			}
			else
			{
				this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
			}

			this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
			this.SetStyle(ControlStyles.UserPaint, true);
			this.SetStyle(ControlStyles.ResizeRedraw, true);
			this.DoubleBuffered = true;
			InitializeComponent();
			
			Text = "";
			Resizable = true;
			ControlBox = false;
			StartPosition = FormStartPosition.CenterScreen;
			FormBorderStyle = FormBorderStyle.None;
			Paint += new PaintEventHandler(BasicForm_Paint);
			ParamUpdate();
		}
Ejemplo n.º 13
0
 public LineSeparator()
 {
     //InitializeComponent();
     Paint += new PaintEventHandler(LineSeparator_Paint);
     MaximumSize = new Size(2000, 2);
     MinimumSize = new Size(0, 2);
     Width = 350;
 }
Ejemplo n.º 14
0
        public FormSplashScreen() {
            InitializeComponent();
            GlassArea = ClientRectangle;
            LogMessage = "Loading The server for setting up of the server..";
            _devList = GenerateDevList();

            Paint += new PaintEventHandler(FormSplashScreen_Paint);
        }
        // MTScratchpadRTStylusForm constructor
        public MTScratchpadRTStylusForm()
        {
            InitializeComponent();

            // Setup event handlers
            Load += new System.EventHandler(this.OnLoadHandler);
            Paint += new PaintEventHandler(this.OnPaintHandler);
        }
Ejemplo n.º 16
0
		public MainWindow() {

			this.StartPosition = FormStartPosition.CenterScreen;

			BackColor = Color.Green;
			Paint += new PaintEventHandler(MainWindow_Paint);
			MouseDown += new MouseEventHandler(MainWindow_MouseDown);
		}
Ejemplo n.º 17
0
        /// <summary>
        /// Creates a Display instance.
        /// </summary>
        /// <param name="settings">ScreenSettings object</param>
        /// <param name="startupWindow"></param>
        public Display(ScreenSettings settings, bool startupWindow)
        {
            ScreenSettings = settings;
            _startupWindow = startupWindow;
            InitializeComponent();

            Paint += new PaintEventHandler(Display_Paint);
        }
Ejemplo n.º 18
0
 public ImageViewer(System.Drawing.Bitmap bmp)
 {
     InitializeComponent();
     mImage = bmp;
     this.ClientSize = new Size(Math.Max(bmp.Width,50), Math.Max(bmp.Height,50));
     Paint += new PaintEventHandler(ImageViewer_Paint);
     this.Resize += new EventHandler(ImageViewer_Resize);
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Setup all internal events of the class.
 /// </summary>
 public void AddEvents()
 {
     Paint += new PaintEventHandler(HandlePaint);
     MouseDown += new MouseEventHandler(HandleMouseDown);
     MouseMove += new MouseEventHandler(HandleMouseMove);
     MouseUp += new MouseEventHandler(HandleMouseUp);
     Resize += new EventHandler(HandleResize);
     KeyUp += new KeyEventHandler(HandleKeyUp);
 }
Ejemplo n.º 20
0
        // コンストラクタ
        public Viewer()
        {
            InitializeComponent(); // 初期化

            SnapWindow = true;

            MouseWheel += new MouseEventHandler(Viewer_MouseWheel); // マウスホイールイベント
            Paint += new PaintEventHandler(Viewer_Paint);
        }
Ejemplo n.º 21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Chart"/> class.
 /// </summary>
 /// <param name="b">The barlist.</param>
 /// <param name="allowtype">if set to <c>true</c> [allowtype] will allow typing/changing of new symbols on the chart window.</param>
 public Chart(BarList b,bool allowtype)
 {
     InitializeComponent();
     bl = b;
     Symbol = b.Symbol;
     Paint += new PaintEventHandler(Chart_Paint);
     MouseWheel +=new MouseEventHandler(Chart_MouseUp);
     if (allowtype) this.KeyUp += new KeyEventHandler(Chart_KeyUp);
 }
Ejemplo n.º 22
0
 public SplineControl()
 {
     InitializeComponent();
     mSplineInterpolation = Interpolation.CreateRational(new double[] { 0, mMidPoint.X, 1 }, new double[] { 1, mMidPoint.Y, 0 });
     Paint += new PaintEventHandler(paintControl);
     MouseDown += new MouseEventHandler(mousePressed);
     MouseUp += new MouseEventHandler(mouseReleased);
     MouseMove += new MouseEventHandler(mouseMoved);
 }
 public SelectionRangeSlider()
 {
     //    InitializeComponent();
     SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
     Paint += new PaintEventHandler(SelectionRangeSlider_Paint);
     MouseDown += new MouseEventHandler(SelectionRangeSlider_MouseDown);
     MouseMove += new MouseEventHandler(SelectionRangeSlider_MouseMove);
 }
Ejemplo n.º 24
0
        public Visualizer()
        {
            DownloadConfigurationFile("Visualizer.VisualizerSettings");
            
            selfTimer.Elapsed += new ElapsedEventHandler(DoAutomaticStepForward);
            Paint += new PaintEventHandler(DrawInitialState);

            selfTimer.Interval = 650;
            InitializeComponent();
        }
Ejemplo n.º 25
0
        // The Constructor for our application
        MyForm()
        {
            // Setup various Form window attributes
            BackColor = Color.Black;
            Text = " See Dot";

            // Create OnPaint Event Handler: fired every time Windows says it's time to repaint the canvas
            // When Windows says Paint, execute DrawGraphics Method ( see below )
            Paint += new PaintEventHandler(DrawGraphics);
        }
Ejemplo n.º 26
0
        public PathBrowser()
        {
            InitializeComponent();
            Load += new EventHandler(PathBrowser_Load);
            GotFocus += new EventHandler(PathBrowser_GotFocus);
            bBrowse.GotFocus += new EventHandler(bBrowse_GotFocus);
            Paint += new PaintEventHandler(PathBrowser_Paint);
			DragDrop += new DragEventHandler(PathBrowser_DragDrop);
			tPath.DragDrop += new DragEventHandler(tPath_DragDrop);
			tPath.DragEnter += new DragEventHandler(tPath_DragEnter);
        }
Ejemplo n.º 27
0
        public MultiPointSplineControl()
        {
            InitializeComponent();
            mPoints.Add(new PointF(0.5f, 0.1f));
            SetInterpolationMethod(SplineInterpolationMethod.Polynomial);

            Paint += new PaintEventHandler(paintControl);
            MouseDown += new MouseEventHandler(mousePressed);
            MouseUp += new MouseEventHandler(mouseReleased);
            MouseMove += new MouseEventHandler(mouseMoved);
        }
Ejemplo n.º 28
0
        // The Constructor for our application
        MyForm()
        {
            // Setup various Form window attributes
            SuspendLayout();
            Size = new Size(400, 300);
            Text = "Background";
            CenterToScreen();
            ResumeLayout(false);

            // Create OnPaint Event Handler: fired every time Windows says it's time to repaint the canvas
            Paint += new PaintEventHandler(OnPaint);
        }
Ejemplo n.º 29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Chart"/> class.
 /// </summary>
 /// <param name="b">The barlist.</param>
 /// <param name="allowtype">if set to <c>true</c> [allowtype] will allow typing/changing of new symbols on the chart window.</param>
 public ChartControl(BarList b,bool allowtype)
 {
     InitializeComponent();
     Paint += new PaintEventHandler(Chart_Paint);
     MouseDoubleClick += new MouseEventHandler(ChartControl_MouseDoubleClick);
     MouseWheel +=new MouseEventHandler(Chart_MouseUp);
     if (b != null)
     {
         bl = b;
         Symbol = b.Symbol;
     }
 }
Ejemplo n.º 30
0
        // The Constructor for our application
        MyForm()
        {
            SuspendLayout();
            Size = new Size(400, 300);
            AutoValidate = System.Windows.Forms.AutoValidate.EnablePreventFocusChange;
            Text = "Graphic Input Output";
            CenterToScreen();
            ResumeLayout(false);

            // Create OnPaint Event Handler: fired every time Windows says it's time to repaint the canvas
            Paint += new PaintEventHandler(OnPaint);
        }