public EngineFlightUI(string title, GUIFramework framework) : base(title, framework, typeof (EngineFlightUI), "EngineFlightUI.xml") { _root = new LayoutControl {Direction = LayoutDirection.Vertical}; _saTable.Children.Add(_root); }
/// <summary> /// Initializes a new window and loads controls tree from resource. /// </summary> /// <param name="title">Window title</param> /// <param name="framework">Reference to <seealso cref="GUIFramework"/> object to be used for initializing the controls tree.</param> /// <param name="type">Type to use as a namespace for resource</param> /// <param name="resourceName">Resource name</param> public GUIWindow(string title, GUIFramework framework, Type type, string resourceName) { _windowId = GetHashCode(); Title = title; IsDisplayDelegate = () => true; framework.InitWindow(this, type, resourceName); MapControlFields(); }
public EngineFlightUI(string title, GUIFramework framework) : base(title, framework, typeof(EngineFlightUI), "EngineFlightUI.xml") { _root = new LayoutControl { Direction = LayoutDirection.Vertical }; _saTable.Children.Add(_root); }
public EngineGroupNameUI(string title, GUIFramework framework) : base(title, framework, typeof (EngineGroupNameUI), "EngineGroupNameUI.xml") { IsModal = true; _btnCancel.ButtonPressed += BtnCancelOnButtonPressed; _btnAccept.ButtonPressed += BtnAcceptOnButtonPressed; _btnAccept.Enabled = false; _tbName.TextChanged += TbNameOnTextChanged; }
public EngineGroupNameUI(string title, GUIFramework framework) : base(title, framework, typeof(EngineGroupNameUI), "EngineGroupNameUI.xml") { IsModal = true; _btnCancel.ButtonPressed += BtnCancelOnButtonPressed; _btnAccept.ButtonPressed += BtnAcceptOnButtonPressed; _btnAccept.Enabled = false; _tbName.TextChanged += TbNameOnTextChanged; }
public void OnDestroy() { DebugHelper.Debug("EngineFlightControl:OnDestroy"); GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIAppLauncherReady); ApplicationLauncher.Instance.RemoveModApplication(_appLauncherButton); //GameEvents.onVesselChange.Remove(OnVesselWasModified); GameEvents.onVesselWasModified.Remove(OnVesselWasModified); _gui.RenderEnabled = false; Instance = null; _gui = null; _framework = null; }
public void OnDestroy() { DebugHelper.Debug("EngineFlightControl:OnDestroy"); GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIAppLauncherReady); ApplicationLauncher.Instance.RemoveModApplication(_appLauncherButton); //GameEvents.onVesselChange.Remove(OnVesselWasModified); GameEvents.onVesselWasModified.Remove(OnVesselWasModified); _gui.EndPostDisplay(); Instance = null; _gui = null; _framework = null; }
public void Start() { DebugHelper.Debug("EngineFlightControl:Start"); _framework = new GUIFramework(); _gui = new EngineFlightUI("Engine Groups Controller", _framework); _gui.IsDisplayDelegate += () => _displayGUI; Instance = this; OnVesselWasModified(FlightGlobals.ActiveVessel); //GameEvents.onVesselChange.Add(OnVesselWasModified); GameEvents.onVesselWasModified.Add(OnVesselWasModified); _gui.StartPostDisplay(1); GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady); }