Well, I have just come across another issue with Scripter v1.23 and newer. I have come across a Access Violation when using a TScrPascalMemoStyler.
To reproduce the issue do the following:
- Load the Scripter Demo project.
- Add a TScrPascalMemoStyler to the form.
- Use the default name of ScrPascalMemoStyler1 for the Styler.
- Now modify the TForm.OnCreateEditor procedure to look like the following:
procedure TForm1.OnCreateEditor(Sender: TObject);
var
AMenu: TMainMenu;
AItem: TMenuItem;
ASubItem: TMenuItem;
c: integer;
AOldImages: TCustomImageList;
begin
{This callback event is only used to add an About options in the menu}
if Sender is TForm then
begin
{Create about menu and "migrate" all items from popup to the about}
AMenu := TIDEEditorForm(Sender).MainMenu1;
AOldImages := AMenu.Images; //visual workaround
AMenu.Images := nil;
AItem := TMenuItem.Create(AMenu.Owner);
AItem.Caption := 'About';
AMenu.Items.Add(AItem);
for c := 0 to PopupMenu1.Items.Count - 1 do
begin
ASubItem := TMenuItem.Create(AMenu.Owner);
ASubItem.Caption := PopupMenu1.Items[c].Caption;
ASubItem.OnClick := PopupMenu1.Items[c].OnClick;
AItem.Add(ASuBItem);
end;
AMenu.Images := AOldImages;
{Add Pascal Styler to the IDEMemo1}
TIDEEditorForm(Sender).IDEMemo1.SyntaxStyles := ScrPascalMemoStyler1;
end;
end;
- Select the IDEEngine1 icon on the Form.
- Remove the checkmark from the AutoStyler property.
- Build and Run the project
- Once the Scripter IDE Demo is displayed, click anywhere in the IDEMemo.
The following AV message is displayed:
---------------------------
Scripterproide
---------------------------
Access violation at address 007BA5D1 in module 'ScripterProIDE.exe'. Read of address 00000048.
---------------------------
OK
---------------------------
To verify that the AV is with using the Styler, do the following:
- Select the IDEEngine1 icon on the form.
- Replace the checkmark for the AutoStyle property.
- Build and Run the project.
- Once the Scripter IDE Demo is window is displayed. Click anywhere in the IDEMemo.
At which point you will not get the AV.
I have also tried using the following lines in place of the ones in the above shown code.
{Add Pascal Styler to the IDEMemo1}
IDEEngine1.Memo.SyntaxStyles := ScrPascalMemoStyler1;
And I still get the AV when using the TScrPascalMemoStyler instead of the TIDEEngine's AutoStyle.