本文整理汇总了C++中HTMLSelectElement::SetOptionsSelectedByIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLSelectElement::SetOptionsSelectedByIndex方法的具体用法?C++ HTMLSelectElement::SetOptionsSelectedByIndex怎么用?C++ HTMLSelectElement::SetOptionsSelectedByIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLSelectElement
的用法示例。
在下文中一共展示了HTMLSelectElement::SetOptionsSelectedByIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSelect
NS_IMETHODIMP
HTMLOptionElement::SetSelected(bool aValue)
{
// Note: The select content obj maintains all the PresState
// so defer to it to get the answer
HTMLSelectElement* selectInt = GetSelect();
if (selectInt) {
int32_t index = Index();
// This should end up calling SetSelectedInternal
selectInt->SetOptionsSelectedByIndex(index, index, aValue,
false, true, true);
} else {
SetSelectedInternal(aValue, true);
}
return NS_OK;
}
示例2: GetSelect
NS_IMETHODIMP
HTMLOptionElement::SetSelected(bool aValue)
{
// Note: The select content obj maintains all the PresState
// so defer to it to get the answer
HTMLSelectElement* selectInt = GetSelect();
if (selectInt) {
int32_t index = Index();
uint32_t mask = HTMLSelectElement::SET_DISABLED | HTMLSelectElement::NOTIFY;
if (aValue) {
mask |= HTMLSelectElement::IS_SELECTED;
}
// This should end up calling SetSelectedInternal
selectInt->SetOptionsSelectedByIndex(index, index, mask);
} else {
SetSelectedInternal(aValue, true);
}
return NS_OK;
}