void __fastcall TCustomCommandOptionsDialog::AddOptionComboBox(
  TComboBox * ComboBox, const UnicodeString & Value, const TCustomCommandType::TOption & Option, std::vector<UnicodeString> & Values)
{
  std::unique_ptr<TStringList> Items(new TStringList());
  int ItemIndex = -1;

  TCustomCommandType::TOption::TParams::const_iterator ParamI = Option.Params.begin();
  while (ParamI != Option.Params.end())
  {
    UnicodeString Item = (*ParamI);
    int P = Item.Pos(L"=");
    UnicodeString ParamValue;
    if (P > 0)
    {
      ParamValue = Item.SubString(1, P - 1);
      Item.Delete(1, P);
    }
    else
    {
      ParamValue = Item;
    }
    Item = WinConfiguration->ExtensionStringTranslation(FCommand->Id, Item);
    Items->Add(Item);
    if (Value == ParamValue)
    {
      ItemIndex = Items->Count - 1;
    }
    Values.push_back(ParamValue);
    ParamI++;
  }

  AddComboBox(ComboBox, CreateLabel(Option.Caption), Items.get(), true);

  ComboBox->ItemIndex = ItemIndex;
}

void __fastcall TCustomCommandOptionsDialog::AddOptionComboBox(
  TComboBox * ComboBox, const UnicodeString & Value, const TCustomCommandType::TOption & Option, std::vector<UnicodeString> & Values)
{
  std::unique_ptr<TStringList> Items(new TStringList());
  int ItemIndex = -1;

  TCustomCommandType::TOption::TParams::const_iterator ParamI = Option.Params.begin();
  while (ParamI != Option.Params.end())
  {
    UnicodeString Item = (*ParamI);
    int P = Item.Pos(L"=");
    UnicodeString ParamValue;
    if (P > 0)
    {
      ParamValue = Item.SubString(1, P - 1);
      Item.Delete(1, P);
    }
    else
    {
      ParamValue = Item;
    }
    Item = WinConfiguration->ExtensionStringTranslation(FCommand->Id, Item);
    Items->Add(Item);
    if (Value == ParamValue)
    {
      ItemIndex = Items->Count - 1;
    }
    Values.push_back(ParamValue);
    ParamI++;
  }

  AddComboBox(ComboBox, CreateLabel(Option.Caption), Items.get(), true);

  ComboBox->ItemIndex = ItemIndex;
}
