示例#1
0
 public BigList(IListModel provider)
 {
     this.provider = provider;
       RefAccessible ().Role = Atk.Role.List;
       hAdjustment = new Gtk.Adjustment (0, 0, currentWidth, 1, 1, 1);
       hAdjustment.ValueChanged += new EventHandler (HAdjustmentValueChangedHandler);
       vAdjustment = new Gtk.Adjustment (0, 0, provider.Rows, 1, 1, 1);
       vAdjustment.ValueChanged += new EventHandler (VAdjustmentValueChangedHandler);
       layout = new Pango.Layout (PangoContext);
       ExposeEvent += new ExposeEventHandler (ExposeHandler);
       ButtonPressEvent += new ButtonPressEventHandler (ButtonPressEventHandler);
       ButtonReleaseEvent += new ButtonReleaseEventHandler (ButtonReleaseEventHandler);
       KeyPressEvent += new KeyPressEventHandler (KeyHandler);
       Realized += new EventHandler (RealizeHandler);
       Unrealized += new EventHandler (UnrealizeHandler);
       ScrollEvent += new ScrollEventHandler (ScrollHandler);
         SizeAllocated += new SizeAllocatedHandler (SizeAllocatedHandler);
       MotionNotifyEvent += new MotionNotifyEventHandler (MotionNotifyEventHandler);
       AddEvents ((int) EventMask.ButtonPressMask | (int) EventMask.ButtonReleaseMask | (int) EventMask.KeyPressMask | (int) EventMask.PointerMotionMask);
       CanFocus = true;
       style_widget = new EventBox ();
       style_widget.StyleSet += new StyleSetHandler (StyleHandler);
       layout.SetMarkup (ellipsis);
       layout.GetPixelSize (out ellipsis_width, out line_height);
       layout.SetMarkup ("n");
       layout.GetPixelSize (out en_width, out line_height);
       layout.SetMarkup ("W");
       layout.GetPixelSize (out en_width, out line_height);
       old_width = Allocation.Width;
 }
示例#2
0
        private void BottomViewContainerOnScrolled(object sender, ScrolledEventArgs e)
        {
            var range    = _bottomViewContainer.Content.Height - _bottomViewContainer.Height;
            var progress = e.ScrollY / range;

            ScrollEventHandler?.Invoke(this, new ScrollEventArgs(progress));
            ScrollProgress = progress;
        }
示例#3
0
        internal static new void InvokeHandler(Delegate handler, IntPtr sender, IntPtr args)
        {
            ScrollEventHandler handler_ = (ScrollEventHandler)handler;

            if (handler_ != null)
            {
                handler_(Extend.GetProxy(sender, false), new ScrollEventArgs(args, false));
            }
        }
示例#4
0
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// scrolleventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this ScrollEventHandler scrolleventhandler, Object sender, ScrollEventArgs e, AsyncCallback callback)
        {
            if (scrolleventhandler == null)
            {
                throw new ArgumentNullException("scrolleventhandler");
            }

            return(scrolleventhandler.BeginInvoke(sender, e, callback, null));
        }
        internal void OnUIAValueChanged(ScrollEventArgs args)
        {
            ScrollEventHandler eh = (ScrollEventHandler)Events [UIAValueChangeEvent];

            if (eh != null)
            {
                eh(this, args);
            }
        }
示例#6
0
        public ZoomPictureBox()
        {
            InitializeComponent();

            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true);
            AutoScroll = true;

            Scroll += new ScrollEventHandler(ZoomPictureBox_Scroll);
        }
示例#7
0
        /// <include file='doc\ScrollBar.uex' path='docs/doc[@for="ScrollBar.OnScroll"]/*' />
        /// <devdoc>
        ///    <para>
        ///       Raises the <see cref='System.Windows.Forms.ScrollBar.ValueChanged'/> event.
        ///    </para>
        /// </devdoc>
        protected virtual void OnScroll(ScrollEventArgs se)
        {
            ScrollEventHandler handler = (ScrollEventHandler)Events[EVENT_SCROLL];

            if (handler != null)
            {
                handler(this, se);
            }
        }
