picoe/Eto

Allow a Control to be positioned directly in its parent Container, making PixelLayout obsolete

開放

#158 建立於 2013年11月20日

 (3 則留言) (0 個反應) (0 位負責人)C# (320 個分叉)batch import
help wanted

倉庫指標

星標
 (3,387 顆星)
PR 合併指標
 (平均合併 2天 23小時) (30 天內合併 15 個 PR)

描述

Problem:

  1. It is cumbersome to create a PixelLayout just to position a control.
  2. PixelLayout adds a new window to the container hierarchy, obscuring the content beneath and requiring event bubbling to register mouse clicks, etc.
  3. It isn't possible to explicitly position some controls while using a table layout for the rest of the Container's children.

Solution: These methods and properties allow a Control to be added and positioned directly on its parent:

  1. Container.Add(Control child): adds an absolutely positioned child
  2. Container.Remove(Control child): removes an absolutely positioned child
  3. Control.Location {get; set;} : The setter is new. Sets the position of this Control in its parent. This Control must have been added using Add.

Implementation Notes: Curtis mentioned GTK being problematic in that it required an explicit window. However, this is no longer the case, GTK.Fixed supports a windowless mode (HasWindow = false) and in fact Eto currently uses this mode.

貢獻者指南