LazReport, patch from Alexs Lagunov to allow datasets on frames

git-svn-id: trunk@27174 -
This commit is contained in:
jesus 2010-08-23 23:12:17 +00:00
parent 8553012044
commit 1f81f24737
17 changed files with 176 additions and 53 deletions

View File

@ -1419,6 +1419,10 @@ msgstr "[Keine]"
msgid "Object inspector" msgid "Object inspector"
msgstr "Objektinspektor" msgstr "Objektinspektor"
#: lr_const.sobjectnotfound
msgid "Object \"%s\" not found"
msgstr ""
#: lr_const.sok #: lr_const.sok
msgid "Ok" msgid "Ok"
msgstr "OK" msgstr "OK"

View File

@ -1408,6 +1408,10 @@ msgstr "[Nada]"
msgid "Object inspector" msgid "Object inspector"
msgstr "Inspector de objetos" msgstr "Inspector de objetos"
#: lr_const.sobjectnotfound
msgid "Object \"%s\" not found"
msgstr ""
#: lr_const.sok #: lr_const.sok
msgid "Ok" msgid "Ok"
msgstr "Aceptar" msgstr "Aceptar"

View File

@ -1417,6 +1417,10 @@ msgstr "[Aucun]"
msgid "Object inspector" msgid "Object inspector"
msgstr "Inspecteur d'objets" msgstr "Inspecteur d'objets"
#: lr_const.sobjectnotfound
msgid "Object \"%s\" not found"
msgstr ""
#: lr_const.sok #: lr_const.sok
msgid "Ok" msgid "Ok"
msgstr "OK" msgstr "OK"

View File

@ -1408,6 +1408,10 @@ msgstr "[Tidak ada]"
msgid "Object inspector" msgid "Object inspector"
msgstr "Inspektor obyek" msgstr "Inspektor obyek"
#: lr_const.sobjectnotfound
msgid "Object \"%s\" not found"
msgstr ""
#: lr_const.sok #: lr_const.sok
msgid "Ok" msgid "Ok"
msgstr "Ok" msgstr "Ok"

View File

@ -1410,6 +1410,10 @@ msgstr "[Joks]"
msgid "Object inspector" msgid "Object inspector"
msgstr "Objektų inspektorius" msgstr "Objektų inspektorius"
#: lr_const.sobjectnotfound
msgid "Object \"%s\" not found"
msgstr ""
#: lr_const.sok #: lr_const.sok
msgid "Ok" msgid "Ok"
msgstr "Tinka" msgstr "Tinka"

View File

@ -1408,6 +1408,10 @@ msgstr "[Nenhum]"
msgid "Object inspector" msgid "Object inspector"
msgstr "Inspetor de Objetos" msgstr "Inspetor de Objetos"
#: lr_const.sobjectnotfound
msgid "Object \"%s\" not found"
msgstr ""
#: lr_const.sok #: lr_const.sok
msgid "Ok" msgid "Ok"
msgstr "Ok" msgstr "Ok"

View File

@ -1411,6 +1411,10 @@ msgstr "[Brak]"
msgid "Object inspector" msgid "Object inspector"
msgstr "Inspektor obiektów" msgstr "Inspektor obiektów"
#: lr_const.sobjectnotfound
msgid "Object \"%s\" not found"
msgstr ""
#: lr_const.sok #: lr_const.sok
msgid "Ok" msgid "Ok"
msgstr "" msgstr ""

View File

@ -1403,6 +1403,10 @@ msgstr ""
msgid "Object inspector" msgid "Object inspector"
msgstr "" msgstr ""
#: lr_const.sobjectnotfound
msgid "Object \"%s\" not found"
msgstr ""
#: lr_const.sok #: lr_const.sok
msgid "Ok" msgid "Ok"
msgstr "" msgstr ""

View File

@ -1408,6 +1408,10 @@ msgstr "[Нет]"
msgid "Object inspector" msgid "Object inspector"
msgstr "Инспектор объектов" msgstr "Инспектор объектов"
#: lr_const.sobjectnotfound
msgid "Object \"%s\" not found"
msgstr ""
#: lr_const.sok #: lr_const.sok
msgid "Ok" msgid "Ok"
msgstr "OK" msgstr "OK"

