・ListeningMessenderで入力チェックをするようにした
・ワンクリックで画面を表示するようにした
@@ -24,12 +24,19 @@ | ||
24 | 24 | |
25 | 25 | private void sendBtn_Click(object sender, EventArgs e) |
26 | 26 | { |
27 | - Program.m_form.tweetBox.Text = string.Format(SettingsXml.Instance.template, textBox1.Text, textBox2.Text, "", "", ""); | |
28 | - if (!Program.m_form.PostTweet(false)) | |
27 | + if (textBox1.Text.Trim().Length != 0 || textBox2.Text.Trim().Length != 0) | |
29 | 28 | { |
30 | - MessageBox.Show("投稿できませんでした。内容を確認してください。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); | |
29 | + Program.m_form.tweetBox.Text = string.Format(SettingsXml.Instance.template, textBox1.Text, textBox2.Text, "", "", ""); | |
30 | + if (!Program.m_form.PostTweet(false)) | |
31 | + { | |
32 | + MessageBox.Show("投稿できませんでした。内容を確認してください。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); | |
33 | + } | |
34 | + textBox1.Clear(); textBox2.Clear(); | |
31 | 35 | } |
32 | - textBox1.Clear(); textBox2.Clear(); | |
36 | + else | |
37 | + { | |
38 | + MessageBox.Show("曲名またはアーティスト名を入力してください。", "入力エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); | |
39 | + } | |
33 | 40 | } |
34 | 41 | |
35 | 42 | //インスタンスを作成せずログを表示させるメソッド |
@@ -40,6 +40,9 @@ | ||
40 | 40 | this.つぶやきログLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); |
41 | 41 | this.listeningMessenderMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); |
42 | 42 | this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); |
43 | + this.wikiToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |
44 | + this.バージョン情報AToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |
45 | + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); | |
43 | 46 | this.終了XToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); |
44 | 47 | this.label1 = new System.Windows.Forms.Label(); |
45 | 48 | this.postBtn = new System.Windows.Forms.Button(); |
@@ -47,9 +50,6 @@ | ||
47 | 50 | this.tweetBox = new System.Windows.Forms.TextBox(); |
48 | 51 | this.OneSecTimer = new System.Windows.Forms.Timer(this.components); |
49 | 52 | this.charcount = new System.Windows.Forms.Label(); |
50 | - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); | |
51 | - this.wikiToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |
52 | - this.バージョン情報AToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); | |
53 | 53 | this.mainContextMenu.SuspendLayout(); |
54 | 54 | this.SuspendLayout(); |
55 | 55 | // |
@@ -57,7 +57,7 @@ | ||
57 | 57 | // |
58 | 58 | this.notifyIcon1.ContextMenuStrip = this.mainContextMenu; |
59 | 59 | this.notifyIcon1.Text = "りすにんぐついったー"; |
60 | - this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick); | |
60 | + this.notifyIcon1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseClick); | |
61 | 61 | // |
62 | 62 | // mainContextMenu |
63 | 63 | // |
@@ -76,7 +76,7 @@ | ||
76 | 76 | this.toolStripSeparator4, |
77 | 77 | this.終了XToolStripMenuItem}); |
78 | 78 | this.mainContextMenu.Name = "mainContextMenu"; |
79 | - this.mainContextMenu.Size = new System.Drawing.Size(211, 248); | |
79 | + this.mainContextMenu.Size = new System.Drawing.Size(211, 226); | |
80 | 80 | // |
81 | 81 | // メイン画面を表示VToolStripMenuItem |
82 | 82 | // |
@@ -138,6 +138,25 @@ | ||
138 | 138 | this.toolStripSeparator3.Name = "toolStripSeparator3"; |
139 | 139 | this.toolStripSeparator3.Size = new System.Drawing.Size(207, 6); |
140 | 140 | // |
141 | + // wikiToolStripMenuItem | |
142 | + // | |
143 | + this.wikiToolStripMenuItem.Name = "wikiToolStripMenuItem"; | |
144 | + this.wikiToolStripMenuItem.Size = new System.Drawing.Size(210, 22); | |
145 | + this.wikiToolStripMenuItem.Text = "&Wiki"; | |
146 | + this.wikiToolStripMenuItem.Click += new System.EventHandler(this.wikiToolStripMenuItem_Click); | |
147 | + // | |
148 | + // バージョン情報AToolStripMenuItem | |
149 | + // | |
150 | + this.バージョン情報AToolStripMenuItem.Name = "バージョン情報AToolStripMenuItem"; | |
151 | + this.バージョン情報AToolStripMenuItem.Size = new System.Drawing.Size(210, 22); | |
152 | + this.バージョン情報AToolStripMenuItem.Text = "バージョン情報(&A)"; | |
153 | + this.バージョン情報AToolStripMenuItem.Click += new System.EventHandler(this.バージョン情報AToolStripMenuItem_Click); | |
154 | + // | |
155 | + // toolStripSeparator4 | |
156 | + // | |
157 | + this.toolStripSeparator4.Name = "toolStripSeparator4"; | |
158 | + this.toolStripSeparator4.Size = new System.Drawing.Size(207, 6); | |
159 | + // | |
141 | 160 | // 終了XToolStripMenuItem |
142 | 161 | // |
143 | 162 | this.終了XToolStripMenuItem.Name = "終了XToolStripMenuItem"; |
@@ -206,25 +225,6 @@ | ||
206 | 225 | this.charcount.Text = "残り140文字"; |
207 | 226 | this.charcount.TextAlign = System.Drawing.ContentAlignment.BottomRight; |
208 | 227 | // |
209 | - // toolStripSeparator4 | |
210 | - // | |
211 | - this.toolStripSeparator4.Name = "toolStripSeparator4"; | |
212 | - this.toolStripSeparator4.Size = new System.Drawing.Size(207, 6); | |
213 | - // | |
214 | - // wikiToolStripMenuItem | |
215 | - // | |
216 | - this.wikiToolStripMenuItem.Name = "wikiToolStripMenuItem"; | |
217 | - this.wikiToolStripMenuItem.Size = new System.Drawing.Size(210, 22); | |
218 | - this.wikiToolStripMenuItem.Text = "&Wiki"; | |
219 | - this.wikiToolStripMenuItem.Click += new System.EventHandler(this.wikiToolStripMenuItem_Click); | |
220 | - // | |
221 | - // バージョン情報AToolStripMenuItem | |
222 | - // | |
223 | - this.バージョン情報AToolStripMenuItem.Name = "バージョン情報AToolStripMenuItem"; | |
224 | - this.バージョン情報AToolStripMenuItem.Size = new System.Drawing.Size(210, 22); | |
225 | - this.バージョン情報AToolStripMenuItem.Text = "バージョン情報(&A)"; | |
226 | - this.バージョン情報AToolStripMenuItem.Click += new System.EventHandler(this.バージョン情報AToolStripMenuItem_Click); | |
227 | - // | |
228 | 228 | // MainForm |
229 | 229 | // |
230 | 230 | this.AcceptButton = this.postBtn; |
@@ -50,7 +50,7 @@ | ||
50 | 50 | bool re = false; |
51 | 51 | var tweet = tweetBox.Text; |
52 | 52 | |
53 | - if (!(this.Visible && tweetBox.Focused) && tweet != oldData && !string.IsNullOrEmpty(tweet)) | |
53 | + if (!(this.Visible && tweetBox.Focused) && tweet != oldData && !string.IsNullOrEmpty(tweet.Trim())) | |
54 | 54 | { |
55 | 55 | OneSecTimer.Stop(); |
56 | 56 | timeLbl.Text = "Sending..."; |
@@ -229,11 +229,6 @@ | ||
229 | 229 | } |
230 | 230 | } |
231 | 231 | |
232 | - private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) | |
233 | - { | |
234 | - this.Visible = true; | |
235 | - } | |
236 | - | |
237 | 232 | private void tweetBox_Enter(object sender, EventArgs e) |
238 | 233 | { |
239 | 234 | if (!over) |
@@ -353,5 +348,13 @@ | ||
353 | 348 | { |
354 | 349 | MessageBox.Show("りすにんぐついったー\n\nVersion " + version, "りすにんぐついったー", MessageBoxButtons.OK, MessageBoxIcon.Information); |
355 | 350 | } |
351 | + | |
352 | + private void notifyIcon1_MouseClick(object sender, MouseEventArgs e) | |
353 | + { | |
354 | + if (e.Button == MouseButtons.Left) | |
355 | + { | |
356 | + this.Visible = true; | |
357 | + } | |
358 | + } | |
356 | 359 | } |
357 | 360 | } |