blob: 5660c00b9b4b6d31745d813f8f69c60a06181a64 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
using System;
using System.Xml.Serialization;
using System.ComponentModel;
using OpenTK.Input;
namespace Crow
{
public class ScrollBar : NumericControl
{
Orientation _orientation;
#region CTOR
public ScrollBar() : base() {}
#endregion
[XmlAttributeAttribute()][DefaultValue(Orientation.Vertical)]
public virtual Orientation Orientation
{
get { return _orientation; }
set {
if (_orientation == value)
return;
_orientation = value;
NotifyValueChanged ("Orientation", _orientation);
RegisterForGraphicUpdate ();
}
}
public void onScrollBack (object sender, MouseButtonEventArgs e)
{
Value -= SmallIncrement;
}
public void onScrollForth (object sender, MouseButtonEventArgs e)
{
Value += SmallIncrement;
}
public void onSliderValueChange(object sender, ValueChangeEventArgs e){
if (e.MemberName == "Value")
Value = Convert.ToDouble(e.NewValue);
}
}
}
|