interface
uses Windows, IniFiles, BRegExp, Graphics, SysUtils, Forms, Dialogs, Classes,
- ComCtrls, Contnrs, SsPlayTime;
+ ComCtrls, Contnrs, SsPlayTime, StrReplace;
type
TReturnKeyFunction = (kfYenN, kfReturn, kfYenNReturn, kfConstText);
FBottleServer: String;
FTabWidth: integer;
FBrowserExeName: string;
+ FReplacePresets: TReplacePresets;
procedure SetDblClkInsert(const Value: boolean);
procedure SetDefaultScript(const Value: String);
property PlayTimeParams: TSsPlayTimeParams read FPlayTimeParams write SetPlayTimeParams;
//URL\83I\81[\83v\83\93\8e\9e\82É\8eg\82¤\83u\83\89\83E\83U\82Ì\8eÀ\8ds\83t\83@\83C\83\8b\96¼
property BrowserExeName: string read FBrowserExeName write SetBrowserExeName;
+ //\8e©\93®\92u\8a·\83v\83\8a\83Z\83b\83g
+ property ReplacePresets: TReplacePresets read FReplacePresets;
//\83R\83\93\83X\83g\83\89\83N\83^\81E\83f\83X\83g\83\89\83N\83^\81E\95Û\91¶
constructor Create;
function ComponentToString(Component: TComponent): string;
function StringToComponent(Value: string): TComponent;
+function ReplacePresetFileName: string;
+
+procedure BuildShortCutList(Target: TStrings);
+
implementation
function ParamsEncode(const ASrc: string): string;
end;
end;
+function ReplacePresetFileName: string;
+begin
+ Result := ExtractFilePath(Application.ExeName) + 'replace.txt';
+end;
+
+procedure BuildShortCutList(Target: TStrings);
+var
+ c: Char;
+ i: Integer;
+begin
+ // \83V\83\87\81[\83g\83J\83b\83g\83\8a\83X\83g\82Ì\91I\91ð\8e\88\82ð\8dì\90¬
+ with Target do
+ begin
+ BeginUpdate;
+ try
+ for c := 'A' to 'Z' do
+ Add('Ctrl+' + c);
+ for c := 'A' to 'Z' do
+ Add('Shift+Ctrl+' + c);
+ for c := 'A' to 'Z' do
+ Add('Alt+Ctrl+' + c);
+ for i := 1 to 12 do
+ Add('F' + IntToStr(i));
+ for i := 1 to 12 do
+ Add('Shift+F' + IntToStr(i));
+ finally
+ EndUpdate;
+ end;
+ end;
+end;
+
{ TBottlePrefs }
constructor TBottlePrefs.Create;
//URL\82ð\8aJ\82\83u\83\89\83E\83U
FBrowserExeName:= FIni.ReadString('System', 'BrowserExeName', '');
+ //\8e©\93®\92u\8a·\83v\83\8a\83Z\83b\83g
+ if FileExists(ReplacePresetFileName) then
+ begin
+ try
+ Strs := TStringList.Create;
+ try
+ Strs.LoadFromFile(ReplacePresetFileName);
+ FReplacePresets := StringToComponent(Strs.Text) as TReplacePresets;
+ finally
+ Strs.Free;
+ end;
+ except
+ ShowMessage('Replace.txt\93Ç\82Ý\8d\9e\82Ý\92\86\82Ì\83G\83\89\81[\81B'#13#10+
+ '\83t\83@\83C\83\8b\82ª\94j\91¹\82µ\82Ä\82¢\82é\8fê\8d\87\82Í\81A\82±\82Ì\83t\83@\83C\83\8b\82ð\8dí\8f\9c\82µ\82Ä\8dÄ\8bN\93®\82µ\82Ä\82\82¾\82³\82¢');
+ raise;
+ end;
+ end else
+ FReplacePresets := TReplacePresets.Create(nil);
except
- ShowMessage('INI\83t\83@\83C\83\8b\93Ç\82Ý\8d\9e\82Ý\83G\83\89\81[');
- Application.Terminate;
+ on E: Exception do
+ begin
+ ShowMessage('\90Ý\92è\93Ç\82Ý\8d\9e\82Ý\83G\83\89\81['#13#10 + E.Message);
+ Application.Terminate;
+ end;
end;
end;
begin
inherited;
SaveSettings;
+ if FReplacePresets <> nil then
+ FReplacePresets.Free;
if FIni <> nil then
FIni.Free;
if FAutoJoinChannels <> nil then
FIni.WriteInteger('System', 'SurfacePreviewOnScriptPointPosition', Ord(SurfacePreviewOnScriptPointPosition));
FIni.WriteString('System', 'BrowserExeName', FBrowserExeName);
+
+ Strs := TStringList.Create;
+ try
+ Strs.Text := ComponentToString(FReplacePresets);
+ Strs.SaveToFile(ReplacePresetFileName);
+ finally
+ Strs.Free;
+ end;
end;
function TBottlePrefs.GetDefaultScript: String;