Questions about restrictions
Dear developers!
I am making my first steps with FR's evaluation version, and try to integrate it into my application.
I make runtime reports basically with TfrxMemoViews.
It would be of great importance that some of the memos shall not be editable by the user (especially their contents, the positions and sizes can be modifiable). To achieve this I experienced with TfrxMemoView's Restrictions property, but even if I set them, they do not apply, and in the design window I can see an empty set at the Restrictions. I watched it in Delhi debugger, and after the memo is finished, the needed restrictions are there indeed - but they disappear by the time I open the designer. Is this a bug, or some kind of planned behaviour? Hereby the code I'm using:
On the other hand, even if I do manage to apply these restrictions, users can still switch them off in the designer window, and then be able to edit the contents of the memos. Is there a way to make a memo really uneditable? Or if not, is there a method to know that the user edited the created report and act accordingly?
Thank you in advance for your help!
I am making my first steps with FR's evaluation version, and try to integrate it into my application.
I make runtime reports basically with TfrxMemoViews.
It would be of great importance that some of the memos shall not be editable by the user (especially their contents, the positions and sizes can be modifiable). To achieve this I experienced with TfrxMemoView's Restrictions property, but even if I set them, they do not apply, and in the design window I can see an empty set at the Restrictions. I watched it in Delhi debugger, and after the memo is finished, the needed restrictions are there indeed - but they disappear by the time I open the designer. Is this a bug, or some kind of planned behaviour? Hereby the code I'm using:
Result:=TfrxMemoView.Create(fActPage);
with Result do
begin
CreateUniqueName;
AllowHTMLTags:=MustAllowHtml(_Text);
SetBounds(_Pos.rX + dx,_Pos.rY + dy,w,h);
AllowExpressions:=True;
Text:=_Text;
AssignActualFont(Result);
ExpressionDelimiters:=c_ExpDelim1+','+c_ExpDelim2;
WordWrap:=_WordWrap;
case Hal of
TA_LEFT : HAlign:=haLeft;
TA_RIGHT : HAlign:=haRight;
TA_CENTER : HAlign:=haCenter;
end;
case Val of
TA_TOP : VAlign:=vaTop;
TA_BOTTOM : VAlign:=vaBottom;
TA_CENTER : VAlign:=vaCenter;
end;
fActX:=Left + Width;
fActY:=Top + Height;
cw:=CalcWidth;
if cw<>w then
begin
case Hal of
TA_LEFT : Width:=cw;
TA_RIGHT : begin
Left:=Width + Left - cw;
Width:=cw;
end;
TA_CENTER : begin
Left := Left + (Width + cw)/2;
Width := cw;
end;
end;
end;
Restrictions:=Restrictions + [rfDontDelete,rfDontEdit];//this should apply, but doesn't...
end;
On the other hand, even if I do manage to apply these restrictions, users can still switch them off in the designer window, and then be able to edit the contents of the memos. Is there a way to make a memo really uneditable? Or if not, is there a method to know that the user edited the created report and act accordingly?
Thank you in advance for your help!