Стартовый пул

This commit is contained in:
2024-04-02 08:46:59 +03:00
parent fd57fffd3a
commit 3bb34d000b
5591 changed files with 3291734 additions and 0 deletions

View File

@@ -0,0 +1,111 @@
object MainFrm: TMainFrm
Left = 603
Height = 297
Top = 302
Width = 559
BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Caption = 'JSON Font Demo'
ClientHeight = 297
ClientWidth = 559
Font.CharSet = RUSSIAN_CHARSET
Font.Color = clBlack
Font.Height = -15
Font.Name = 'Times New Roman'
Font.Pitch = fpVariable
Font.Quality = fqDraft
Position = poScreenCenter
LCLVersion = '1.6.4.0'
object JSONFileNameEd: TFileNameEdit
Left = 16
Height = 25
Top = 32
Width = 528
Filter = 'JSON File (*.json)|*.json'
FilterIndex = 0
HideDirectories = False
ButtonWidth = 23
NumGlyphs = 1
Flat = True
FocusOnButtonClick = True
MaxLength = 0
TabOrder = 0
end
object JSONFileNameEdLbl: TLabel
Left = 16
Height = 17
Top = 8
Width = 72
Caption = '&Имя файла:'
ParentColor = False
end
object KeyEdt: TLabeledEdit
Left = 16
Height = 25
Top = 88
Width = 528
EditLabel.AnchorSideLeft.Control = KeyEdt
EditLabel.AnchorSideRight.Control = KeyEdt
EditLabel.AnchorSideRight.Side = asrBottom
EditLabel.AnchorSideBottom.Control = KeyEdt
EditLabel.Left = 16
EditLabel.Height = 17
EditLabel.Top = 68
EditLabel.Width = 528
EditLabel.Caption = '&Ключ:'
EditLabel.ParentColor = False
TabOrder = 1
end
object ExitBtn: TButton
Left = 432
Height = 25
Top = 256
Width = 112
Caption = 'В&ыход'
Default = True
OnClick = ExitBtnClick
TabOrder = 2
end
object WriteBtn: TButton
Left = 296
Height = 25
Top = 256
Width = 131
Caption = '&Записать'
OnClick = WriteBtnClick
TabOrder = 3
end
object FontDemoLbl: TLabel
Left = 16
Height = 56
Top = 136
Width = 528
AutoSize = False
Caption = 'Это пример шрифта'
ParentColor = False
end
object ReadBtn: TButton
Left = 160
Height = 25
Top = 256
Width = 131
Caption = '&Прочитать'
OnClick = ReadBtnClick
TabOrder = 4
end
object SelectFontBtn: TButton
Left = 16
Height = 25
Top = 203
Width = 528
Caption = 'В&ыбрать шрифт'
OnClick = SelectFontBtnClick
TabOrder = 5
end
object FontDialog: TFontDialog
MinFontSize = 0
MaxFontSize = 0
left = 440
top = 8
end
end

View File

@@ -0,0 +1,69 @@
unit MainForm;
{$mode delphi}
{$codepage UTF8}
interface
uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, EditBtn, windows, SimplyJSON;
type
{ TMainFrm }
TMainFrm = class(TForm)
FontDialog: TFontDialog;
SelectFontBtn: TButton;
FontDemoLbl: TLabel;
WriteBtn: TButton;
ExitBtn: TButton;
JSONFileNameEd: TFileNameEdit;
JSONFileNameEdLbl: TLabel;
KeyEdt: TLabeledEdit;
ReadBtn: TButton;
procedure ExitBtnClick(Sender: TObject);
procedure ReadBtnClick(Sender: TObject);
procedure SelectFontBtnClick(Sender: TObject);
procedure WriteBtnClick(Sender: TObject);
private
public
function CheckReqs: Boolean;
end;
var
MainFrm: TMainFrm;
implementation
{$R *.lfm}
{ TMainFrm }
function TMainFrm.CheckReqs: Boolean;
begin
Result:= True;
if Trim(JSONFileNameEd.Text) = '' then
begin
Application.MessageBox(PChar('Поле "Имя файла" не заполнено!'), PChar('Ошибка!'), MB_ICONERROR);
Result:= False;
end;
if Trim(KeyEdt.Text) = '' then
begin
Application.MessageBox(PChar('Поле "Ключ" не заполнено!'), PChar('Ошибка!'), MB_ICONERROR);
Result:= False;
end;
end;
procedure TMainFrm.ExitBtnClick(Sender: TObject);
begin
Application.Terminate;
end;
procedure TMainFrm.ReadBtnClick(Sender: TObject);
begin
if not CheckReqs then
Exit;
FontDemoLbl.Font:= JSReadFont(KeyEdt.Text, FontDemoLbl.Font, JSONFileNameEd.Text);
Application.MessageBox(PChar('Шрифт загружен из файла!'), PChar('Информация'), MB_ICONASTERISK);
end;
procedure TMainFrm.SelectFontBtnClick(Sender: TObject);
begin
FontDialog.Font:= FontDemoLbl.Font;
if FontDialog.Execute then
FontDemoLbl.Font:= FontDialog.Font;
end;
procedure TMainFrm.WriteBtnClick(Sender: TObject);
begin
if not CheckReqs then
Exit;
JSWriteFont(KeyEdt.Text, FontDemoLbl.Font, JSONFileNameEd.Text);
Application.MessageBox(PChar('Шрифт записан в файл!'), PChar('Информация'), MB_ICONASTERISK);
end;
end.