constructor TForm1.Create(AOwner: TComponent);
begin
PrgINI := TIniFile.Create(ExtractFilePath(ParamStr(0)) + 'BBcode.ini');
inherited Create(AOwner);
end;
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
with Params do
begin
Y := PrgINI.ReadInteger('Position', 'Top', Top);
X := PrgINI.ReadInteger('Position', 'Left', Left);
Width := PrgINI.ReadInteger('Position', 'Width', Width);
Height := PrgINI.ReadInteger('Position', 'Height', Height);
Memo.Font.Charset := PrgINI.ReadInteger('Editor', 'CharSet', RUSSIAN_CHARSET);
Memo.Font.Color := PrgINI.ReadInteger('Editor', 'FontColor', clWindowText);
Memo.Font.Size := PrgINI.ReadInteger('Editor', 'FontSize', 10);
Memo.Color := PrgINI.ReadInteger('Editor', 'EditorColor', clWindow);
SpeedButton1.Down := ReadBool('Editor', 'WordWpap', True);
end;
end;
procedure TForm1.DoShow;
var
aWindowState: integer;
begin
aWindowState := PrgINI.ReadInteger('position', 'WindowState', 0);
case aWindowState of
0: WindowState := wsNormal;
1: WindowState := wsMinimized;
2: WindowState := wsMaximized;
end;
end;
destructor TForm1.Destroy;
begin
if WindowState = wsNormal then
begin
PrgINI.WriteInteger('Position', 'Top', Top);
PrgINI.WriteInteger('Position', 'Left', Left);
end;
PrgINI.WriteInteger('Position', 'Width', 802);
PrgINI.WriteInteger('Position', 'Height', 606);
case WindowState of
wsNormal: PrgINI.WriteInteger('Position', 'WindowState', 0);
wsMinimized: PrgINI.WriteInteger('Position', 'WindowState', 1);
wsMaximized: PrgINI.WriteInteger('Position', 'WindowState', 2);
end;
PrgINI.WriteInteger('Editor', 'CharSet', Memo.Font.CHARSET);
PrgINI.WriteInteger('Editor', 'FontColor', Memo.Font.Color);
PrgINI.WriteInteger('Editor', 'FontSize', Memo.Font.Size);
PrgINI.WriteInteger('Editor', 'EditorColor', Memo.Color);
PrgINI.WriteBool('Editor', 'WordWpap', SpeedButton1.Down);
PrgINI.Free;
inherited Destroy;
end;