aboutsummaryrefslogtreecommitdiffstatsci
path: root/src
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-05 16:14:26 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-05 16:14:26 +0100
commit9188b4aaeeef71a525292dc92325555f7d633982 (patch)
tree9feb94055a2b8cbd6af13091bfae074fc7be8183 /src
parent829c71bc6ae4d92553627e1c0d21fc0147606e0e (diff)
resolve several bug in scrollbar
Diffstat (limited to 'src')
-rw-r--r--src/GraphicObjects/NumericControl.cs12
-rw-r--r--src/GraphicObjects/ScrollBar.cs13
-rw-r--r--src/GraphicObjects/Scroller.cs4
-rw-r--r--src/GraphicObjects/Slider.cs1
4 files changed, 14 insertions, 16 deletions
diff --git a/src/GraphicObjects/NumericControl.cs b/src/GraphicObjects/NumericControl.cs
index 3e35f102..409a200f 100644
--- a/src/GraphicObjects/NumericControl.cs
+++ b/src/GraphicObjects/NumericControl.cs
@@ -29,7 +29,8 @@ namespace Crow
return;
minValue = value;
-
+ NotifyValueChanged ("Minimum", minValue);
+ registerForGraphicUpdate ();
}
}
[XmlAttributeAttribute()][DefaultValue(100.0)]
@@ -41,7 +42,8 @@ namespace Crow
return;
maxValue = value;
-
+ NotifyValueChanged ("Maximum", maxValue);
+ registerForGraphicUpdate ();
}
}
[XmlAttributeAttribute()][DefaultValue(1.0)]
@@ -53,7 +55,8 @@ namespace Crow
return;
smallStep = value;
-
+ NotifyValueChanged ("SmallIncrement", smallStep);
+ registerForGraphicUpdate ();
}
}
[XmlAttributeAttribute()][DefaultValue(5.0)]
@@ -65,7 +68,8 @@ namespace Crow
return;
bigStep = value;
-
+ NotifyValueChanged ("LargeIncrement", bigStep);
+ registerForGraphicUpdate ();
}
}
[XmlAttributeAttribute()][DefaultValue(0)]
diff --git a/src/GraphicObjects/ScrollBar.cs b/src/GraphicObjects/ScrollBar.cs
index 9a598aba..3e095457 100644
--- a/src/GraphicObjects/ScrollBar.cs
+++ b/src/GraphicObjects/ScrollBar.cs
@@ -76,22 +76,17 @@ namespace Crow
}
public void onScrollBack (object sender, MouseButtonEventArgs e)
{
- Scroll -= _slider.LargeIncrement;
+ Scroll -= 50;
}
public void onScrollForth (object sender, MouseButtonEventArgs e)
{
- Scroll += _slider.LargeIncrement;
+ Scroll += 50;
}
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);
+ if (e.MemberName == "Value")
+ Scroll = Convert.ToDouble(e.NewValue);
}
}
}
diff --git a/src/GraphicObjects/Scroller.cs b/src/GraphicObjects/Scroller.cs
index 1171d8d9..b2a09db5 100644
--- a/src/GraphicObjects/Scroller.cs
+++ b/src/GraphicObjects/Scroller.cs
@@ -80,8 +80,8 @@ namespace Crow
public int MaximumScroll {
get {
return VerticalScrolling ?
- child == null ? 0 : Child.Slot.Height - ClientRectangle.Height :
- Child.Slot.Width - ClientRectangle.Width;
+ child == null ? 0 : Math.Max(Child.Slot.Height - ClientRectangle.Height,0) :
+ Math.Max(Child.Slot.Width - ClientRectangle.Width,0);
}
}
diff --git a/src/GraphicObjects/Slider.cs b/src/GraphicObjects/Slider.cs
index d0a56d9d..495683d2 100644
--- a/src/GraphicObjects/Slider.cs
+++ b/src/GraphicObjects/Slider.cs
@@ -86,7 +86,6 @@ namespace Crow
base.Maximum = value;
LargeIncrement = base.Maximum / 10.0;
SmallIncrement = LargeIncrement / 5.0;
-
}
}