From ec31f4f9b3264b3422588a297caaf448edb5489a Mon Sep 17 00:00:00 2001 From: yoffy Date: Mon, 11 Oct 2004 15:59:17 +0000 Subject: [PATCH] =?utf8?q?-=20=E3=83=9E=E3=82=A6=E3=82=B9=E3=82=B8?= =?utf8?q?=E3=82=A7=E3=82=B9=E3=83=81=E3=83=A3=E3=83=BC=E3=82=92=E4=BD=BF?= =?utf8?q?=E3=81=86=E3=81=8B=E8=A8=AD=E5=AE=9A=E3=81=A7=E3=81=8D=E3=82=8B?= =?utf8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F=E3=80=82?= =?utf8?q?=20-=20=E3=83=AC=E3=82=B9=E3=82=A8=E3=83=87=E3=82=A3=E3=82=BF?= =?utf8?q?=E3=82=82=E3=83=9E=E3=82=A6=E3=82=B9=E3=82=B8=E3=82=A7=E3=82=B9?= =?utf8?q?=E3=83=81=E3=83=A3=E3=81=AB=E5=AF=BE=E5=BF=9C=E3=80=82=20?= =?utf8?q?=E2=80=BBtodo:=E3=83=A1=E3=82=A4=E3=83=B3=E3=81=A8=E3=83=AC?= =?utf8?q?=E3=82=B9=E3=82=A8=E3=83=87=E3=82=A3=E3=82=BF=E3=81=AE=E4=B8=A1?= =?utf8?q?=E6=96=B9=E3=81=AE=E3=82=B8=E3=82=A7=E3=82=B9=E3=83=81=E3=83=A3?= =?utf8?q?=E3=82=92=E6=B7=B7=E5=9C=A8=E3=81=95=E3=81=9B=E3=82=8B=E3=81=A8?= =?utf8?q?=20AV=20=E3=81=8C=E7=99=BA=E7=94=9F=E3=81=99=E3=82=8B=E3=81=AE?= =?utf8?q?=E3=81=A7=E3=80=81=20=E3=80=80GikoSys.Setting.Gestures=20?= =?utf8?q?=E3=82=92=E3=81=9D=E3=82=8C=E3=81=9E=E3=82=8C=E3=81=AE=E3=82=A6?= =?utf8?q?=E3=82=A3=E3=83=B3=E3=83=89=E3=82=A6=E7=94=A8=E3=81=AB=E7=94=A8?= =?utf8?q?=E6=84=8F=E3=81=99=E3=82=8B=E5=BF=85=E8=A6=81=E3=81=8C=E3=81=82?= =?utf8?q?=E3=82=8A=E3=81=9D=E3=81=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Editor.dfm | 1 + Editor.pas | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- Giko.dfm | 4 ++-- Giko.pas | 7 +++++-- KeySetting.dfm | 27 ++++++++++++++++-------- KeySetting.pas | 28 ++++++++++++++++++------- Setting.pas | 9 ++++++++ 7 files changed, 120 insertions(+), 21 deletions(-) diff --git a/Editor.dfm b/Editor.dfm index 4aae0dd..1cf4473 100644 --- a/Editor.dfm +++ b/Editor.dfm @@ -32,6 +32,7 @@ object EditorForm: TEditorForm OnCloseQuery = FormCloseQuery OnCreate = FormCreate OnDestroy = FormDestroy + OnDeactivate = FormDeactivate PixelsPerInch = 96 TextHeight = 12 object StatusBar: TStatusBar diff --git a/Editor.pas b/Editor.pas index 6c30b76..67dd8d7 100644 --- a/Editor.pas +++ b/Editor.pas @@ -163,6 +163,7 @@ type procedure GetHeadTXTActionExecute(Sender: TObject); procedure CalcCapasityActionExecute(Sender: TObject); procedure RuleClick(Sender: TObject); + procedure FormDeactivate(Sender: TObject); private FThreadItem: TThreadItem; FBoard: TBoard; @@ -207,6 +208,12 @@ type function GetTitlePictureURL(body: TStringList; ABoard: TBoard): string; procedure ShowTitlePicture(); function GetFusianaName(body: TStringList; ABoard: TBoard): String; + //! ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[ŠJŽn + procedure OnGestureStart(Sender: TObject); + //! ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[’† + procedure OnGestureMove(Sender: TObject); + //! ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[I—¹ + procedure OnGestureEnd(Sender: TObject); protected procedure CreateParams(var Params: TCreateParams); override; public @@ -221,7 +228,7 @@ type implementation uses - Giko, ItemDownload; + Giko, ItemDownload, Gesture; const CAPTION_NAME_NEW: string = 'ƒMƒRƒiƒr ƒXƒŒ—§‚ăGƒfƒBƒ^'; CAPTION_NAME_RES: string = 'ƒMƒRƒiƒr ƒŒƒXƒGƒfƒBƒ^'; @@ -391,6 +398,15 @@ begin ini.Free; end; + // ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[‚̃Cƒ“ƒXƒg[ƒ‹ + if GikoSys.Setting.GestureEnabled then begin + MouseGesture.UnHook; + MouseGesture.OnGestureStart := OnGestureStart; + MouseGesture.OnGestureMove := OnGestureMove; + MouseGesture.OnGestureEnd := OnGestureEnd; + MouseGesture.SetHook( Handle ); + end; + end; procedure TEditorForm.SetBoard(Item: TBoard); @@ -1455,6 +1471,13 @@ procedure TEditorForm.FormActivate(Sender: TObject); begin if ( Timer1.Enabled ) and ( FThreadItem <> nil )then ReadSambaTime(FHost); + if GikoSys.Setting.GestureEnabled then begin + MouseGesture.UnHook; + MouseGesture.OnGestureStart := OnGestureStart; + MouseGesture.OnGestureMove := OnGestureMove; + MouseGesture.OnGestureEnd := OnGestureEnd; + MouseGesture.SetHook( Handle ); + end; end; //Samba24‘΍ô‚ðŽg‚¤‚©‚Ç‚¤‚©Œˆ‚ß‚éŠÖ” //ReadSambaTime ‚ðŒÄ‚яo‚·‚ÆTimer‚ªOn‚É‚È‚é @@ -1836,4 +1859,44 @@ begin end; end; +procedure TEditorForm.FormDeactivate(Sender: TObject); +begin + if GikoSys.Setting.GestureEnabled then begin + MouseGesture.UnHook; + MouseGesture.SetHook( GikoForm.Handle ); + end; +end; + +procedure TEditorForm.OnGestureStart(Sender: TObject); +begin +// +end; + +procedure TEditorForm.OnGestureMove(Sender: TObject); +var + s: string; + Action: TAction; + ActStr: string; +begin + s := MouseGesture.GetGestureStr; + ActStr := ''; + Action := GikoSys.Setting.Gestures.GetGestureAction(s); + if Action <> nil then + ActStr := 'i' + Action.Caption + 'j'; + s := 'ƒWƒFƒXƒ`ƒƒ[: ' + s + ActStr; + StatusBar.Panels[2].Text := s; +end; + +procedure TEditorForm.OnGestureEnd(Sender: TObject); +var + s: string; + Action: TAction; +begin + s := MouseGesture.GetGestureStr; + Action := GikoSys.Setting.Gestures.GetGestureAction(s); + if Action <> nil then + Action.Execute; + StatusBar.Panels[2].Text := ''; +end; + end. diff --git a/Giko.dfm b/Giko.dfm index 83a7c91..74793f1 100644 --- a/Giko.dfm +++ b/Giko.dfm @@ -1,6 +1,6 @@ object GikoForm: TGikoForm - Left = 290 - Top = 123 + Left = 181 + Top = 126 HorzScrollBar.Visible = False VertScrollBar.Visible = False AutoScroll = False diff --git a/Giko.pas b/Giko.pas index 7661215..8ea6fa0 100644 --- a/Giko.pas +++ b/Giko.pas @@ -1725,7 +1725,8 @@ begin MouseGesture.OnGestureStart := OnGestureStart; MouseGesture.OnGestureMove := OnGestureMove; MouseGesture.OnGestureEnd := OnGestureEnd; - MouseGesture.SetHook( Handle ) + if GikoSys.Setting.GestureEnabled then + MouseGesture.SetHook( Handle ); end; // CoolBar ‚̐ݒè‚ð•Ï”‚É•Û‘¶ @@ -6955,10 +6956,12 @@ begin GikoSys.SaveEditorKeySetting(Dlg.EditorForm.ActionList); finally Dlg.Release; + MouseGesture.UnHook; MouseGesture.OnGestureStart := OnGestureStart; MouseGesture.OnGestureMove := OnGestureMove; MouseGesture.OnGestureEnd := OnGestureEnd; - MouseGesture.SetHook( Handle ); + if GikoSys.Setting.GestureEnabled then + MouseGesture.SetHook( Handle ); end; end; diff --git a/KeySetting.dfm b/KeySetting.dfm index a9e8cab..602a776 100644 --- a/KeySetting.dfm +++ b/KeySetting.dfm @@ -34,7 +34,7 @@ object KeySettingForm: TKeySettingForm object Panel2: TPanel Left = 0 Top = 0 - Width = 425 + Width = 417 Height = 78 Align = alLeft BevelOuter = bvNone @@ -49,15 +49,15 @@ object KeySettingForm: TKeySettingForm object Label2: TLabel Left = 8 Top = 4 - Width = 369 + Width = 281 Height = 12 - Caption = #12471#12519#12540#12488#12459#12483#12488#12434#12300#12394#12375#12301#12395#35373#23450#12377#12427#22580#21512#12399' Shift'#12461#12540#12398#12415#12434#25276#12375#12390#12367#12384#12373#12356 + Caption = #12300#12394#12375#12301#12395#35373#23450#12377#12427#22580#21512#12399' Shift'#12461#12540#12398#12415#12434#25276#12375#12390#12367#12384#12373#12356 end object GestureLabel: TLabel Left = 8 Top = 48 - Width = 89 - Height = 17 + Width = 80 + Height = 12 Caption = #12472#12455#12473#12481#12515#12540'(&G)' end object HotKey: THotKey @@ -101,6 +101,15 @@ object KeySettingForm: TKeySettingForm TabOrder = 3 OnClick = GestureSetButtonClick end + object GestureCheckBox: TCheckBox + Left = 368 + Top = 48 + Width = 49 + Height = 17 + Caption = #26377#21177 + TabOrder = 4 + OnClick = GestureCheckBoxClick + end end object Panel3: TPanel Left = 467 @@ -164,9 +173,9 @@ object KeySettingForm: TKeySettingForm Top = 4 Width = 672 Height = 240 - ActivePage = TabSheet1 + ActivePage = TabSheet2 Align = alClient - TabIndex = 0 + TabIndex = 1 TabOrder = 0 object TabSheet1: TTabSheet Caption = #12513#12452#12531 @@ -191,7 +200,7 @@ object KeySettingForm: TKeySettingForm end item Caption = #12472#12455#12473#12481#12515#12540 - Width = 140 + Width = 130 end> ColumnClick = False HideSelection = False @@ -229,7 +238,7 @@ object KeySettingForm: TKeySettingForm end item Caption = #12472#12455#12473#12481#12515#12540 - Width = 140 + Width = 130 end> ColumnClick = False HideSelection = False diff --git a/KeySetting.pas b/KeySetting.pas index 1c52d85..25217a1 100644 --- a/KeySetting.pas +++ b/KeySetting.pas @@ -39,6 +39,7 @@ type GestureLabel: TLabel; GestureEdit: TEdit; GestureSetButton: TButton; + GestureCheckBox: TCheckBox; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure ListViewSelectItem(Sender: TObject; Item: TListItem; @@ -55,6 +56,7 @@ type procedure OnGestureStart(Sender: TObject); procedure OnGestureMove(Sender: TObject); procedure OnGestureEnd(Sender: TObject); + procedure GestureCheckBoxClick(Sender: TObject); private { Private éŒ¾ } public @@ -78,10 +80,6 @@ var KeyItem: TKeySettingItem; begin - MouseGesture.OnGestureStart := OnGestureStart; - MouseGesture.OnGestureMove := OnGestureMove; - MouseGesture.OnGestureEnd := OnGestureEnd; - MouseGesture.SetHook( Handle ); for i := 0 to GikoForm.ActionList.ActionCount - 1 do begin if GikoForm.ActionList.Actions[i] is TAction then begin if GikoForm.ActionList.Actions[i].Tag <> 0 then @@ -128,12 +126,20 @@ begin ListView1.SmallImages := EditorForm.HotToobarImageList; finally - end;{ + end; // ActionListView.SortType := stText; StatusBar.Height := 21; StatusBar.Width := 21; PageControl1.ActivePageIndex := 0; -}end; + GestureCheckBox.Checked := GikoSys.Setting.GestureEnabled; + GestureCheckBoxClick( Sender ); + + MouseGesture.UnHook; + MouseGesture.OnGestureStart := OnGestureStart; + MouseGesture.OnGestureMove := OnGestureMove; + MouseGesture.OnGestureEnd := OnGestureEnd; + MouseGesture.SetHook( Handle ); +end; procedure TKeySettingForm.FormDestroy(Sender: TObject); var @@ -147,7 +153,7 @@ begin if TObject(ListView1.Items[i].Data) is TKeySettingItem then TKeySettingItem(ListView1.Items[i].Data).Free; end; - EditorForm.Release; + EditorForm.Release; end; procedure TKeySettingForm.ListViewSelectItem(Sender: TObject; @@ -235,6 +241,8 @@ var Item: TListItem; KeyItem: TKeySettingItem; begin + + GikoSys.Setting.GestureEnabled := GestureCheckBox.Checked; GikoSys.Setting.Gestures.ClearGesture; for i := 0 to ListView.Items.Count - 1 do begin Item := ListView.Items[i]; @@ -324,4 +332,10 @@ begin GestureEdit.Text := MouseGesture.GetGestureStr; end; +procedure TKeySettingForm.GestureCheckBoxClick(Sender: TObject); +begin + GestureEdit.Enabled := GestureCheckBox.Checked; + GestureSetButton.Enabled := GestureCheckBox.Checked; +end; + end. diff --git a/Setting.pas b/Setting.pas index fe7b550..ce342ae 100644 --- a/Setting.pas +++ b/Setting.pas @@ -407,6 +407,8 @@ type //! ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[ FGestures : TGestureModel; + //! ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[‚ðŽg—p‚·‚é‚©‚Ç‚¤‚© + FGestureEnabled : Boolean; function GetMainCoolSet(Index: Integer): TCoolSet; function GetBoardCoolSet(Index: Integer): TCoolSet; @@ -696,6 +698,8 @@ type property KuroutSettingTabIndex: Integer read FKuroutSettingTabIndex write FKuroutSettingTabIndex; //! ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[ property Gestures : TGestureModel read FGestures write FGestures; + //! ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[‚ðŽg—p‚·‚é‚©‚Ç‚¤‚© + property GestureEnabled : Boolean read FGestureEnabled write FGestureEnabled; end; @@ -1240,6 +1244,8 @@ begin FKuroutSettingTabIndex := ini.ReadInteger('OptionDialog', 'KuroutTabIndex' , 0); + // ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[ + FGestureEnabled := ini.ReadBool( 'Guesture', 'Enabled', False ); finally ini.Free; end; @@ -1571,6 +1577,9 @@ begin //‚É‚¿‚á‚ñŒêˆÄ“à‹@”\ ini.WriteBool('2chSupport', 'Support', F2chSupport); + // ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[‚ðŽg—p‚·‚é‚©‚Ç‚¤‚© + ini.WriteBool( 'Guesture', 'Enabled', FGestureEnabled ); + ini.UpdateFile; finally ini.Free; -- 2.11.0