Пример #1
0
        private void PaperWrap_MouseWheel(object sender, MouseEventArgs e)
        {
            if (Control.ModifierKeys == Keys.Control)
            {
                if (PaperWrap.WheelDelta < 0)
                {
                    if (comboZoom.SelectedIndex + 1 < comboZoom.Items.Count)
                    {
                        comboZoom.SelectedIndex = comboZoom.SelectedIndex + 1;
                    }
                }
                else
                {
                    if (comboZoom.SelectedIndex - 1 >= 0)
                    {
                        comboZoom.SelectedIndex = comboZoom.SelectedIndex - 1;
                    }
                }
            }

            if (Control.ModifierKeys == Keys.Alt)
            {
                int newvalue = Funcs.Clamp((PaperWrap.HorizontalScroll.Value - PaperWrap.WheelDelta),
                                           PaperWrap.HorizontalScroll.Minimum, PaperWrap.HorizontalScroll.Maximum);

                // Don't ask me but if you don't set the value twice the H Scroll seems
                // To not register the value at first call (debugged for f'ing 5 hours)
                //
                PaperWrap.HorizontalScroll.Value = newvalue;
                PaperWrap.HorizontalScroll.Value = newvalue;
                //
            }

            PaperWrap.Update();
        }
Пример #2
0
 protected override void OnMouseWheel(MouseEventArgs e)
 {
     PaperWrap.TriggerMouseWheel(e);
     base.OnMouseWheel(e);
 }