I want to evenly distribute the buttons across a TTMSFNCListEditor.
I have a prototype of code that would probably work, but I can figure out two things: (1) how to programmatically determine how many buttons are on the ListEditor and (2) how to determine the width of each existing button. Here is my prototype code (which I tested by hardcoding values and seems close to working). Even if you can only show me how to it in Delphi, I can convert it back to C++:
//---------------------------------------------------------------------------
void __fastcall TForm2::FormResize(TObject *Sender)
{
int occupiedSpace = 0;
int itemCount = 3; // How do you do this in code?
for (int i = 0; i < itemCount; i++) {
int IndividualItemSize = ? // how do you do this in code ?
occupiedSpace += IndividualItemSize;
}
int SpacingSize = (TMSFNCListEditor1->Width - (occupiedSpace)) / (itemCount + 1) - (6 * itemCount);
TMSFNCListEditor1->ItemAppearance->HorizontalSpacing = SpacingSize;
}
//---------------------------------------------------------------------------