Exemplo n.º 1
0
 void meterScroll(Meter meter, int delta)
 {
     if (meter != null && meter.MouseWheelAction == "Change system volume")
         audioDevice.AudioEndpointVolume.MasterVolumeLevelScalar = Math.Min(Math.Max(audioDevice.AudioEndpointVolume.MasterVolumeLevelScalar + (float)delta / 24 / 100, 0), 1);
 }
Exemplo n.º 2
0
        private void formSysMeters_MouseMove(object sender, MouseEventArgs e)
        {
            if (mousedown)
            {
                this.Left += e.X - prevX;
                this.Top += e.Y - prevY;
            }
            else
            {
                Meter meter = GetSelectedMeter(e.X);

                string newTip = getTooltip(meter);
                if (tipInfo.GetToolTip(this) != newTip)
                    tipInfo.SetToolTip(this, newTip);

                if (meter != null && meter.Data == "Dota-style clock")
                {
                    meter.ClockMouseover = true;
                    clockMeter = meter;
                }
                else if (clockMeter != null)
                {
                    clockMeter.ClockMouseover = false;
                    clockMeter = null;
                }
            }
        }
Exemplo n.º 3
0
        string getTooltip(Meter meter)
        {
            if (meter == null)
                return "";
            else
            {
                string tip;

                if (meter.Data == "Dota-style clock")
                    tip = DateTime.Now.Date.ToLongDateString();
                else
                {
                    if (meter.OnlyValue)
                        tip = data.GetValue(meter.Data, meter.DataSubsource).ToString();
                    else
                        tip = meter.Prefix + data.GetValue(meter.Data, meter.DataSubsource).ToString() + meter.Postfix;
                }

                return tip;
            }
        }
Exemplo n.º 4
0
 private void formSysMana_MouseLeave(object sender, EventArgs e)
 {
     if (clockMeter != null)
     {
         clockMeter.ClockMouseover = false;
         clockMeter = null;
     }
 }