本文整理汇总了C++中HTMLSelectElement::optionToListIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLSelectElement::optionToListIndex方法的具体用法?C++ HTMLSelectElement::optionToListIndex怎么用?C++ HTMLSelectElement::optionToListIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLSelectElement
的用法示例。
在下文中一共展示了HTMLSelectElement::optionToListIndex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showPopup
void RenderMenuList::showPopup()
{
if (m_popupIsVisible)
return;
if (document()->page()->chrome().hasOpenedPopup())
return;
// Create m_innerBlock here so it ends up as the first child.
// This is important because otherwise we might try to create m_innerBlock
// inside the showPopup call and it would fail.
createInnerBlock();
if (!m_popup)
m_popup = document()->page()->chrome().createPopupMenu(this);
m_popupIsVisible = true;
// Compute the top left taking transforms into account, but use
// the actual width of the element to size the popup.
FloatPoint absTopLeft = localToAbsolute(FloatPoint(), UseTransforms);
IntRect absBounds = absoluteBoundingBoxRectIgnoringTransforms();
absBounds.setLocation(roundedIntPoint(absTopLeft));
HTMLSelectElement* select = selectElement();
m_popup->show(absBounds, document()->view(), select->optionToListIndex(select->selectedIndex()));
}
示例2: selectedIndex
int RenderMenuList::selectedIndex() const
{
HTMLSelectElement* select = selectElement();
return select->optionToListIndex(select->selectedIndex());
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_WebKit,代码行数:5,代码来源:RenderMenuList.cpp
示例3: selectedIndex
int RenderMenuList::selectedIndex() const
{
HTMLSelectElement* select = static_cast<HTMLSelectElement*>(node());
return select->optionToListIndex(select->selectedIndex());
}