Exemple #1
0
        public WinScroll()
        {
            leftArrow  = "full_left".GetHashCode();
            upArrow    = "upper_right".GetHashCode();
            downArrow  = "lower_right".GetHashCode();
            rightArrow = "full_right".GetHashCode();

            InitializeComponent();
            Init();

            //SizeChanged += new System.EventHandler(formResize);
            Layout += new LayoutEventHandler(formResize);
            notifyIcon.DoubleClick         += new System.EventHandler(windowShow);
            optionsToolStripMenuItem.Click += new System.EventHandler(windowShow);
            exitToolStripMenuItem.Click    += new System.EventHandler(trayExit);

            captureX.LostFocus      += new System.EventHandler(CaptureBounds);
            captureY.LostFocus      += new System.EventHandler(CaptureBounds);
            captureWidth.LostFocus  += new System.EventHandler(CaptureBounds);
            captureHeight.LostFocus += new System.EventHandler(CaptureBounds);

            captureCheck.CheckedChanged += new System.EventHandler(captureCheckChanged);
            trayCheck.CheckedChanged    += new System.EventHandler(trayCheckChanged);
            startupCheck.CheckedChanged += new System.EventHandler(startupCheckChanged);
            windowCheck.CheckedChanged  += new System.EventHandler(windowCheckChanged);

            aboutLink.Click += new System.EventHandler(aboutLinkClicked);
        }
Exemple #2
0
	public MainForm ()
	{
		// 
		// _dataGridView
		// 
		_dataGridView = new DataGridView ();
		_dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		_dataGridView.Location = new Point (26, 22);
		_dataGridView.Size = new Size (240, 221);
		_dataGridView.TabIndex = 0;
		Controls.Add (_dataGridView);
		// 
		// _changeButton
		// 
		_changeButton = new Button ();
		_changeButton.Location = new Point (97, 261);
		_changeButton.Size = new Size (112, 32);
		_changeButton.TabIndex = 1;
		_changeButton.Text = "&Change";
		_changeButton.UseVisualStyleBackColor = true;
		_changeButton.Click += new EventHandler (ChangeButton_Click);
		Controls.Add (_changeButton);
		// 
		// MainForm
		// 
		AutoScaleDimensions = new SizeF (6F, 13F);
		AutoScaleMode = AutoScaleMode.Font;
		BackColor = Color.FromArgb (((int) (((byte) (220)))), ((int) (((byte) (220)))), ((int) (((byte) (255)))));
		ClientSize = new Size (292, 305);
		Location = new Point (200, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #78523";
		Layout += new LayoutEventHandler (OnLayout);
		Load += new EventHandler (MainForm_Load);
	}
Exemple #3
0
        public ContactItem(string line1, string line2, Image avatar)
        {
            InitializeComponent();

            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.Opaque, true);

            // Set text and avatar
            line_one_text = line1;
            line_two_text = line2;
            Image         = avatar;

            // Set colors and fonts
            border_pen     = new Pen(Color.FromArgb(131, 150, 195));
            line_one_font  = new Font("Trebuchet MS", 8.25f, FontStyle.Bold);
            line_two_font  = new Font("Trebuchet MS", 6.75f, FontStyle.Italic);
            line_one_color = Color.Black;
            line_two_color = Color.Gray;
            BackColor      = Color.White;

            Enabled = false;

            MouseEnter          += new EventHandler(ContactItem_MouseEnter);
            MouseLeave          += new EventHandler(ContactItem_MouseLeave);
            MouseCaptureChanged += new EventHandler(ContactItem_MouseLeave);
            Layout += new LayoutEventHandler(ContactItem_Layout);
        }
Exemple #4
0
        public void WebBrowserBase_Layout_AddRemove_ThrowsNotSupportedException()
        {
            using var control = new SubWebBrowserBase("8856f961-340a-11d0-a96b-00c04fd705a2");
            LayoutEventHandler handler = (sender, e) => { };

            Assert.Throws <NotSupportedException>(() => control.Layout += handler);
            ((Control)control).Layout -= handler;
        }
Exemple #5
0
        public void AxHost_Layout_AddRemove_ThrowsNotSupportedException()
        {
            var control = new SubAxHost("00000000-0000-0000-0000-000000000000");
            LayoutEventHandler handler = (sender, e) => { };

            Assert.Throws <NotSupportedException>(() => control.Layout += handler);
            control.Layout -= handler;
        }
