Skip to content

WindowControl

NickWare edited this page Dec 27, 2021 · 6 revisions

Use the WindowControl to create window control buttons (minimize, maximize, close) in native mode. Use the WindowMover to implement window moving function. "Mouse down" action on the WindowMover sends the doWindowMove event to the bridge.

The WindowControl HTML model:

<div class="Window">
    <div class="WindowHeader">
        <div class="WindowIcon"></div>
        <div class="WindowCaption">Window title</div>
        <div class="WindowMover"></div>
        <div class="WindowControlsBlock">
            <div class="WindowControl Min"><div></div></div>
            <div class="WindowControl Max"><div></div></div>
            <div class="WindowControl Close"><div></div></div>
        </div>
    </div>
    
    ...
    
</div>

Catch events using a bridge. In C++ for example:

doEventAttach("doWindowMove", [this](auto data) {
    // window moving start
});
    
doEventAttach("doWindowMaximize", [this](auto data) {
    // maximize window
});

doEventAttach("doWindowMinimize", [this](auto data) {
    // minimize window
});
    
doEventAttach("doWindowClose", [this](auto data) {
    // close window
});

Learn more on bridge example page.

Clone this wiki locally