title: Good way of enabling buttons
body: <p>I have an application that has 15 Buttons on a form. Each button can be Enabled as required and there are no set configurations so there could dozens of combinations.</p>
  
  <p>To set Btnxxx.Enabled, I am currently using,</p>
  
  <pre><code>procedure TForm1.SetButtons(aStr : String);
    // aStr can be '123456789ABC' for all Enabled
    //          or '123_567__ABC' for all-but 4, 8 and 9 Enabled
  
  begin
    btnInsert.Enabled:=Pos('1',aStr);
    btnVariety.Enabled:=Pos('2',aStr);
  </code></pre>
  
  <p>This is getting cumbersome and error prone when I add or delete buttons. I tried using Boolean instead of aStr as in</p>
  
  <pre><code>const
    aInsOn = True;
    aInsOff = False;
    aVarOn = True;
    aVarOff = False;
  
  procedure TForm1.SetButtons(InsOnOf, VarOnOff ... for 15 buttons : Boolean);
  begin
    btnInsert.Enabled:=InsOnOff;
    btnVariety.Enabled:=VarOnOff;
  </code></pre>
  
  <p>Calling SetButtons would be</p>
  
  <pre><code>SetButtons(aInsOff, aVarOn, .......);
  </code></pre>
  
  <p>but that too was less than ideal with huge strings of Boolean settings.</p>
  
  <p>I also tried using the Tag in similar fashion to the aStr example, but it too is error prone.</p>
  
  <p>Does anyone have a pet-idea for doing this? I have not been able to make Actions work due to the unknown combinations of Enabled states of the buttons at any given time.</p>