Exemple #6
0
        public StandardForm()
        {
            InitializeComponent();

            Layout += new LayoutEventHandler(StandardForm_Layout);

            browseScrapbookPanel.SelectionHandler = new OnSelectionHandler(OnScrapbookSelection);
        }
        public GroupPanel()
        {
            InitializeComponent();

            GroupHeader1.ExpandedChanged += new EventHandler(GroupHeader1_ExpandedChanged);
            ItemPanel.ControlAdded       += new ControlEventHandler(ItemPanel_ControlAdded);
            Layout           += new LayoutEventHandler(GroupPanel_Layout);
            ItemPanel.Layout += new LayoutEventHandler(GroupPanel_Layout);
        }
        public FlowPanel()
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            Spacing.Width  = 1;
            Spacing.Height = 1;
            Layout        += new LayoutEventHandler(FlowPanel_Layout);
        }
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// layouteventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this LayoutEventHandler layouteventhandler, Object sender, LayoutEventArgs e, AsyncCallback callback)
        {
            if (layouteventhandler == null)
            {
                throw new ArgumentNullException("layouteventhandler");
            }

            return(layouteventhandler.BeginInvoke(sender, e, callback, null));
        }
        public FlowPanel()
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            Spacing.Width = 1;
            Spacing.Height = 1;
            Layout += new LayoutEventHandler(FlowPanel_Layout);
        }
        public GroupPanel()
        {
            InitializeComponent ();

            GroupHeader1.ExpandedChanged += new EventHandler (GroupHeader1_ExpandedChanged);
            ItemPanel.ControlAdded += new ControlEventHandler (ItemPanel_ControlAdded);
            Layout += new LayoutEventHandler (GroupPanel_Layout);
            ItemPanel.Layout += new LayoutEventHandler (GroupPanel_Layout);
        }
Exemple #12
0
        private void DoInit()
        {
#if REPMAN_COMPACT
#else
            LayoutEventHandler resizeevent;
            resizeevent = new LayoutEventHandler(MyResizeHandler);
            Layout     += resizeevent;
#endif
        }
        public FrameListPanel()
        {
            base.AutoSize = false;
            Layout += new LayoutEventHandler(Panel_SizeChanged);
            ControlAdded += new ControlEventHandler(FrameListPanel_ControlAdded);

            panelAddNewFrame = new AddFramePanel(this);
            Controls.Add(panelAddNewFrame);
        }
Exemple #14
0
        public StatusPanel()
        {
            InitializeComponent();

            CloseButton.Click      += new EventHandler(CloseButton_Click);
            CloseButton.MouseEnter += new EventHandler(CloseButton_MouseEnter);
            CloseButton.MouseLeave += new EventHandler(CloseButton_MouseLeave);

            Layout += new LayoutEventHandler(StatusBarPanel_Layout);
        }
        public StatusPanel()
        {
            InitializeComponent ();

            CloseButton.Click += new EventHandler (CloseButton_Click);
            CloseButton.MouseEnter += new EventHandler (CloseButton_MouseEnter);
            CloseButton.MouseLeave += new EventHandler (CloseButton_MouseLeave);

            Layout += new LayoutEventHandler (StatusBarPanel_Layout);
        }
Exemple #16
0
        /// <summary>
        /// Executes the handler the first time the elements's LayoutUpdated event fires.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <param name="handler">The handler.</param>
        public static void ExecuteOnLayoutUpdated(FrameworkElement element, LayoutEventHandler handler)
        {
            LayoutEventHandler onLayout = null;

            onLayout = (s, e) =>
            {
                handler(s, e);
                element.Layout -= onLayout;
            };
            element.Layout += onLayout;
        }
Exemple #17
0
    public ScoreTab(FileReader file)
    {
        this.file = file;
        TrackerData.ValidateFile(file);

        Text = "Scores";
        Dock = DockStyle.Fill;

        Controls.Add(tabs);

        addComparison.Dock    = DockStyle.Left;
        addComparison.Text    = "Add Comparison";
        removeComparison.Dock = DockStyle.Right;
        removeComparison.Text = "Remove Comparison";

        Panel p = new Panel();

        p.Height = 20;
        p.Controls.Add(addComparison);
        p.Controls.Add(removeComparison);
        p.Dock = DockStyle.Top;

        pages.Add("Best Run", ConfigureTab("Best Run"));
        pages.Add("Top Scores", ConfigureTab("Top Scores"));
        tabs.TabPages.Add(ToTabPage(pages["Best Run"]));
        tabs.TabPages.Add(ToTabPage(pages["Top Scores"]));
        comparisons.Text = "Comparisons";
        selector         = new ComparisonSelector(file);
        selector.SetType = ScoresetType.Comparison;
        selector.Reload();
        selector.Dock          = DockStyle.Top;
        currentComparison.Dock = DockStyle.Fill;
        comparisons.Controls.Add(currentComparison);
        comparisons.Controls.Add(selector);
        comparisons.Controls.Add(p);

        selector.Changed  = ReloadComparisons;
        selector.Reloaded = ReloadComparisons;
        selector.Index    = selectorIndex;

        ReloadComparisons();

        tabs.TabPages.Add(comparisons);

        tabs.SelectedIndexChanged += delegate { CacheTabIndex(); };
        addComparison.Click       += delegate { AddComparison(); };
        removeComparison.Click    += delegate { ConfirmComparisonDeletion(); };

        Layout += new LayoutEventHandler((object sender, LayoutEventArgs e) => DoLayout());

        tabs.SelectedIndex = tabIndex;

        DoLayout();
    }
