ScrollBar.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  1. //
  2. // System.Windows.Forms.ScrollBar.cs
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining
  5. // a copy of this software and associated documentation files (the
  6. // "Software"), to deal in the Software without restriction, including
  7. // without limitation the rights to use, copy, modify, merge, publish,
  8. // distribute, sublicense, and/or sell copies of the Software, and to
  9. // permit persons to whom the Software is furnished to do so, subject to
  10. // the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be
  13. // included in all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  18. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  19. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  20. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  21. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. //
  23. // Copyright (C) 2004, Novell, Inc.
  24. //
  25. // Authors:
  26. // Jordi Mas i Hernandez [email protected]
  27. //
  28. //
  29. // $Revision: 1.14 $
  30. // $Modtime: $
  31. // $Log: ScrollBar.cs,v $
  32. // Revision 1.14 2004/08/23 22:53:15 jordi
  33. // small fix
  34. //
  35. // Revision 1.13 2004/08/23 22:43:46 jordi
  36. // *** empty log message ***
  37. //
  38. // Revision 1.11 2004/08/22 19:34:22 jackson
  39. // Update the position through the Value property so the OnValueChanged event is raised.
  40. //
  41. // Revision 1.10 2004/08/21 20:22:21 pbartok
  42. // - Replaced direct XplatUI calls with their Control counterpart
  43. //
  44. // Revision 1.9 2004/08/20 19:35:33 jackson
  45. // Use the SWF timer so callbacks are run in the correct thread
  46. //
  47. // Revision 1.8 2004/08/20 19:34:26 jackson
  48. // Use the SWF timer so callbacks are run in the correct thread
  49. //
  50. // Revision 1.7 2004/08/19 22:25:31 jordi
  51. // theme enhancaments
  52. //
  53. // Revision 1.6 2004/08/18 15:56:12 jordi
  54. // fixes to scrollbar: steps and multiple timers
  55. //
  56. // Revision 1.5 2004/08/10 19:21:27 jordi
  57. // scrollbar enhancements and standarize on win colors defaults
  58. //
  59. // Revision 1.4 2004/08/10 15:41:50 jackson
  60. // Allow control to handle buffering
  61. //
  62. // Revision 1.3 2004/07/27 15:29:40 jordi
  63. // fixes scrollbar events
  64. //
  65. // Revision 1.2 2004/07/26 17:42:03 jordi
  66. // Theme support
  67. //
  68. // NOT COMPLETE
  69. using System.Drawing;
  70. using System.Drawing.Imaging;
  71. using System.Drawing.Drawing2D;
  72. using System.ComponentModel;
  73. using System.Runtime.InteropServices;
  74. namespace System.Windows.Forms
  75. {
  76. [DefaultEvent ("Scroll")]
  77. [DefaultProperty ("Value")]
  78. public class ScrollBar : Control
  79. {
  80. #region Local Variables
  81. private int position;
  82. private int minimum;
  83. private int maximum;
  84. private int largeChange;
  85. private int smallChange;
  86. private int scrollbutton_height;
  87. private int scrollbutton_width;
  88. private Rectangle paint_area = new Rectangle ();
  89. private ScrollBars type;
  90. private Rectangle first_arrow_area = new Rectangle (); // up or left
  91. private Rectangle second_arrow_area = new Rectangle (); // down or right
  92. private Rectangle thumb_pos = new Rectangle ();
  93. private Rectangle thumb_area = new Rectangle ();
  94. private ButtonState firstbutton_state = ButtonState.Normal;
  95. private ButtonState secondbutton_state = ButtonState.Normal;
  96. private bool thumb_pressed = false;
  97. private float pixel_per_pos = 0;
  98. private Timer firstclick_timer;
  99. private Timer holdclick_timer;
  100. private int thumb_pixel_click_move;
  101. private int thumb_size = 0;
  102. private const int thumb_min_size = 8;
  103. internal bool vert;
  104. public new event EventHandler BackColorChanged;
  105. public new event EventHandler BackgroundImageChanged;
  106. public new event EventHandler Click;
  107. public new event EventHandler DoubleClick;
  108. public new event EventHandler FontChanged;
  109. public new event EventHandler ForeColorChanged;
  110. public new event EventHandler ImeModeChanged;
  111. public new event MouseEventHandler MouseDown;
  112. public new event MouseEventHandler MouseUp;
  113. public new event PaintEventHandler Paint;
  114. public event ScrollEventHandler Scroll;
  115. public new event EventHandler TextChanged;
  116. public event EventHandler ValueChanged;
  117. #endregion // Local Variables
  118. public ScrollBar () : base ()
  119. {
  120. position = 0;
  121. minimum = 0;
  122. maximum = 100;
  123. largeChange = 10;
  124. smallChange = 1;
  125. holdclick_timer = new Timer ();
  126. firstclick_timer = new Timer ();
  127. holdclick_timer.Tick += new EventHandler (OnHoldClickTimer);
  128. firstclick_timer.Tick += new EventHandler (OnFirstClickTimer);
  129. base.TabStop = false;
  130. if (ThemeEngine.Current.WriteToWindow == true)
  131. double_buffering = false;
  132. else
  133. double_buffering = true;
  134. SetStyle (ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
  135. SetStyle (ControlStyles.ResizeRedraw | ControlStyles.Opaque, true);
  136. }
  137. [EditorBrowsable (EditorBrowsableState.Never)]
  138. public override Color BackColor
  139. {
  140. get { return base.BackColor; }
  141. set {
  142. if (base.BackColor == value)
  143. return;
  144. if (BackColorChanged != null)
  145. BackColorChanged (this, EventArgs.Empty);
  146. base.BackColor = value;
  147. Refresh ();
  148. }
  149. }
  150. [EditorBrowsable (EditorBrowsableState.Never)]
  151. public override Image BackgroundImage
  152. {
  153. get { return base.BackgroundImage; }
  154. set {
  155. if (base.BackgroundImage == value)
  156. return;
  157. if (BackgroundImageChanged != null)
  158. BackgroundImageChanged (this, EventArgs.Empty);
  159. base.BackgroundImage = value;
  160. }
  161. }
  162. public override Font Font {
  163. get { return base.Font; }
  164. set {
  165. if (base.Font == value)
  166. return;
  167. if (FontChanged != null)
  168. FontChanged (this, EventArgs.Empty);
  169. base.Font = value;
  170. }
  171. }
  172. [EditorBrowsable (EditorBrowsableState.Never)]
  173. public override Color ForeColor
  174. {
  175. get { return base.ForeColor; }
  176. set {
  177. if (base.ForeColor == value)
  178. return;
  179. if (ForeColorChanged != null)
  180. ForeColorChanged (this, EventArgs.Empty);
  181. base.ForeColor = value;
  182. Refresh ();
  183. }
  184. }
  185. [EditorBrowsable (EditorBrowsableState.Never)]
  186. public new ImeMode ImeMode
  187. {
  188. get { return base.ImeMode; }
  189. set {
  190. if (base.ImeMode == value)
  191. return;
  192. if (ImeModeChanged != null)
  193. ImeModeChanged (this, EventArgs.Empty);
  194. base.ImeMode = value;
  195. }
  196. }
  197. public int LargeChange {
  198. get { return largeChange; }
  199. set {
  200. if (value < 0)
  201. throw new Exception( string.Format("Value '{0}' must be greater than or equal to 0.", value));
  202. if (largeChange != value) {
  203. largeChange = value;
  204. Refresh ();
  205. }
  206. }
  207. }
  208. public int Maximum {
  209. get { return maximum; }
  210. set {
  211. maximum = value;
  212. if (maximum < minimum)
  213. minimum = maximum;
  214. Refresh ();
  215. }
  216. }
  217. public int Minimum {
  218. get { return minimum; }
  219. set {
  220. minimum = value;
  221. if (minimum > maximum)
  222. maximum = minimum;
  223. Refresh ();
  224. }
  225. }
  226. public int SmallChange {
  227. get { return smallChange; }
  228. set {
  229. if ( value < 0 )
  230. throw new Exception( string.Format("Value '{0}' must be greater than or equal to 0.", value));
  231. if (smallChange != value) {
  232. smallChange = value;
  233. Refresh ();
  234. }
  235. }
  236. }
  237. public new bool TabStop {
  238. get { return base.TabStop; }
  239. set { base.TabStop = value; }
  240. }
  241. [EditorBrowsable (EditorBrowsableState.Never)]
  242. public override string Text {
  243. get { return base.Text; }
  244. set { base.Text = value; }
  245. }
  246. public int Value {
  247. get { return position; }
  248. set {
  249. if ( value < Minimum || value > Maximum )
  250. throw new ArgumentException(
  251. string.Format("'{0}' is not a valid value for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'", value));
  252. if (position != value){
  253. position = value;
  254. if (ValueChanged != null)
  255. ValueChanged (this, EventArgs.Empty);
  256. Refresh ();
  257. }
  258. }
  259. }
  260. public override string ToString()
  261. {
  262. return string.Format("{0}, Minimum: {1}, Maximum: {2}, Value: {3}",
  263. GetType( ).FullName.ToString( ), Minimum, Maximum, position);
  264. }
  265. protected override CreateParams CreateParams {
  266. get {
  267. CreateParams createParams = base.CreateParams;
  268. createParams.ClassName = XplatUI.DefaultClassName;
  269. createParams.Style = (int) (
  270. WindowStyles.WS_CHILD |
  271. WindowStyles.WS_VISIBLE);
  272. return createParams;
  273. }
  274. }
  275. protected override ImeMode DefaultImeMode {
  276. get { return ImeMode.Disable; }
  277. }
  278. private void fire_Scroll (ScrollEventArgs event_args)
  279. {
  280. if (Scroll == null)
  281. return;
  282. Scroll (this, event_args);
  283. //if (event_args.NewValue != position)
  284. // UpdatePos (event_args.NewValue, true);
  285. }
  286. protected virtual void OnValueChanged (EventArgs e)
  287. {
  288. if (ValueChanged != null)
  289. ValueChanged (this, e);
  290. }
  291. private void Draw ()
  292. {
  293. ThemeEngine.Current.DrawScrollBar (DeviceContext, paint_area, this, thumb_pos,
  294. ref first_arrow_area, ref second_arrow_area,
  295. firstbutton_state, secondbutton_state,
  296. ref scrollbutton_width, ref scrollbutton_height, vert);
  297. }
  298. private void CalcThumbArea ()
  299. {
  300. // Thumb area
  301. if (vert) {
  302. thumb_area.Height = Height - scrollbutton_height - scrollbutton_height;
  303. thumb_area.X = 0;
  304. thumb_area.Y = scrollbutton_height;
  305. thumb_area.Width = Width;
  306. if (Height < scrollbutton_height * 2)
  307. thumb_size = 0;
  308. else {
  309. double per = ((double)LargeChange / (double)((1 + Maximum - Minimum)));
  310. thumb_size = 1 + (int) (thumb_area.Height * per);
  311. if (thumb_size < thumb_min_size)
  312. thumb_size = thumb_min_size;
  313. }
  314. pixel_per_pos = ((float)(thumb_area.Height - thumb_size) / (float) ((Maximum - Minimum - LargeChange) + 1));
  315. } else {
  316. if (Width < scrollbutton_width * 2)
  317. thumb_size = 0;
  318. else
  319. if (Width < 70)
  320. thumb_size = 8;
  321. else
  322. thumb_size = Width /10;
  323. thumb_area.Y = 0;
  324. thumb_area.X = scrollbutton_width;
  325. thumb_area.Height = Height;
  326. thumb_area.Width = Width - scrollbutton_width - scrollbutton_width;
  327. pixel_per_pos = ((float)(thumb_area.Width - thumb_size) / (float) ((Maximum - Minimum - LargeChange) + 1));
  328. }
  329. }
  330. protected override void OnResize (EventArgs e)
  331. {
  332. base.OnResize (e);
  333. if (Width <= 0 || Height <= 0)
  334. return;
  335. paint_area.X = paint_area. Y = 0;
  336. paint_area.Width = Width;
  337. paint_area.Height = Height;
  338. CreateBuffers (Width, Height);
  339. CalcThumbArea ();
  340. UpdatePos (position, true);
  341. }
  342. /*
  343. Called when the control is created
  344. */
  345. protected override void CreateHandle()
  346. {
  347. base.CreateHandle(); // Let control.cs create the underlying Window
  348. scrollbutton_height = ThemeEngine.Current.ScrollBarButtonSize;
  349. scrollbutton_width = ThemeEngine.Current.ScrollBarButtonSize;
  350. CreateBuffers (Width, Height);
  351. CalcThumbArea ();
  352. UpdatePos (Value, true);
  353. }
  354. protected override void OnPaint (PaintEventArgs pevent)
  355. {
  356. if (Width <= 0 || Height <= 0 || Visible == false)
  357. return;
  358. /* Copies memory drawing buffer to screen*/
  359. Draw ();
  360. if (double_buffering)
  361. pevent.Graphics.DrawImage (ImageBuffer, 0, 0);
  362. }
  363. /* Disable background painting to avoid flickering, since we do our painting*/
  364. protected override void OnPaintBackground (PaintEventArgs pevent)
  365. {
  366. if (!double_buffering)
  367. base.OnPaintBackground (pevent);
  368. }
  369. protected override void OnClick (EventArgs e)
  370. {
  371. //Console.WriteLine ("On click");
  372. }
  373. private void UpdatePos (int newPos, bool update_trumbpos)
  374. {
  375. int old = position;
  376. int pos;
  377. if (newPos < minimum)
  378. pos = minimum;
  379. else
  380. if (newPos > maximum)
  381. pos = maximum;
  382. else
  383. pos = newPos;
  384. if (update_trumbpos)
  385. if (vert)
  386. UpdateThumbPos (thumb_area.Y + (int)(((float)(pos - Minimum)) * pixel_per_pos), false);
  387. else
  388. UpdateThumbPos (thumb_area.X + (int)(((float)(pos - Minimum)) * pixel_per_pos), false);
  389. Value = pos;
  390. if (pos != old) // Fire event
  391. fire_Scroll (new ScrollEventArgs (ScrollEventType.ThumbTrack, pos));
  392. }
  393. private void UpdateThumbPos (int pixel, bool update_value)
  394. {
  395. float new_pos = 0;
  396. if (vert) {
  397. if (pixel < thumb_area.Y)
  398. thumb_pos.Y = thumb_area.Y;
  399. else
  400. if (pixel > thumb_area.Y + thumb_area.Height - thumb_size)
  401. thumb_pos.Y = thumb_area.Y + thumb_area.Height - thumb_size;
  402. else
  403. thumb_pos.Y = pixel;
  404. thumb_pos = new Rectangle (0, thumb_pos.Y, ThemeEngine.Current.ScrollBarButtonSize, thumb_size);
  405. new_pos = (float) (thumb_pos.Y - thumb_area.Y);
  406. new_pos = new_pos / pixel_per_pos;
  407. } else {
  408. if (pixel < thumb_area.X)
  409. thumb_pos.X = thumb_area.X;
  410. else
  411. if (pixel > thumb_area.X + thumb_area.Width - thumb_size)
  412. thumb_pos.X = thumb_area.X + thumb_area.Width - thumb_size;
  413. else
  414. thumb_pos.X = pixel;
  415. thumb_pos = new Rectangle (thumb_pos.X, 0, thumb_size, ThemeEngine.Current.ScrollBarButtonSize);
  416. new_pos = (float) (thumb_pos.X - thumb_area.X);
  417. new_pos = new_pos / pixel_per_pos;
  418. }
  419. // Console.WriteLine ("UpdateThumbPos: thumb_pos.Y {0} thumb_area.Y {1} pixel_per_pos {2}, new pos {3}, pixel {4}",
  420. // thumb_pos.Y, thumb_area.Y, pixel_per_pos, new_pos, pixel);
  421. if (update_value)
  422. UpdatePos ((int) new_pos, false);
  423. }
  424. private void OnHoldClickTimer (Object source, EventArgs e)
  425. {
  426. if ((firstbutton_state & ButtonState.Pushed) == ButtonState.Pushed)
  427. SmallDecrement();
  428. if ((secondbutton_state & ButtonState.Pushed) == ButtonState.Pushed)
  429. SmallIncrement();
  430. }
  431. private void OnFirstClickTimer (Object source, EventArgs e)
  432. {
  433. firstclick_timer.Enabled = false;
  434. holdclick_timer.Interval = 50;
  435. holdclick_timer.Enabled = true;
  436. }
  437. protected override void OnMouseMove (MouseEventArgs e)
  438. {
  439. if (!first_arrow_area.Contains (new Point (e.X, e.Y)) &&
  440. ((firstbutton_state & ButtonState.Pushed) == ButtonState.Pushed)) {
  441. firstbutton_state = ButtonState.Normal;
  442. Refresh ();
  443. }
  444. if (!second_arrow_area.Contains (new Point (e.X, e.Y)) &&
  445. ((secondbutton_state & ButtonState.Pushed) == ButtonState.Pushed)) {
  446. secondbutton_state = ButtonState.Normal;
  447. Refresh ();
  448. }
  449. if (thumb_pressed == true) {
  450. int pixel_pos;
  451. if (vert)
  452. pixel_pos = e.Y - (thumb_pixel_click_move - thumb_pos.Y);
  453. else
  454. pixel_pos = e.X - (thumb_pixel_click_move - thumb_pos.X);
  455. UpdateThumbPos (pixel_pos, true);
  456. if (vert)
  457. thumb_pixel_click_move = e.Y;
  458. else
  459. thumb_pixel_click_move = e.X;
  460. //System.Console.WriteLine ("OnMouseMove thumb "+ e.Y
  461. // + " clickpos " + thumb_pixel_click_move + " pos:" + thumb_pos.Y);
  462. Refresh ();
  463. }
  464. }
  465. protected override void OnMouseDown (MouseEventArgs e)
  466. {
  467. //System.Console.WriteLine ("OnMouseDown");
  468. Point point = new Point (e.X, e.Y);
  469. if (first_arrow_area.Contains (point)) {
  470. firstbutton_state = ButtonState.Pushed;
  471. Refresh ();
  472. }
  473. if (second_arrow_area.Contains (point)) {
  474. secondbutton_state = ButtonState.Pushed;
  475. Refresh ();
  476. }
  477. if (thumb_pos.Contains (point)) {
  478. thumb_pressed = true;
  479. this.Capture = true;
  480. Refresh ();
  481. if (vert)
  482. thumb_pixel_click_move = e.Y;
  483. else
  484. thumb_pixel_click_move = e.X;
  485. }
  486. else
  487. if (thumb_area.Contains (point)) {
  488. if (vert) {
  489. if (e.Y > thumb_pos.Y + thumb_pos.Height)
  490. LargeIncrement ();
  491. else
  492. LargeDecrement ();
  493. } else {
  494. if (e.X > thumb_pos.X + thumb_pos.Width)
  495. LargeIncrement ();
  496. else
  497. LargeDecrement ();
  498. }
  499. }
  500. /* If arrows are pressed, lunch timer for auto-repeat */
  501. if ((((firstbutton_state & ButtonState.Pushed) == ButtonState.Pushed)
  502. || ((secondbutton_state & ButtonState.Pushed) == ButtonState.Pushed)) &&
  503. firstclick_timer.Enabled == false) {
  504. //Console.WriteLine ("Activate Timer");
  505. firstclick_timer.Interval = 200;
  506. firstclick_timer.Enabled = true;
  507. }
  508. }
  509. private void SmallIncrement ()
  510. {
  511. UpdatePos (Value + SmallChange, true);
  512. Refresh ();
  513. fire_Scroll (new ScrollEventArgs (ScrollEventType.SmallIncrement, position));
  514. fire_Scroll (new ScrollEventArgs (ScrollEventType.EndScroll, position));
  515. }
  516. private void SmallDecrement ()
  517. {
  518. UpdatePos (Value - SmallChange, true);
  519. Refresh ();
  520. fire_Scroll (new ScrollEventArgs (ScrollEventType.SmallDecrement, position));
  521. fire_Scroll (new ScrollEventArgs (ScrollEventType.EndScroll, position));
  522. }
  523. private void LargeIncrement ()
  524. {
  525. UpdatePos (Value + LargeChange, true);
  526. Refresh ();
  527. fire_Scroll (new ScrollEventArgs (ScrollEventType.LargeIncrement, position));
  528. fire_Scroll (new ScrollEventArgs (ScrollEventType.EndScroll, position));
  529. }
  530. private void LargeDecrement ()
  531. {
  532. UpdatePos (Value - LargeChange, true);
  533. Refresh ();
  534. fire_Scroll (new ScrollEventArgs (ScrollEventType.LargeDecrement, position));
  535. fire_Scroll (new ScrollEventArgs (ScrollEventType.EndScroll, position));
  536. }
  537. protected override void OnMouseUp (MouseEventArgs e)
  538. {
  539. //System.Console.WriteLine ("OnMouseUp");
  540. if (first_arrow_area.Contains (new Point (e.X, e.Y))) {
  541. firstbutton_state = ButtonState.Normal;
  542. SmallDecrement ();
  543. holdclick_timer.Enabled = false;
  544. }
  545. if (second_arrow_area.Contains (new Point (e.X, e.Y))) {
  546. secondbutton_state = ButtonState.Normal;
  547. SmallIncrement ();
  548. holdclick_timer.Enabled = false;
  549. }
  550. if (thumb_pressed == true) {
  551. fire_Scroll (new ScrollEventArgs (ScrollEventType.ThumbPosition, position));
  552. fire_Scroll (new ScrollEventArgs (ScrollEventType.EndScroll, position));
  553. this.Capture = false;
  554. thumb_pressed = false;
  555. Refresh ();
  556. }
  557. }
  558. protected override void OnKeyDown (KeyEventArgs key)
  559. {
  560. switch (key.KeyCode){
  561. case Keys.Up:
  562. {
  563. SmallDecrement ();
  564. break;
  565. }
  566. case Keys.Down:
  567. {
  568. SmallIncrement ();
  569. break;
  570. }
  571. case Keys.PageUp:
  572. {
  573. LargeDecrement ();
  574. break;
  575. }
  576. case Keys.PageDown:
  577. {
  578. LargeIncrement ();
  579. break;
  580. }
  581. default:
  582. break;
  583. }
  584. }
  585. protected void UpdateScrollInfo ()
  586. {
  587. Refresh ();
  588. }
  589. }
  590. }