private void btnEditText_Click(object sender, EventArgs e) { var diag = new TextDialog(this, _sym, _text); diag.ShowDialog(this); OnResourceChanged(); }
public async void TextTips(InfoListModel infoListModel, Action <InfoListModel> action, DialogClosingEventHandler e = null) { try { if (e == null) { e = closingEventHandler; } var textDialog = new TextDialog() { Text_CardAddress = { Text = infoListModel.address }, Text_Name = { Text = infoListModel.userName }, Text_Card = { Text = infoListModel.cardNo }, Text_Sex = { Text = infoListModel.sex }, Text_homeAddress = { Text = infoListModel.address }, Text_company = { Text = infoListModel.company } }; await DialogHost.Show(textDialog, "ReadDialog"); action(textDialog.InfoListModel); } catch (Exception ex) { Logger.Default.Error(ex.Message); } }
private void modifySequenceLengthToolStripMenuItem_Click(object sender, EventArgs e) { string oldLength = _sequence.Length.ToString("m\\:ss\\.fff"); TextDialog prompt = new TextDialog("Enter new sequence length:", "Sequence Length", oldLength, true); do { if (prompt.ShowDialog() != DialogResult.OK) { break; } TimeSpan time; bool success = TimeSpan.TryParseExact(prompt.Response, TimeFormats.PositiveFormats, null, out time); if (success) { SequenceLength = time; SequenceModified(); break; } //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm("Error parsing time: please use the format '<minutes>:<seconds>.<milliseconds>'", @"Error parsing time", false, false); messageBox.ShowDialog(); } while (true); }
private void ShowMainMenu() { TextDialog d = new TextDialog(); Crt.CurrentDialog = d; d.Display = Crt; d.Add("Connect", "Alt-C"); d.Add("Disconnect", "Alt-D"); d.Add("Port settings", "Alt-P"); d.Add("Terminal Settings", "Alt-T"); d.Add("Screen Size", "Alt-V"); d.Add("Clear Screen", "Control-Home"); d.Add("Upload (Send)", "Alt-U"); d.Add("Download (Receive)", "Alt-R"); d.Left = 15; d.Top = 5; d.Width = 44; d.Height = 14; d.Show(); //debug //Crt.PrintAtStart("Main Menu"); }
IEnumerator StartDialogImpl(TextDialog dialog, bool block) { _controllerWasActive = PlayerController.enabled; if (block) { PlayerController.enabled = false; } _text.enabled = true; _frame.SetActive(true); foreach (var snippet in dialog.Snippets) { if (snippet.append) { _text.text += "\n" + snippet.text; } else { _text.text = snippet.text; } var co_bt = ShowButtonWithDelay(2.0f); StartCoroutine(co_bt); yield return(null); // wait for next loop so the GetButtonDown() reset yield return(StartCoroutine(WaitForUse())); StopCoroutine(co_bt); _button.SetActive(false); } EndDialog(block); }
private void renameNodesToolStripMenuItem_Click(object sender, EventArgs e) { if (multiSelectTreeviewElementsGroups.SelectedNodes.Count == 0) { return; } else if (multiSelectTreeviewElementsGroups.SelectedNodes.Count == 1) { ElementNode cn = multiSelectTreeviewElementsGroups.SelectedNode.Tag as ElementNode; using (TextDialog dialog = new TextDialog("Item name?", "Rename item", (cn).Name, true)) { if (dialog.ShowDialog() == DialogResult.OK) { if (dialog.Response != "" && dialog.Response != cn.Name) { VixenSystem.Nodes.RenameNode(cn, dialog.Response); } } } } else if (multiSelectTreeviewElementsGroups.SelectedNodes.Count > 1) { RenameSelectedElements(); } PopulateNodeTree(); PopulateFormWithNode(_displayedNode, true); }
private Tuple <bool, string> GetProfileName(string initialName) { TextDialog dialog = new TextDialog("Enter a name for the new profile", "Profile Name", initialName); while (dialog.ShowDialog() == DialogResult.OK) { if (dialog.Response == string.Empty) { var messageBox = new MessageBoxForm("Profile name can not be blank.", "Error", MessageBoxButtons.OK, SystemIcons.Error); messageBox.ShowDialog(); } else if (comboProfiles.Items.Cast <ExportProfile>().Any(items => items.Name == dialog.Response)) { var messageBox = new MessageBoxForm("A profile with the name " + dialog.Response + @" already exists.", "Warning", MessageBoxButtons.OK, SystemIcons.Warning); messageBox.ShowDialog(); } else { break; } } if (dialog.DialogResult == DialogResult.Cancel) { return(new Tuple <bool, string>(false, String.Empty)); } return(new Tuple <bool, string>(true, dialog.Response)); }
//--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\ #region --Set-, Get- Methods-- #endregion //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\ #region --Misc Methods (Public)-- #endregion #region --Misc Methods (Private)-- private void requestPurchase(string featureName) { Task.Run(async() => { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() => { ProductPurchaseStatus resultsStatus = await BuyContentHelper.requestPuracheAsync(featureName); TextDialog dialog; switch (resultsStatus) { case ProductPurchaseStatus.Succeeded: dialog = new TextDialog("Thanks for supporting the development!", "Success!"); break; default: dialog = new TextDialog("Failed to place order:\n" + resultsStatus, "An error occurred!"); break; } await UiUtils.showDialogAsyncQueue(dialog); donate_prgr.Visibility = Visibility.Collapsed; donate_btn.IsEnabled = true; }); }); }
public MessageBoxResponse GetUserInput(string question, string title, string defaultText, Form parent = null) { TextDialog dialog = new TextDialog(question, title, defaultText, true); if (parent == null) { CenterDialog(dialog); } var input = string.Empty; var validInput = false; DialogResult result; do { result = dialog.ShowDialog(parent); if (result == DialogResult.OK) { if (dialog.Response == string.Empty) { continue; } input = dialog.Response; } validInput = true; }while (!validInput && result != DialogResult.OK); return(new MessageBoxResponse(Enum <MessageResult> .ConvertFromOtherEnumValue(result), input)); }
protected override void Start() { Pools.DisableStandardBalls(); List <LevelData.BallData> lp = LevelDataIndex.CurrentLevel.ballDatas; Transform ooRoot = GameObject.Find("8Ball/OtherObjects").transform; for (int i = 0, count = lp.Count; i < count; i++) { LevelData.BallData d = lp[i]; GameObject o = Resources.Load(d.Type.ToString()) as GameObject; GameObject oo = Instantiate(o) as GameObject; oo.transform.SetParent(ooRoot); d.Position.y = 0; oo.transform.position = d.Position; PoolBall pb = oo.GetComponent <PoolBall>(); pb.SetBallID(d.ID); pb.ballType = d.Type; if (pb.ballType != BallType.JIANGYOU && pb.ballType != BallType.DEMON) { m_TargetBalls.Add(d.ID); } Pools.CustomBalls.Add(pb.GetBallID(), pb); } Pools.CueBall.transform.position = LevelDataIndex.CurrentLevel.cueBallData.Position; PocketTrigger.MarkPocketType(LevelDataIndex.CurrentLevel.StartPunishmentPocket, LevelDataIndex.CurrentLevel.StartRewardPocket); PocketTrigger.Block(LevelDataIndex.CurrentLevel.BlockPockets); m_Player.ShotsRemain = LevelDataIndex.CurrentLevel.shotCount; TurnBegin(); TextDialog.Show(LevelDataIndex.CurrentLevel.DescriptionID); }
private void addAccount() { addAccount_prgr.Visibility = Visibility.Visible; addAccount_btn.IsEnabled = false; Task t = Task.Run(() => { int accountCount = AccountDBManager.INSTANCE.getAccountCount(); Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { // https://docs.microsoft.com/en-us/uwp/api/windows.security.credentials.passwordvault.add#Windows_Security_Credentials_PasswordVault_Add_Windows_Security_Credentials_PasswordCredential_ if (accountCount >= 15) { TextDialog dialog = new TextDialog(Localisation.getLocalizedString("AccountSettingsPage_too_many_accounts_text"), "Error!"); await UiUtils.showDialogAsyncQueue(dialog); } else { (Window.Current.Content as Frame).Navigate(typeof(AddAccountPage)); } addAccount_prgr.Visibility = Visibility.Visible; addAccount_btn.IsEnabled = false; }).AsTask(); }); }
/// <summary> /// Rename current project /// </summary> private void RenameProject() { // name the project TextDialog dialog = new TextDialog("Please enter a new name for the project"); dialog.ShowDialog(); Project.Current.Title = dialog.Answer; }
public HybrasylDialog NewTextDialog(string displayText, string topCaption, string bottomCaption, int inputLength = 254, dynamic handler = null, dynamic callback = null) { var dialog = new TextDialog(displayText, topCaption, bottomCaption, inputLength); dialog.setInputHandler(handler); dialog.SetCallbackHandler(callback); return(new HybrasylDialog(dialog)); }
private void onRemoveBookmarkTimeout() { Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TextDialog dialog = new TextDialog("Failed to remove bookmark!\nServer did not respond in time.", "Error"); Task t = UiUtils.showDialogAsyncQueue(dialog); }).AsTask(); }
private async void logLevelDebug_btn_Click(object sender, RoutedEventArgs e) { TextDialog dialog = new TextDialog() { Title = "Warning", Text = "If you set the log-level to 'Debug' you may experience performance and connection problems, because EVERY send and received XML message gets logged!" }; await UiUtils.showDialogAsyncQueue(dialog); }
protected virtual void exceptionTextBox_DoubleClick(object sender, EventArgs e) { using (TextDialog dialog = new TextDialog("Exception", exceptionTextBox.Text, ReadOnly || !Content.CanChangeDescription)) { if (dialog.ShowDialog(this) == DialogResult.OK) { Content.Description = dialog.Content; } } }
private void infoLabel_DoubleClick(object sender, System.EventArgs e) { using (TextDialog dialog = new TextDialog("Description of " + Content.Name, Content.Description, ReadOnly || !Content.CanChangeDescription)) { if (dialog.ShowDialog(this) == DialogResult.OK) { Content.Description = dialog.Content; } } }
public static async Task ShowMessageAsync(string title, string message, string button = "确认") { var dialog2 = new TextDialog(title, message, button); await dialog2.ShowAsync(); //var dialog = new MessageDialog(message, title); //dialog.Commands.Add(new UICommand(button)); //await dialog.ShowAsync(); }
protected virtual void infoLabel_DoubleClick(object sender, EventArgs e) { const string caption = "Degree of Parallelism Description"; const string description = @"Specifies the maximum degree of parallelization (-1 no limit given) to balance the maximum processor load. For further information see http://msdn.microsoft.com/en-us/library/system.threading.tasks.paralleloptions.maxdegreeofparallelism.aspx"; using (TextDialog dialog = new TextDialog(caption, description, true)) { dialog.ShowDialog(this); } }
protected void descriptionTextBox_DoubleClick(object sender, EventArgs e) { using (TextDialog dialog = new TextDialog("Description of " + Content.Name, descriptionTextBox.Text, ReadOnly)) { if (dialog.ShowDialog(this) == DialogResult.OK) { Content.Description = dialog.Content; } } }
/// <summary> /// The <see cref="Control.Click"/> event handler for the /// <see cref="Button"/> <see cref="btnInstruction"/>. /// Shows a <see cref="TextDialog"/> to define a textual /// instruction that is added to all imported slides. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">An empty <see cref="EventArgs"/></param> private void btnInstruction_Click(object sender, EventArgs e) { TextDialog dlg = new TextDialog(); if (dlg.ShowDialog() == DialogResult.OK) { VGText text = dlg.NewText; this.cbbDesignedItem.Items.Add(text); this.cbbDesignedItem.SelectedItem = text; } }
/// <summary> /// Rename the diagram /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnDoubleClickTab_RenameDiagram(object sender, MouseButtonEventArgs e) { if (e.ClickCount < 2) { return; } TextDialog dialog = new TextDialog("Please enter a new name for the diagram"); dialog.ShowDialog(); this.Title = dialog.Answer; }
private void AddDeviceGroup_OnClick(object sender, RoutedEventArgs e) { var w = new TextDialog("Device group name"); w.ShowDialog(); if (!w.DialogResult.HasValue || !w.DialogResult.Value) { return; } GetViewModel().AddDeviceGroup(w.TextResult); }
protected void ControlToolTip_DoubleClick(object sender, EventArgs e) { Control control = sender as Control; if (control != null) { using (TextDialog dialog = new TextDialog(control.Name, (string)control.Tag, true)) { dialog.ShowDialog(this); } } }
public override IEnumerator StartLevel() { { var dialog = new TextDialog(); dialog.Snippets.Add(new TextSnippet { text = "Soon some shapes started to appear." }); yield return(Director.Instance.WaitForDialog(dialog, block: true)); } yield return(new WaitForSeconds(1.0f)); }
private void ConfigureClipSize(object sender, RoutedEventArgs e) { var dialog = new TextDialog("Enter Ammount of ammo that a clip can contain", "Configure Clip Size", Settings.Default.ClipSize); dialog.ShowDialog(); if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { VariableStorage.ViewModel.ClipSize = dialog.GetEnteredText(); Settings.Default.ClipSize = dialog.GetEnteredText(); Settings.Default.Save(); } }
public override IEnumerator StartLevel() { { var dialog = new TextDialog(); dialog.Snippets.Add(new TextSnippet { text = "Finally some color appeared." }); yield return(Director.Instance.WaitForDialog(dialog, block: false)); } yield return(new WaitForSeconds(1.0f)); }
private void OnTriggerStay2D(Collider2D collision) { if (collision.tag == "Player") { if (Input.GetKeyDown(KeyCode.W)) { TextDialog dialog = Instantiate(textDialog, transform.position + textOffset, Quaternion.identity); TextMesh texto = dialog.GetComponentInChildren <TextMesh>(); texto.text = text; } } }
/// <summary> /// Create a new text dialog (a dialog that asks a player a question; the player can type in a response). /// </summary> /// <param name="displayText">The text to be displayed in the dialog</param> /// <param name="topCaption">The top caption of the text box input</param> /// <param name="bottomCaption">The bottom caption of the text box input</param> /// <param name="inputLength">The maximum length (up to 254 characters) of the text that can be typed into the dialog by the player</param> /// <param name="callback">The callback function or lua expression that will fire when this dialog is shown to a player.</param> /// <param name="handler">The function or lua expression that will handle the response once the player hits enter / hits next.</param> /// <returns>The constructed dialog</returns> public HybrasylDialog NewTextDialog(string displayText, string topCaption, string bottomCaption, int inputLength = 254, string callback = "", string handler = "") { if (string.IsNullOrEmpty(displayText)) { GameLog.Error("NewTextDialog: display text (first argument) was null"); return(null); } var dialog = new TextDialog(displayText, topCaption, bottomCaption, inputLength); dialog.SetInputHandler(handler); dialog.SetCallbackHandler(callback); return(new HybrasylDialog(dialog)); }
public override void OnMouseDown(DrawArea drawArea, MouseEventArgs e) { Point p = drawArea.BackTrackMouse(new Point(e.X, e.Y)); TextDialog td = new TextDialog(); td.Location = new Point(e.X, e.Y + drawArea.Top + td.Height); if (td.ShowDialog() == DialogResult.OK) { string t = td.TheText; Color c = td.TheColor; Font f = td.TheFont; AddNewObject(drawArea, new DrawText(p.X, p.Y, t, f, c)); } }
public HybrasylDialog NewTextDialog(String displayText, String topCaption, string bottomCaption, int inputLength = 254, dynamic handler = null, dynamic callback = null) { var dialog = new TextDialog(displayText, topCaption, bottomCaption, inputLength); dialog.setInputHandler(handler); dialog.SetCallbackHandler(callback); return new HybrasylDialog(dialog); }
public void SetDialog(TextDialog newDialog) { this.gameObject.SetActive(true); this.dialog = newDialog; textField.text = this.dialog.Text; }
/// <summary> /// Rename the diagram /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnDoubleClickTab_RenameDiagram(object sender, MouseButtonEventArgs e) { if (e.ClickCount < 2) return; TextDialog dialog = new TextDialog("Please enter a new name for the diagram"); dialog.ShowDialog(); this.Title = dialog.Answer; }