Exemple #18
0
        /// <summary>
        /// Executes the handler the first time the elements's LayoutUpdated event fires.
        /// </summary>
        /// <param name="control">The control.</param>
        /// <param name="handler">The handler.</param>
        public static void ExecuteOnLayoutUpdated(Control control, LayoutEventHandler handler)
        {
            LayoutEventHandler onLayout = null;

            onLayout = (s, e) =>
            {
                handler(s, e);
                control.Layout -= onLayout;
            };
            control.Layout += onLayout;
        }
Exemple #19
0
 ToolStripVisualInheritanceFixer(IContainer container)
 {
     if (container != null)
     {
         container.Add(this);
     }
     _toolStrip                = null;
     _inheritedToolStrip       = null;
     _visibilityChangedHandler = new EventHandler(_toolStrip_VisibleChanged);
     _layoutHandler            = new LayoutEventHandler(_toolStrip_Layout);
     InitializeComponent();
 }
        private void Init()
        {
            sfdSave.Filter     = "CSLA Gen files (*.xml) | *.xml";
            sfdSave.DefaultExt = "xml";

            ofdLoad.Filter     = sfdSave.Filter;
            ofdLoad.DefaultExt = sfdSave.DefaultExt;

            fbGenerate.OnlyFilesystem = true;

            Layout += new LayoutEventHandler(Form_Layout);
        }
Exemple #21
0
    public CheckField(string name, string current)
    {
        this.name.Text = name;
        option.Checked = (current == "0") ? false : true;

        Controls.Add(this.name);
        Controls.Add(this.option);

        Layout += new LayoutEventHandler((object sender, LayoutEventArgs e) => DoLayout());

        DoLayout();
    }
Exemple #22
0
    public ColorField(string name, Color color)
    {
        this.name.Text   = name;
        this.color.Color = color;

        button.BackColor = color;
        button.Click    += new EventHandler(OnClick);

        this.Controls.Add(this.name);
        this.Controls.Add(this.button);
        Layout += new LayoutEventHandler((object sender, LayoutEventArgs e) => DoLayout());
    }
Exemple #23
0
    public OptionsWindow()
    {
        Text = "Options";

        config     = ScoreTracker.config;
        colorTheme = ScoreTracker.colors;

        Controls.Add(tabs);
        Panel p = new Panel();

        p.Height = 20;
        p.Controls.Add(save);
        p.Controls.Add(saveClose);
        p.Dock = DockStyle.Bottom;
        Controls.Add(p);

        scoreTab.Text = "Scores";
        tabs.TabPages.Add(scoreTab);

        generalTab.Text = "General";
        tabs.TabPages.Add(generalTab);

        colorTab.Text = "Colors";
        tabs.TabPages.Add(colorTab);

        aboutTab.Text = "About";
        tabs.TabPages.Add(aboutTab);

        save.Text   = "Save All Changes";
        save.Dock   = DockStyle.Left;
        save.Click += new EventHandler(Save);

        saveClose.Text   = "Save and Close";
        saveClose.Dock   = DockStyle.Right;
        saveClose.Click += new EventHandler(SaveClose);

        Size        = new Size(w, h);
        MaximumSize = Size;
        MinimumSize = Size;

        Layout += new LayoutEventHandler((object sender, LayoutEventArgs e) => DoLayout());
        tabs.SelectedIndexChanged += delegate { CacheTabIndex(); };

        ConfigureScoreTab();
        ConfigureGeneralTab();
        ConfigColors();
        ConfigAboutTab();

        tabs.SelectedIndex = tabIndex;

        DoLayout();
    }
 public BrowseScrapbookPanel()
 {
     InitializeComponent();
     Layout += new LayoutEventHandler(OnLayout);
     listSortBy.ValueMember   = "Key";
     listSortBy.DisplayMember = "Value";
     listSortBy.Items.Clear();
     listSortBy.Items.Add(SORT_LAST_MODIFIED);
     listSortBy.Items.Add(SORT_RELEVANCE);
     listSortBy.Items.Add(SORT_TITLE);
     listSortBy.SelectedItem          = SORT_LAST_MODIFIED;
     listSortBy.SelectedIndexChanged += new System.EventHandler(listSortBy_SelectedIndexChanged);
 }
Exemple #25
0
    public DropdownField(string name, string current, params Object[] options)
    {
        this.name.Text = name;
        this.options.Items.AddRange(options);

        this.options.SelectedIndex = Int32.Parse(current);
        this.options.DropDownStyle = ComboBoxStyle.DropDownList;
        Controls.Add(this.name);
        Controls.Add(this.options);

        Layout += new LayoutEventHandler((object sender, LayoutEventArgs e) => DoLayout());

        DoLayout();
    }
Exemple #26
0
    public NumericField(string name, string number)
    {
        this.name.Text  = name;
        this.score.Text = number;

        Controls.Add(this.name);
        Controls.Add(this.score);

        Height = 20;

        Layout += new LayoutEventHandler((object sender, LayoutEventArgs e) => DoLayout());

        DoLayout();
    }
