mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-11 15:00:38 +01:00
LazReport, fix barcode addin when TfrBarCodeObject is not yet instantiated (in this case barcode editor defaults to memo view editor
git-svn-id: trunk@36510 -
This commit is contained in:
parent
7ebaadc7bd
commit
23849c7fce
@ -17,7 +17,7 @@ object frBarCodeForm: TfrBarCodeForm
|
|||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
LCLVersion = '0.9.31'
|
LCLVersion = '1.1'
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
AnchorSideTop.Control = Owner
|
AnchorSideTop.Control = Owner
|
||||||
|
|||||||
@ -739,13 +739,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure InitializeBarcAddin;
|
||||||
{ TfrBarCodeObject }
|
|
||||||
|
|
||||||
constructor TfrBarCodeObject.Create(aOwner: TComponent);
|
|
||||||
begin
|
begin
|
||||||
inherited Create(aOwner);
|
|
||||||
|
|
||||||
if not assigned(frBarCodeForm) {and not (csDesigning in ComponentState)} then
|
if not assigned(frBarCodeForm) {and not (csDesigning in ComponentState)} then
|
||||||
begin
|
begin
|
||||||
frBarCodeForm := TfrBarCodeForm.Create(nil);
|
frBarCodeForm := TfrBarCodeForm.Create(nil);
|
||||||
@ -755,9 +750,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TfrBarCodeObject }
|
||||||
|
|
||||||
|
constructor TfrBarCodeObject.Create(aOwner: TComponent);
|
||||||
|
begin
|
||||||
|
inherited Create(aOwner);
|
||||||
|
InitializeBarcAddin;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
frBarcodeForm := nil;
|
frBarcodeForm := nil;
|
||||||
frRegisterObject(TfrBarCodeView, nil, '', nil);
|
frRegisterObject(TfrBarCodeView, nil, '', nil, @InitializeBarcAddin);
|
||||||
|
|
||||||
finalization
|
finalization
|
||||||
if Assigned(frBarCodeForm) then
|
if Assigned(frBarCodeForm) then
|
||||||
|
|||||||
@ -1125,10 +1125,12 @@ type
|
|||||||
procedure DeCompress({%H-}StreamIn, {%H-}StreamOut: TStream); virtual;
|
procedure DeCompress({%H-}StreamIn, {%H-}StreamOut: TStream); virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TfrAddinInitProc = procedure;
|
||||||
|
|
||||||
|
|
||||||
function frCreateObject(Typ: Byte; const ClassName: String): TfrView;
|
function frCreateObject(Typ: Byte; const ClassName: String): TfrView;
|
||||||
procedure frRegisterObject(ClassRef: TFRViewClass; ButtonBmp: TBitmap;
|
procedure frRegisterObject(ClassRef: TFRViewClass; ButtonBmp: TBitmap;
|
||||||
const ButtonHint: String; EditorForm: TfrObjEditorForm);
|
const ButtonHint: String; EditorForm: TfrObjEditorForm; InitProc:TfrAddinInitProc=nil);
|
||||||
procedure frSetAddinEditor(ClassRef: TfrViewClass; EditorForm: TfrObjEditorForm);
|
procedure frSetAddinEditor(ClassRef: TfrViewClass; EditorForm: TfrObjEditorForm);
|
||||||
procedure frSetAddinIcon(ClassRef: TfrViewClass; ButtonBmp: TBitmap);
|
procedure frSetAddinIcon(ClassRef: TfrViewClass; ButtonBmp: TBitmap);
|
||||||
procedure frSetAddinHint(ClassRef: TfrViewClass; ButtonHint: string);
|
procedure frSetAddinHint(ClassRef: TfrViewClass; ButtonHint: string);
|
||||||
@ -1177,6 +1179,7 @@ type
|
|||||||
EditorForm: TfrObjEditorForm;
|
EditorForm: TfrObjEditorForm;
|
||||||
ButtonBmp: TBitmap;
|
ButtonBmp: TBitmap;
|
||||||
ButtonHint: String;
|
ButtonHint: String;
|
||||||
|
InitializeProc: TfrAddinInitProc;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TfrExportFilterInfo = record
|
TfrExportFilterInfo = record
|
||||||
@ -1449,15 +1452,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure frRegisterObject(ClassRef: TfrViewClass; ButtonBmp: TBitmap;
|
procedure frRegisterObject(ClassRef: TfrViewClass; ButtonBmp: TBitmap;
|
||||||
const ButtonHint: String; EditorForm: TfrObjEditorForm);
|
const ButtonHint: String; EditorForm: TfrObjEditorForm; InitProc:TfrAddinInitProc=nil);
|
||||||
begin
|
begin
|
||||||
frAddIns[frAddInsCount].ClassRef := ClassRef;
|
frAddIns[frAddInsCount].ClassRef := ClassRef;
|
||||||
frAddIns[frAddInsCount].EditorForm := EditorForm;
|
frAddIns[frAddInsCount].EditorForm := EditorForm;
|
||||||
frAddIns[frAddInsCount].ButtonBmp := ButtonBmp;
|
frAddIns[frAddInsCount].ButtonBmp := ButtonBmp;
|
||||||
frAddIns[frAddInsCount].ButtonHint := ButtonHint;
|
frAddIns[frAddInsCount].ButtonHint := ButtonHint;
|
||||||
if frDesigner <> nil then
|
frAddIns[frAddInsCount].InitializeProc := InitProc;
|
||||||
|
if frDesigner <> nil then begin
|
||||||
|
if Assigned(InitProc) then
|
||||||
|
InitProc;
|
||||||
frDesigner.RegisterObject(ButtonBmp, ButtonHint,
|
frDesigner.RegisterObject(ButtonBmp, ButtonHint,
|
||||||
Integer(gtAddIn) + frAddInsCount);
|
Integer(gtAddIn) + frAddInsCount);
|
||||||
|
end;
|
||||||
Inc(frAddInsCount);
|
Inc(frAddInsCount);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -2373,6 +2373,8 @@ begin
|
|||||||
for i := 0 to frAddInsCount - 1 do
|
for i := 0 to frAddInsCount - 1 do
|
||||||
with frAddIns[i] do
|
with frAddIns[i] do
|
||||||
begin
|
begin
|
||||||
|
if Assigned(frAddIns[i].InitializeProc) then
|
||||||
|
frAddIns[i].InitializeProc;
|
||||||
RegisterObject(ButtonBMP, ButtonHint, Integer(gtAddIn) + i);
|
RegisterObject(ButtonBMP, ButtonHint, Integer(gtAddIn) + i);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user