示例#8
0
            public static void EndScrollEvent(IAsyncResult iar)
            {
                System.Runtime.Remoting.Messaging.AsyncResult ar = (System.Runtime.Remoting.Messaging.AsyncResult)iar;
                object             o             = ar.AsyncDelegate;
                ScrollEventHandler invokedMethod = (ScrollEventHandler)ar.AsyncDelegate;

                try { invokedMethod.EndInvoke(iar); }
                catch { }
            }
示例#9
0
        protected virtual void OnScroll(ScrollEventArgs e)
        {
            ScrollEventHandler handler = this.Scroll;

            if (handler != null)
            {
                handler(this, e);
            }
        }
示例#10
0
        protected virtual void OnScroll(ScrollEventArgs se)
        {
            ScrollEventHandler eh = (ScrollEventHandler)(Events [OnScrollEvent]);

            if (eh != null)
            {
                eh(this, se);
            }
        }
示例#11
0
        public virtual void OnScroll(ScrollEventArgs e)
        {
            ScrollEventHandler scroll = this.Scroll;

            if (scroll == null)
            {
                return;
            }
            scroll((object)this, e);
        }
示例#12
0
        protected virtual void OnScroll(ScrollEventArgs e)
        {
            ScrollEventHandler handler = this.Scroll;

            this.textBox.Hide();
            this.combo.Hide();
            this.numUpDown.Hide();
            if (handler != null)
            {
                handler(this, e);
            }
        }
示例#13
0
文件: list.cs 项目: lulzzz/ifolder
        int currentWidth = 50; // pixels

        public BigList(IListModel provider)
        {
            this.provider = provider;

            //Accessibility
            RefAccessible().Role = Atk.Role.List;

            hAdjustment = new Gtk.Adjustment(0, 0, currentWidth, 1, 1, 1);
            hAdjustment.ValueChanged += new EventHandler(HAdjustmentValueChangedHandler);

            vAdjustment = new Gtk.Adjustment(0, 0, provider.Rows, 1, 1, 1);
            vAdjustment.ValueChanged += new EventHandler(VAdjustmentValueChangedHandler);

            layout = new Pango.Layout(PangoContext);

            ExposeEvent        += new ExposeEventHandler(ExposeHandler);
            ButtonPressEvent   += new ButtonPressEventHandler(ButtonPressEventHandler);
            ButtonReleaseEvent += new ButtonReleaseEventHandler(ButtonReleaseEventHandler);
            KeyPressEvent      += new KeyPressEventHandler(KeyHandler);
            Realized           += new EventHandler(RealizeHandler);
            Unrealized         += new EventHandler(UnrealizeHandler);
            ScrollEvent        += new ScrollEventHandler(ScrollHandler);
            SizeAllocated      += new SizeAllocatedHandler(SizeAllocatedHandler);
            MotionNotifyEvent  += new MotionNotifyEventHandler(MotionNotifyEventHandler);

            AddEvents((int)EventMask.ButtonPressMask | (int)EventMask.ButtonReleaseMask | (int)EventMask.KeyPressMask | (int)EventMask.PointerMotionMask);
            CanFocus = true;

            style_widget           = new EventBox();
            style_widget.StyleSet += new StyleSetHandler(StyleHandler);

            //
            // Compute the height and ellipsis width of the font,
            // and the en_width for our ellipsizing algorithm
            //
            layout.SetMarkup(ellipsis);
            layout.GetPixelSize(out ellipsis_width, out line_height);

            layout.SetMarkup("n");
            layout.GetPixelSize(out en_width, out line_height);

            layout.SetMarkup("W");
            layout.GetPixelSize(out en_width, out line_height);

            old_width = Allocation.Width;
        }
