Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in TVclStylesSystemMenu.CreateMenuStyles #299

Open
mksjgj opened this issue Aug 31, 2022 · 0 comments
Open

bug in TVclStylesSystemMenu.CreateMenuStyles #299

mksjgj opened this issue Aug 31, 2022 · 0 comments

Comments

@mksjgj
Copy link

mksjgj commented Aug 31, 2022

as the document suggestion, write this codes:

constructor TForm1.Create(AOwner: TComponent);
begin

inherited;
TVclStylesSystemMenu.Create(Self);

end;

if you has compile option range check on(the default is false), you will get a runtime error:

Project Project1.exe raised exception class ERangeError with message 'Range check error'.

the reason is here:

if SameText('Windows', s) then
  AddMenuSeparatorHelper(FVCLStylesMenu, LSubMenuIndex);   //error: use a used LSubMenuIndex for new item

it should be:

if SameText('Windows', s) then
begin
  Inc(LSubMenuIndex); //n9p+: use a new index for the Separator
  AddMenuSeparatorHelper(FVCLStylesMenu, LSubMenuIndex);
end;
salvadordf added a commit to salvadordf/vcl-styles-utils that referenced this issue Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant