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


C++ ScrollableArea::TriggerScrollInputAction方法代码示例

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


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

示例1: OnInputAction


//.........这里部分代码省略.........

		case OpInputAction::ACTION_UNDO:
			return OpStatus::IsSuccess(execCommand(OP_DOCUMENT_EDIT_COMMAND_UNDO));
		case OpInputAction::ACTION_REDO:
			return OpStatus::IsSuccess(execCommand(OP_DOCUMENT_EDIT_COMMAND_REDO));

#ifdef USE_OP_CLIPBOARD
		case OpInputAction::ACTION_CUT:
			return OpStatus::IsSuccess(execCommand(OP_DOCUMENT_EDIT_COMMAND_CUT));
		case OpInputAction::ACTION_COPY:
			return OpStatus::IsSuccess(execCommand(OP_DOCUMENT_EDIT_COMMAND_COPY));
		case OpInputAction::ACTION_PASTE:
			return OpStatus::IsSuccess(execCommand(OP_DOCUMENT_EDIT_COMMAND_PASTE));
		case OpInputAction::ACTION_PASTE_MOUSE_SELECTION:
		{
			if (!m_caret.GetElement())
			{
				// Code is unfortunately dependant on m_caret.m_helm. Will be fixed in the next redesign/rewrite.
				return FALSE;
			}

# ifdef _X11_SELECTION_POLICY_
			g_clipboard_manager->SetMouseSelectionMode(TRUE);
# endif // _X11_SELECTION_POLICY_
			if( g_clipboard_manager->HasText() )
			{
				if( action->GetActionData() == 1 )
				{
					Clear();
				}
				HTML_Element* target = m_selection.HasContent() ? m_selection.GetStartElement() : m_caret.GetElement();
				g_clipboard_manager->Paste(this, m_doc, target);
			}
# ifdef _X11_SELECTION_POLICY_
			g_clipboard_manager->SetMouseSelectionMode(FALSE);
# endif // _X11_SELECTION_POLICY_
			return TRUE;
		}
#endif // USE_OP_CLIPBOARD

		case OpInputAction::ACTION_SELECT_ALL:
			return OpStatus::IsSuccess(execCommand(OP_DOCUMENT_EDIT_COMMAND_SELECTALL));

#ifdef DEBUG_DOCUMENT_EDIT
		case OpInputAction::ACTION_RELOAD:
		case OpInputAction::ACTION_FORCE_RELOAD:
#endif
		case OpInputAction::ACTION_CLEAR:
			Clear();
			return TRUE;

		case OpInputAction::ACTION_INSERT:
			if (!m_caret.GetElement())
			{
				// Code is unfortunately dependant on m_caret.m_helm. Will be fixed in the next redesign/rewrite.
				return FALSE;
			}

			InsertText(action->GetActionDataString(), uni_strlen(action->GetActionDataString()));
			return TRUE;

		case OpInputAction::ACTION_FOCUS_NEXT_WIDGET:
		case OpInputAction::ACTION_FOCUS_PREVIOUS_WIDGET:
			if (m_caret.GetElement())
			{
				HTML_Element *ec = GetEditableContainer(m_caret.GetElement());
				if (ec && ec->Type() == HE_BODY)
				{
					FramesDocElm *fd_elm = m_doc->GetDocManager()->GetFrame();
					if (fd_elm && fd_elm->IsInlineFrame())
					{
						// This is a IFRAME so we should focus the parentdocument and call this action on it, so
						// focus will be moved within the parentdocument.
						fd_elm->GetCurrentDoc()->GetParentDoc()->GetVisualDevice()->SetFocus(FOCUS_REASON_KEYBOARD);
						OP_BOOLEAN res = fd_elm->GetCurrentDoc()->GetParentDoc()->OnInputAction(action);
						return res == OpBoolean::IS_TRUE;
					}
				}
			}
			return FALSE;
		case OpInputAction::ACTION_SCROLL_UP:
		case OpInputAction::ACTION_SCROLL_DOWN:
		case OpInputAction::ACTION_SCROLL_LEFT:
		case OpInputAction::ACTION_SCROLL_RIGHT:
			if (m_caret.GetElement())
			{
				// Redirect theese actions to a scrollablecontainer so selectionscroll works.
				// The ScrollableContainer is not a parent or child of the DocumentEdits inputcontext.
				HTML_Element *ec = GetEditableContainer(m_caret.GetElement());
				if (ec && ec->GetLayoutBox())
				{
					ScrollableArea* sc = ec->GetLayoutBox()->GetScrollable();
					if (sc)
						return sc->TriggerScrollInputAction(action);
				}
			}
			break;
	}
	return FALSE;
}
开发者ID:prestocore,项目名称:browser,代码行数:101,代码来源:OpDocumentEditInput.cpp


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