public async Task AddPane(Pane pane) { if (FocusedGroup.Count == 0) { var paneGroup = new PaneGroup(container, this); container.InsertPanel(paneGroup); Focus = paneGroup; } Focus.AddPane(pane); }
/// <summary> /// Move pane to a container relative to targetPaneGroup. /// </summary> /// <param name="pane">Pane to be moved</param> /// <param name="depth">Refer a parent container of targetPaneGroup, each /// depth is one parent container away. Depth 0 add a PaneContainer in the /// same container if the container is horizontal, if not adds the movedPane /// to a new child vertical container</param> /// <param name="moveRight"> True to move pane to the rigth of PaneGroup </param> internal void MovePaneHorizontally(TabButton pane, uint depth, bool moveRight) { var container = GetParentContainer(this); if (!container.IsHorizontal) { var childContainer = new Container(container) {IsHorizontal = true}; container.ReplacePanel(this,childContainer,false); childContainer.InsertPanel(this); container = childContainer; } var paneGroup = new PaneGroup(container, paneManager); paneGroup.AddPage(pane); container.InsertPanel(paneGroup,this,!moveRight); }
/// <summary> /// Move pane from the current PaneGroup to the targetPaneGroup. /// </summary> /// <param name="pane">Pane to be moved</param> /// <param name="targetPaneGroup"></param> internal void MovePane(TabButton pane, PaneGroup targetPaneGroup) { targetPaneGroup.AddPage(pane); }
void InitializeGui() { GuiRenderer = new GwenRenderer(); var textureName = "DefaultSkin.png"; var defaultFont = new Flood.GUI.Font("Vera.ttf", 16); var resMan = FloodEngine.GetEngine().ResourceManager; var options = new ResourceLoadOptions {Name = textureName, AsynchronousLoad = false}; var imageHandle = resMan.LoadResource<Image>(options); if (imageHandle.Id == 0) return; var skin = new TexturedSkin(GuiRenderer, imageHandle, defaultFont); Canvas = new Canvas(skin); var container = new Container(Canvas); var paneGroup = new PaneGroup(container); container.InsertPanel(paneGroup); paneGroup.AddPane(new Pane { Title = "PANE1" }); paneGroup.AddPane(new Pane { Title = "PANE2" }); Input = new GwenInput(FloodEngine.GetEngine().InputManager); Input.Initialize(Canvas); }
public void RemovePane(PaneGroup paneGroup) { FocusedGroup.Remove(paneGroup); }