1 unit SpecialCharEditor;
6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7 Dialogs, Spin, StdCtrls;
10 TfrmSpecialCharEditor = class(TForm)
17 procedure btnOkClick(Sender: TObject);
18 procedure btnCancelClick(Sender: TObject);
22 procedure SetCost(const Value: integer);
23 procedure SetSpecialChar(const Value: String);
26 property SpecialChar: String read FSpecialChar write SetSpecialChar;
27 property Cost: integer read FCost write SetCost;
28 function Execute: boolean;
32 frmSpecialCharEditor: TfrmSpecialCharEditor;
40 function TfrmSpecialCharEditor.Execute: boolean;
42 spnCost.Value := Cost;
43 edtChar.Text := SpecialChar;
44 Result := ShowModal = mrOk;
47 procedure TfrmSpecialCharEditor.SetCost(const Value: integer);
52 procedure TfrmSpecialCharEditor.SetSpecialChar(const Value: String);
54 FSpecialChar := Value;
57 procedure TfrmSpecialCharEditor.btnOkClick(Sender: TObject);
62 if (Length(edtChar.Text) = 1) and not (edtChar.Text[1] in LeadBytes) then
64 if (Length(edtChar.Text) = 2) and (edtChar.Text[1] in LeadBytes) then
66 SpecialChar := edtChar.Text;
67 Cost := spnCost.Value;
72 procedure TfrmSpecialCharEditor.btnCancelClick(Sender: TObject);
74 ModalResult := mrCancel;