diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-02 12:19:06 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-02 12:19:06 +0100 |
| commit | 2b087282dd73152d21140ea7312a90e046c84f61 (patch) | |
| tree | 5d03225090e39c1d14465bdbaf1882e87026402b /src/GraphicObjects/ScrollBar.cs | |
| parent | 73b7c1d82226e4d10708e858a011991e3f598655 (diff) | |
Fix CRLF
Diffstat (limited to 'src/GraphicObjects/ScrollBar.cs')
| -rw-r--r-- | src/GraphicObjects/ScrollBar.cs | 194 |
1 files changed, 97 insertions, 97 deletions
diff --git a/src/GraphicObjects/ScrollBar.cs b/src/GraphicObjects/ScrollBar.cs index 32bc8807..9a598aba 100644 --- a/src/GraphicObjects/ScrollBar.cs +++ b/src/GraphicObjects/ScrollBar.cs @@ -1,97 +1,97 @@ -using System;
-
-
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-//using OpenTK.Graphics.OpenGL;
-
-using Cairo;
-
-using winColors = System.Drawing.Color;
-using System.Diagnostics;
-using System.Xml.Serialization;
-using OpenTK.Input;
-using System.ComponentModel;
-
-namespace Crow
-{
- [DefaultTemplate("#Crow.Templates.ScrollBar.goml")]
- public class ScrollBar : TemplatedControl
- {
- Orientation _orientation;
- Slider _slider;
- double _maximumScroll;
- double _scroll;
-
- public ScrollBar() : base()
- {
- }
-
- protected override void loadTemplate(GraphicObject template = null)
- {
- base.loadTemplate (template);
- _slider = this.child.FindByName ("Slider") as Slider;
- }
-
- [XmlAttributeAttribute()][DefaultValue(0.0)]
- public virtual double MaximumScroll
- {
- get { return _maximumScroll; }
- set {
- if (_maximumScroll == value)
- return;
- _maximumScroll = value;
- registerForGraphicUpdate ();
- NotifyValueChanged ("MaximumScroll", _maximumScroll);
- }
- }
- [XmlAttributeAttribute()][DefaultValue(0.0)]
- public virtual double Scroll
- {
- get { return _scroll; }
- set {
- if (_scroll == value)
- return;
- _scroll = value;
- if (_scroll < 0.0)
- _scroll = 0.0;
- else if (_scroll > _maximumScroll)
- _scroll = _maximumScroll;
- registerForGraphicUpdate ();
- NotifyValueChanged ("Scroll", _scroll);
- }
- }
- [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)
- {
- Scroll -= _slider.LargeIncrement;
- }
- public void onScrollForth (object sender, MouseButtonEventArgs e)
- {
- Scroll += _slider.LargeIncrement;
-
- }
-
- public void onSliderValueChange(object sender, ValueChangeEventArgs e){
- Scroll = Convert.ToDouble(e.NewValue);
- }
-
- public override void OnLayoutChanges (LayoutingType layoutType)
- {
- OpenTKGameWindow.currentWindow.CursorVisible = true;
- base.OnLayoutChanges (layoutType);
- }
- }
-}
+using System; + + +using System.Collections.Generic; +using System.Linq; +using System.Text; +//using OpenTK.Graphics.OpenGL; + +using Cairo; + +using winColors = System.Drawing.Color; +using System.Diagnostics; +using System.Xml.Serialization; +using OpenTK.Input; +using System.ComponentModel; + +namespace Crow +{ + [DefaultTemplate("#Crow.Templates.ScrollBar.goml")] + public class ScrollBar : TemplatedControl + { + Orientation _orientation; + Slider _slider; + double _maximumScroll; + double _scroll; + + public ScrollBar() : base() + { + } + + protected override void loadTemplate(GraphicObject template = null) + { + base.loadTemplate (template); + _slider = this.child.FindByName ("Slider") as Slider; + } + + [XmlAttributeAttribute()][DefaultValue(0.0)] + public virtual double MaximumScroll + { + get { return _maximumScroll; } + set { + if (_maximumScroll == value) + return; + _maximumScroll = value; + registerForGraphicUpdate (); + NotifyValueChanged ("MaximumScroll", _maximumScroll); + } + } + [XmlAttributeAttribute()][DefaultValue(0.0)] + public virtual double Scroll + { + get { return _scroll; } + set { + if (_scroll == value) + return; + _scroll = value; + if (_scroll < 0.0) + _scroll = 0.0; + else if (_scroll > _maximumScroll) + _scroll = _maximumScroll; + registerForGraphicUpdate (); + NotifyValueChanged ("Scroll", _scroll); + } + } + [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) + { + Scroll -= _slider.LargeIncrement; + } + public void onScrollForth (object sender, MouseButtonEventArgs e) + { + Scroll += _slider.LargeIncrement; + + } + + public void onSliderValueChange(object sender, ValueChangeEventArgs e){ + Scroll = Convert.ToDouble(e.NewValue); + } + + public override void OnLayoutChanges (LayoutingType layoutType) + { + OpenTKGameWindow.currentWindow.CursorVisible = true; + base.OnLayoutChanges (layoutType); + } + } +} |