OSDN Git Service

no message
authorwagashi <wagashi@users.sourceforge.jp>
Thu, 18 Nov 2010 11:55:09 +0000 (20:55 +0900)
committerwagashi <wagashi@users.sourceforge.jp>
Thu, 18 Nov 2010 11:55:09 +0000 (20:55 +0900)
components/AutoCompleteTextBox.cs
components/DropdownListForm.cs
components/IconListBox.cs
passer/MainForm.cs
passer/MainFormEvent.cs

index f21f931..40cca29 100644 (file)
@@ -352,14 +352,17 @@ namespace Lugens.Components
             switch (m.Msg)
             {
                 case 0x010F: //WM_IME_COMPOSITION
-                    IntPtr hIMC = ImmGetContext(this.Handle);
-                    StringBuilder sb = new StringBuilder(1024);
-                    byte[] buffer = new byte[1024];
-                    int length = ImmGetCompositionString(hIMC, GCS_COMPSTR, buffer, 1024);
-                    ImmReleaseContext(this.Handle, hIMC);
-                    string str = Encoding.GetEncoding("Shift_JIS").GetString(buffer);
-                    str = str.TrimEnd('\0');
-                    this.ImeComposition(str);
+                    if (((int)m.LParam & GCS_COMPSTR) == GCS_COMPSTR)
+                    {
+                        IntPtr hIMC = ImmGetContext(this.Handle);
+                        StringBuilder sb = new StringBuilder(1024);
+                        byte[] buffer = new byte[1024];
+                        int length = ImmGetCompositionString(hIMC, GCS_COMPSTR, buffer, 1024);
+                        ImmReleaseContext(this.Handle, hIMC);
+                        string str = Encoding.GetEncoding("Shift_JIS").GetString(buffer);
+                        str = str.TrimEnd('\0');
+                        this.ImeComposition(str);
+                    }
                     break;
             }
             base.WndProc(ref m);
index 6da9b6f..920c1c9 100644 (file)
@@ -177,7 +177,6 @@ namespace Lugens.Components
         {
             if (visible)
             {
-
                 this.Opacity = this.parentTextBox.FindForm().Opacity;
                 this.Visible = true;
             }
index 90e95e9..c6bffdf 100644 (file)
@@ -450,7 +450,7 @@ namespace Lugens.Components
         {
             DrawItemEventArgs ea;
             Rectangle r = new Rectangle();
-            for(int i = this.TopIndex; (i < this.Items.Count) && (i < this.TopIndex + this.showItemCount); i++)
+            for (int i = this.TopIndex; (i < this.Items.Count) && (i < this.TopIndex + this.showItemCount); i++)
             {
                 r.X = 0;
                 r.Y = (i - this.TopIndex) * this.ItemHeight;
index 30303e7..1f91872 100644 (file)
@@ -472,7 +472,7 @@ namespace Lugens.Passer
                     }
                     try
                     {
-                        System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo();
+                        ProcessStartInfo info = new ProcessStartInfo();
                         CommandInfo commandInfo = Program.CommandDic[str];
                         info.FileName = EnvDeploy(commandInfo.Target);
                         info.WorkingDirectory = EnvDeploy(commandInfo.Path);
@@ -481,7 +481,7 @@ namespace Lugens.Passer
                         this.DoVisibleChange(false);
                         return true;
                     }
-                    catch
+                    catch (Exception ex) { MessageBox.Show("ex: " + ex.ToString()); }
                     {
                         return false;
                     }
@@ -862,9 +862,11 @@ namespace Lugens.Passer
                                 item.Type = IconListBoxType.SearchEngine;
                                 this.searchTextBox.TextBox.DropdownForm.DropdownListBox.Items.Add(item);
                             }
-                            this.searchTextBox.TextBox.DropdownForm.DoVisibleChange(true);
+
                             this.searchTextBox.TextBox.SetDropdownFormLocation();
                             //this.searchTextBox.TextBox.DropdownForm.DropdownListBox.SelectedIndex = 0;
+                            this.searchTextBox.TextBox.DropdownForm.DoVisibleChange(true);
+                            //this.searchTextBox.TextBox.DropdownForm.DropdownListBox.SelectedIndex = -1;
                         }
                     }
                     break;
index 0ca9fc0..398c69d 100644 (file)
@@ -40,11 +40,6 @@ namespace Lugens.Passer
             if (this.searchTextBox.TextBox.DropdownForm.Visible)
                 this.searchTextBox.TextBox.DropdownForm.DoVisibleChange(false);
 
-            //リージョン設定
-            //IntPtr hRgn = Win32.CreateRoundRectRgn(0, 0, this.Size.Width, this.Size.Height, 6, 6);
-            //Win32.SetWindowRgn(this.Handle, hRgn, true);
-
-        
         }
 
         private void MainForm_MouseDown(object sender, MouseEventArgs e)
@@ -123,8 +118,11 @@ namespace Lugens.Passer
                     break;
 
                 case 2: //WebSearch
-                    if(String.IsNullOrEmpty(this.searchTextBox.TextBox.Text))
+                    if (String.IsNullOrEmpty(this.searchTextBox.TextBox.Text))
+                    {
                         this.searchTextBox.TextBox.DropdownForm.DoVisibleChange(false);
+                        this.suggestString = "";
+                    }
                     else
                         this.SetEngineDropdownList(this.searchTextBox.TextBox.Text);
                     break;
@@ -324,7 +322,7 @@ namespace Lugens.Passer
                             }
                         }
                     }
-                    catch { }
+                    catch (Exception ex) { MessageBox.Show("ex: " + ex.ToString()); }
                 }
                 else
                 {
@@ -376,6 +374,7 @@ namespace Lugens.Passer
         /// </summary>
         public void SetEngineDropdownList(string text)
         {
+            Debug.WriteLine("SetEngineDropdownList:" + suggestString + "," + text);
             if (this.suggestString.Equals(text))
                 return;
 
@@ -584,8 +583,11 @@ namespace Lugens.Passer
 
         private void textBox_cmd_ImeComposition(string text)
         {
-            if (String.IsNullOrEmpty(text))
+            Debug.WriteLine("ImeComposition:" + suggestString + "," + text);
+            if (String.IsNullOrEmpty(text)){
                 this.searchTextBox.TextBox.DropdownForm.DoVisibleChange(false);
+                this.suggestString = "";
+            }
             else
                 this.SetEngineDropdownList(text);
         }
@@ -597,6 +599,8 @@ namespace Lugens.Passer
                 return;
 
             IconListBox listBox = this.searchTextBox.TextBox.DropdownForm.DropdownListBox;
+            if (listBox.SelectedIndex == -1)
+                return;
 
             string text = listBox.Text;
             if (text.Equals(this.dropdownListBoxText))