private void ImportTTFFont(string fileName, string newTTFName, string newWFNName) { int fontSize = NumberEntryDialog.Show("Font size", "Select the font size to import this TTF font at:", DEFAULT_IMPORTED_FONT_SIZE, 1); if (fontSize > 0) { File.Copy(fileName, newTTFName, true); try { if (File.Exists(newWFNName)) { Factory.AGSEditor.DeleteFileOnDiskAndSourceControl(newWFNName); } Factory.NativeProxy.ReloadFont(_item.ID); _item.PointSize = fontSize; _item.SizeMultiplier = 1; _item.SourceFilename = Utilities.GetRelativeToProjectPath(fileName); } catch (AGSEditorException ex) { Factory.GUIController.ShowMessage("Unable to import the font.\n\n" + ex.Message, MessageBoxIcon.Warning); File.Delete(newTTFName); } } }
public static int Show(string titleBar, string headerText, int currentValue) { int result = -1; NumberEntryDialog dialog = new NumberEntryDialog(titleBar, headerText, currentValue); if (dialog.ShowDialog() == DialogResult.OK) { result = dialog.Number; } dialog.Dispose(); return result; }
public static int Show(string titleBar, string headerText, int currentValue, int minValue = Int32.MinValue, int maxValue = Int32.MaxValue) { int result = -1; NumberEntryDialog dialog = new NumberEntryDialog(titleBar, headerText, currentValue, minValue, maxValue); if (dialog.ShowDialog() == DialogResult.OK) { result = dialog.Number; } dialog.Dispose(); return(result); }