You've already forked lazarus-ccr
tvplanit: Improve usability and avoid crashes in PrintFormat element editor.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8532 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -2,14 +2,14 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 288
|
||||
Height = 446
|
||||
Top = 321
|
||||
Width = 455
|
||||
Width = 487
|
||||
HorzScrollBar.Page = 378
|
||||
VertScrollBar.Page = 444
|
||||
AutoSize = True
|
||||
BorderStyle = bsDialog
|
||||
Caption = 'Edit Element'
|
||||
ClientHeight = 446
|
||||
ClientWidth = 455
|
||||
ClientWidth = 487
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
Position = poScreenCenter
|
||||
@ -17,7 +17,7 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 12
|
||||
Height = 54
|
||||
Top = 351
|
||||
Width = 431
|
||||
Width = 463
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 12
|
||||
@ -26,7 +26,7 @@ object frmEditElement: TfrmEditElement
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = ' Caption '
|
||||
ClientHeight = 34
|
||||
ClientWidth = 427
|
||||
ClientWidth = 459
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 4
|
||||
@ -50,7 +50,7 @@ object frmEditElement: TfrmEditElement
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = gbCaption
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 360
|
||||
Left = 392
|
||||
Height = 25
|
||||
Top = 1
|
||||
Width = 59
|
||||
@ -70,7 +70,7 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 43
|
||||
Height = 23
|
||||
Top = 2
|
||||
Width = 313
|
||||
Width = 345
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 2
|
||||
@ -85,7 +85,7 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 12
|
||||
Height = 23
|
||||
Top = 8
|
||||
Width = 431
|
||||
Width = 463
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 12
|
||||
@ -94,7 +94,7 @@ object frmEditElement: TfrmEditElement
|
||||
BorderSpacing.Bottom = 8
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 23
|
||||
ClientWidth = 431
|
||||
ClientWidth = 463
|
||||
TabOrder = 0
|
||||
object lblName: TLabel
|
||||
AnchorSideTop.Control = edName
|
||||
@ -113,7 +113,7 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 42
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 389
|
||||
Width = 421
|
||||
Align = alRight
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 4
|
||||
@ -124,7 +124,7 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 12
|
||||
Height = 51
|
||||
Top = 152
|
||||
Width = 433
|
||||
Width = 465
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 12
|
||||
@ -132,7 +132,7 @@ object frmEditElement: TfrmEditElement
|
||||
BorderSpacing.Right = 10
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 51
|
||||
ClientWidth = 433
|
||||
ClientWidth = 465
|
||||
TabOrder = 2
|
||||
object gbDayOffset: TGroupBox
|
||||
AnchorSideTop.Control = DayOffsetPanel
|
||||
@ -190,7 +190,7 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 112
|
||||
Height = 51
|
||||
Top = 0
|
||||
Width = 321
|
||||
Width = 353
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoFill = True
|
||||
AutoSize = True
|
||||
@ -205,7 +205,7 @@ object frmEditElement: TfrmEditElement
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 4
|
||||
ClientHeight = 31
|
||||
ClientWidth = 317
|
||||
ClientWidth = 349
|
||||
Columns = 4
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
@ -222,7 +222,7 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 12
|
||||
Height = 25
|
||||
Top = 413
|
||||
Width = 431
|
||||
Width = 463
|
||||
Align = alTop
|
||||
BorderSpacing.Left = 12
|
||||
BorderSpacing.Top = 8
|
||||
@ -230,7 +230,7 @@ object frmEditElement: TfrmEditElement
|
||||
BorderSpacing.Bottom = 8
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 25
|
||||
ClientWidth = 431
|
||||
ClientWidth = 463
|
||||
TabOrder = 5
|
||||
object btnShape: TButton
|
||||
Left = 0
|
||||
@ -245,7 +245,7 @@ object frmEditElement: TfrmEditElement
|
||||
TabOrder = 0
|
||||
end
|
||||
object btnOk: TButton
|
||||
Left = 323
|
||||
Left = 355
|
||||
Height = 25
|
||||
Top = 0
|
||||
Width = 42
|
||||
@ -257,7 +257,7 @@ object frmEditElement: TfrmEditElement
|
||||
TabOrder = 1
|
||||
end
|
||||
object btnCancel: TButton
|
||||
Left = 369
|
||||
Left = 401
|
||||
Height = 25
|
||||
Top = 0
|
||||
Width = 62
|
||||
@ -272,7 +272,7 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 12
|
||||
Height = 97
|
||||
Top = 43
|
||||
Width = 433
|
||||
Width = 465
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 12
|
||||
@ -280,13 +280,13 @@ object frmEditElement: TfrmEditElement
|
||||
BorderSpacing.Right = 10
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 97
|
||||
ClientWidth = 433
|
||||
ClientWidth = 465
|
||||
TabOrder = 1
|
||||
object rgItemType: TRadioGroup
|
||||
Left = 0
|
||||
Height = 97
|
||||
Top = 0
|
||||
Width = 433
|
||||
Width = 465
|
||||
Align = alClient
|
||||
AutoFill = True
|
||||
BorderSpacing.InnerBorder = 4
|
||||
@ -300,7 +300,7 @@ object frmEditElement: TfrmEditElement
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 3
|
||||
ClientHeight = 77
|
||||
ClientWidth = 429
|
||||
ClientWidth = 461
|
||||
Columns = 3
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
@ -323,14 +323,14 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 12
|
||||
Height = 124
|
||||
Top = 215
|
||||
Width = 443
|
||||
Width = 475
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 12
|
||||
BorderSpacing.Top = 12
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 124
|
||||
ClientWidth = 443
|
||||
ClientWidth = 475
|
||||
TabOrder = 3
|
||||
object rgRotation: TRadioGroup
|
||||
AnchorSideLeft.Control = PositionPanel
|
||||
@ -373,28 +373,28 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 101
|
||||
Height = 116
|
||||
Top = 0
|
||||
Width = 330
|
||||
Width = 362
|
||||
Anchors = [akTop, akLeft, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 16
|
||||
BorderSpacing.Right = 12
|
||||
Caption = 'Position'
|
||||
ClientHeight = 96
|
||||
ClientWidth = 326
|
||||
ClientWidth = 358
|
||||
TabOrder = 1
|
||||
object TopLeftPanel: TPanel
|
||||
AnchorSideLeft.Control = gbPosition
|
||||
AnchorSideTop.Control = gbPosition
|
||||
Left = 16
|
||||
Height = 54
|
||||
Height = 55
|
||||
Top = 4
|
||||
Width = 92
|
||||
Width = 104
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 16
|
||||
BorderSpacing.Top = 4
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 54
|
||||
ClientWidth = 92
|
||||
ClientHeight = 55
|
||||
ClientWidth = 104
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
object BevelTopLeft: TBevel
|
||||
@ -402,10 +402,10 @@ object frmEditElement: TfrmEditElement
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = TopLeftPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Left = 32
|
||||
Height = 8
|
||||
Top = 23
|
||||
Width = 92
|
||||
Width = 72
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
end
|
||||
object LblTop: TLabel
|
||||
@ -430,7 +430,8 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 32
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 48
|
||||
Width = 60
|
||||
Alignment = taRightJustify
|
||||
Anchors = [akRight, akBottom]
|
||||
OnEnter = PosEditEnter
|
||||
OnExit = PosEditExit
|
||||
@ -442,7 +443,7 @@ object frmEditElement: TfrmEditElement
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = TopLeftPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 80
|
||||
Left = 92
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 12
|
||||
@ -459,9 +460,9 @@ object frmEditElement: TfrmEditElement
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = TopLeftPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 80
|
||||
Left = 92
|
||||
Height = 23
|
||||
Top = 31
|
||||
Top = 32
|
||||
Width = 12
|
||||
Anchors = [akTop, akRight]
|
||||
Associate = edLeft
|
||||
@ -471,12 +472,14 @@ object frmEditElement: TfrmEditElement
|
||||
TabOrder = 3
|
||||
end
|
||||
object edLeft: TEdit
|
||||
AnchorSideLeft.Control = edTop
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = udLeft
|
||||
Left = 32
|
||||
Height = 23
|
||||
Top = 31
|
||||
Width = 48
|
||||
Top = 32
|
||||
Width = 60
|
||||
Alignment = taRightJustify
|
||||
Anchors = [akTop, akRight]
|
||||
OnEnter = PosEditEnter
|
||||
OnExit = PosEditExit
|
||||
@ -489,7 +492,7 @@ object frmEditElement: TfrmEditElement
|
||||
AnchorSideRight.Control = edLeft
|
||||
Left = 1
|
||||
Height = 15
|
||||
Top = 35
|
||||
Top = 36
|
||||
Width = 23
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Left = 1
|
||||
@ -505,16 +508,16 @@ object frmEditElement: TfrmEditElement
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = TopLeftPanel
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 124
|
||||
Left = 136
|
||||
Height = 54
|
||||
Top = 4
|
||||
Width = 99
|
||||
Width = 119
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 16
|
||||
BorderSpacing.Right = 12
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 54
|
||||
ClientWidth = 99
|
||||
ClientWidth = 119
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
object LblHeight: TLabel
|
||||
@ -540,7 +543,8 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 47
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 40
|
||||
Width = 60
|
||||
Alignment = taRightJustify
|
||||
Anchors = [akRight, akBottom]
|
||||
OnEnter = PosEditEnter
|
||||
OnExit = PosEditExit
|
||||
@ -552,7 +556,7 @@ object frmEditElement: TfrmEditElement
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = HeightWidthPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 87
|
||||
Left = 107
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 12
|
||||
@ -585,7 +589,8 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 47
|
||||
Height = 23
|
||||
Top = 31
|
||||
Width = 40
|
||||
Width = 60
|
||||
Alignment = taRightJustify
|
||||
Anchors = [akTop, akRight]
|
||||
OnEnter = PosEditEnter
|
||||
OnExit = PosEditExit
|
||||
@ -597,7 +602,7 @@ object frmEditElement: TfrmEditElement
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = HeightWidthPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 87
|
||||
Left = 107
|
||||
Height = 23
|
||||
Top = 31
|
||||
Width = 12
|
||||
@ -617,7 +622,7 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 0
|
||||
Height = 8
|
||||
Top = 23
|
||||
Width = 99
|
||||
Width = 119
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
end
|
||||
end
|
||||
@ -628,7 +633,7 @@ object frmEditElement: TfrmEditElement
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = gbPosition
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 93
|
||||
Left = 109
|
||||
Height = 19
|
||||
Top = 73
|
||||
Width = 52
|
||||
@ -644,7 +649,7 @@ object frmEditElement: TfrmEditElement
|
||||
AnchorSideTop.Control = gbPosition
|
||||
AnchorSideBottom.Control = gbPosition
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 255
|
||||
Left = 287
|
||||
Height = 94
|
||||
Top = 0
|
||||
Width = 59
|
||||
@ -709,7 +714,7 @@ object frmEditElement: TfrmEditElement
|
||||
Left = 16
|
||||
Height = 8
|
||||
Top = 64
|
||||
Width = 207
|
||||
Width = 239
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Shape = bsSpacer
|
||||
end
|
||||
|
@ -201,7 +201,7 @@ end;
|
||||
procedure TfrmPrnFormat.btnDeleteElementClick(Sender: TObject);
|
||||
var
|
||||
Format: TVpPrintFormatItem;
|
||||
Idx: Integer;
|
||||
i, idx, n: Integer;
|
||||
Item: string;
|
||||
begin
|
||||
Format := TVpPrintFormatItem(lbFormats.Items.Objects[lbFormats.ItemIndex]);
|
||||
@ -210,30 +210,54 @@ begin
|
||||
Item := lbElements.Items[lbElements.ItemIndex];
|
||||
|
||||
if Item <> '' then begin
|
||||
for Idx := Pred(Format.Elements.Count) downto 0 do begin
|
||||
if Format.Elements.Items[Idx].ElementName = Item then begin
|
||||
Format.Elements.Items[Idx].Free;
|
||||
n := Format.Elements.Count;
|
||||
idx := lbElements.ItemIndex;
|
||||
for i := n-1 downto 0 do begin
|
||||
if Format.Elements.Items[i].ElementName = Item then begin
|
||||
Format.Elements.Items[i].Free;
|
||||
lbElements.Items.Delete(lbElements.ItemIndex);
|
||||
IsDirty := True;
|
||||
if idx = lbElements.Items.Count then
|
||||
idx := lbElements.Items.Count-1;
|
||||
lbElements.ItemIndex := idx;
|
||||
UpdatePreview;
|
||||
IsDirty := True;
|
||||
Break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
EnableElementButtons(true);
|
||||
end;
|
||||
|
||||
procedure TfrmPrnFormat.btnDeleteFormatClick(Sender: TObject);
|
||||
var
|
||||
Prn: TVpPrinter;
|
||||
Idx: Integer;
|
||||
Idx, fmtIdx: Integer;
|
||||
begin
|
||||
Prn := ControlLink.Printer;
|
||||
Idx := Prn.Find(lbFormats.Items[lbFormats.ItemIndex]);
|
||||
if (Idx < 0) or (Idx >= Prn.PrintFormats.Count) then
|
||||
Idx := lbFormats.ItemIndex;
|
||||
fmtIdx := Prn.Find(lbFormats.Items[idx]);
|
||||
if (fmtIdx < 0) or (fmtIdx >= Prn.PrintFormats.Count) then
|
||||
begin
|
||||
ShowMessage ('Invalid print format: ' + lbFormats.Items[lbFormats.ItemIndex]);
|
||||
Prn.PrintFormats.Items[Idx].Free;
|
||||
lbFormats.Items.Delete(lbFormats.ItemIndex);
|
||||
exit;
|
||||
end;
|
||||
Prn.PrintFormats.Items[FmtIdx].Free;
|
||||
lbElements.Items.Clear;
|
||||
lbFormats.Items.Delete(idx);
|
||||
IsDirty := True;
|
||||
if idx = lbFormats.Items.Count then
|
||||
idx := lbFormats.Items.Count-1;
|
||||
if idx >= 0 then
|
||||
begin
|
||||
lbFormats.ItemIndex := idx;
|
||||
fmtIdx := Prn.Find(lbFormats.Items[idx]);
|
||||
Prn.CurFormat := fmtIdx;
|
||||
UpdatePreview;
|
||||
end else
|
||||
; // to do: clear preview
|
||||
EnableFormatButtons(true);
|
||||
EnableElementButtons(true);
|
||||
end;
|
||||
|
||||
procedure TfrmPrnFormat.btnEditElementClick(Sender: TObject);
|
||||
@ -303,8 +327,8 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
NewFormatIdx := DoNewFormat;
|
||||
if (NewFormatIdx > 0) and (Assigned (ControlLink)) and
|
||||
(NewFormatIdx < ControlLink.Printer.PrintFormats.Count)
|
||||
if Assigned(ControlLink) and
|
||||
(NewFormatIdx > 0) and (NewFormatIdx < ControlLink.Printer.PrintFormats.Count)
|
||||
then
|
||||
for i := 0 to lbFormats.Items.Count - 1 do
|
||||
if lbFormats.Items[i] = ControlLink.Printer.PrintFormats.Items[NewFormatIdx].FormatName then
|
||||
@ -364,16 +388,15 @@ var
|
||||
frmEditElement: TfrmEditElement;
|
||||
begin
|
||||
if lbElements.ItemIndex > -1 then begin
|
||||
Application.CreateForm(TfrmEditElement, frmEditElement);
|
||||
|
||||
frmEditElement := TfrmEditElement.Create(nil);
|
||||
try
|
||||
E := TVpPrintFormatElementItem(lbElements.Items.Objects[lbElements.ItemIndex]);
|
||||
if frmEditElement.Execute(E) then begin
|
||||
if frmEditElement.Execute(E) then
|
||||
IsDirty := True;
|
||||
end;
|
||||
|
||||
frmEditElement.Free;
|
||||
|
||||
UpdatePreview;
|
||||
finally
|
||||
frmEditElement.Free;
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
DoNewElement;
|
||||
@ -419,19 +442,19 @@ begin
|
||||
|
||||
Unique := False;
|
||||
|
||||
Application.CreateForm(TfrmEditElement, frmEditElement);
|
||||
|
||||
frmEditElement := TfrmEditElement.Create(nil);
|
||||
try
|
||||
repeat
|
||||
E := TVpPrintFormatElementItem.Create(Format.Elements);
|
||||
|
||||
{ edit Element }
|
||||
// Edit element
|
||||
Cancelled := not frmEditElement.Execute(E);
|
||||
|
||||
if not Cancelled then begin
|
||||
if lbElements.Items.IndexOf(E.ElementName) > -1 then begin
|
||||
ShowMessage('An Element named ' + E.ElementName + ' already exists.' +
|
||||
#13#10 + 'Please use another name.');
|
||||
{ dump empty element }
|
||||
// Dump empty element
|
||||
Format.Elements.Items[E.Index].Free;
|
||||
Unique := False;
|
||||
end
|
||||
@ -443,12 +466,15 @@ begin
|
||||
UpdatePreview;
|
||||
end;
|
||||
end else
|
||||
{ dump empty element }
|
||||
// Dump empty element
|
||||
Format.Elements.Items[E.Index].Free;
|
||||
{ until element name is Unique or operation Cancelled }
|
||||
// ...until element name is Unique or operation is cancelled
|
||||
until Unique or Cancelled;
|
||||
|
||||
EnableElementButtons(true);
|
||||
finally
|
||||
frmEditElement.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmPrnFormat.DoNewFile;
|
||||
@ -475,20 +501,20 @@ var
|
||||
frmEditFormat: TfrmEditFormat;
|
||||
begin
|
||||
Result := -1;
|
||||
Application.CreateForm(TfrmEditFormat, frmEditFormat);
|
||||
|
||||
frmEditFormat := TfrmEditFormat.Create(nil);
|
||||
try
|
||||
Prn := ControlLink.Printer;
|
||||
Unique := False;
|
||||
repeat
|
||||
AFormat := TVpPrintFormatItem.Create(Prn.PrintFormats);
|
||||
{ edit format }
|
||||
// Edit format
|
||||
Cancelled := not frmEditFormat.Execute(AFormat);
|
||||
|
||||
if not Cancelled then begin
|
||||
if lbFormats.Items.IndexOf(AFormat.FormatName) > -1 then begin
|
||||
ShowMessage('A format named ' + AFormat.FormatName + ' already exists.' +
|
||||
#13#10 + 'Please use another name.');
|
||||
{ dump empty format }
|
||||
// Dump empty format
|
||||
Prn.PrintFormats.Items[AFormat.Index].Free;
|
||||
Unique := False;
|
||||
end
|
||||
@ -500,15 +526,19 @@ begin
|
||||
Unique := True;
|
||||
end;
|
||||
end else
|
||||
{ dump empty format }
|
||||
// Dump empty format
|
||||
Prn.PrintFormats.Items[AFormat.Index].Free;
|
||||
{ until format name is Unique or operation Cancelled }
|
||||
// ... until format name is Unique or operation cancelled
|
||||
until Unique or Cancelled;
|
||||
|
||||
if not Cancelled then
|
||||
Result := AFormat.Index;
|
||||
|
||||
EnableFormatButtons(true);
|
||||
EnableElementButtons(true);
|
||||
finally
|
||||
frmEditFormat.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmPrnFormat.DoSave;
|
||||
@ -527,17 +557,17 @@ end;
|
||||
|
||||
procedure TfrmPrnFormat.EnableElementButtons(Enable: Boolean);
|
||||
begin
|
||||
btnNewElement.Enabled := Enable;
|
||||
btnEditElement.Enabled := Enable;
|
||||
btnDeleteElement.Enabled := Enable;
|
||||
btnNewElement.Enabled := Enable and (lbFormats.ItemIndex > -1);
|
||||
btnEditElement.Enabled := btnNewElement.Enabled and (lbElements.ItemIndex > -1);
|
||||
btnDeleteElement.Enabled := btnEditElement.Enabled;
|
||||
EnableMoveButtons;
|
||||
end;
|
||||
|
||||
procedure TfrmPrnFormat.EnableFormatButtons(Enable: Boolean);
|
||||
begin
|
||||
btnNewFormat.Enabled := Enable;
|
||||
btnEditFormat.Enabled := Enable;
|
||||
btnDeleteFormat.Enabled := Enable;
|
||||
btnEditFormat.Enabled := Enable and (lbFormats.ItemIndex > -1);
|
||||
btnDeleteFormat.Enabled := Enable and (lbFormats.ItemIndex > -1);
|
||||
end;
|
||||
|
||||
function TfrmPrnFormat.Execute: Boolean;
|
||||
|
Reference in New Issue
Block a user