void __fastcall TCustomDialog::SetUpComboBox(TCustomCombo * Combo, TStrings * Items, bool OneLine)
{
  if (Items != NULL)
  {
    Combo->Items = Items;
  }

  if (OneLine)
  {
    int Width = 0;
    for (int Index = 0; Index < Combo->Items->Count; Index++)
    {
      Width = Max(Width, Combo->Canvas->TextWidth(Combo->Items->Strings[Index]));
    }

    Width += ScaleByTextHeight(Combo, 4 + 16 + 14);
    Width = Max(Width, HelpButton->Width);

    Combo->Width = Width;
    Combo->Left = GetDefaultParent()->ClientWidth - FHorizontalMargin - Width;
  }

  TComboBox * PublicCombo = reinterpret_cast<TComboBox *>(Combo);
  if (PublicCombo->OnChange == NULL)
  {
    PublicCombo->OnChange = Change;
  }
}

void __fastcall TCustomDialog::SetUpComboBox(TCustomCombo * Combo, TStrings * Items, bool OneLine)
{
  if (Items != NULL)
  {
    Combo->Items = Items;
  }

  if (OneLine)
  {
    int Width = 0;
    for (int Index = 0; Index < Combo->Items->Count; Index++)
    {
      Width = Max(Width, Combo->Canvas->TextWidth(Combo->Items->Strings[Index]));
    }

    Width += ScaleByTextHeight(Combo, 4 + 16 + 14);
    Width = Max(Width, HelpButton->Width);

    Combo->Width = Width;
    Combo->Left = GetDefaultParent()->ClientWidth - FHorizontalMargin - Width;
  }

  TComboBox * PublicCombo = reinterpret_cast<TComboBox *>(Combo);
  if (PublicCombo->OnChange == NULL)
  {
    PublicCombo->OnChange = Change;
  }
}
