| 1 |
unit compadlg; |
| 2 |
|
| 3 |
{$IFDEF FPC} |
| 4 |
{$MODE DELPHI}{$H+} |
| 5 |
{$ENDIF} |
| 6 |
|
| 7 |
(***************************************) |
| 8 |
(* Copyright (C) 2009, SHIRAISHI Kazuo *) |
| 9 |
(***************************************) |
| 10 |
|
| 11 |
|
| 12 |
interface |
| 13 |
|
| 14 |
uses SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, |
| 15 |
Buttons, ExtCtrls, ComCtrls, LResources; |
| 16 |
|
| 17 |
type |
| 18 |
|
| 19 |
{ TcompatibilityDialog } |
| 20 |
|
| 21 |
TcompatibilityDialog = class(TForm) |
| 22 |
OKBtn: TButton; |
| 23 |
CancelBtn: TButton; |
| 24 |
HelpBtn: TButton; |
| 25 |
PageControl1: TPageControl; |
| 26 |
TabSheet1: TTabSheet; |
| 27 |
TabSheet2: TTabSheet; |
| 28 |
TabSheet3: TTabSheet; |
| 29 |
RadioGroup1: TRadioGroup; |
| 30 |
RadioGroup3: TRadioGroup; |
| 31 |
RadioGroup4: TRadioGroup; |
| 32 |
RadioGroup5: TRadioGroup; |
| 33 |
RadioGroup2: TRadioGroup; |
| 34 |
RadioGroup6: TRadioGroup; |
| 35 |
RadioGroup9: TRadioGroup; |
| 36 |
RadioGroup11: TRadioGroup; |
| 37 |
procedure HelpBtnClick(Sender: TObject); |
| 38 |
private |
| 39 |
{ Private 宣言 } |
| 40 |
public |
| 41 |
{ Public 宣言 } |
| 42 |
end; |
| 43 |
|
| 44 |
var |
| 45 |
compatibilityDialog: TcompatibilityDialog; |
| 46 |
|
| 47 |
procedure setCompatibility; |
| 48 |
|
| 49 |
implementation |
| 50 |
uses MainFrm,base,base0,plottext; |
| 51 |
{$R *.lfm} |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
procedure TcompatibilityDialog.HelpBtnClick(Sender: TObject); |
| 56 |
begin |
| 57 |
Application.HelpContext(HelpContext); |
| 58 |
end; |
| 59 |
|
| 60 |
procedure setCompatibility; |
| 61 |
|
| 62 |
begin |
| 63 |
with compatibilityDialog do |
| 64 |
begin |
| 65 |
RadioGroup1.ItemIndex:=byte(JISFormat); |
| 66 |
RadioGroup2.ItemIndex:=byte(InitialCharacterByte0); |
| 67 |
RadioGroup3.ItemIndex:=byte(JISSetWindow); |
| 68 |
RadioGroup4.ItemIndex:=byte(JISDim); |
| 69 |
RadioGroup5.ItemIndex:=byte(ForceFunctionDeclare); |
| 70 |
RadioGroup6.ItemIndex:=byte(JISDef); |
| 71 |
RadioGroup9.ItemIndex:=byte(ForNextBroadOwn); |
| 72 |
RadioGroup11.ItemIndex:=1-byte(TextPhysicalCoordinate); |
| 73 |
|
| 74 |
if ShowModal=mrOK then |
| 75 |
begin |
| 76 |
byte(JISFormat):=RadioGroup1.ItemIndex; |
| 77 |
byte(InitialCharacterByte0):=RadioGroup2.ItemIndex; |
| 78 |
byte(JISSetWindow):=RadioGroup3.ItemIndex; |
| 79 |
byte(JISDim):=RadioGroup4.ItemIndex; |
| 80 |
byte(ForceFunctionDeclare):=RadioGroup5.ItemIndex; |
| 81 |
byte(JISDef):=RadioGroup6.ItemIndex; |
| 82 |
byte(ForNextBroadown):=RadioGroup9.ItemIndex; |
| 83 |
TextPhysicalCoordinate:=RadioGroup11.ItemIndex=0; |
| 84 |
end; |
| 85 |
end; |
| 86 |
end; |
| 87 |
|
| 88 |
initialization |
| 89 |
|
| 90 |
with TMyIniFile.create('Frame') do |
| 91 |
begin |
| 92 |
JISFormat:= ReadBool('JISFormat',JISFormat); |
| 93 |
InitialCharacterByte0:=ReadBool('CharacterByte', InitialCharacterByte0); |
| 94 |
JISSetWindow:= ReadBool('JISSetWindow',JISSetWindow); |
| 95 |
JISDim:= ReadBool('JISDim',JISDim); |
| 96 |
ForceFunctionDeclare:= ReadBool('ForceFunctionDeclare',ForceFunctionDeclare); |
| 97 |
JISDef:= ReadBool('JISDef',JISDef); |
| 98 |
ForNextBroadOwn:= ReadBool('ForNextBroadOwn',ForNextBroadOwn); |
| 99 |
free |
| 100 |
end; |
| 101 |
|
| 102 |
with TMyIniFile.create('Graphics') do |
| 103 |
begin |
| 104 |
TextPhysicalCoordinate:=ReadBool('TextPhysicalCoordinate',TextPhysicalCoordinate); |
| 105 |
free |
| 106 |
end; |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
finalization |
| 112 |
with TMyIniFile.create('Frame') do |
| 113 |
begin |
| 114 |
WriteBool('JISFormat',JISFormat); |
| 115 |
WriteBool('CharacterByte', InitialCharacterByte0); |
| 116 |
WriteBool('JISSetWindow',JISSetWindow); |
| 117 |
WriteBool('JISDim',JISDim); |
| 118 |
WriteBool('ForceFunctionDeclare',ForceFunctionDeclare); |
| 119 |
WriteBool('JISDef',JISDef); |
| 120 |
WriteBool('ForNextBroadOwn',ForNextBroadOwn); |
| 121 |
free |
| 122 |
end; |
| 123 |
with TMyIniFile.create('Graphics') do |
| 124 |
begin |
| 125 |
WriteBool('TextPhysicalCoordinate', TextPhysicalCoordinate); |
| 126 |
free |
| 127 |
end; |
| 128 |
end. |
| 129 |
|