/// <summary> /// Creates and adds the voicepack combiner menu items as children to parentItemName /// </summary> public VoicepackCombinerMenuItems(string parentItemName, VoicepackCombiner voicepackCombiner, VoicepackCombinerForm voicepackCombinerForm, GUIMain mainForm) { _voicepackCombiner = voicepackCombiner; _voicepackCombinerForm = voicepackCombinerForm; _mainForm = mainForm; CreateVoicepackCombinerSubMenu(); AddVoicepackCombinerSubMenuToParent(parentItemName); UpdateGUIVoicepackListIsEmpty(); }
/// <summary> /// Eventhandler that brings up the VoicepackCombinerForm /// </summary> private void settingsMenuItem_Click(Object sender, EventArgs e) { //When the form is closed it is not null, but I have to create a new one in stead of just making it visible //because else the rounded edges wont look properly. (Maybe there is a better way to re-initialize the edges..) if (_voicepackCombinerForm == null || !_voicepackCombinerForm.Visible) { _voicepackCombinerForm = new VoicepackCombinerForm(_voicepackCombiner); } else if (_voicepackCombinerForm.Visible) { return; } //Show the plugin GUI and position it in the middle of the main GUI _voicepackCombinerForm.StartPosition = FormStartPosition.Manual; _voicepackCombinerForm.Location = new Point( _mainForm.Location.X + (_mainForm.Width - _voicepackCombinerForm.Width) / 2, _mainForm.Location.Y + (_mainForm.Height - _voicepackCombinerForm.Height) / 2); _voicepackCombinerForm.Show(_mainForm); }