void HandleListScrollEvent (object o, ScrollEventArgs args)
		{
			if (!vScrollbar.Visible)
				return;
			
			var adj = vScrollbar.Adjustment;
			var alloc = Allocation;
			
			//This widget is a special case because it's always aligned to items as it scrolls.
			//Although this means we can't use the pixel deltas for true smooth scrolling, we 
			//can still make use of the effective scrolling velocity by basing the calculation 
			//on pixels and rounding to the nearest item.
			
			double dx, dy;
			args.Event.GetPageScrollPixelDeltas (0, alloc.Height, out dx, out dy);
			if (dy == 0)
				return;
			
			var itemDelta = dy / (alloc.Height / adj.PageSize);
			double discreteItemDelta = System.Math.Round (itemDelta);
			if (discreteItemDelta == 0.0 && dy != 0.0)
				discreteItemDelta = dy > 0? 1.0 : -1.0;
			
			adj.AddValueClamped (discreteItemDelta);
			args.RetVal = true;
		}
Beispiel #2
0
        private void HandleScrollEvent(object sender, ScrollEventArgs args)
        {
            // Activated only by Control + ScrollWheelUp/ScrollWheelDown
            if (ModifierType.ControlMask != (args.Event.State & ModifierType.ControlMask))
                return;

            if (args.Event.Direction == ScrollDirection.Up) {
                ZoomIn ();
                // stop event from propagating.
                args.RetVal = true;
            } else if (args.Event.Direction == ScrollDirection.Down ) {
                ZoomOut ();
                args.RetVal = true;
            }
        }
Beispiel #3
0
        protected virtual void OnVideoboxScrollEvent(object o, Gtk.ScrollEventArgs args)
        {
            switch (args.Event.Direction)
            {
            case ScrollDirection.Down:
                SeekToPreviousFrame(InSegment());
                break;

            case ScrollDirection.Up:
                SeekToNextFrame(InSegment());
                break;

            case ScrollDirection.Left:
                StepBackward();
                break;

            case ScrollDirection.Right:
                StepForward();
                break;
            }
        }
Beispiel #4
0
        void OnVideoboxScrollEvent(object o, Gtk.ScrollEventArgs args)
        {
            switch (args.Event.Direction)
            {
            case ScrollDirection.Down:
                Player.SeekToPreviousFrame();
                break;

            case ScrollDirection.Up:
                Player.SeekToNextFrame();
                break;

            case ScrollDirection.Left:
                Player.StepBackward();
                break;

            case ScrollDirection.Right:
                Player.StepForward();
                break;
            }
        }
Beispiel #5
0
 private void OnPlusMinusScollEvent(object o, ScrollEventArgs args)
 {
     if(args.Event.Direction == Gdk.ScrollDirection.Up) {
         AdjustVolume(1);
     } else if(args.Event.Direction == Gdk.ScrollDirection.Down) {
         AdjustVolume(-1);
     }
 }
