[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms ScrollBar.cs, 1.
From: |
Richard Baumann <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms ScrollBar.cs, 1.2, 1.3 |
Date: |
Tue, 15 Jul 2003 14:38:55 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms
In directory subversions:/tmp/cvs-serv27099/System.Windows.Forms
Modified Files:
ScrollBar.cs
Log Message:
Fix several ScrollBar drawing problems, and implement DrawGrid.
Index: ScrollBar.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/ScrollBar.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** ScrollBar.cs 10 Jul 2003 11:47:15 -0000 1.2
--- ScrollBar.cs 15 Jul 2003 18:38:53 -0000 1.3
***************
*** 184,188 ****
maximum = value;
Redraw();
- //range = max - min;
}
}
--- 184,187 ----
***************
*** 201,205 ****
minimum = value;
Redraw();
- //range = max - min;
}
}
--- 200,203 ----
***************
*** 247,254 ****
tmp = tmp > minimum ?
tmp : minimum;
! if (value == tmp) { return; }
! Value = tmp;
! OnScroll(new
ScrollEventArgs(this,ScrollEventType.SmallDecrement,value));
! SetPositionByValue();
Redraw(false);
}
--- 245,254 ----
tmp = tmp > minimum ?
tmp : minimum;
! if (value != tmp)
! {
! Value = tmp;
! OnScroll(new
ScrollEventArgs(this,ScrollEventType.SmallDecrement,value));
! SetPositionByValue();
! }
Redraw(false);
}
***************
*** 277,284 ****
Rectangle bounds = new Rectangle(x,y,width,height);
- x += 2; // skip border
- y += 2; // skip border
- width -= 4; // skip border
- height -= 4; // skip border
if (layout)
--- 277,280 ----
***************
*** 301,305 ****
bgBrush,
vertical,Enabled,
! bar,
decrement,decDown,
increment,incDown);
--- 297,301 ----
bgBrush,
vertical,Enabled,
! bar, track,
decrement,decDown,
increment,incDown);
***************
*** 313,320 ****
tmp = tmp < tmp2 ?
tmp : tmp2;
! if (value == tmp) { return; }
! Value = tmp;
! OnScroll(new
ScrollEventArgs(this,ScrollEventType.SmallIncrement,value));
! SetPositionByValue();
Redraw(false);
}
--- 309,318 ----
tmp = tmp < tmp2 ?
tmp : tmp2;
! if (value != tmp)
! {
! Value = tmp;
! OnScroll(new
ScrollEventArgs(this,ScrollEventType.SmallIncrement,value));
! SetPositionByValue();
! }
Redraw(false);
}
***************
*** 401,404 ****
--- 399,403 ----
int position = (value-minimum) < guiMax ?
(value-minimum) : guiMax;
+
// layout rectangle for decrement button
decrement = new Rectangle(x,y,width,width);
***************
*** 421,425 ****
int scrollSize = trackRange/scrolls;
int trackMax = trackRange-scrollSize;
! int scrollPos = (trackMax)*(position/guiMax);
scrollPos = trackMax < scrollPos ?
trackMax : scrollPos;
--- 420,424 ----
int scrollSize = trackRange/scrolls;
int trackMax = trackRange-scrollSize;
! int scrollPos = (trackMax*position)/guiMax;
scrollPos = trackMax < scrollPos ?
trackMax : scrollPos;
***************
*** 441,445 ****
protected override void OnKeyDown(KeyEventArgs e)
{
- Console.WriteLine("OnKeyDown("+e.KeyCode+")");
if (keyDown) { return; }
--- 440,443 ----
***************
*** 611,616 ****
newPos = guiMax;
}
! barDown = y;
! bar.Y = newPos;
}
else
--- 609,629 ----
newPos = guiMax;
}
! if (newPos != bY)
! {
! barDown = y;
! bar.Y = newPos;
! OnScroll(new
ScrollEventArgs(this,ScrollEventType.ThumbTrack,value));
! SetValueByPosition();
! Redraw(false);
! }
! else
! {
! // if the mouse has gone too far up or
! // down and we're still tracking it,
! // make sure when it comes back that
! // it's tracked by the center of the
! // scroll bar
! barDown = bY+bHeight/2;
! }
}
else
***************
*** 630,639 ****
newPos = guiMax;
}
! barDown = x;
! bar.X = newPos;
}
- OnScroll(new
ScrollEventArgs(this,ScrollEventType.ThumbTrack,value));
- SetValueByPosition();
- Redraw(false);
}
base.OnMouseMove(e);
--- 643,664 ----
newPos = guiMax;
}
! if (newPos != bX)
! {
! barDown = x;
! bar.X = newPos;
! OnScroll(new
ScrollEventArgs(this,ScrollEventType.ThumbTrack,value));
! SetValueByPosition();
! Redraw(false);
! }
! else
! {
! // if the mouse has gone too far right
! // or left and we're still tracking it,
! // make sure when it comes back that
! // it's tracked by the center of the
! // scroll bar
! barDown = bX+bWidth/2;
! }
}
}
base.OnMouseMove(e);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms ScrollBar.cs, 1.2, 1.3,
Richard Baumann <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms/Themes DefaultThemePainter.cs, 1.5, 1.6 IThemePainter.cs, 1.2, 1.3
- Next by Date:
[Dotgnu-pnet-commits] CVS: pnet ChangeLog,1.2563,1.2564
- Previous by thread:
[Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms/Themes DefaultThemePainter.cs, 1.5, 1.6 IThemePainter.cs, 1.2, 1.3
- Next by thread:
[Dotgnu-pnet-commits] CVS: pnet ChangeLog,1.2563,1.2564
- Index(es):