OSDN Git Service

入力アシストのキー更新時にも重複チェックを入れた。
authorh677 <h677>
Sat, 21 Jul 2007 01:56:29 +0000 (01:56 +0000)
committerh677 <h677>
Sat, 21 Jul 2007 01:56:29 +0000 (01:56 +0000)
InputAssist.pas
InputAssistDataModule.pas

index 852e305..8957a46 100644 (file)
@@ -177,15 +177,20 @@ begin
                if (Length(KeyNameEdit.Text) = 0) then begin
                        ShowMessage('\83L\81[\96¼\82ð\96³\82µ\82É\82Í\82Å\82«\82Ü\82¹\82ñ\81B');
                end else begin
-                       resWord := TResistWord(GikoListView1.Selected.Data);
-                       resWord.SetKey(KeyNameEdit.Text);
-                       resWord.SetCategory(CategoryNameComboBox.Text);
-                       resWord.SetText(TextMemo.Text);
-                       // \88ê\97\97\82Ì\8dX\90V
-                       GikoListView1.Selected.Caption := resWord.GetKey;
-                       GikoListView1.Selected.SubItems[0] := resWord.GetCategory;
-            SetCategory(CategoryNameComboBox);
-                       GikoListView1.AlphaSort;
+            if (not InputAssistDM.IsDupulicate(
+                       KeyNameEdit.Text, CategoryNameComboBox.Text) ) then begin
+                       resWord := TResistWord(GikoListView1.Selected.Data);
+                       resWord.SetKey(KeyNameEdit.Text);
+                           resWord.SetCategory(CategoryNameComboBox.Text);
+                       resWord.SetText(TextMemo.Text);
+                       // \88ê\97\97\82Ì\8dX\90V
+                           GikoListView1.Selected.Caption := resWord.GetKey;
+                       GikoListView1.Selected.SubItems[0] := resWord.GetCategory;
+                SetCategory(CategoryNameComboBox);
+                       GikoListView1.AlphaSort;
+               end else begin
+                       ShowMessage('\93¯\88ê\82Ì\83L\81[\96¼\81E\83J\83e\83S\83\8a\96¼\82Å\8aù\82É\93o\98^\8dÏ\82Ý\82Å\82·\81B');
+                   end;
                end;
        end;
 end;
index a5626d4..1b6f584 100644 (file)
@@ -408,7 +408,6 @@ end;
 function TInputAssistDM.IsDupulicate(Key: String; Category: String): Boolean;
 var
        i : Integer;
-//     resWord : TResistWord;
 begin
        // \82±\82Ì\83\81\83\\83b\83h\82Å\82Í\81A\83\\81[\83g\8dÏ\82Ý\82Æ\82Í\8cÀ\82ç\82È\82¢\82Ì\82Å\81A\91S\82Ä\82Ì\83L\81[\82ð\92T\8dõ\82µ\82Ä\82¢\82é
        Result := False;