View File

@ -249,9 +249,11 @@ resourcestring
sFRVariables = 'FR variables'; sFRVariables = 'FR variables';
sErrorOccured = 'An error occured during calculating'; sErrorOccured = 'An error occured during calculating';
sSpecVal = 'Other'; sSpecVal = 'Other';
sFRFError='Unsupported FRF format'; sFRFError = 'Unsupported FRF format';
sClassObjectNotFound='Class Object "%s" not found'; sClassObjectNotFound = 'Class Object "%s" not found';
sDuplicatedObjectName = 'An object named "%s" already exists'; sDuplicatedObjectName = 'An object named "%s" already exists';
sObjectNotFound = 'Object "%s" not found';
SDoc = 'Report:'; SDoc = 'Report:';
SBand = 'Band:'; SBand = 'Band:';

View File

@ -32,10 +32,10 @@ inherited frEditorForm: TfrEditorForm
object Button1: TButton object Button1: TButton
AnchorSideTop.Control = Panel2 AnchorSideTop.Control = Panel2
AnchorSideRight.Control = Button2 AnchorSideRight.Control = Button2
Left = 473 Left = 477
Height = 37 Height = 37
Top = 4 Top = 4
Width = 39 Width = 37
HelpContext = 40 HelpContext = 40
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
@ -50,10 +50,10 @@ inherited frEditorForm: TfrEditorForm
AnchorSideTop.Control = Panel2 AnchorSideTop.Control = Panel2
AnchorSideRight.Control = Panel2 AnchorSideRight.Control = Panel2
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 518 Left = 520
Height = 37 Height = 37
Top = 4 Top = 4
Width = 65 Width = 63
HelpContext = 50 HelpContext = 50
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
@ -70,7 +70,7 @@ inherited frEditorForm: TfrEditorForm
Left = 6 Left = 6
Height = 37 Height = 37
Top = 4 Top = 4
Width = 73 Width = 71
HelpContext = 60 HelpContext = 60
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
AutoSize = True AutoSize = True
@ -84,10 +84,10 @@ inherited frEditorForm: TfrEditorForm
AnchorSideLeft.Control = Button3 AnchorSideLeft.Control = Button3
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel2 AnchorSideTop.Control = Panel2
Left = 85 Left = 83
Height = 37 Height = 37
Top = 4 Top = 4
Width = 71 Width = 69
HelpContext = 70 HelpContext = 70
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
AutoSize = True AutoSize = True
@ -101,10 +101,10 @@ inherited frEditorForm: TfrEditorForm
AnchorSideLeft.Control = Button6 AnchorSideLeft.Control = Button6
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel2 AnchorSideTop.Control = Panel2
Left = 243 Left = 237
Height = 37 Height = 37
Top = 4 Top = 4
Width = 68 Width = 66
HelpContext = 110 HelpContext = 110
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
AutoSize = True AutoSize = True
@ -118,10 +118,10 @@ inherited frEditorForm: TfrEditorForm
AnchorSideLeft.Control = Button4 AnchorSideLeft.Control = Button4
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel2 AnchorSideTop.Control = Panel2
Left = 162 Left = 158
Height = 37 Height = 37
Top = 4 Top = 4
Width = 75 Width = 73
HelpContext = 70 HelpContext = 70
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
AutoSize = True AutoSize = True
@ -145,7 +145,7 @@ inherited frEditorForm: TfrEditorForm
TabOrder = 1 TabOrder = 1
object Label2: TLabel object Label2: TLabel
Left = 4 Left = 4
Height = 16 Height = 18
Top = 0 Top = 0
Width = 38 Width = 38
Caption = 'S&cript' Caption = 'S&cript'
@ -167,7 +167,7 @@ inherited frEditorForm: TfrEditorForm
TabOrder = 0 TabOrder = 0
BookMarkOptions.Xoffset = 2 BookMarkOptions.Xoffset = 2
Gutter.Color = 13605511 Gutter.Color = 13605511
Gutter.Width = 57 Gutter.Width = 55
Gutter.MouseActions = < Gutter.MouseActions = <
item item
Shift = [] Shift = []
@ -191,6 +191,30 @@ inherited frEditorForm: TfrEditorForm
Option = 0 Option = 0
Priority = 0 Priority = 0
end> end>
RightGutter.Width = 0
RightGutter.MouseActions = <
item
Shift = []
ShiftMask = []
Button = mbLeft
ClickCount = ccAny
ClickDir = cdDown
Command = 13
MoveCaret = False
Option = 0
Priority = 0
end
item
Shift = []
ShiftMask = []
Button = mbRight
ClickCount = ccSingle
ClickDir = cdUp
Command = 12
MoveCaret = False
Option = 0
Priority = 0
end>
Highlighter = SynPasSyn1 Highlighter = SynPasSyn1
Keystrokes = < Keystrokes = <
item item
@ -753,6 +777,8 @@ inherited frEditorForm: TfrEditorForm
end> end>
end end
end end
inline SynRightGutterPartList1: TSynRightGutterPartList
end
end end
end end
object MemoPanel: TPanel[2] object MemoPanel: TPanel[2]
@ -775,8 +801,8 @@ inherited frEditorForm: TfrEditorForm
AnchorSideBottom.Control = MemoPanel AnchorSideBottom.Control = MemoPanel
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 0 Left = 0
Height = 162 Height = 160
Top = 28 Top = 30
Width = 589 Width = 589
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
OnEnter = M1Enter OnEnter = M1Enter
@ -789,7 +815,7 @@ inherited frEditorForm: TfrEditorForm
AnchorSideLeft.Control = MemoPanel AnchorSideLeft.Control = MemoPanel
AnchorSideTop.Control = MemoPanel AnchorSideTop.Control = MemoPanel
Left = 6 Left = 6
Height = 16 Height = 18
Top = 6 Top = 6
Width = 41 Width = 41
BorderSpacing.Around = 6 BorderSpacing.Around = 6