Exemple #27
0
		public Splitter() {

			min_extra = 25;
			min_size = 25;
			split_requested = -1;
			splitter_size = 3;
			horizontal = false;

			SetStyle(ControlStyles.Selectable, false);
			Anchor = AnchorStyles.None;
			Dock = DockStyle.Left;

			Layout += new LayoutEventHandler(LayoutSplitter);
			this.ParentChanged += new EventHandler(ReparentSplitter);
			Cursor = splitter_we;
		}
Exemple #28
0
        public Splitter()
        {
            min_extra       = 25;
            min_size        = 25;
            split_requested = -1;
            splitter_size   = 3;
            horizontal      = false;

            SetStyle(ControlStyles.Selectable, false);
            Anchor = AnchorStyles.None;
            Dock   = DockStyle.Left;

            Layout             += new LayoutEventHandler(LayoutSplitter);
            this.ParentChanged += new EventHandler(ReparentSplitter);
            Cursor              = splitter_we;
        }
        private void DoInit()
        {
#if REPMAN_COMPACT
#else
            OptimizeWMF = WMFOptimization.None;
#endif
            prdriver            = new PrintOutNet();
            image               = new PictureBox();
            image.MouseDown    += new MouseEventHandler(MyMouseDown);
            image.Parent        = this;
            FBitmap             = new System.Drawing.Bitmap(10, 10);
            prdriver.Output     = FBitmap;
            FEntirePageCount    = 1;
            aparams             = new Object[3];
            this.ParentChanged += new EventHandler(MyParentChanged);
#if REPMAN_COMPACT
            BackColor            = System.Drawing.SystemColors.ControlDark;
            MyAutoScrollPosition = new Point(0, 0);
            dpix = PrintOutNet.DEFAULT_RESOLUTION;
            dpiy = PrintOutNet.DEFAULT_RESOLUTION;
#else
            Graphics gr = this.CreateGraphics();
            try
            {
                dpix = (int)gr.DpiX;
                dpiy = (int)gr.DpiY;
            }
            finally
            {
                gr.Dispose();
            }
            resizeevent = new LayoutEventHandler(MyResizeHandler);
            Layout     += resizeevent;
#endif
            image.Image   = FBitmap;
            image.Top     = 0;
            image.Left    = 0;
            FPreviewScale = 1.0F;
#if REPMAN_COMPACT
            FBarWidth  = 0;
            FBarHeight = 0;
#else
            FBarWidth  = System.Windows.Forms.SystemInformation.VerticalScrollBarWidth;
            FBarHeight = System.Windows.Forms.SystemInformation.HorizontalScrollBarHeight;
#endif
        }
Exemple #30
0
    public ScorePage(FileReader file, string section)
    {
        this.file      = file;
        this.section   = section;
        Text           = section;
        totalName.Text = "Total:";
        Dock           = DockStyle.Fill;

        totalPanel.Height = 25;
        Controls.Add(totalPanel);
        totalPanel.Controls.Add(totalName);
        totalPanel.Controls.Add(total);
        totalName.Dock = DockStyle.Fill;
        total.Dock     = DockStyle.Right;

        //Resize += delegate { DoLayout(); };
        Layout += new LayoutEventHandler((object sender, LayoutEventArgs e) => DoLayout());
    }
Exemple #31
0
 /// <summary>
 /// Performs an action on a control after its handle has been created. If the control's handle has already been created, the action is executed immediately.
 /// </summary>
 /// <param name="ctrl">This control.</param>
 /// <param name="action">The action to execute.</param>
 public static void CallWhenHandleValid(this Control ctrl, Action <Control> action)
 {
     if (ctrl.IsHandleCreated)
     {
         action(ctrl);
     }
     else
     {
         LayoutEventHandler handler = null;
         handler = (sender, e) =>
         {
             if (ctrl.IsHandleCreated)
             {
                 ctrl.Layout -= handler;
                 action(ctrl);
             }
         };
         ctrl.Layout += handler;
     }
 }
Exemple #32
0
        public void ContainerControl_OnLayout_Invoke_CallsLayout(LayoutEventArgs eventArgs)
        {
            var control   = new SubContainerControl();
            int callCount = 0;
            LayoutEventHandler handler = (sender, e) =>
            {
                Assert.Same(control, sender);
                Assert.Same(eventArgs, e);
                callCount++;
            };

            // Call with handler.
            control.Layout += handler;
            control.OnLayout(eventArgs);
            Assert.Equal(1, callCount);

            // Remove handler.
            control.Layout -= handler;
            control.OnLayout(eventArgs);
            Assert.Equal(1, callCount);
        }
Exemple #33
0
        public void ByteViewer_OnLayout_InvokeWithHandle_CallsLayout(LayoutEventArgs eventArgs)
        {
            using var control = new SubByteViewer();
            Assert.NotEqual(IntPtr.Zero, control.Handle);
            int invalidatedCallCount = 0;

            control.Invalidated += (sender, e) => invalidatedCallCount++;
            int styleChangedCallCount = 0;

            control.StyleChanged += (sender, e) => styleChangedCallCount++;
            int createdCallCount = 0;

            control.HandleCreated += (sender, e) => createdCallCount++;
            int callCount = 0;
            LayoutEventHandler handler = (sender, e) =>
            {
                Assert.Same(control, sender);
                Assert.Same(eventArgs, e);
                callCount++;
            };

            // Call with handler.
            control.Layout += handler;
            control.OnLayout(eventArgs);
            Assert.Equal(1, callCount);
            Assert.True(control.IsHandleCreated);
            Assert.Equal(1, invalidatedCallCount);
            Assert.Equal(0, styleChangedCallCount);
            Assert.Equal(0, createdCallCount);

            // Remove handler.
            control.Layout -= handler;
            control.OnLayout(eventArgs);
            Assert.Equal(1, callCount);
            Assert.True(control.IsHandleCreated);
            Assert.Equal(2, invalidatedCallCount);
            Assert.Equal(0, styleChangedCallCount);
            Assert.Equal(0, createdCallCount);
        }
Exemple #34
0
        public void ByteViewer_OnLayout_Invoke_CallsLayout(LayoutEventArgs eventArgs)
        {
            using var control = new SubByteViewer();
            int callCount = 0;
            LayoutEventHandler handler = (sender, e) =>
            {
                Assert.Same(control, sender);
                Assert.Same(eventArgs, e);
                callCount++;
            };

            // Call with handler.
            control.Layout += handler;
            control.OnLayout(eventArgs);
            Assert.Equal(1, callCount);
            Assert.False(control.IsHandleCreated);

            // Remove handler.
            control.Layout -= handler;
            control.OnLayout(eventArgs);
            Assert.Equal(1, callCount);
            Assert.False(control.IsHandleCreated);
        }
        public ToolBoxGroupPanel()
        {
            ItemPanel    = new Panel();
            GroupHeader1 = new ToolBoxGroupHeader();
            SuspendLayout();

            //
            // ItemPanel
            //
            ItemPanel.Dock     = DockStyle.Fill;
            ItemPanel.Location = new Point(1, 21);
            ItemPanel.Name     = "ItemPanel";
            ItemPanel.Size     = new Size(198, 0);
            ItemPanel.TabIndex = 1;
            //
            // GroupHeader1
            //
            GroupHeader1.Dock     = DockStyle.Top;
            GroupHeader1.Expanded = true;
            GroupHeader1.Location = new Point(1, 1);
            GroupHeader1.Margin   = new Padding(0);
            GroupHeader1.Name     = "GroupHeader1";
            GroupHeader1.Padding  = new Padding(1, 1, 1, 0);
            GroupHeader1.Size     = new Size(198, 20);
            GroupHeader1.TabIndex = 0;

            Controls.Add(this.ItemPanel);
            Controls.Add(this.GroupHeader1);
            Name    = "ToolBoxGroupPanel";
            Padding = new System.Windows.Forms.Padding(1, 1, 1, 0);
            Size    = new System.Drawing.Size(200, 20);
            ResumeLayout(false);

            GroupHeader1.ExpandedChanged += new EventHandler(GroupHeader1_ExpandedChanged);
            ItemPanel.ControlAdded       += new ControlEventHandler(ItemPanel_ControlAdded);
            Layout += new LayoutEventHandler(ToolBoxGroupPanel_Layout);
        }
Exemple #36
0
        /// <summary>
        /// Sets the handle for rendering and input.
        /// </summary>
        public static void SetHandle(IntPtr handle)
        {
            var lastControl = Control;

            Handle  = handle;
            Control = Control.FromHandle(handle);
            HandleSet?.Invoke(handle);

            LayoutEventHandler sizeChanged = (s, e) =>
            {
                Renderer.ResizeNextFrame = true;
                Renderer.ControlSize     = new Vector2(Control.Width, Control.Height);
            };

            if (lastControl != null)
            {
                lastControl.Layout -= sizeChanged;
            }

            if (handle != IntPtr.Zero)
            {
                Control.Layout += sizeChanged;
            }
        }
        public void Run(Machine m, Host h)
        {
            M = m;
            M.H = h;

            VisiblePitch = M.VisiblePitch;
            NumSoundBuffers = EMU7800App.Instance.Settings.NumSoundBuffers;
            EffectiveFPS = M.FrameHZ + EMU7800App.Instance.Settings.FrameRateAdjust;
            SoundSampleRate = M.SoundSampleRate*EffectiveFPS/M.FrameHZ;

            FrameSamples = EffectiveFPS << 1;

            Rectangulator r = new Rectangulator(VisiblePitch, M.Scanlines);
            r.UpdateRect += new UpdateRectHandler(OnUpdateRect);
            r.Palette = M.Palette;
            r.PixelAspectXRatio = 320/VisiblePitch;
            r.OffsetLeft = 0;
            r.ClipTop = M.FirstScanline;
            r.ClipHeight = 240;
            r.UpdateTransformationParameters();
            Rectangulator = r;
            FrameBitmap = null;
            FrameBuffer = null;

            Text = EMU7800App.Title;
            Icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream("EMU7800.Icon1.ico"));

            ShowInTaskbar = true;
            FormBorderStyle = FormBorderStyle.Sizable;
            CenterToScreen();

            ClientSize = new Size(640, 480);
            MinimumSize = new Size(320 + 8, 240 + 27);

            // Enable double-buffering to avoid flicker
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);

            TextFont = new Font("Courier New", 18);
            TextBrush = new SolidBrush(Color.White);

            Paint += new PaintEventHandler(OnPaint);
            Layout += new LayoutEventHandler(OnLayout);
            LocationChanged += new EventHandler(OnLocationChanged);

            KeyDown += new KeyEventHandler(OnKeyDown);
            KeyUp   += new KeyEventHandler(OnKeyUp);
            KeyPreview = true;

            if (SavedLocation.X >= 0)
            {
                Location = SavedLocation;
            }

            Show();

            Paused = false;
            ReqRefresh = true;

            KeyboardPlayerNo = 0;

            WinmmNativeMethods.Open(SoundSampleRate, M.Scanlines << 1, NumSoundBuffers);
            Run();
        }
