Commit 4b2edf78 authored by bitplane's avatar bitplane

scrollbar fix, updated readme

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@988 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 490609e5
...@@ -200,6 +200,7 @@ GUI: ...@@ -200,6 +200,7 @@ GUI:
Scrollbars are now only visible when the list doesn't fit in the visible area. Scrollbars are now only visible when the list doesn't fit in the visible area.
You can now type an item's text to select it. You can now type an item's text to select it.
- IGUIScrollBar new methods set/getLargeStep
------------------------------------------- -------------------------------------------
Changes in version 1.3.1 (20 Jun 2007) Changes in version 1.3.1 (20 Jun 2007)
......
...@@ -151,6 +151,7 @@ bool CGUIScrollBar::OnEvent(const SEvent& event) ...@@ -151,6 +151,7 @@ bool CGUIScrollBar::OnEvent(const SEvent& event)
{ {
Dragging = true; Dragging = true;
DraggedBySlider = SliderRect.isPointInside(core::position2di(event.MouseInput.X, event.MouseInput.Y)); DraggedBySlider = SliderRect.isPointInside(core::position2di(event.MouseInput.X, event.MouseInput.Y));
TrayClick = !DraggedBySlider;
DesiredPos = getPosFromMousePos(event.MouseInput.X, event.MouseInput.Y); DesiredPos = getPosFromMousePos(event.MouseInput.X, event.MouseInput.Y);
return true; return true;
} }
...@@ -229,19 +230,27 @@ void CGUIScrollBar::draw() ...@@ -229,19 +230,27 @@ void CGUIScrollBar::draw()
{ {
LastChange = now; LastChange = now;
s32 oldPos = Pos;
if (DesiredPos >= Pos + LargeStep) if (DesiredPos >= Pos + LargeStep)
setPos(Pos + LargeStep); setPos(Pos + LargeStep);
else else
if (DesiredPos >= Pos + SmallStep)
setPos(Pos + SmallStep);
else
if (DesiredPos <= Pos - LargeStep) if (DesiredPos <= Pos - LargeStep)
setPos(Pos - LargeStep); setPos(Pos - LargeStep);
else else
if (DesiredPos <= Pos - SmallStep) if (DesiredPos >= Pos - LargeStep && DesiredPos <= Pos + LargeStep)
setPos(Pos - SmallStep); setPos(DesiredPos);
}
if (Pos != oldPos && Parent)
{
SEvent newEvent;
newEvent.EventType = EET_GUI_EVENT;
newEvent.GUIEvent.Caller = this;
newEvent.GUIEvent.Element = 0;
newEvent.GUIEvent.EventType = EGET_SCROLL_BAR_CHANGED;
Parent->OnEvent(newEvent);
}
}
SliderRect = AbsoluteRect; SliderRect = AbsoluteRect;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment