mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 00:59:30 +02:00
LazReport, patch from Alexs Lagunov to allow datasets on frames
git-svn-id: trunk@27174 -
This commit is contained in:
parent
8553012044
commit
1f81f24737
@ -1419,6 +1419,10 @@ msgstr "[Keine]"
|
||||
msgid "Object inspector"
|
||||
msgstr "Objektinspektor"
|
||||
|
||||
#: lr_const.sobjectnotfound
|
||||
msgid "Object \"%s\" not found"
|
||||
msgstr ""
|
||||
|
||||
#: lr_const.sok
|
||||
msgid "Ok"
|
||||
msgstr "OK"
|
||||
|
@ -1408,6 +1408,10 @@ msgstr "[Nada]"
|
||||
msgid "Object inspector"
|
||||
msgstr "Inspector de objetos"
|
||||
|
||||
#: lr_const.sobjectnotfound
|
||||
msgid "Object \"%s\" not found"
|
||||
msgstr ""
|
||||
|
||||
#: lr_const.sok
|
||||
msgid "Ok"
|
||||
msgstr "Aceptar"
|
||||
|
@ -1417,6 +1417,10 @@ msgstr "[Aucun]"
|
||||
msgid "Object inspector"
|
||||
msgstr "Inspecteur d'objets"
|
||||
|
||||
#: lr_const.sobjectnotfound
|
||||
msgid "Object \"%s\" not found"
|
||||
msgstr ""
|
||||
|
||||
#: lr_const.sok
|
||||
msgid "Ok"
|
||||
msgstr "OK"
|
||||
|
@ -1408,6 +1408,10 @@ msgstr "[Tidak ada]"
|
||||
msgid "Object inspector"
|
||||
msgstr "Inspektor obyek"
|
||||
|
||||
#: lr_const.sobjectnotfound
|
||||
msgid "Object \"%s\" not found"
|
||||
msgstr ""
|
||||
|
||||
#: lr_const.sok
|
||||
msgid "Ok"
|
||||
msgstr "Ok"
|
||||
|
@ -1410,6 +1410,10 @@ msgstr "[Joks]"
|
||||
msgid "Object inspector"
|
||||
msgstr "Objektų inspektorius"
|
||||
|
||||
#: lr_const.sobjectnotfound
|
||||
msgid "Object \"%s\" not found"
|
||||
msgstr ""
|
||||
|
||||
#: lr_const.sok
|
||||
msgid "Ok"
|
||||
msgstr "Tinka"
|
||||
|
@ -1408,6 +1408,10 @@ msgstr "[Nenhum]"
|
||||
msgid "Object inspector"
|
||||
msgstr "Inspetor de Objetos"
|
||||
|
||||
#: lr_const.sobjectnotfound
|
||||
msgid "Object \"%s\" not found"
|
||||
msgstr ""
|
||||
|
||||
#: lr_const.sok
|
||||
msgid "Ok"
|
||||
msgstr "Ok"
|
||||
|
@ -1411,6 +1411,10 @@ msgstr "[Brak]"
|
||||
msgid "Object inspector"
|
||||
msgstr "Inspektor obiektów"
|
||||
|
||||
#: lr_const.sobjectnotfound
|
||||
msgid "Object \"%s\" not found"
|
||||
msgstr ""
|
||||
|
||||
#: lr_const.sok
|
||||
msgid "Ok"
|
||||
msgstr ""
|
||||
|
@ -1403,6 +1403,10 @@ msgstr ""
|
||||
msgid "Object inspector"
|
||||
msgstr ""
|
||||
|
||||
#: lr_const.sobjectnotfound
|
||||
msgid "Object \"%s\" not found"
|
||||
msgstr ""
|
||||
|
||||
#: lr_const.sok
|
||||
msgid "Ok"
|
||||
msgstr ""
|
||||
|
@ -1408,6 +1408,10 @@ msgstr "[Нет]"
|
||||
msgid "Object inspector"
|
||||
msgstr "Инспектор объектов"
|
||||
|
||||
#: lr_const.sobjectnotfound
|
||||
msgid "Object \"%s\" not found"
|
||||
msgstr ""
|
||||
|
||||
#: lr_const.sok
|
||||
msgid "Ok"
|
||||
msgstr "OK"
|
||||
|
@ -249,9 +249,11 @@ resourcestring
|
||||
sFRVariables = 'FR variables';
|
||||
sErrorOccured = 'An error occured during calculating';
|
||||
sSpecVal = 'Other';
|
||||
sFRFError='Unsupported FRF format';
|
||||
sClassObjectNotFound='Class Object "%s" not found';
|
||||
sFRFError = 'Unsupported FRF format';
|
||||
sClassObjectNotFound = 'Class Object "%s" not found';
|
||||
sDuplicatedObjectName = 'An object named "%s" already exists';
|
||||
sObjectNotFound = 'Object "%s" not found';
|
||||
|
||||
|
||||
SDoc = 'Report:';
|
||||
SBand = 'Band:';
|
||||
|
@ -32,10 +32,10 @@ inherited frEditorForm: TfrEditorForm
|
||||
object Button1: TButton
|
||||
AnchorSideTop.Control = Panel2
|
||||
AnchorSideRight.Control = Button2
|
||||
Left = 473
|
||||
Left = 477
|
||||
Height = 37
|
||||
Top = 4
|
||||
Width = 39
|
||||
Width = 37
|
||||
HelpContext = 40
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
@ -50,10 +50,10 @@ inherited frEditorForm: TfrEditorForm
|
||||
AnchorSideTop.Control = Panel2
|
||||
AnchorSideRight.Control = Panel2
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 518
|
||||
Left = 520
|
||||
Height = 37
|
||||
Top = 4
|
||||
Width = 65
|
||||
Width = 63
|
||||
HelpContext = 50
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
@ -70,7 +70,7 @@ inherited frEditorForm: TfrEditorForm
|
||||
Left = 6
|
||||
Height = 37
|
||||
Top = 4
|
||||
Width = 73
|
||||
Width = 71
|
||||
HelpContext = 60
|
||||
Anchors = [akLeft, akBottom]
|
||||
AutoSize = True
|
||||
@ -84,10 +84,10 @@ inherited frEditorForm: TfrEditorForm
|
||||
AnchorSideLeft.Control = Button3
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Panel2
|
||||
Left = 85
|
||||
Left = 83
|
||||
Height = 37
|
||||
Top = 4
|
||||
Width = 71
|
||||
Width = 69
|
||||
HelpContext = 70
|
||||
Anchors = [akLeft, akBottom]
|
||||
AutoSize = True
|
||||
@ -101,10 +101,10 @@ inherited frEditorForm: TfrEditorForm
|
||||
AnchorSideLeft.Control = Button6
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Panel2
|
||||
Left = 243
|
||||
Left = 237
|
||||
Height = 37
|
||||
Top = 4
|
||||
Width = 68
|
||||
Width = 66
|
||||
HelpContext = 110
|
||||
Anchors = [akLeft, akBottom]
|
||||
AutoSize = True
|
||||
@ -118,10 +118,10 @@ inherited frEditorForm: TfrEditorForm
|
||||
AnchorSideLeft.Control = Button4
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Panel2
|
||||
Left = 162
|
||||
Left = 158
|
||||
Height = 37
|
||||
Top = 4
|
||||
Width = 75
|
||||
Width = 73
|
||||
HelpContext = 70
|
||||
Anchors = [akLeft, akBottom]
|
||||
AutoSize = True
|
||||
@ -145,7 +145,7 @@ inherited frEditorForm: TfrEditorForm
|
||||
TabOrder = 1
|
||||
object Label2: TLabel
|
||||
Left = 4
|
||||
Height = 16
|
||||
Height = 18
|
||||
Top = 0
|
||||
Width = 38
|
||||
Caption = 'S&cript'
|
||||
@ -167,7 +167,7 @@ inherited frEditorForm: TfrEditorForm
|
||||
TabOrder = 0
|
||||
BookMarkOptions.Xoffset = 2
|
||||
Gutter.Color = 13605511
|
||||
Gutter.Width = 57
|
||||
Gutter.Width = 55
|
||||
Gutter.MouseActions = <
|
||||
item
|
||||
Shift = []
|
||||
@ -191,6 +191,30 @@ inherited frEditorForm: TfrEditorForm
|
||||
Option = 0
|
||||
Priority = 0
|
||||
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
|
||||
Keystrokes = <
|
||||
item
|
||||
@ -753,6 +777,8 @@ inherited frEditorForm: TfrEditorForm
|
||||
end>
|
||||
end
|
||||
end
|
||||
inline SynRightGutterPartList1: TSynRightGutterPartList
|
||||
end
|
||||
end
|
||||
end
|
||||
object MemoPanel: TPanel[2]
|
||||
@ -775,8 +801,8 @@ inherited frEditorForm: TfrEditorForm
|
||||
AnchorSideBottom.Control = MemoPanel
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 162
|
||||
Top = 28
|
||||
Height = 160
|
||||
Top = 30
|
||||
Width = 589
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
OnEnter = M1Enter
|
||||
@ -789,7 +815,7 @@ inherited frEditorForm: TfrEditorForm
|
||||
AnchorSideLeft.Control = MemoPanel
|
||||
AnchorSideTop.Control = MemoPanel
|
||||
Left = 6
|
||||
Height = 16
|
||||
Height = 18
|
||||
Top = 6
|
||||
Width = 41
|
||||
BorderSpacing.Around = 6
|
||||
|
@ -134,7 +134,7 @@ end;
|
||||
|
||||
procedure TfrEditorForm.Button3Click(Sender: TObject);
|
||||
begin
|
||||
frVarForm := TfrVarForm.Create(nil);
|
||||
frVarForm := TfrVarForm.Create(Application);
|
||||
try
|
||||
with frVarForm do
|
||||
if ShowModal = mrOk then
|
||||
@ -193,7 +193,7 @@ end;
|
||||
|
||||
procedure TfrEditorForm.Button4Click(Sender: TObject);
|
||||
begin
|
||||
frFieldsForm := TfrFieldsForm.Create(nil);
|
||||
frFieldsForm := TfrFieldsForm.Create(Application);
|
||||
try
|
||||
with frFieldsForm do
|
||||
begin
|
||||
|
@ -19,7 +19,7 @@ object frFieldsForm: TfrFieldsForm
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 6
|
||||
Height = 16
|
||||
Height = 18
|
||||
Top = 6
|
||||
Width = 90
|
||||
BorderSpacing.Around = 6
|
||||
@ -34,8 +34,8 @@ object frFieldsForm: TfrFieldsForm
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 29
|
||||
Top = 28
|
||||
Height = 31
|
||||
Top = 30
|
||||
Width = 295
|
||||
HelpContext = 10
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
@ -55,14 +55,15 @@ object frFieldsForm: TfrFieldsForm
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 282
|
||||
Top = 63
|
||||
Height = 278
|
||||
Top = 67
|
||||
Width = 295
|
||||
HelpContext = 23
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Around = 6
|
||||
ClickOnSelChange = False
|
||||
ItemHeight = 0
|
||||
OnDblClick = ValListDblClick
|
||||
OnKeyDown = ValListKeyDown
|
||||
OnSelectionChange = ValListSelectionChange
|
||||
TabOrder = 1
|
||||
|
@ -31,6 +31,7 @@ type
|
||||
procedure FormActivate(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDeactivate(Sender: TObject);
|
||||
procedure ValListDblClick(Sender: TObject);
|
||||
procedure ValListKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
procedure FormKeyDown(Sender: TObject; var Key: Word;
|
||||
@ -60,7 +61,8 @@ var
|
||||
procedure TfrFieldsForm.ValListKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
if Key = vk_Return then begin
|
||||
if Key = vk_Return then
|
||||
begin
|
||||
UpdateDBField;
|
||||
ModalResult := mrOk;
|
||||
end;
|
||||
@ -123,12 +125,12 @@ end;
|
||||
|
||||
procedure TfrFieldsForm.ValListSelectionChange(Sender: TObject; User: boolean);
|
||||
begin
|
||||
if User then
|
||||
{ if User then
|
||||
begin
|
||||
UpdateDbField;
|
||||
if DBField<>'' then
|
||||
ModalResult := mrOk;
|
||||
end;
|
||||
end;}
|
||||
end;
|
||||
|
||||
procedure TfrFieldsForm.FormCreate(Sender: TObject);
|
||||
@ -155,4 +157,11 @@ begin
|
||||
//UpdateDBField;
|
||||
end;
|
||||
|
||||
procedure TfrFieldsForm.ValListDblClick(Sender: TObject);
|
||||
begin
|
||||
UpdateDbField;
|
||||
if DBField<>'' then
|
||||
ModalResult := mrOk;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -63,7 +63,7 @@ function UTF8QuotedStr(s:string; Quote: TUTF8Char; desc:string=''): string;
|
||||
|
||||
implementation
|
||||
|
||||
uses LR_Class;
|
||||
uses LR_Class, LR_Const;
|
||||
|
||||
var
|
||||
LocalDescri: string;
|
||||
@ -323,7 +323,7 @@ procedure frGetDataSetAndField(ComplexName: String; var DataSet: TfrTDataSet;
|
||||
var
|
||||
n: Integer;
|
||||
f: TComponent;
|
||||
s1, s2, s3: String;
|
||||
s1, s2, s3, s4: String;
|
||||
begin
|
||||
Field := nil;
|
||||
f := CurReport.Owner;
|
||||
@ -339,7 +339,17 @@ begin
|
||||
f:=FindGlobalComponent(S1);
|
||||
if f <> nil then
|
||||
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);
|
||||
if DataSet <> nil then
|
||||
Field := TfrTField(DataSet.FindField(s3));
|
||||
@ -369,7 +379,7 @@ end;
|
||||
function frFindComponent(Owner: TComponent; Name: String): TComponent;
|
||||
var
|
||||
n: Integer;
|
||||
s1, s2: String;
|
||||
s1, s2, s3: String;
|
||||
begin
|
||||
Result := nil;
|
||||
n := Pos('.', Name);
|
||||
@ -379,14 +389,29 @@ begin
|
||||
else
|
||||
begin
|
||||
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);
|
||||
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;
|
||||
except
|
||||
on Exception do
|
||||
raise EClassNotFound.Create('Îòñóòñòâóåò ' + Name);
|
||||
raise EClassNotFound.CreateFmt(sObjectNotFound, [Name]);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -413,13 +438,17 @@ var
|
||||
for i := 0 to f.ComponentCount - 1 do
|
||||
begin
|
||||
c := f.Components[i];
|
||||
if c is TFrame then
|
||||
EnumComponents(c)
|
||||
else
|
||||
if (c <> Skip) and (c is ClassRef) then
|
||||
if f = Owner then
|
||||
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)
|
||||
else
|
||||
List.Add(TControl(f).Parent.Name + '.' + f.Name + '.' + c.Name)
|
||||
List.Add(TControl(f).Owner.Name + '.' + f.Name + '.' + c.Name)
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
object frVarForm: TfrVarForm
|
||||
Left = 555
|
||||
Height = 317
|
||||
Height = 343
|
||||
Top = 187
|
||||
Width = 217
|
||||
Width = 297
|
||||
HorzScrollBar.Page = 216
|
||||
VertScrollBar.Page = 316
|
||||
ActiveControl = ValList
|
||||
BorderStyle = bsDialog
|
||||
Caption = 'Variables'
|
||||
ClientHeight = 317
|
||||
ClientWidth = 217
|
||||
ClientHeight = 343
|
||||
ClientWidth = 297
|
||||
Font.Color = clBlack
|
||||
OnActivate = FormActivate
|
||||
OnCreate = FormCreate
|
||||
@ -18,20 +18,32 @@ object frVarForm: TfrVarForm
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '0.9.29'
|
||||
object Label1: TLabel
|
||||
Left = 4
|
||||
Height = 15
|
||||
Top = 4
|
||||
Width = 55
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 6
|
||||
Height = 18
|
||||
Top = 6
|
||||
Width = 62
|
||||
BorderSpacing.Around = 6
|
||||
Caption = '&Category:'
|
||||
FocusControl = ValCombo
|
||||
ParentColor = False
|
||||
end
|
||||
object ValList: TListBox
|
||||
Left = 4
|
||||
Height = 264
|
||||
Top = 48
|
||||
Width = 209
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = ValCombo
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 270
|
||||
Top = 67
|
||||
Width = 285
|
||||
HelpContext = 22
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Around = 6
|
||||
ClickOnSelChange = False
|
||||
IntegralHeight = True
|
||||
ItemHeight = 0
|
||||
@ -42,11 +54,18 @@ object frVarForm: TfrVarForm
|
||||
TopIndex = -1
|
||||
end
|
||||
object ValCombo: TComboBox
|
||||
Left = 4
|
||||
Height = 29
|
||||
Top = 24
|
||||
Width = 209
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Label1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 31
|
||||
Top = 30
|
||||
Width = 285
|
||||
HelpContext = 32
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
ItemHeight = 0
|
||||
OnChange = ValComboClick
|
||||
Style = csDropDownList
|
||||
|
@ -54,3 +54,4 @@
|
||||
{$UNDEFINE MODALDESIGNER}
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
{$DEFINE Delphi5}
|
||||
|
Loading…
Reference in New Issue
Block a user