OSDN Git Service

no message
authorwagashi <wagashi@users.sourceforge.jp>
Thu, 18 Nov 2010 17:41:33 +0000 (02:41 +0900)
committerwagashi <wagashi@users.sourceforge.jp>
Thu, 18 Nov 2010 17:41:33 +0000 (02:41 +0900)
components/AutoCompleteTextBox.cs
components/SearchTextBox.cs
passer/AddCommandForm.cs
passer/AddEngineForm.cs
passer/MainForm.cs
passer/MainFormEvent.cs
passer/Passer.csproj
passer/Passer.csproj.user
passer/Passer.suo
utils/Win32.cs

index 40cca29..06c5252 100644 (file)
@@ -64,7 +64,7 @@ namespace Lugens.Components
         /// IME変換時のイベントハンドラ
         /// </summary>
         /// <param name="type"></param>
-        public delegate void ImeCompositionEventHandler(string text);
+        public delegate void ImeCompositionEventHandler(int type, string text);
         public event ImeCompositionEventHandler ImeComposition;
 
         private bool complemented = false;
@@ -352,8 +352,8 @@ namespace Lugens.Components
             switch (m.Msg)
             {
                 case 0x010F: //WM_IME_COMPOSITION
-                    if (((int)m.LParam & GCS_COMPSTR) == GCS_COMPSTR)
-                    {
+                    //if (((int)m.LParam & GCS_COMPSTR) == GCS_COMPSTR)
+                    //{
                         IntPtr hIMC = ImmGetContext(this.Handle);
                         StringBuilder sb = new StringBuilder(1024);
                         byte[] buffer = new byte[1024];
@@ -361,8 +361,8 @@ namespace Lugens.Components
                         ImmReleaseContext(this.Handle, hIMC);
                         string str = Encoding.GetEncoding("Shift_JIS").GetString(buffer);
                         str = str.TrimEnd('\0');
-                        this.ImeComposition(str);
-                    }
+                        this.ImeComposition((int)m.LParam, str);
+                    //}
                     break;
             }
             base.WndProc(ref m);
index 7787a34..ea6c33f 100644 (file)
@@ -86,9 +86,9 @@ namespace Lugens.Components
             this.label.Visible = String.IsNullOrEmpty(this.textBox.Text);
         }
 
-        private void textBox_ImeComposition(string text)
+        private void textBox_ImeComposition(int type, string text)
         {
-            this.label.Visible = String.IsNullOrEmpty(text);
+            this.label.Visible =  String.IsNullOrEmpty(this.textBox.Text) && String.IsNullOrEmpty(text);
         }
     }
 }
index aa01a0e..f1544c7 100644 (file)
@@ -122,7 +122,8 @@ namespace Lugens.Passer
         {
             if (Program.SettingForm == null)
                 return;
-            if (this.textBox_command.Text.Length == 0)
+
+            if (String.IsNullOrEmpty(this.textBox_command.Text))
             {
                 this.label_duplicate.Visible = false;
                 this.button_ok.Enabled = false;
index a2a2669..b7cac29 100644 (file)
@@ -145,6 +145,9 @@ namespace Lugens.Passer
 
         private void textBox_name_TextChanged(object sender, EventArgs e)
         {
+            if (String.IsNullOrEmpty(this.textBox_name.Text))
+                return;
+
             if (this.textBox_name.Text[0] == '@')
             {
                 this.label_engine_duplicate.Text = "※先頭に@は使用できません";
index 1f91872..49ec373 100644 (file)
@@ -864,9 +864,11 @@ namespace Lugens.Passer
                             }
 
                             this.searchTextBox.TextBox.SetDropdownFormLocation();
-                            //this.searchTextBox.TextBox.DropdownForm.DropdownListBox.SelectedIndex = 0;
                             this.searchTextBox.TextBox.DropdownForm.DoVisibleChange(true);
-                            //this.searchTextBox.TextBox.DropdownForm.DropdownListBox.SelectedIndex = -1;
+                        }
+                        else
+                        {
+                            this.searchTextBox.TextBox.DropdownForm.DoVisibleChange(false);
                         }
                     }
                     break;
index 398c69d..7f34e40 100644 (file)
@@ -581,15 +581,29 @@ namespace Lugens.Passer
             //this.ShowFileList();
         }
 
-        private void textBox_cmd_ImeComposition(string text)
+        private void textBox_cmd_ImeComposition(int type, string text)
         {
-            Debug.WriteLine("ImeComposition:" + suggestString + "," + text);
-            if (String.IsNullOrEmpty(text)){
+            if(!String.IsNullOrEmpty(this.searchTextBox.TextBox.Text))
+            {
+                string str = this.searchTextBox.TextBox.Text;
+                text = str.Substring(0, this.searchTextBox.TextBox.SelectionStart)
+                     + text
+                     + str.Substring(this.searchTextBox.TextBox.SelectionStart);
+            }
+
+            Debug.WriteLine("str:" + text);
+
+            Debug.WriteLine("ImeComposition:(" + type + ") " + suggestString + "," + text);
+            if (String.IsNullOrEmpty(text))
+            {
                 this.searchTextBox.TextBox.DropdownForm.DoVisibleChange(false);
                 this.suggestString = "";
             }
             else
-                this.SetEngineDropdownList(text);
+            {
+                if((type & Win32.GCS_RESULTSTR) != Win32.GCS_RESULTSTR)
+                    this.SetEngineDropdownList(text);
+            }
         }
 
         private void dropdownListBox_SelectedIndexChanged(object sender, EventArgs e)
index c102299..aa6fef9 100644 (file)
     <UseVSHostingProcess>false</UseVSHostingProcess>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Newtonsoft.Json.Net20, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>bin\Release\Newtonsoft.Json.Net20.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Data" />
     <Reference Include="System.Deployment" />
     <Reference Include="System.Drawing" />
+    <Reference Include="System.Web" />
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml" />
   </ItemGroup>
index fef3cfc..5fdc88d 100644 (file)
@@ -10,4 +10,7 @@
     <FallbackCulture>ja-JP</FallbackCulture>
     <VerifyUploadedFiles>false</VerifyUploadedFiles>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
+    <EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
+  </PropertyGroup>
 </Project>
\ No newline at end of file
index e6645e4..b898537 100644 (file)
Binary files a/passer/Passer.suo and b/passer/Passer.suo differ
index 462d616..491c767 100644 (file)
@@ -86,6 +86,9 @@ namespace Lugens.Utils
         public const int WM_IME_REQUEST = 0x0288;
         public const int IMR_QUERYCHARPOSITION = 0x0006;
 
+        public const int GCS_COMPSTR = 0x0008;
+        public const int GCS_RESULTSTR = 0x0800;
+        
         [StructLayout(LayoutKind.Sequential)]
         public struct KeyboardHookStruct
         {