示例#14
0
    public IconList() : base()
    {
        status   = new Gtk.Window("status");
        status_l = new Gtk.Label("Status");
        status.Add(status_l);
        //status.ShowAll ();

        SetSizeRequest(670, 370);
        CanFocus = true;

        Realized          += new EventHandler(RealizeHanlder);
        Unrealized        += new EventHandler(UnrealizeHandler);
        SizeAllocated     += new SizeAllocatedHandler(SizeAllocatedHandler);
        MotionNotifyEvent += new MotionNotifyEventHandler(MotionHandler);
        ButtonPressEvent  += new ButtonPressEventHandler(ButtonHandler);
        KeyPressEvent     += new KeyPressEventHandler(KeyPressHandler);
        KeyReleaseEvent   += new KeyReleaseEventHandler(KeyReleaseHandler);
        ScrollEvent       += new ScrollEventHandler(ScrollHandler);

        AddEvents((int)(EventMask.ExposureMask |
                        EventMask.LeaveNotifyMask |
                        EventMask.ButtonPressMask |
                        EventMask.PointerMotionMask |
                        EventMask.KeyPressMask |
                        EventMask.ScrollMask |
                        EventMask.KeyReleaseMask));

        zoom = 1.0f;

        SetPreviewSize(160, 120);

        adjustment = new Adjustment(0, 0, 0, 0, 0, 0);
        adjustment.ValueChanged += new EventHandler(ValueChangedHandler);

        image_count = 0;

        Gtk.Settings s = Gtk.Settings.Default;
        double_click_time = (uint)s.DoubleClickTime;

        last_click_time = 0;
    }
        protected virtual void OnScroll(ScrollEventArgs se)
        {
            ScrollEventHandler eh = (ScrollEventHandler)(Events[ScrollEvent]);

            if (eh == null)
            {
                return;
            }

            if (se.NewValue < Minimum)
            {
                se.NewValue = Minimum;
            }

            if (se.NewValue > Maximum)
            {
                se.NewValue = Maximum;
            }

            eh(this, se);
        }
        public void ScrollableControl_OnScroll_Invoke_CallsHandler()
        {
            var control   = new SubScrollableControl();
            var eventArgs = new ScrollEventArgs(ScrollEventType.First, 0);
            int callCount = 0;
            ScrollEventHandler handler = (sender, e) =>
            {
                Assert.Same(control, sender);
                Assert.Same(eventArgs, e);
                callCount++;
            };

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

            // Remove handler.
            control.Scroll -= handler;
            control.OnScroll(eventArgs);
            Assert.Equal(1, callCount);
        }
示例#17
0
        public void ScrollableControl_OnScroll_Invoke_Success()
        {
            var control = new SubScrollableControl();

            // No handler.
            control.OnScrollEntry(null);

            // Handler.
            int callCount = 0;
            ScrollEventHandler handler = (sender, e) =>
            {
                Assert.Equal(control, sender);
                callCount++;
            };

            control.Scroll += handler;
            control.OnScrollEntry(null);
            Assert.Equal(1, callCount);

            // Should not call if the handler is removed.
            control.Scroll -= handler;
            control.OnScrollEntry(null);
            Assert.Equal(1, callCount);
        }
示例#18
0
        public Recorder()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();
            this.DoubleBuffered = true;

            //waveStream = (WaveStream)new NAudio.Wave.RawSourceWaveStream(new MemoryStream(), new WaveFormat(16000, 16, 2));

            // initialize waveStream to 5 seconds
            Reset();

            oLinePen = new Pen(Color.FromArgb(255, 255 - this.BackColor.R, 255 - this.BackColor.G, 255 - this.BackColor.B), 1);
            backgroundPen = new Pen(Color.FromArgb(255, BackColor.R, BackColor.G, BackColor.B));
            //backgroundPen = new Pen(Color.White);

            InvertMouse = false;
            IsPanning = false;

            ZoomValue = 100;
            ZoomIncrement = 20;

            VScroll = false;

            HorzScrollValueChanged = new ScrollEventHandler(Recorder_HorzScrollValueChanged);

            SetAutoScrollMargin(10, 0);

            currentContext = BufferedGraphicsManager.Current;
        }
示例#19
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public VSPanel() : base()
 {
     this.ControlAdded += new ControlEventHandler(VSPanel_ControlAdded);
     MouseWheel        += VSPanel_MouseWheel;
     Scroll            += new ScrollEventHandler(VSPanel_Scroll);
 }
