Generated reference › API — ICoreEssentials/UI/Backends/WinUI/MenuBar
kind: generated#api#icoreessentials-ui-backends-winui-menubar

API — ICoreEssentials/UI/Backends/WinUI/MenuBar

The public contract of 2 header(s) under ICoreEssentials/UI/Backends/WinUI/MenuBar — 1 class/struct definition(s), 0 declaration(s). Each section shows the header's banner and its public (and protected-virtual) surface exactly as the file writes it.

ICoreWinUIMenuFocus.h#

ICoreEssentials/UI/Backends/WinUI/MenuBar/ICoreWinUIMenuFocus.h

"What has the keyboard right now", as the six facts the mirror rules read.

⚠⚠ THIS DECLARATION EXISTS SO THAT EXACTLY ONE FILE IN THE MENU SEAT NAMES A WinRT TYPE. icoreFocusIsInTextEntry() is the only one of the mirror seam's fourteen functions that has to ask the toolkit anything; putting the ask behind this line means ICoreMenuMirror.cpp -- which holds the other thirteen, the chord rule and the null contract -- compiles and LINKS with no Windows App SDK anywhere near it, so winui_menu_mirror drives the real seam functions rather than a copy of them.

⚠ THE SUITE SUPPLIES ITS OWN DEFINITION OF THIS, WHICH IS THE POINT. A stub that answers a scripted descriptor turns "is the stand-down correct?" into a question that can be answered on a machine with no XAML tree -- and the stand-down is on the path of EVERY menu keyboard shortcut in the product on

Declares no class of its own — see the file.

ICoreWinUIMenuMirrorRules.h#

ICoreEssentials/UI/Backends/WinUI/MenuBar/ICoreWinUIMenuMirrorRules.h

The two DECISIONS behind UI/MenuBar/ICoreMenuMirror.h's seam, split out of the seat so they can be tested with no App SDK, no XAML tree and no window.

⚠ THIS IS W3.6's WHOLE POINT. The mirror seam has fourteen functions and eleven of them are bookkeeping over a platform menu; on Windows there is no platform menu, so those eleven are inert and there is nothing in them to get wrong. The three that are left decide something, they are reached on this backend whether or not a system menu bar exists, and two of the three are answered here -- the third (icoreChordDisplayText) is a forward to a value type that already spells a chord this desktop's way.

⚠ NO WINRT, NO WIN32, NO TOOLKIT NAME. A chord is a plain 32-bit word (Values/ICoreWinUIKeySequenceAccess.h) and a focused element is reduced to the six facts below before it reaches this file, so winui_menu_mirror

ICoreWinUIFocusedElement#

ICoreWinUIMenuMirrorRules.h:65 · struct · 0 declaration(s)

What the focused element is, reduced to the facts the rule below reads.

struct ICoreWinUIFocusedElement {
public:
    // Nothing has focus, or focus is outside every window this process owns.
    bool hasFocus = false;

    // A control whose whole job is typed text: TextBox, RichEditBox,
    // PasswordBox, AutoSuggestBox's inner box, NumberBox's inner box.
    bool isTextControl = false;

    // ⚠ READ-ONLY IS NOT DISABLED AND BOTH ARE HERE. A read-only TextBox still
    // takes focus, still shows a caret and still answers arrow keys -- but no
    // character is being typed into it, so a menu row carrying Delete has the
    // better claim. A DISABLED one cannot hold focus at all and is recorded
    // only so that a filled-in descriptor is never ambiguous about which of
    // the two it saw.
    bool isReadOnly = false;
    bool isEnabled = true;

    // ⚠ A NAME BEING TYPED ON THE CANVAS IS NOT IN A CONTROL AT ALL, and that
    // is the case the Qt seat needed its QGraphicsView branch for: block names,
    // port descriptions, area titles and notes are scene text items that take
    // the keyboard through the view they live in. The focused element is then
    // the canvas host and "looks like nothing in particular", so the scene has
    // to be asked separately -- and this flag is that answer.
    bool isEditableSceneText = false;
};
};