Locating and changing shapes on a preview from script

edited 2:45AM in FastReport 4.0
Hi. I have a question on using script with a report preview.
I see that I can toggle the color of a shape using:
procedure shpSelOnPreviewClick(Sender: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean);
var
Shape : TfrxShapeView;
begin
Shape := TfrxShapeView(Sender);
If Shape.Color = clNone then
Shape.Color := clBlack
else
Shape.Color := clNone;
Modified := True;
end;

I would now like to toggle an entire row of shapes using a click on another shape. I extended the code above to become:
procedure Shape1OnPreviewClick(Sender: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean);
var
Shape : TfrxShapeView;
I : integer;
S : string;
begin
For I := 0 to 17 do
begin
S := 'shpR0C' + IntToStr(I);
Shape := TfrxShapeView(Page1.FindObject( S ));
If Shape <> nil then
begin
If Shape.Color = clNone then
Shape.Color := clBlack
else
Shape.Color := clNone;
end;
end;
end;
But I dont see any change. I seem to be locating the target shape (it shows up as a number in the debugger) but I dont know how to refresh it.
Where can I find documentation that gives me the methods that I can call on shapes etc in script code?

Thanks

Comments

  • edited 2:45AM
    Hello,

    same Problem here.
    for i = 0 to MainPage.AllObjects.Count - 1
    if MainPage.AllObjects.Items[i].ClassName = "TfrxShapeView" then                                                                      
    TfrxShapeView(MainPage.AllObjects.Items[i]).visible = false                                    
    end if
    

    Doesnt Display in Preview. Any Solutions?

    Thx in Advance

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.