EtheaDev / StyledComponents

Components similar to Delphi VCL Buttons, Toolbar, DbNavigator, BindNavigator, ButtonGroup and CategoryButtons with Custom Graphic Styles, and an advanced, full-customizable TaskDialog, also with animations!
Apache License 2.0
152 stars 34 forks source link

ClearButtons method with TStledToolBar gives Stack Overflow Error #32

Closed lancerasmussen closed 2 months ago

lancerasmussen commented 2 months ago

May be in part related to prior issue posted.

When calling the ClearButtons method it gives an error in the CMControlChange procedure:

procedure TStyledToolBar.CMControlChange(var Message: TCMControlChange); begin inherited; with Message do if Inserting then InsertButton(Control) else RemoveButton(Control); <-- Stack Overflow error. end;

lancerasmussen commented 2 months ago

I also tried plain simple Freeing and it gave same error. I tried the standard delphi TToolbar and buttons and tried the Free and it worked. while tpmenu.ButtonCount > 0 do tpmenu.Buttons[0].Free;

lancerasmussen commented 2 months ago

Example test project BadMenuIndexing.zip

carloBarazzetta commented 2 months ago

Please remove this line at 1426 from Vcl.StyledToolbar.pas RemoveControl(Control);

carloBarazzetta commented 2 months ago

Fixed in 3.6.2, please confirm ;-)

lancerasmussen commented 2 months ago

No longer stack overflow. Now just cant seem to keep the toolbar buttons in the exact order I want.

lancerasmussen commented 2 months ago

Confirmed