Beispiel #6
0
		static void HandleTreeScrollEvent (object o, ScrollEventArgs args)
		{
			HideTooltip ((Gtk.TreeView)o);
		}
        private void OnMouseScroll (object o, ScrollEventArgs args)
        {
            switch (args.Event.Direction) {
                case Gdk.ScrollDirection.Up:
                    if ((args.Event.State & Gdk.ModifierType.ControlMask) != 0) {
                        ServiceManager.PlayerEngine.Volume += (ushort)PlayerEngine.VolumeDelta;
                    } else if((args.Event.State & Gdk.ModifierType.ShiftMask) != 0) {
                        ServiceManager.PlayerEngine.Position += PlayerEngine.SkipDelta;
                    } else {
                        ServiceManager.PlaybackController.Next ();
                    }
                    break;

                case Gdk.ScrollDirection.Down:
                    if ((args.Event.State & Gdk.ModifierType.ControlMask) != 0) {
                        if (ServiceManager.PlayerEngine.Volume < (ushort)PlayerEngine.VolumeDelta) {
                            ServiceManager.PlayerEngine.Volume = 0;
                        } else {
                            ServiceManager.PlayerEngine.Volume -= (ushort)PlayerEngine.VolumeDelta;
                        }
                    } else if((args.Event.State & Gdk.ModifierType.ShiftMask) != 0) {
                        ServiceManager.PlayerEngine.Position -= PlayerEngine.SkipDelta;
                    } else {
                        ServiceManager.PlaybackController.Previous ();
                    }
                    break;
            }
        }
 protected void OnDrawingAreaScroll(object o, ScrollEventArgs args)
 {
     if (args.Event.Direction == ScrollDirection.Up) {
         zoomSpeed+=ZoomSpeedIncrement;
     }
     if (args.Event.Direction == ScrollDirection.Down) {
         zoomSpeed-=ZoomSpeedIncrement;
     }
     args.RetVal = true;
 }
        void PlotWidget_ScrollEvent(object o, ScrollEventArgs args)
        {
            int X, Y;
            int direction = -1;
            Gdk.ModifierType state;

            args.Event.Window.GetPointer(out X, out Y, out state);
            Modifier keys = MouseInput(state);
            if (args.Event.Direction == Gdk.ScrollDirection.Up)
            {
                direction = +1;
            }
            this.InteractivePlotSurface2D.DoMouseScroll(X, Y, direction, keys);
        }
        private void ScrollNotify(object o, ScrollEventArgs args)
        {
            int X, Y;
            int direction = -1;
            Gdk.ModifierType state;

            args.Event.Window.GetPointer(out X, out Y, out state);
            Modifier keys = MouseInput(state);
            if (args.Event.Direction == Gdk.ScrollDirection.Up) {
                direction = +1;
            }
            DoMouseScroll (X, Y, direction, keys);
        }
 void OnScrolled(object o, ScrollEventArgs args)
 {
     if (args.Event.Direction == Gdk.ScrollDirection.Up)
         scrollbar.Value --;
     else if (args.Event.Direction == Gdk.ScrollDirection.Down)
         scrollbar.Value ++;
 }
Beispiel #12
0
 private void Scroll(object sender, ScrollEventArgs e)
 {
     try
     {
         if (Core.HoldingCtrl)
         {
             if (e.Event.Direction == Gdk.ScrollDirection.Up)
             {
                 scrollback.ResizeText(400);
             }
             else
             {
                 scrollback.ResizeText(-400);
             }
             e.RetVal = true;
         }
     }
     catch (Exception fail)
     {
         Core.handleException(fail);
     }
 }
 void Viewport_ScrollEvent(object o, ScrollEventArgs args)
 {
     // need to update when scrolled and pointer still at same position, otherwise would display outdated info
     // HACK
     ClearTooltip ();
     // TODO update tooltip after scroll event
     // ok but not accurate, probably called before scroll is done
     //UpdateToolTip ();
 }
Beispiel #14
0
 void control_ScrollEvent(object sender, ScrollEventArgs a)
 {
     Update();
 }
Beispiel #15
0
	void ScrollHandler (object o, ScrollEventArgs args)
	{
		Gdk.EventScroll es = args.Event;
                double newloc = 0.0;
		int steps = Math.Max (rows / 6, 2);
		
                switch (es.Direction){
                case ScrollDirection.Up:
                        newloc = adjustment.Value - steps;
                        break;
                        
                case ScrollDirection.Down:
                        newloc = adjustment.Value + steps;
                        break;
                }

		newloc = Math.Max (newloc, 0);
		newloc = Math.Min (newloc, provider.Rows - rows);

                adjustment.Value = newloc;
	}
Beispiel #16
0
			void HandleKeyTreeScrollEvent (object o, ScrollEventArgs args)
			{
				HandleKeyTreeMotion (args.Event.X, args.Event.Y);
			}
Beispiel #17
0
 private void OnScrollEvent(object sender, ScrollEventArgs a)
 {
     Gdk.EventScroll ev = a.Event;
     if (ev.Direction == ScrollDirection.Up)
         ZoomIn ();
     else
         ZoomOut ();
     Redraw ();
 }
Beispiel #18
0
 private void OnNotificationAreaIconScroll(object o, ScrollEventArgs args)
 {
     switch (args.Event.Direction) {
         case Gdk.ScrollDirection.Up:
             Driver.PlayerWindow.Volume += 10;
             break;
         case Gdk.ScrollDirection.Down:
             Driver.PlayerWindow.Volume -= 10;
             break;
     }
 }