View File

@ -134,7 +134,7 @@ end;
procedure TfrEditorForm.Button3Click(Sender: TObject); procedure TfrEditorForm.Button3Click(Sender: TObject);
begin begin
frVarForm := TfrVarForm.Create(nil); frVarForm := TfrVarForm.Create(Application);
try try
with frVarForm do with frVarForm do
if ShowModal = mrOk then if ShowModal = mrOk then
@ -193,7 +193,7 @@ end;
procedure TfrEditorForm.Button4Click(Sender: TObject); procedure TfrEditorForm.Button4Click(Sender: TObject);
begin begin
frFieldsForm := TfrFieldsForm.Create(nil); frFieldsForm := TfrFieldsForm.Create(Application);
try try
with frFieldsForm do with frFieldsForm do
begin begin

View File

@ -19,7 +19,7 @@ object frFieldsForm: TfrFieldsForm
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner AnchorSideTop.Control = Owner
Left = 6 Left = 6
Height = 16 Height = 18
Top = 6 Top = 6
Width = 90 Width = 90
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -34,8 +34,8 @@ object frFieldsForm: TfrFieldsForm
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 6 Left = 6
Height = 29 Height = 31
Top = 28 Top = 30
Width = 295 Width = 295
HelpContext = 10 HelpContext = 10
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
@ -55,14 +55,15 @@ object frFieldsForm: TfrFieldsForm
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 282 Height = 278
Top = 63 Top = 67
Width = 295 Width = 295
HelpContext = 23 HelpContext = 23
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
ClickOnSelChange = False ClickOnSelChange = False
ItemHeight = 0 ItemHeight = 0
OnDblClick = ValListDblClick
OnKeyDown = ValListKeyDown OnKeyDown = ValListKeyDown
OnSelectionChange = ValListSelectionChange OnSelectionChange = ValListSelectionChange
TabOrder = 1 TabOrder = 1

View File

