ScrollBarRenderView.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // SuperTux Editor
  2. // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. using System;
  17. using Gtk;
  18. public class ScrollBarRenderView : Table
  19. {
  20. private RenderView renderview;
  21. public ScrollBarRenderView(RenderView renderview)
  22. : base(2, 2, false)
  23. {
  24. this.renderview = renderview;
  25. Attach(renderview, 0, 1, 0, 1,
  26. AttachOptions.Expand | AttachOptions.Fill,
  27. AttachOptions.Expand | AttachOptions.Fill, 0, 0);
  28. Adjustment hadjustment = new Adjustment(0, -10, 10, 1, 2, 2);
  29. HScrollbar hscroll = new HScrollbar(hadjustment);
  30. Attach(hscroll, 0, 1, 1, 2,
  31. AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
  32. Adjustment vadjustment = new Adjustment(0, -10, 10, 1, 2, 2);
  33. VScrollbar vscroll = new VScrollbar(vadjustment);
  34. Attach(vscroll, 1, 2, 0, 1,
  35. 0, AttachOptions.Expand | AttachOptions.Fill, 0, 0);
  36. renderview.SetAdjustments(hadjustment, vadjustment);
  37. }
  38. public RenderView Renderer {
  39. get {
  40. return renderview;
  41. }
  42. }
  43. }
  44. /* EOF */