示例#20
0
	public IconList () : base ()
	{
		status = new Gtk.Window ("status");
		status_l = new Gtk.Label ("Status");
		status.Add (status_l);
		//status.ShowAll ();
		
		SetSizeRequest (670, 370);
		CanFocus = true;
		
		Realized += new EventHandler (RealizeHanlder);
		Unrealized += new EventHandler (UnrealizeHandler);
		SizeAllocated += new SizeAllocatedHandler (SizeAllocatedHandler);
		MotionNotifyEvent += new MotionNotifyEventHandler (MotionHandler);
		ButtonPressEvent += new ButtonPressEventHandler (ButtonHandler);
		KeyPressEvent += new KeyPressEventHandler (KeyPressHandler);
		KeyReleaseEvent += new KeyReleaseEventHandler (KeyReleaseHandler);
		ScrollEvent += new ScrollEventHandler (ScrollHandler);
		
		AddEvents ((int) (EventMask.ExposureMask |
				  EventMask.LeaveNotifyMask |
				  EventMask.ButtonPressMask |
				  EventMask.PointerMotionMask |
				  EventMask.KeyPressMask |
				  EventMask.ScrollMask |
				  EventMask.KeyReleaseMask));

                zoom = 1.0f;

		SetPreviewSize (160, 120);
		
		adjustment = new Adjustment (0, 0, 0, 0, 0, 0);
		adjustment.ValueChanged += new EventHandler (ValueChangedHandler);

                image_count = 0;

		Gtk.Settings s = Gtk.Settings.Default;
		double_click_time = (uint) s.DoubleClickTime;

		last_click_time = 0;
	}
示例#21
0
 public QueryView(IBrowsableCollection query) : base(query)
 {
     ScrollEvent += new ScrollEventHandler(HandleScrollEvent);
 }
示例#22
0
 public QueryView(IBrowsableCollection query)
     : base(query)
 {
     ScrollEvent += new ScrollEventHandler (HandleScrollEvent);
 }
        /// <summary>Performs the appropriate type casting to call the type-safe <see cref="T:System.Windows.Controls.Primitives.ScrollEventHandler" /> delegate for the <see cref="E:System.Windows.Controls.Primitives.ScrollBar.Scroll" /> event. </summary>
        /// <param name="genericHandler">The event handler to call.</param>
        /// <param name="genericTarget">The current object along the event's route.</param>
        // Token: 0x06005FB5 RID: 24501 RVA: 0x001AD234 File Offset: 0x001AB434
        protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
        {
            ScrollEventHandler scrollEventHandler = (ScrollEventHandler)genericHandler;

            scrollEventHandler(genericTarget, this);
        }
示例#24
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public VSPanel():base()
 {
     this.ControlAdded += new ControlEventHandler(VSPanel_ControlAdded);
     MouseWheel += VSPanel_MouseWheel;
     Scroll += new ScrollEventHandler(VSPanel_Scroll);
 }
示例#25
0
	protected IconView () : base (null, null)
	{
		cache = new FSpot.PixbufCache ();
		cache.OnPixbufLoaded += HandlePixbufLoaded;

		ScrollAdjustmentsSet += new ScrollAdjustmentsSetHandler (HandleScrollAdjustmentsSet);
		
		ButtonPressEvent += new ButtonPressEventHandler (HandleButtonPressEvent);
		ButtonReleaseEvent += new ButtonReleaseEventHandler (HandleButtonReleaseEvent);
		KeyPressEvent += new KeyPressEventHandler (HandleKeyPressEvent);
		ScrollEvent += new ScrollEventHandler(HandleScrollEvent);

		Destroyed += HandleDestroyed;

		AddEvents ((int) EventMask.KeyPressMask
			   | (int) EventMask.KeyReleaseMask 
			   | (int) EventMask.PointerMotionMask);
		
		CanFocus = true;

		//FSpot.Global.ModifyColors (this);
	}
示例#26
0
 public void SetScrollHandler(ScrollEventHandler handler)
 {
     VScroll.Scroll += handler;
 }
示例#27
0
 public void SetScrollHandler(ScrollEventHandler handler)
 {
     VScroll.Scroll += handler;
 }