| 1 |
unit afdg; |
| 2 |
|
| 3 |
{$IFDEF FPC} |
| 4 |
{$MODE DELPHI}{$H+} |
| 5 |
{$ENDIF} |
| 6 |
|
| 7 |
(***************************************) |
| 8 |
(* Copyright (C) 2003, SHIRAISHI Kazuo *) |
| 9 |
(***************************************) |
| 10 |
|
| 11 |
|
| 12 |
interface |
| 13 |
|
| 14 |
uses |
| 15 |
SysUtils, Classes, Graphics, Controls, Forms, Dialogs, |
| 16 |
StdCtrls, ExtCtrls, CheckLst, LResources, Buttons; |
| 17 |
|
| 18 |
|
| 19 |
type |
| 20 |
|
| 21 |
{ TAutoFormatDlg } |
| 22 |
|
| 23 |
TAutoFormatDlg = class(TForm) |
| 24 |
OKBtn: TButton; |
| 25 |
CancelBtn: TButton; |
| 26 |
HelpBtn: TButton; |
| 27 |
Bevel1: TBevel; |
| 28 |
CheckListBox1: TCheckListBox; |
| 29 |
programCharset1: TRadioGroup; |
| 30 |
procedure HelpBtnClick(Sender: TObject); |
| 31 |
procedure programCharset1Click(Sender: TObject); |
| 32 |
private |
| 33 |
{ Private 宣言 } |
| 34 |
public |
| 35 |
{ Public 宣言 } |
| 36 |
end; |
| 37 |
|
| 38 |
var |
| 39 |
AutoFormatDlg: TAutoFormatDlg; |
| 40 |
AutoFormatKw:boolean=true; |
| 41 |
ProgramFileCharsetUTF8:boolean={$IFDEF Windows}false{$ELSE}true{$ENDIF}; |
| 42 |
|
| 43 |
|
| 44 |
procedure setAutoFormat; |
| 45 |
|
| 46 |
implementation |
| 47 |
uses base,base0; |
| 48 |
|
| 49 |
{$R *.lfm} |
| 50 |
|
| 51 |
procedure TAutoFormatDlg.HelpBtnClick(Sender: TObject); |
| 52 |
begin |
| 53 |
Application.HelpContext(HelpContext); |
| 54 |
end; |
| 55 |
|
| 56 |
procedure TAutoFormatDlg.programCharset1Click(Sender: TObject); |
| 57 |
begin |
| 58 |
|
| 59 |
end; |
| 60 |
|
| 61 |
procedure setAutoFormat; |
| 62 |
begin |
| 63 |
with AutoFormatDlg do |
| 64 |
begin |
| 65 |
//OkBtn.Focused; |
| 66 |
CheckListBox1.checked[0]:=AutoFormatKw; |
| 67 |
ProgramCharset1.ItemIndex:=byte(ProgramFileCharsetUTF8); |
| 68 |
if ShowModal=mrOk then |
| 69 |
begin |
| 70 |
AutoFormatKw:=CheckListBox1.checked[0]; |
| 71 |
byte(ProgramFileCharsetUTF8) := ProgramCharset1.ItemIndex; |
| 72 |
|
| 73 |
end; |
| 74 |
end; |
| 75 |
end; |
| 76 |
|
| 77 |
initialization |
| 78 |
with TMyIniFile.create('AutoFormat') do |
| 79 |
begin |
| 80 |
AutoFormatKw:=ReadBool('kw',AutoFormatKw); |
| 81 |
ProgramFileCharsetUTF8:=ReadBool('cs',ProgramFileCharsetUTF8); |
| 82 |
free |
| 83 |
end; |
| 84 |
|
| 85 |
finalization |
| 86 |
with TMyIniFile.create('AutoFormat') do |
| 87 |
begin |
| 88 |
WriteBool('kw',AutoFormatKw); |
| 89 |
WriteBool('cs',ProgramFileCharsetUTF8); |
| 90 |
free |
| 91 |
end; |
| 92 |
|
| 93 |
end. |
| 94 |
|