public void AddFrameController(GnosisFrameController frameController) { if (((IGnosisTileTabImplementation)ControlImplementation).CurrentTileTabItem == null) { if (tabItemControllers.Count == 0) { Setup(); } else { GlobalData.Singleton.ErrorHandler.HandleError("No tab item selected", "GnosisTileTabController.AddFrameController"); } } //Find the selected tab item and pass it the frame GnosisTileTabItemController controller = tabItemControllers.Find(i => i.ControlImplementation == ((IGnosisTileTabImplementation)ControlImplementation).CurrentTileTabItem); controller.LoadFrame(frameController); controller.IsDummyTabItem = false; //string caption = frameController.Caption; //if (frameController.InstanceController != null) //{ // if (frameController.InstanceController.Instance.InstanceName != null && frameController.InstanceController.Instance.InstanceName.Length > 0) // { // caption += " - " + frameController.InstanceController.Instance.InstanceName; // } //} //((IGnosisTileTabItemImplementation)ControlImplementation).SetCaption(caption); //((IGnosisTileTabImplementation)ControlImplementation).CurrentTileTabItem.LoadFrame((IGnosisFrameImplementation)frameController.ControlImplementation, caption); //check if there is a '+' tab item GnosisTileTabItemController dummy = tabItemControllers.Find(i => i.IsDummyTabItem); if (dummy == null) { //create dummy tabitem GnosisTileTabItem tabItem = GnosisControlCreator.CreateGnosisTabItem(1); // IGnosisTileTabItemImplementation tabItemImp = GlobalData.Singleton.ImplementationCreator.GetGnosisTabItemImplementation(); GnosisTileTabItemController itemController = new GnosisTileTabItemController(tabItem, EntityController, this); itemController.IsDummyTabItem = true; itemController.ControlImplementation.Order = tabItemControllers.Count + 1; tabItemControllers.Add(itemController); GnosisToggleButton headerButton = GnosisControlCreator.CreateGnosisToggleButton(1, "+"); GlobalData.Singleton.StyleHelper.ApplyStyle(headerButton, frameController.EntityController.GetNormalStyle()); // headerButton.SetCaption("+"); headerButton.Order = itemController.ControlImplementation.Order; tabItem.SetHeaderButton(headerButton); ((IGnosisTileTabImplementation)ControlImplementation).LoadTabItem(tabItem); //headerButtons.Add(headerButton); } }
public static GnosisTileTabItem CreateGnosisTabItem(int order) { GnosisTileTabItem tabItem = new GnosisTileTabItem(); tabItem.ID = GlobalData.Singleton.GetNewControlID(); tabItem.GnosisName = "TabItem" + tabItem.ID.ToString(); tabItem.Order = order; tabItem.ControlType = ControlTypeMapping.GetControlTypeName(typeof(GnosisTileTabItem)); return(tabItem); }
public GnosisTileTabItemController( GnosisTileTabItem tabItem, // IGnosisTileTabItemImplementation tabItemImplementation, GnosisEntityController entityController, GnosisTileTabController parent) : base(tabItem, entityController, parent) { frameControllers = new List <GnosisFrameController>(); tabItem.SetLoadedHandler(new Action <double>(TileTabItemLoaded)); tabItem.SetCloseHandler(new Action(OnTileTabItemClose)); }
public void Setup() { GnosisTileTabItem tabItem = GnosisControlCreator.CreateGnosisTabItem(1); // IGnosisTileTabItemImplementation tabItemImp = GlobalData.Singleton.ImplementationCreator.GetGnosisTabItemImplementation(); GnosisTileTabItemController itemController = new GnosisTileTabItemController(tabItem, EntityController, this); tabItemControllers.Add(itemController); itemController.IsDummyTabItem = true; itemController.ControlImplementation.Order = 1; //IGnosisToggleButtonImplementation headerButton = GlobalData.Singleton.ImplementationCreator.GetGnosisToggleButtonImplementation(); //GlobalData.Singleton.StyleHelper.ApplyStyle(headerButton, tabItemImp, itemController, frameController.EntityController.GetNormalStyle()); // headerButton.SetCaption("+"); // headerButton.Order = 1; // tabItemImp.SetHeader(headerButton); ((IGnosisTileTabImplementation)ControlImplementation).LoadTabItem(tabItem); //headerButtons.Add(headerButton); currentTabItemController = tabItemControllers[0]; }