@ -31,6 +31,7 @@ type
procedure FormActivate(Sender: TObject); procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormDeactivate(Sender: TObject); procedure FormDeactivate(Sender: TObject);
procedure ValListDblClick(Sender: TObject);
procedure ValListKeyDown(Sender: TObject; var Key: Word; procedure ValListKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); Shift: TShiftState);
procedure FormKeyDown(Sender: TObject; var Key: Word; procedure FormKeyDown(Sender: TObject; var Key: Word;
@ -60,7 +61,8 @@ var
procedure TfrFieldsForm.ValListKeyDown(Sender: TObject; var Key: Word; procedure TfrFieldsForm.ValListKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); Shift: TShiftState);
begin begin
if Key = vk_Return then begin if Key = vk_Return then
begin
UpdateDBField; UpdateDBField;
ModalResult := mrOk; ModalResult := mrOk;
end; end;
@ -123,12 +125,12 @@ end;
procedure TfrFieldsForm.ValListSelectionChange(Sender: TObject; User: boolean); procedure TfrFieldsForm.ValListSelectionChange(Sender: TObject; User: boolean);
begin begin
if User then { if User then
begin begin
UpdateDbField; UpdateDbField;
if DBField<>'' then if DBField<>'' then
ModalResult := mrOk; ModalResult := mrOk;
end; end;}
end; end;
procedure TfrFieldsForm.FormCreate(Sender: TObject); procedure TfrFieldsForm.FormCreate(Sender: TObject);
@ -155,4 +157,11 @@ begin
//UpdateDBField; //UpdateDBField;
end; end;
procedure TfrFieldsForm.ValListDblClick(Sender: TObject);
begin
UpdateDbField;
if DBField<>'' then
ModalResult := mrOk;
end;
end. end.

View File

@ -63,7 +63,7 @@ function UTF8QuotedStr(s:string; Quote: TUTF8Char; desc:string=''): string;
implementation implementation
uses LR_Class; uses LR_Class, LR_Const;
var var
LocalDescri: string; LocalDescri: string;
@ -323,7 +323,7 @@ procedure frGetDataSetAndField(ComplexName: String; var DataSet: TfrTDataSet;
var var
n: Integer; n: Integer;
f: TComponent; f: TComponent;
s1, s2, s3: String; s1, s2, s3, s4: String;
begin begin
Field := nil; Field := nil;
f := CurReport.Owner; f := CurReport.Owner;
@ -339,7 +339,17 @@ begin
f:=FindGlobalComponent(S1); f:=FindGlobalComponent(S1);
if f <> nil then if f <> nil then
begin begin
DataSet := TfrTDataSet(f.FindComponent(s2)); n:=Pos('.', S3); //test for frame name
if n>0 then //if frame name present
begin
S4:=Copy(S3, 1, n-1);
Delete(S3, 1, n);
f:=F.FindComponent(S2);
if Assigned(F)then
DataSet := TfrTDataSet(f.FindComponent(s4));
end
else
DataSet := TfrTDataSet(f.FindComponent(s2));
RemoveQuotes(s3); RemoveQuotes(s3);
if DataSet <> nil then if DataSet <> nil then
Field := TfrTField(DataSet.FindField(s3)); Field := TfrTField(DataSet.FindField(s3));
@ -369,7 +379,7 @@ end;
function frFindComponent(Owner: TComponent; Name: String): TComponent; function frFindComponent(Owner: TComponent; Name: String): TComponent;
var var
n: Integer; n: Integer;
s1, s2: String; s1, s2, s3: String;
begin begin
Result := nil; Result := nil;
n := Pos('.', Name); n := Pos('.', Name);
@ -379,14 +389,29 @@ begin
else else
begin begin
s1 := Copy(Name, 1, n - 1); // module name s1 := Copy(Name, 1, n - 1); // module name
s2 := Copy(Name, n + 1, 255); // component name s2 := Copy(Name, n + 1, Length(Name)); // component name
n := Pos('.', S2); //check for frames
if n = 0 then
S3:=''
else
begin
s3 := Copy(S2, 1, n - 1); // module name
Delete(S2, 1, n);
end;
Owner := FindGlobalComponent(s1); Owner := FindGlobalComponent(s1);
if Owner <> nil then if Owner <> nil then
Result := Owner.FindComponent(s2); begin
if s3<>'' then
Owner:=Owner.FindComponent(s3);
if Assigned(Owner) then
Result := Owner.FindComponent(s2);
end;
end; end;
except except
on Exception do on Exception do
raise EClassNotFound.Create('Îòñóòñòâóåò ' + Name); raise EClassNotFound.CreateFmt(sObjectNotFound, [Name]);
end; end;
end; end;
@ -413,13 +438,17 @@ var
for i := 0 to f.ComponentCount - 1 do for i := 0 to f.ComponentCount - 1 do
begin begin
c := f.Components[i]; c := f.Components[i];
if c is TFrame then
EnumComponents(c)
else
if (c <> Skip) and (c is ClassRef) then if (c <> Skip) and (c is ClassRef) then
if f = Owner then if f = Owner then
List.Add(c.Name) List.Add(c.Name)
else if ((f is TForm) or (f is TDataModule)) then else
if ((f is TForm) or (f is TDataModule)) then
List.Add(f.Name + '.' + c.Name) List.Add(f.Name + '.' + c.Name)
else else
List.Add(TControl(f).Parent.Name + '.' + f.Name + '.' + c.Name) List.Add(TControl(f).Owner.Name + '.' + f.Name + '.' + c.Name)
end; end;
end; end;

View File

@ -1,15 +1,15 @@
object frVarForm: TfrVarForm object frVarForm: TfrVarForm
Left = 555 Left = 555
Height = 317 Height = 343
Top = 187 Top = 187
Width = 217 Width = 297
HorzScrollBar.Page = 216 HorzScrollBar.Page = 216
VertScrollBar.Page = 316 VertScrollBar.Page = 316
ActiveControl = ValList ActiveControl = ValList
BorderStyle = bsDialog BorderStyle = bsDialog
Caption = 'Variables' Caption = 'Variables'
ClientHeight = 317 ClientHeight = 343
ClientWidth = 217 ClientWidth = 297
Font.Color = clBlack Font.Color = clBlack
OnActivate = FormActivate OnActivate = FormActivate
OnCreate = FormCreate OnCreate = FormCreate
@ -18,20 +18,32 @@ object frVarForm: TfrVarForm
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '0.9.29' LCLVersion = '0.9.29'
object Label1: TLabel object Label1: TLabel
Left = 4 AnchorSideLeft.Control = Owner
Height = 15 AnchorSideTop.Control = Owner
Top = 4 Left = 6
Width = 55 Height = 18
Top = 6
Width = 62
BorderSpacing.Around = 6
Caption = '&Category:' Caption = '&Category:'
FocusControl = ValCombo FocusControl = ValCombo
ParentColor = False ParentColor = False
end end
object ValList: TListBox object ValList: TListBox
Left = 4 AnchorSideLeft.Control = Owner
Height = 264 AnchorSideTop.Control = ValCombo
Top = 48 AnchorSideTop.Side = asrBottom
Width = 209 AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 270
Top = 67
Width = 285
HelpContext = 22 HelpContext = 22
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
ClickOnSelChange = False ClickOnSelChange = False
IntegralHeight = True IntegralHeight = True
ItemHeight = 0 ItemHeight = 0
@ -42,11 +54,18 @@ object frVarForm: TfrVarForm
TopIndex = -1 TopIndex = -1
end end
object ValCombo: TComboBox object ValCombo: TComboBox
Left = 4 AnchorSideLeft.Control = Owner
Height = 29 AnchorSideTop.Control = Label1
Top = 24 AnchorSideTop.Side = asrBottom
Width = 209 AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 31
Top = 30
Width = 285
HelpContext = 32 HelpContext = 32
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 6
ItemHeight = 0 ItemHeight = 0
OnChange = ValComboClick OnChange = ValComboClick
Style = csDropDownList Style = csDropDownList

View File

@ -54,3 +54,4 @@
{$UNDEFINE MODALDESIGNER} {$UNDEFINE MODALDESIGNER}
{$ENDIF} {$ENDIF}
{$ENDIF} {$ENDIF}
{$DEFINE Delphi5}