本文整理汇总了C++中ContextMenuItem::setSubMenu方法的典型用法代码示例。如果您正苦于以下问题:C++ ContextMenuItem::setSubMenu方法的具体用法?C++ ContextMenuItem::setSubMenu怎么用?C++ ContextMenuItem::setSubMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContextMenuItem
的用法示例。
在下文中一共展示了ContextMenuItem::setSubMenu方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createAndAppendSpellingAndGrammarSubMenu
static void createAndAppendSpellingAndGrammarSubMenu(const HitTestResult& result, ContextMenuItem& spellingAndGrammarMenuItem)
{
ContextMenu spellingAndGrammarMenu(result);
ContextMenuItem showSpellingPanel(ActionType, ContextMenuItemTagShowSpellingPanel,
contextMenuItemTagShowSpellingPanel(true));
ContextMenuItem checkSpelling(ActionType, ContextMenuItemTagCheckSpelling,
contextMenuItemTagCheckSpelling());
ContextMenuItem checkAsYouType(CheckableActionType, ContextMenuItemTagCheckSpellingWhileTyping,
contextMenuItemTagCheckSpellingWhileTyping());
ContextMenuItem grammarWithSpelling(CheckableActionType, ContextMenuItemTagCheckGrammarWithSpelling,
contextMenuItemTagCheckGrammarWithSpelling());
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
ContextMenuItem correctSpelling(CheckableActionType, ContextMenuItemTagCorrectSpellingAutomatically,
contextMenuItemTagCorrectSpellingAutomatically());
#endif
spellingAndGrammarMenu.appendItem(showSpellingPanel);
spellingAndGrammarMenu.appendItem(checkSpelling);
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
spellingAndGrammarMenu.appendItem(*separatorItem());
#endif
spellingAndGrammarMenu.appendItem(checkAsYouType);
spellingAndGrammarMenu.appendItem(grammarWithSpelling);
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
spellingAndGrammarMenu.appendItem(correctSpelling);
#endif
spellingAndGrammarMenuItem.setSubMenu(&spellingAndGrammarMenu);
}
示例2: createAndAppendFontSubMenu
static void createAndAppendFontSubMenu(const HitTestResult& result, ContextMenuItem& fontMenuItem)
{
ContextMenu fontMenu(result);
#if PLATFORM(MAC)
ContextMenuItem showFonts(ActionType, ContextMenuItemTagShowFonts, contextMenuItemTagShowFonts());
#endif
ContextMenuItem bold(CheckableActionType, ContextMenuItemTagBold, contextMenuItemTagBold());
ContextMenuItem italic(CheckableActionType, ContextMenuItemTagItalic, contextMenuItemTagItalic());
ContextMenuItem underline(CheckableActionType, ContextMenuItemTagUnderline, contextMenuItemTagUnderline());
ContextMenuItem outline(ActionType, ContextMenuItemTagOutline, contextMenuItemTagOutline());
#if PLATFORM(MAC)
ContextMenuItem styles(ActionType, ContextMenuItemTagStyles, contextMenuItemTagStyles());
ContextMenuItem showColors(ActionType, ContextMenuItemTagShowColors, contextMenuItemTagShowColors());
#endif
#if PLATFORM(MAC)
fontMenu.appendItem(showFonts);
#endif
fontMenu.appendItem(bold);
fontMenu.appendItem(italic);
fontMenu.appendItem(underline);
fontMenu.appendItem(outline);
#if PLATFORM(MAC)
fontMenu.appendItem(styles);
fontMenu.appendItem(*separatorItem());
fontMenu.appendItem(showColors);
#endif
fontMenuItem.setSubMenu(&fontMenu);
}
示例3: createAndAppendSpeechSubMenu
static void createAndAppendSpeechSubMenu(const HitTestResult& result, ContextMenuItem& speechMenuItem)
{
ContextMenu speechMenu(result);
ContextMenuItem start(ActionType, ContextMenuItemTagStartSpeaking, contextMenuItemTagStartSpeaking());
ContextMenuItem stop(ActionType, ContextMenuItemTagStopSpeaking, contextMenuItemTagStopSpeaking());
speechMenu.appendItem(start);
speechMenu.appendItem(stop);
speechMenuItem.setSubMenu(&speechMenu);
}
示例4: createAndAppendTextDirectionSubMenu
static void createAndAppendTextDirectionSubMenu(const HitTestResult& result, ContextMenuItem& textDirectionMenuItem)
{
ContextMenu textDirectionMenu(result);
ContextMenuItem defaultItem(ActionType, ContextMenuItemTagTextDirectionDefault, contextMenuItemTagDefaultDirection());
ContextMenuItem ltr(CheckableActionType, ContextMenuItemTagTextDirectionLeftToRight, contextMenuItemTagLeftToRight());
ContextMenuItem rtl(CheckableActionType, ContextMenuItemTagTextDirectionRightToLeft, contextMenuItemTagRightToLeft());
textDirectionMenu.appendItem(defaultItem);
textDirectionMenu.appendItem(ltr);
textDirectionMenu.appendItem(rtl);
textDirectionMenuItem.setSubMenu(&textDirectionMenu);
}
示例5: createAndAppendTransformationsSubMenu
static void createAndAppendTransformationsSubMenu(const HitTestResult& result, ContextMenuItem& transformationsMenuItem)
{
ContextMenu transformationsMenu(result);
ContextMenuItem makeUpperCase(ActionType, ContextMenuItemTagMakeUpperCase, contextMenuItemTagMakeUpperCase());
ContextMenuItem makeLowerCase(ActionType, ContextMenuItemTagMakeLowerCase, contextMenuItemTagMakeLowerCase());
ContextMenuItem capitalize(ActionType, ContextMenuItemTagCapitalize, contextMenuItemTagCapitalize());
transformationsMenu.appendItem(makeUpperCase);
transformationsMenu.appendItem(makeLowerCase);
transformationsMenu.appendItem(capitalize);
transformationsMenuItem.setSubMenu(&transformationsMenu);
}
示例6: createAndAppendSpellingSubMenu
static void createAndAppendSpellingSubMenu(const HitTestResult& result, ContextMenuItem& spellingMenuItem)
{
ContextMenu spellingMenu(result);
ContextMenuItem showSpellingPanel(ActionType, ContextMenuItemTagShowSpellingPanel,
contextMenuItemTagShowSpellingPanel(true));
ContextMenuItem checkSpelling(ActionType, ContextMenuItemTagCheckSpelling,
contextMenuItemTagCheckSpelling());
ContextMenuItem checkAsYouType(CheckableActionType, ContextMenuItemTagCheckSpellingWhileTyping,
contextMenuItemTagCheckSpellingWhileTyping());
spellingMenu.appendItem(showSpellingPanel);
spellingMenu.appendItem(checkSpelling);
spellingMenu.appendItem(checkAsYouType);
spellingMenuItem.setSubMenu(&spellingMenu);
}
示例7: createAndAppendSubstitutionsSubMenu
static void createAndAppendSubstitutionsSubMenu(const HitTestResult& result, ContextMenuItem& substitutionsMenuItem)
{
ContextMenu substitutionsMenu(result);
ContextMenuItem showSubstitutions(ActionType, ContextMenuItemTagShowSubstitutions, contextMenuItemTagShowSubstitutions(true));
ContextMenuItem smartCopyPaste(CheckableActionType, ContextMenuItemTagSmartCopyPaste, contextMenuItemTagSmartCopyPaste());
ContextMenuItem smartQuotes(CheckableActionType, ContextMenuItemTagSmartQuotes, contextMenuItemTagSmartQuotes());
ContextMenuItem smartDashes(CheckableActionType, ContextMenuItemTagSmartDashes, contextMenuItemTagSmartDashes());
ContextMenuItem smartLinks(CheckableActionType, ContextMenuItemTagSmartLinks, contextMenuItemTagSmartLinks());
ContextMenuItem textReplacement(CheckableActionType, ContextMenuItemTagTextReplacement, contextMenuItemTagTextReplacement());
substitutionsMenu.appendItem(showSubstitutions);
substitutionsMenu.appendItem(*separatorItem());
substitutionsMenu.appendItem(smartCopyPaste);
substitutionsMenu.appendItem(smartQuotes);
substitutionsMenu.appendItem(smartDashes);
substitutionsMenu.appendItem(smartLinks);
substitutionsMenu.appendItem(textReplacement);
substitutionsMenuItem.setSubMenu(&substitutionsMenu);
}