SplitContainer.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. using NStack;
  2. using System;
  3. using System.Collections.Generic;
  4. using Terminal.Gui.Graphs;
  5. namespace Terminal.Gui {
  6. /// <summary>
  7. /// A <see cref="View"/> consisting of a moveable bar that divides
  8. /// the display area into 2 resizeable panels.
  9. /// </summary>
  10. public class SplitContainer : View {
  11. private SplitContainerLineView splitterLine;
  12. SplitContainer parentSplitPanel;
  13. /// TODO: Might be able to make Border virtual and override here
  14. /// To make this more API friendly
  15. /// <summary>
  16. /// Use this field instead of Border to create an integrated
  17. /// Border in which lines connect with subpanels and splitters
  18. /// seamlessly
  19. /// </summary>
  20. public BorderStyle IntegratedBorder {get;set;}
  21. /// <summary>
  22. /// The <see cref="View"/> showing in the left hand pane of a
  23. /// <see cref="Orientation.Vertical"/> or top of an
  24. /// <see cref="Orientation.Horizontal"/> pane. May be another
  25. /// <see cref="SplitContainer"/> if further splitter subdivisions are
  26. /// desired (e.g. to create a resizeable grid.
  27. /// </summary>
  28. public View Panel1 { get; set; } // TODO: Should not be public set, should be helpers for this
  29. public int Panel1MinSize { get; set; }
  30. public ustring Panel1Title { get; set; } = string.Empty;
  31. /// <summary>
  32. /// The <see cref="View"/> showing in the right hand pane of a
  33. /// <see cref="Orientation.Vertical"/> or bottom of an
  34. /// <see cref="Orientation.Horizontal"/> pane. May be another
  35. /// <see cref="SplitContainer"/> if further splitter subdivisions are
  36. /// desired (e.g. to create a resizeable grid.
  37. /// </summary>
  38. public View Panel2 { get; set; } // TODO: Should not be public set, should be helpers for this
  39. public int Panel2MinSize { get; set; }
  40. public ustring Panel2Title { get; set; } = string.Empty;
  41. private Pos splitterDistance = Pos.Percent (50);
  42. private Orientation orientation = Orientation.Vertical;
  43. /// <summary>
  44. /// Creates a new instance of the SplitContainer class.
  45. /// </summary>
  46. public SplitContainer ()
  47. {
  48. splitterLine = new SplitContainerLineView (this);
  49. Panel1 = new View () { Width = Dim.Fill (), Height = Dim.Fill() };
  50. Panel2 = new View () { Width = Dim.Fill (), Height = Dim.Fill () };
  51. this.Add (Panel1);
  52. this.Add (splitterLine);
  53. this.Add (Panel2);
  54. CanFocus = true;
  55. }
  56. /// <summary>
  57. /// Invoked when the <see cref="SplitterDistance"/> is changed
  58. /// </summary>
  59. public event SplitterEventHandler SplitterMoved;
  60. /// <summary>
  61. /// Raises the <see cref="SplitterMoved"/> event
  62. /// </summary>
  63. protected virtual void OnSplitterMoved ()
  64. {
  65. SplitterMoved?.Invoke (this, new SplitterEventArgs (this, splitterDistance));
  66. }
  67. /// <summary>
  68. /// Orientation of the dividing line (Horizontal or Vertical).
  69. /// </summary>
  70. public Orientation Orientation {
  71. get { return orientation; }
  72. set {
  73. orientation = value;
  74. LayoutSubviews ();
  75. }
  76. }
  77. public override void LayoutSubviews ()
  78. {
  79. splitterLine.moveRuneRenderLocation = null;
  80. if(this.IsRootSplitContainer()) {
  81. var contentArea = Bounds;
  82. if(HasBorder())
  83. {
  84. // TODO: Bound with Max/Min
  85. contentArea = new Rect(
  86. contentArea.X + 1,
  87. contentArea.Y + 1,
  88. contentArea.Width - 2,
  89. contentArea.Height - 2);
  90. }
  91. else if(HasAnyTitles())
  92. {
  93. // TODO: Bound with Max/Min
  94. contentArea = new Rect(
  95. contentArea.X,
  96. contentArea.Y + 1,
  97. contentArea.Width,
  98. contentArea.Height - 1);
  99. }
  100. Setup (contentArea);
  101. }
  102. base.LayoutSubviews ();
  103. }
  104. /// <summary>
  105. /// <para>Distance Horizontally or Vertically to the splitter line when
  106. /// neither panel is collapsed.
  107. /// </para>
  108. /// <para>Only absolute values (e.g. 10) and percent values (i.e. <see cref="Pos.Percent(float)"/>)
  109. /// are supported for this property.</para>
  110. /// </summary>
  111. public Pos SplitterDistance {
  112. get { return splitterDistance; }
  113. set {
  114. if (!(value is Pos.PosAbsolute) && !(value is Pos.PosFactor)) {
  115. throw new ArgumentException ($"Only Percent and Absolute values are supported for {nameof (SplitterDistance)} property. Passed value was {value.GetType ().Name}");
  116. }
  117. splitterDistance = value;
  118. GetRootSplitContainer ().LayoutSubviews ();
  119. OnSplitterMoved ();
  120. }
  121. }
  122. /// <inheritdoc/>
  123. public override bool OnEnter (View view)
  124. {
  125. Driver.SetCursorVisibility (CursorVisibility.Invisible);
  126. return base.OnEnter (view);
  127. }
  128. /// <inheritdoc/>
  129. public override void Redraw (Rect bounds)
  130. {
  131. Driver.SetAttribute (ColorScheme.Normal);
  132. Clear ();
  133. base.Redraw (bounds);
  134. var lc = new LineCanvas(Application.Driver);
  135. if(IsRootSplitContainer())
  136. {
  137. if(HasBorder ()) {
  138. lc.AddLine (new Point (0, 0), bounds.Width - 1, Orientation.Horizontal, IntegratedBorder);
  139. lc.AddLine (new Point (0, 0), bounds.Height - 1, Orientation.Vertical, IntegratedBorder);
  140. lc.AddLine (new Point (bounds.Width - 1, bounds.Height - 1), -bounds.Width + 1, Orientation.Horizontal, IntegratedBorder);
  141. lc.AddLine (new Point (bounds.Width - 1, bounds.Height - 1), -bounds.Height + 1, Orientation.Vertical, IntegratedBorder);
  142. }
  143. foreach (var line in GetAllChildSplitContainerLineViewRecursively(this))
  144. {
  145. bool isRoot = line == splitterLine;
  146. line.ViewToScreen(0,0,out var x1,out var y1);
  147. var origin = ScreenToView(x1,y1);
  148. var length = line.Orientation == Orientation.Horizontal ?
  149. line.Frame.Width - 1 :
  150. line.Frame.Height - 1;
  151. if(!isRoot) {
  152. if(line.Orientation == Orientation.Horizontal) {
  153. origin.X -= 1;
  154. } else {
  155. origin.Y -= 1;
  156. }
  157. length += 2;
  158. // TODO: Render this title too
  159. }
  160. lc.AddLine(origin,length,line.Orientation,IntegratedBorder);
  161. }
  162. }
  163. Driver.SetAttribute (ColorScheme.Normal);
  164. lc.Draw(this,bounds);
  165. // Draw Titles over Border
  166. var screen = ViewToScreen (bounds);
  167. if (Panel1.Visible && Panel1Title.Length > 0) {
  168. Driver.SetAttribute (Panel1.HasFocus ? ColorScheme.HotNormal : ColorScheme.Normal);
  169. Driver.DrawWindowTitle (new Rect (screen.X, screen.Y, Panel1.Frame.Width, 0), Panel1Title, 0, 0, 0, 0);
  170. }
  171. if (splitterLine.Visible) {
  172. screen = ViewToScreen (splitterLine.Frame);
  173. } else {
  174. screen.X--;
  175. //screen.Y--;
  176. }
  177. if (Orientation == Orientation.Horizontal) {
  178. if (Panel2.Visible && Panel2Title?.Length > 0) {
  179. Driver.SetAttribute (Panel2.HasFocus ? ColorScheme.HotNormal : ColorScheme.Normal);
  180. Driver.DrawWindowTitle (new Rect (screen.X + 1, screen.Y, Panel2.Bounds.Width, 1), Panel2Title, 0, 0, 0, 0);
  181. }
  182. } else {
  183. if (Panel2.Visible && Panel2Title?.Length > 0) {
  184. Driver.SetAttribute (Panel2.HasFocus ? ColorScheme.HotNormal : ColorScheme.Normal);
  185. Driver.DrawWindowTitle (new Rect (screen.X + 1, screen.Y, Panel2.Bounds.Width, 1), Panel2Title, 0, 0, 0, 0);
  186. }
  187. }
  188. }
  189. private List<SplitContainerLineView> GetAllChildSplitContainerLineViewRecursively (View v)
  190. {
  191. var lines = new List<SplitContainerLineView>();
  192. foreach(var sub in v.Subviews)
  193. {
  194. if(sub is SplitContainerLineView s)
  195. {
  196. lines.Add(s);
  197. }
  198. else {
  199. lines.AddRange(GetAllChildSplitContainerLineViewRecursively(sub));
  200. }
  201. }
  202. return lines;
  203. }
  204. private bool IsRootSplitContainer ()
  205. {
  206. // TODO: don't want to layout subviews since the parent recursively lays them all out
  207. return parentSplitPanel == null;
  208. }
  209. private SplitContainer GetRootSplitContainer ()
  210. {
  211. SplitContainer root = this;
  212. while (root.parentSplitPanel != null) {
  213. root = root.parentSplitPanel;
  214. }
  215. return root;
  216. }
  217. private void Setup (Rect bounds)
  218. {
  219. splitterLine.Orientation = Orientation;
  220. // splitterLine.Text = Panel2.Title;
  221. // TODO: Recursion
  222. if (!Panel1.Visible || !Panel2.Visible) {
  223. View toFullSize = !Panel1.Visible ? Panel2 : Panel1;
  224. splitterLine.Visible = false;
  225. toFullSize.X = bounds.X;
  226. toFullSize.Y = bounds.Y;
  227. toFullSize.Width = bounds.Width;
  228. toFullSize.Height = bounds.Height;
  229. } else {
  230. splitterLine.Visible = true;
  231. splitterDistance = BoundByMinimumSizes (splitterDistance);
  232. Panel1.X = bounds.X;
  233. Panel1.Y = bounds.Y;
  234. switch (Orientation) {
  235. case Orientation.Horizontal:
  236. splitterLine.X = 0;
  237. splitterLine.Y = splitterDistance;
  238. splitterLine.Width = Dim.Fill ();
  239. splitterLine.Height = 1;
  240. splitterLine.LineRune = Driver.HLine;
  241. Panel1.Width = Dim.Fill (HasBorder()? 1:0);
  242. Panel1.Height = new Dim.DimFunc (() =>
  243. splitterDistance.Anchor (Bounds.Height));
  244. Panel2.Y = Pos.Bottom (splitterLine);
  245. Panel2.X = bounds.X;
  246. Panel2.Width = bounds.Width;
  247. Panel2.Height = Dim.Fill(HasBorder () ? 1 : 0);
  248. break;
  249. case Orientation.Vertical:
  250. splitterLine.X = splitterDistance;
  251. splitterLine.Y = 0;
  252. splitterLine.Width = 1;
  253. splitterLine.Height = Dim.Fill ();
  254. splitterLine.LineRune = Driver.VLine;
  255. Panel1.Height = Dim.Fill();
  256. Panel1.Width = new Dim.DimFunc (() =>
  257. splitterDistance.Anchor (Bounds.Width));
  258. Panel2.X = Pos.Right (splitterLine);
  259. Panel2.Y = bounds.Y;
  260. Panel2.Height = bounds.Height;
  261. Panel2.Width = Dim.Fill(HasBorder()? 1:0);
  262. break;
  263. default: throw new ArgumentOutOfRangeException (nameof (orientation));
  264. };
  265. }
  266. }
  267. /// <summary>
  268. /// Considers <paramref name="pos"/> as a candidate for <see cref="splitterDistance"/>
  269. /// then either returns (if valid) or returns adjusted if invalid with respect to the
  270. /// <see cref="SplitterPanel.MinSize"/> of the panels.
  271. /// </summary>
  272. /// <param name="pos"></param>
  273. /// <returns></returns>
  274. private Pos BoundByMinimumSizes (Pos pos)
  275. {
  276. // if we are not yet initialized then we don't know
  277. // how big we are and therefore cannot sensibly calculate
  278. // how big the panels will be with a given SplitterDistance
  279. if (!IsInitialized) {
  280. return pos;
  281. }
  282. var availableSpace = Orientation == Orientation.Horizontal ? this.Bounds.Height : this.Bounds.Width;
  283. var idealPosition = pos.Anchor (availableSpace);
  284. // bad position because not enough space for Panel1
  285. if (idealPosition < Panel1MinSize) {
  286. // TODO: we should preserve Absolute/Percent status here not just force it to absolute
  287. return (Pos)Math.Min (Panel1MinSize, availableSpace);
  288. }
  289. // if there is a border then 2 screen units are taken occupied
  290. // by the border around the edge (one on left, one on right).
  291. if (HasBorder ()) {
  292. availableSpace -= 2;
  293. }
  294. // bad position because not enough space for Panel2
  295. if (availableSpace - idealPosition <= Panel2MinSize) {
  296. // TODO: we should preserve Absolute/Percent status here not just force it to absolute
  297. // +1 is to allow space for the splitter
  298. return (Pos)Math.Max (availableSpace - (Panel2MinSize + 1), 0);
  299. }
  300. // this splitter position is fine, there is enough space for everyone
  301. return pos;
  302. }
  303. /// <summary>
  304. /// A panel within a <see cref="SplitterPanel"/>.
  305. /// </summary>
  306. public class SplitterPanel : View {
  307. Pos minSize = 1;
  308. /// <summary>
  309. /// Gets or sets the minimum size for the panel.
  310. /// </summary>
  311. public Pos MinSize { get => minSize;
  312. set {
  313. minSize = value;
  314. SuperView?.SetNeedsLayout ();
  315. }
  316. }
  317. ustring title = ustring.Empty;
  318. /// <summary>
  319. /// The title to be displayed for this <see cref="SplitterPanel"/>. The title will be rendered
  320. /// on the top border aligned to the left of the panel.
  321. /// </summary>
  322. /// <value>The title.</value>
  323. public ustring Title {
  324. get => title;
  325. set {
  326. title = value;
  327. SetNeedsDisplay ();
  328. }
  329. }
  330. /// <inheritdoc/>
  331. public override void Redraw (Rect bounds)
  332. {
  333. Driver.SetAttribute (ColorScheme.Normal);
  334. base.Redraw (bounds);
  335. }
  336. /// <inheritdoc/>
  337. public override void OnVisibleChanged ()
  338. {
  339. base.OnVisibleChanged ();
  340. SuperView?.SetNeedsLayout ();
  341. }
  342. }
  343. private class SplitContainerLineView : LineView {
  344. public SplitContainer Parent { get; private set; }
  345. Point? dragPosition;
  346. Pos dragOrignalPos;
  347. public Point? moveRuneRenderLocation;
  348. public SplitContainerLineView (SplitContainer parent)
  349. {
  350. CanFocus = true;
  351. TabStop = true;
  352. this.Parent = parent;
  353. base.AddCommand (Command.Right, () => {
  354. return MoveSplitter (1, 0);
  355. });
  356. base.AddCommand (Command.Left, () => {
  357. return MoveSplitter (-1, 0);
  358. });
  359. base.AddCommand (Command.LineUp, () => {
  360. return MoveSplitter (0, -1);
  361. });
  362. base.AddCommand (Command.LineDown, () => {
  363. return MoveSplitter (0, 1);
  364. });
  365. AddKeyBinding (Key.CursorRight, Command.Right);
  366. AddKeyBinding (Key.CursorLeft, Command.Left);
  367. AddKeyBinding (Key.CursorUp, Command.LineUp);
  368. AddKeyBinding (Key.CursorDown, Command.LineDown);
  369. }
  370. public override bool ProcessKey (KeyEvent kb)
  371. {
  372. if (!CanFocus || !HasFocus) {
  373. return base.ProcessKey (kb);
  374. }
  375. var result = InvokeKeybindings (kb);
  376. if (result != null)
  377. return (bool)result;
  378. return base.ProcessKey (kb);
  379. }
  380. public override void PositionCursor ()
  381. {
  382. base.PositionCursor ();
  383. var location = moveRuneRenderLocation ??
  384. new Point (Bounds.Width / 2, Bounds.Height / 2);
  385. Move (location.X, location.Y);
  386. }
  387. public override bool OnEnter (View view)
  388. {
  389. Driver.SetCursorVisibility (CursorVisibility.Default);
  390. PositionCursor ();
  391. return base.OnEnter (view);
  392. }
  393. public override void Redraw (Rect bounds)
  394. {
  395. base.Redraw (bounds);
  396. if (CanFocus && HasFocus) {
  397. var location = moveRuneRenderLocation ??
  398. new Point (Bounds.Width / 2, Bounds.Height / 2);
  399. AddRune (location.X, location.Y, Driver.Diamond);
  400. }
  401. }
  402. public override bool MouseEvent (MouseEvent mouseEvent)
  403. {
  404. if (!CanFocus) {
  405. return true;
  406. }
  407. if (!dragPosition.HasValue && (mouseEvent.Flags == MouseFlags.Button1Pressed)) {
  408. // Start a Drag
  409. SetFocus ();
  410. Application.EnsuresTopOnFront ();
  411. if (mouseEvent.Flags == MouseFlags.Button1Pressed) {
  412. dragPosition = new Point (mouseEvent.X, mouseEvent.Y);
  413. dragOrignalPos = Orientation == Orientation.Horizontal ? Y : X;
  414. Application.GrabMouse (this);
  415. if (Orientation == Orientation.Horizontal) {
  416. } else {
  417. moveRuneRenderLocation = new Point (0, Math.Max (1, Math.Min (Bounds.Height - 2, mouseEvent.Y)));
  418. }
  419. }
  420. return true;
  421. } else if (
  422. dragPosition.HasValue &&
  423. (mouseEvent.Flags == (MouseFlags.Button1Pressed | MouseFlags.ReportMousePosition))) {
  424. // Continue Drag
  425. // how far has user dragged from original location?
  426. if (Orientation == Orientation.Horizontal) {
  427. int dy = mouseEvent.Y - dragPosition.Value.Y;
  428. Parent.SplitterDistance = Offset (Y, dy);
  429. moveRuneRenderLocation = new Point (mouseEvent.X, 0);
  430. } else {
  431. int dx = mouseEvent.X - dragPosition.Value.X;
  432. Parent.SplitterDistance = Offset (X, dx);
  433. moveRuneRenderLocation = new Point (0, Math.Max (1, Math.Min (Bounds.Height - 2, mouseEvent.Y)));
  434. }
  435. Parent.SetNeedsDisplay ();
  436. return true;
  437. }
  438. if (mouseEvent.Flags.HasFlag (MouseFlags.Button1Released) && dragPosition.HasValue) {
  439. // End Drag
  440. Application.UngrabMouse ();
  441. Driver.UncookMouse ();
  442. FinalisePosition (
  443. dragOrignalPos,
  444. Orientation == Orientation.Horizontal ? Y : X);
  445. dragPosition = null;
  446. //moveRuneRenderLocation = null;
  447. }
  448. return false;
  449. }
  450. private bool MoveSplitter (int distanceX, int distanceY)
  451. {
  452. if (Orientation == Orientation.Vertical) {
  453. // Cannot move in this direction
  454. if (distanceX == 0) {
  455. return false;
  456. }
  457. var oldX = X;
  458. FinalisePosition (oldX, (Pos)Offset (X, distanceX));
  459. return true;
  460. } else {
  461. // Cannot move in this direction
  462. if (distanceY == 0) {
  463. return false;
  464. }
  465. var oldY = Y;
  466. FinalisePosition (oldY, (Pos)Offset (Y, distanceY));
  467. return true;
  468. }
  469. }
  470. private Pos Offset (Pos pos, int delta)
  471. {
  472. var posAbsolute = pos.Anchor (Orientation == Orientation.Horizontal ?
  473. Parent.Bounds.Height : Parent.Bounds.Width);
  474. return posAbsolute + delta;
  475. }
  476. /// <summary>
  477. /// <para>
  478. /// Moves <see cref="parent"/> <see cref="SplitContainer.SplitterDistance"/> to
  479. /// <see cref="Pos"/> <paramref name="newValue"/> preserving <see cref="Pos"/> format
  480. /// (absolute / relative) that <paramref name="oldValue"/> had.
  481. /// </para>
  482. /// <remarks>This ensures that if splitter location was e.g. 50% before and you move it
  483. /// to absolute 5 then you end up with 10% (assuming a parent had 50 width). </remarks>
  484. /// </summary>
  485. /// <param name="oldValue"></param>
  486. /// <param name="newValue"></param>
  487. private void FinalisePosition (Pos oldValue, Pos newValue)
  488. {
  489. if (oldValue is Pos.PosFactor) {
  490. if (Orientation == Orientation.Horizontal) {
  491. Parent.SplitterDistance = ConvertToPosFactor (newValue, Parent.Bounds.Height);
  492. } else {
  493. Parent.SplitterDistance = ConvertToPosFactor (newValue, Parent.Bounds.Width);
  494. }
  495. } else {
  496. Parent.SplitterDistance = newValue;
  497. }
  498. }
  499. /// <summary>
  500. /// <para>
  501. /// Determines the absolute position of <paramref name="p"/> and
  502. /// returns a <see cref="Pos.PosFactor"/> that describes the percentage of that.
  503. /// </para>
  504. /// <para>Effectively turning any <see cref="Pos"/> into a <see cref="Pos.PosFactor"/>
  505. /// (as if created with <see cref="Pos.Percent(float)"/>)</para>
  506. /// </summary>
  507. /// <param name="p">The <see cref="Pos"/> to convert to <see cref="Pos.Percent(float)"/></param>
  508. /// <param name="parentLength">The Height/Width that <paramref name="p"/> lies within</param>
  509. /// <returns></returns>
  510. private Pos ConvertToPosFactor (Pos p, int parentLength)
  511. {
  512. // calculate position in the 'middle' of the cell at p distance along parentLength
  513. float position = p.Anchor (parentLength) + 0.5f;
  514. return new Pos.PosFactor (position / parentLength);
  515. }
  516. }
  517. private bool HasBorder ()
  518. {
  519. return IntegratedBorder != BorderStyle.None;
  520. }
  521. private bool HasAnyTitles()
  522. {
  523. return Panel1Title.Length > 0 || Panel2Title.Length > 0;
  524. }
  525. }
  526. /// <summary>
  527. /// Provides data for <see cref="SplitContainer"/> events.
  528. /// </summary>
  529. public class SplitterEventArgs : EventArgs {
  530. /// <summary>
  531. /// Creates a new instance of the <see cref="SplitterEventArgs"/> class.
  532. /// </summary>
  533. /// <param name="splitContainer"></param>
  534. /// <param name="splitterDistance"></param>
  535. public SplitterEventArgs (SplitContainer splitContainer, Pos splitterDistance)
  536. {
  537. SplitterDistance = splitterDistance;
  538. SplitContainer = splitContainer;
  539. }
  540. /// <summary>
  541. /// New position of the <see cref="SplitContainer.SplitterDistance"/>
  542. /// </summary>
  543. public Pos SplitterDistance { get; }
  544. /// <summary>
  545. /// Container (sender) of the event.
  546. /// </summary>
  547. public SplitContainer SplitContainer { get; }
  548. }
  549. /// <summary>
  550. /// Represents a method that will handle splitter events.
  551. /// </summary>
  552. public delegate void SplitterEventHandler (object sender, SplitterEventArgs e);
  553. }