Exemple #38
0
		public FindDialog() : base(!INCLUDE_BUTTONS)
		{
			Text = StringParser.Parse("${res:ComponentInspector.FindDialog.Title}");
			FormBorderStyle = FormBorderStyle.SizableToolWindow;
			ControlBox = false;
			StartPosition = FormStartPosition.CenterParent;
			ShowInTaskbar = false;

			Label label;
			Panel panel;

			AutoScaleBaseSize = new Size(5, 13);
			ClientSize = new Size(540, 333);
			MinimumSize = new Size(536, 296);

			_nodeFound = new SearchNodeDelegate(NodeFound);
			_nodeLooking = new SearchNodeDelegate(NodeLooking);
			_searchStatus = new SearchStatusDelegate(SearchStatus);
			_searchInvalidate = new SearchInvalidateDelegate(SearchInvalidate);

			SuspendLayout();

			// So we can make the list column change when the form
			// is resized
			Layout += new LayoutEventHandler(LayoutHandler);

			Activated += new EventHandler(ActivateHandler);

			//
			// Current tree node
			//
			label = new Label();
			label.Location = new Point(8, 16);
			label.Size = new Size(72, 30);
			label.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.StartingWithLabel}");
			label.TextAlign = ContentAlignment.TopRight;
			Controls.Add(label);

			_startingNode = new Label();
			_startingNode.Location = new Point(80, 16);
			_startingNode.Size = new Size(360, 30);
			_startingNode.TextAlign = ContentAlignment.TopLeft;
			_startingNode.Font = new Font(_startingNode.Font, FontStyle.Bold);
			_startingNode.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
			Controls.Add(_startingNode);

			//
			// Find text combo
			//
			label = new Label();
			label.Location = new Point(8, 48);
			label.Size = new Size(72, 13);
			label.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.FindWhatLabel}");
			label.TextAlign = ContentAlignment.MiddleRight;
			Controls.Add(label);

			_findWhat = new ComboBox();
			_findWhat.Location = new Point(80, 48);
			_findWhat.Size = new Size(304, 21);
			_findWhat.TabIndex = 0;
			_findWhat.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
			_findWhat.KeyPress += new KeyPressEventHandler(FindWhatKeyHandler);
			Controls.Add(_findWhat);

			Panel selectionPanel = new Panel();
			selectionPanel.Location = new Point(8, 80);
			selectionPanel.Size = new Size(430, 75);
			Controls.Add(selectionPanel);

			//
			// Tree selection panel
			//
			label = new Label();
			label.AutoSize = true;
			label.Location = new Point(10, 0);
			label.Size = new Size(40, 13);
			label.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.FindIn}");
			label.TextAlign = ContentAlignment.MiddleRight;
			selectionPanel.Controls.Add(label);

			panel = new Panel();
			panel.Location = new Point(0, 8);
			panel.Size = new Size(120, 64);
			panel.BorderStyle = BorderStyle.Fixed3D;
			panel.TabIndex = 30;
			selectionPanel.Controls.Add(panel);

			_treeObj = new RadioButton();
			_treeObj.Location = new Point(5, 8);
			_treeObj.Size = new Size(120, 15);
			_treeObj.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.ObjectTreeRadioButtonText}");
			_treeObj.TabIndex = 0;
			_treeObj.Click += new EventHandler(TreeSelectClick);
			panel.Controls.Add(_treeObj);

			_treeAssy = new RadioButton();
			_treeAssy.Location = new Point(5, 23);
			_treeAssy.Size = new Size(120, 15);
			_treeAssy.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.AssembliesRadioButton}");
			_treeAssy.TabIndex = 0;
			_treeAssy.Click += new EventHandler(TreeSelectClick);
			panel.Controls.Add(_treeAssy);

			_treeAx = new RadioButton();
			_treeAx.Location = new Point(5, 38);
			_treeAx.Size = new Size(120, 15);
			_treeAx.Text = "ActiveX/COM";
			_treeAx.TabIndex = 0;
			_treeAx.Click += new EventHandler(TreeSelectClick);
			panel.Controls.Add(_treeAx);

			//
			// Level selection panel
			//
			label = new Label();
			label.AutoSize = true;
			label.Location = new Point(135, 0);
			label.Size = new Size(40, 13);
			label.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.LevelsLabel}");
			label.TextAlign = ContentAlignment.MiddleRight;
			selectionPanel.Controls.Add(label);

			panel = new Panel();
			panel.Location = new Point(125, 8);
			panel.Size = new Size(110, 64);
			panel.BorderStyle = BorderStyle.Fixed3D;
			panel.TabIndex = 35;
			selectionPanel.Controls.Add(panel);

			_levelAll = new RadioButton();
			_levelAll.Location = new Point(5, 8);
			_levelAll.Size = new Size(110, 15);
			_levelAll.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.AllLevelsLabel}");
			_levelAll.Checked = true;
			_levelAll.TabIndex = 0;
			panel.Controls.Add(_levelAll);

			_levelSelect = new RadioButton();
			_levelSelect.Location = new Point(5, 23);
			_levelSelect.Size = new Size(80, 15);
			_levelSelect.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.LevelSelectOnlyDownLabel}");
			_levelSelect.TabIndex = 1;
			panel.Controls.Add(_levelSelect);

			_levelSelectNum = new NumericTextBox();
			_levelSelectNum.Location = new Point(20, 38);
			_levelSelectNum.Width = 25;
			_levelSelectNum.Height = 25;
			_levelSelectNum.Text = "2";
			panel.Controls.Add(_levelSelectNum);

			label = new Label();
			label.Location = new Point(48, 38);
			label.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.LevelsLabel}");
			panel.Controls.Add(label);

			//
			// Object tree options
			//
			_objTreeLabel = new Label();
			_objTreeLabel.Location = new Point(250, 0);
			_objTreeLabel.Size = new Size(64, 16);
			_objTreeLabel.TabIndex = 17;
			_objTreeLabel.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.ObjectTreeRadioButtonText}");
			selectionPanel.Controls.Add(_objTreeLabel);

			_objTreePanel = new Panel();
			_objTreePanel.Location = new Point(240, 8);
			_objTreePanel.Size = new Size(88, 64);
			_objTreePanel.TabIndex = 16;
			_objTreePanel.BorderStyle = BorderStyle.Fixed3D;
			_objTreePanel.TabIndex = 40;
			selectionPanel.Controls.Add(_objTreePanel);

			_objTreeName = new CheckBox();
			_objTreeName.Location = new Point(5, 8);
			_objTreeName.Size = new Size(110, 15);
			_objTreeName.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.ObjectTreeNameCheckBox}");
			_objTreeName.Checked = true;
			_objTreeName.TabIndex = 0;
			_objTreePanel.Controls.Add(_objTreeName);

			_objTreeValue = new CheckBox();
			_objTreeValue.Location = new Point(5, 23);
			_objTreeValue.Size = new Size(110, 15);
			_objTreeValue.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.ObjectTreeValueCheckBox}");
			_objTreeValue.TabIndex = 1;
			_objTreePanel.Controls.Add(_objTreeValue);

			//
			// Matching options panel
			//
			label = new Label();
			label.AutoSize = true;
			label.Location = new Point(343, 0);
			label.Size = new Size(35, 13);
			label.TabIndex = 7;
			label.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.MatchLabel}");
			selectionPanel.Controls.Add(label);

			panel = new Panel();
			panel.BorderStyle = BorderStyle.Fixed3D;
			panel.Location = new Point(333, 8);
			panel.Size = new Size(96, 64);
			panel.TabIndex = 45;
			selectionPanel.Controls.Add(panel);

			_fullName = new RadioButton();
			_fullName.Location = new Point(5, 8);
			_fullName.Size = new Size(110, 15);
			_fullName.Checked = true;
			_fullName.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.FullNameLabel}");
			_fullName.TabIndex = 1;
			panel.Controls.Add(_fullName);
			
			_startsWith = new RadioButton();
			_startsWith.Location = new Point(5, 23);
			_startsWith.Size = new Size(110, 15);
			_startsWith.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.StartsWithRadioButton}");
			_startsWith.TabIndex = 1;
			panel.Controls.Add(_startsWith);

			_contains = new RadioButton();
			_contains.Location = new Point(5, 38);
			_contains.Size = new Size(110, 15);
			_contains.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.ContainsRadioButton}");
			_contains.TabIndex = 1;
			panel.Controls.Add(_contains);

			// Border
			label = new Label();
			label.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			label.Location = new Point(8, 158);
			label.Size = new Size(ClientSize.Width - 16, 2);
			label.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
			label.TabIndex = 10;
			Controls.Add(label);

			// Found list
			_foundList = new ListView();
			_foundList.Location = new Point(8, 166);
			_foundList.Size = new Size(ClientSize.Width - 16, ClientSize.Height - 166 - 8 - 21);
			_foundList.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
			_foundList.TabIndex = 50;
			_foundList.FullRowSelect = true;
			_foundList.MultiSelect = false;
			_foundList.SmallImageList = PresentationMap.ImageList;
			_foundList.View = View.Details;
			_foundList.ItemActivate += new EventHandler(ShowClick);

			MenuItem mi = new MenuItem();
			mi.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.ShowItemMenuItem}");
			mi.Click += new EventHandler(ShowClick);
			_foundList.ContextMenu = new ContextMenu();
			_foundList.ContextMenu.MenuItems.Add(mi);

			_foundListColumn = new ColumnHeader();
			_foundListColumn.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.FoundListColumnHeader}");
			_foundListColumn.TextAlign = HorizontalAlignment.Left;
			_foundListColumn.Width = _foundList.ClientSize.Width;
			_foundList.Columns.Add(_foundListColumn);
			Controls.Add(_foundList);

			//
			// Current tree node
			//
			_lookingLabel = new Label();
			_lookingLabel.Location = new Point(8, ClientSize.Height - 21);
			_lookingLabel.Size = new Size(72, 13);
			_lookingLabel.TextAlign = ContentAlignment.MiddleLeft;
			_lookingLabel.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
			Controls.Add(_lookingLabel);

			_lookingNode = new Label();
			_lookingNode.Location = new Point(80, ClientSize.Height - 21);
			_lookingNode.Size = new Size(360, 13);
			_lookingNode.TextAlign = ContentAlignment.MiddleLeft;
			_lookingNode.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
			Controls.Add(_lookingNode);

			//
			// Buttons
			//
			_findButton = new Button();
			_findButton.Location = new Point(ClientSize.Width - _findButton.Width - 8, 16);
			_findButton.Anchor = AnchorStyles.Top | AnchorStyles.Right;
			_findButton.TabIndex = 5;
			_findButton.Text = StringParser.Parse("${res:ComponentInspector.FindDialog.FindButton}");
			_findButton.Click += new EventHandler(FindClick);
			Controls.Add(_findButton);

			_closeButton = new Button();
			_closeButton.Location = new Point(ClientSize.Width - _closeButton.Width - 8, 48);
			_closeButton.Anchor = AnchorStyles.Top | AnchorStyles.Right;
			_closeButton.TabIndex = 10;
			_closeButton.Text = StringParser.Parse("${res:Global.CloseButtonText}");
			_closeButton.Click += new EventHandler(CloseClick);
			Controls.Add(_closeButton);

			_cancelButton = new Button();
			_cancelButton.Location = new Point(ClientSize.Width - _cancelButton.Width - 8, 80);
			_cancelButton.Anchor = AnchorStyles.Top | AnchorStyles.Right;
			_cancelButton.TabIndex = 15;
			_cancelButton.Text = StringParser.Parse("${res:Global.CloseButtonText}");
			_cancelButton.Click += new EventHandler(CancelClick);
			Controls.Add(_cancelButton);

			_helpButton = new Button();
			_helpButton.Location = new Point(ClientSize.Width - _helpButton.Width - 8, 112);
			_helpButton.Anchor = AnchorStyles.Top | AnchorStyles.Right;
			_helpButton.TabIndex = 20;
			_helpButton.Text = StringParser.Parse("${res:Global.HelpButtonText}");
			_helpButton.Click += new EventHandler(HelpClick);
			Controls.Add(_helpButton);

			ResumeLayout();
		}
        public ContactItem(string line1, string line2, Image avatar)
        {
            InitializeComponent ();

            SetStyle (ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle (ControlStyles.AllPaintingInWmPaint, true);
            SetStyle (ControlStyles.Opaque, true);

            // Set text and avatar
            line_one_text = line1;
            line_two_text = line2;
            Image = avatar;

            // Set colors and fonts
            border_pen = new Pen (Color.FromArgb (131, 150, 195));
            line_one_font = new Font ("Trebuchet MS", 8.25f, FontStyle.Bold);
            line_two_font = new Font ("Trebuchet MS", 6.75f, FontStyle.Italic);
            line_one_color = Color.Black;
            line_two_color = Color.Gray;
            BackColor = Color.White;

            Enabled = false;

            MouseEnter += new EventHandler (ContactItem_MouseEnter);
            MouseLeave += new EventHandler (ContactItem_MouseLeave);
            MouseCaptureChanged += new EventHandler (ContactItem_MouseLeave);
            Layout += new LayoutEventHandler (ContactItem_Layout);
        }
Exemple #40
0
 /// <summary>
 /// Executes the handler the first time the elements's LayoutUpdated event fires.
 /// </summary>
 /// <param name="element">The element.</param>
 /// <param name="handler">The handler.</param>
 public static void ExecuteOnLayoutUpdated(FrameworkElement element, LayoutEventHandler handler)
 {
     LayoutEventHandler onLayout = null;
     onLayout = (s, e) =>
     {
         handler(s, e);
         element.Layout -= onLayout;
     };
     element.Layout += onLayout;
 }