OSDN Git Service

- ジェスチャーが設定されていない項目を選択しても「なし」と表示されないバグを修正。
authoryoffy <yoffy>
Wed, 13 Oct 2004 23:28:32 +0000 (23:28 +0000)
committeryoffy <yoffy>
Wed, 13 Oct 2004 23:28:32 +0000 (23:28 +0000)
- Shift キーを押したまま [設定] を実行しても、エディットボックスが空になるだけで
 リストボックスの設定がクリアされないバグを修正。

KeySetting.dfm
KeySetting.pas

index 602a776..e72e2be 100644 (file)
@@ -91,6 +91,7 @@ object KeySettingForm: TKeySettingForm
         ReadOnly = True
         TabOrder = 2
         Text = #12394#12375
+        OnChange = GestureEditChange
       end
       object GestureSetButton: TButton
         Left = 272
index 25217a1..0e636ae 100644 (file)
@@ -57,6 +57,7 @@ type
                procedure OnGestureMove(Sender: TObject);
                procedure OnGestureEnd(Sender: TObject);
     procedure GestureCheckBoxClick(Sender: TObject);
+    procedure GestureEditChange(Sender: TObject);
        private
                { Private \90é\8c¾ }
        public
@@ -70,6 +71,8 @@ type
 implementation
 
 uses Giko, Gesture;
+const
+       GUESTURE_NOTHING        = '\82È\82µ';
 
 {$R *.dfm}
 
@@ -166,6 +169,7 @@ begin
        if TObject(Item.Data) is TKeySettingItem then begin
                KeyItem := TKeySettingItem(Item.Data);
                HotKey.HotKey := KeyItem.ShortCut;
+               GestureEdit.Text := KeyItem.Gesture;
        end;
 end;
 
@@ -292,6 +296,7 @@ begin
        if ActiveListView.Selected = nil then Exit;
        if (GetKeyState( VK_SHIFT ) and $80000000) <> 0 then begin
                GestureEdit.Text := '';
+               ActiveListView.Selected.SubItems[2] := '';
                Exit;
        end;
 
@@ -302,7 +307,8 @@ begin
                Item := ActiveListView.Items[i];
                if TObject(Item.Data) is TKeySettingItem then begin
                        KeyItem := TKeySettingItem(Item.Data);
-                       if KeyItem.Gesture = GestureEdit.Text then begin
+                       if (GestureEdit.Text <> '')
+                       and (KeyItem.Gesture = GestureEdit.Text) then begin
                                MsgBox(Handle, ERR_MSG, ERR_TITLE, MB_OK or MB_ICONSTOP);
                                HotKey.SetFocus;
                                Exit;
@@ -313,7 +319,10 @@ begin
        if TObject(ActiveListView.Selected.Data) is TKeySettingItem then begin
                KeyItem := TKeySettingItem(ActiveListView.Selected.Data);
                KeyItem.Gesture := GestureEdit.Text;
-               ActiveListView.Selected.SubItems[2] := GestureEdit.Text;
+               if GestureEdit.Text = GUESTURE_NOTHING then
+                       ActiveListView.Selected.SubItems[2] := ''
+               else
+                       ActiveListView.Selected.SubItems[2] := GestureEdit.Text;
        end;
 end;
 
@@ -338,4 +347,12 @@ begin
        GestureSetButton.Enabled := GestureCheckBox.Checked;
 end;
 
+procedure TKeySettingForm.GestureEditChange(Sender: TObject);
+begin
+
+       if GestureEdit.Text = '' then
+               GestureEdit.Text := GUESTURE_NOTHING;
+
+end;
+
 end.