当前位置: 首页>>代码示例>>C++>>正文


C++ RenderTextControlSingleLine类代码示例

本文整理汇总了C++中RenderTextControlSingleLine的典型用法代码示例。如果您正苦于以下问题:C++ RenderTextControlSingleLine类的具体用法?C++ RenderTextControlSingleLine怎么用?C++ RenderTextControlSingleLine使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了RenderTextControlSingleLine类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: eventNames

void TextFieldInputType::forwardEvent(Event* event)
{
    if (m_innerSpinButton) {
        m_innerSpinButton->forwardEvent(event);
        if (event->defaultHandled())
            return;
    }

    if (event->isMouseEvent()
        || event->isDragEvent()
        || event->eventInterface() == WheelEventInterfaceType
        || event->type() == eventNames().blurEvent
        || event->type() == eventNames().focusEvent)
    {
        element().document().updateStyleIfNeededForNode(element());

        if (element().renderer()) {
            RenderTextControlSingleLine* renderTextControl = toRenderTextControlSingleLine(element().renderer());
            if (event->type() == eventNames().blurEvent) {
                if (RenderTextControlInnerBlock* innerTextRenderer = innerTextElement()->renderer()) {
                    if (RenderLayer* innerLayer = innerTextRenderer->layer()) {
                        IntSize scrollOffset(!renderTextControl->style().isLeftToRightDirection() ? innerLayer->scrollWidth() : 0, 0);
                        innerLayer->scrollToOffset(scrollOffset, RenderLayer::ScrollOffsetClamped);
                    }
                }

                renderTextControl->capsLockStateMayHaveChanged();
            } else if (event->type() == eventNames().focusEvent)
                renderTextControl->capsLockStateMayHaveChanged();

            element().forwardEvent(event);
        }
    }
}
开发者ID:CannedFish,项目名称:webkit,代码行数:34,代码来源:TextFieldInputType.cpp

示例2: toRenderTextControlSingleLine

void TextFieldInputType::forwardEvent(Event* event)
{
    if (SpinButtonElement* spinButton = spinButtonElement()) {
        spinButton->forwardEvent(event);
        if (event->defaultHandled())
            return;
    }

    if (element().renderer() && (event->isMouseEvent() || event->isDragEvent() || event->hasInterface(EventNames::WheelEvent) || event->type() == EventTypeNames::blur || event->type() == EventTypeNames::focus)) {
        RenderTextControlSingleLine* renderTextControl = toRenderTextControlSingleLine(element().renderer());
        if (event->type() == EventTypeNames::blur) {
            if (RenderBox* innerEditorRenderer = element().innerEditorElement()->renderBox()) {
                // FIXME: This class has no need to know about RenderLayer!
                if (RenderLayer* innerLayer = innerEditorRenderer->layer()) {
                    if (RenderLayerScrollableArea* innerScrollableArea = innerLayer->scrollableArea()) {
                        IntSize scrollOffset(!renderTextControl->style()->isLeftToRightDirection() ? innerScrollableArea->scrollWidth().toInt() : 0, 0);
                        innerScrollableArea->scrollToOffset(scrollOffset, ScrollOffsetClamped);
                    }
                }
            }

            renderTextControl->capsLockStateMayHaveChanged();
        } else if (event->type() == EventTypeNames::focus) {
            renderTextControl->capsLockStateMayHaveChanged();
        }

        element().forwardEvent(event);
    }
}
开发者ID:kjthegod,项目名称:WebKit,代码行数:29,代码来源:TextFieldInputType.cpp

示例3: defaultEventHandler

void SearchFieldResultsButtonElement::defaultEventHandler(Event* evt)
{
    // On mousedown, bring up a menu, if needed
    HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
    if (evt->type() == eventNames().mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
        input->focus();
        input->select();
        RenderTextControlSingleLine* renderer = static_cast<RenderTextControlSingleLine*>(input->renderer());
        if (renderer->popupIsVisible())
            renderer->hidePopup();
        else if (input->maxResults() > 0)
            renderer->showPopup();
        evt->setDefaultHandled();
    }
    if (!evt->defaultHandled())
        HTMLDivElement::defaultEventHandler(evt);
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:17,代码来源:TextControlInnerElements.cpp

示例4: toRenderTextControlSingleLine

void TextFieldInputType::forwardEvent(Event* event)
{
    if (element()->renderer() && (event->isMouseEvent() || event->isDragEvent() || event->hasInterface(eventNames().interfaceForWheelEvent) || event->type() == eventNames().blurEvent || event->type() == eventNames().focusEvent)) {
        RenderTextControlSingleLine* renderTextControl = toRenderTextControlSingleLine(element()->renderer());
        if (event->type() == eventNames().blurEvent) {
            if (RenderBox* innerTextRenderer = innerTextElement()->renderBox()) {
                if (RenderLayer* innerLayer = innerTextRenderer->layer())
                    innerLayer->scrollToOffset(!renderTextControl->style()->isLeftToRightDirection() ? innerLayer->scrollWidth() : 0, 0, RenderLayer::ScrollOffsetClamped);
            }

            renderTextControl->capsLockStateMayHaveChanged();
        } else if (event->type() == eventNames().focusEvent)
            renderTextControl->capsLockStateMayHaveChanged();

        element()->forwardEvent(event);
    }
}
开发者ID:,项目名称:,代码行数:17,代码来源:


注:本文中的RenderTextControlSingleLine类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。