private void QuickEditTextWin_FormClosed(object sender, FormClosedEventArgs e) { string text = this.MainText.Text; text = text.Trim(); text = text.Replace("\r", ""); text = Utils2.Escape(text); this.RetText = text; }
public QuickEditTextWin(RectWin parentWin, string text) { InitializeComponent(); this.ParentWin = parentWin; if (text != null) { text = Utils2.Unescape(text); text = text.Replace("\n", "\r\n"); this.MainText.Text = text; } }
private void LoadData() { string text = this.RI.Text; text = Utils2.Unescape(text); text = text.Replace("\n", "\r\n"); this.TextText.Text = text; this.FontCombo.Text = this.RI.TextFont; this.SizeText.Text = "" + this.RI.TextSize; this.ColorRText.Text = "" + this.RI.TextColorR; this.ColorGText.Text = "" + this.RI.TextColorG; this.ColorBText.Text = "" + this.RI.TextColorB; }
private void テキストをファイルに保存するSToolStripMenuItem_Click(object sender, EventArgs e) { string outFile = SaveLoadDialogs.SaveFile( "保存先のファイルを指定して下さい", "テキスト:txt", Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "WindRect_Text_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt" ); if (outFile != null) { File.WriteAllText(outFile, Utils2.Unescape(this.RI.Text), Encoding.UTF8); } }
private void SaveData() { { string text = this.TextText.Text; text = text.Trim(); text = text.Replace("\r", ""); text = Utils2.Escape(text); this.RI.Text = text; } this.RI.TextFont = Tools.FontFilter(this.FontCombo.Text); this.RI.TextSize = Tools.ParseInt(this.SizeText.Text, 1, 300, 10); this.RI.TextColorR = Tools.ParseInt(this.ColorRText.Text, 0, 255, 255); this.RI.TextColorG = Tools.ParseInt(this.ColorGText.Text, 0, 255, 255); this.RI.TextColorB = Tools.ParseInt(this.ColorBText.Text, 0, 255, 255); }
private void UpdateUi() { this.Location = new Point(this.RI.XPos, this.RI.YPos); this.Size = new Size(this.RI.WinW, this.RI.WinH); this.BackColor = Color.FromArgb(this.RI.WinColorR, this.RI.WinColorG, this.RI.WinColorB); this.ドラッグで移動MToolStripMenuItem.Checked = this.RI.MovableFlag; this.常に手前に表示TToolStripMenuItem.Checked = this.RI.MostTop; this.TopMost = this.RI.MostTop; this.Opacity = 1.0 - this.RI.透明度Pct / 100.0; try { if (this.RI.ImageFile != "") { this.BackgroundImage = new Bitmap(this.RI.ImageFile); this.BackgroundImageLayout = this.RI.ImageStretchFlag ? ImageLayout.Stretch : ImageLayout.Tile; } else { this.BackgroundImage = null; } } catch { try { this.BackgroundImage = null; } catch { } } try { if (string.IsNullOrEmpty(this.RI.Text)) { throw null; } string text = this.RI.Text; text = Utils2.Unescape(text); text = text.Replace("\n", "\r\n"); this.RectText.Text = text; this.RectText.Font = new Font(this.RI.TextFont, this.RI.TextSize, FontStyle.Regular); this.RectText.ForeColor = Color.FromArgb(this.RI.TextColorR, this.RI.TextColorG, this.RI.TextColorB); //this.RectText.BackColor = this.BackColor; this.RectText.Visible = true; if (Gnd.I.AdjustToTextSize) { Gnd.I.AdjustToTextSize = false; int mgn = this.RectText.Left; int w = this.RectText.Width; int h = this.RectText.Height; this.RI.WinW = mgn + w + mgn; this.RI.WinH = mgn + h + mgn; this.Size = new Size(this.RI.WinW, this.RI.WinH); } } catch { try { this.RectText.Visible = false; } catch { } } GC.Collect(); }