Skip to content

AWindow#

Represents a window in the underlying windowing system.

Header:#include <AUI/Platform/AWindow.h>
CMake:aui_link(my_target PUBLIC aui::views)

Examples#

examples/app/fractal/src/JumpToCoordsWindow.cpp

Fractal Example - Fractal viewer application demonstrating usage of custom shaders.

#include <AUI/Platform/AMessageBox.h>

using namespace declarative;

JumpToCoordsWindow::JumpToCoordsWindow(_<FractalView> fractalView, AWindow* parent)
  : AWindow("Jump to coords", 854_dp, 500_dp, parent, WindowStyle::NO_RESIZE) {
    auto re = _new<ATextField>();
    auto im = _new<ATextField>();
    auto scale = _new<ATextField>();

examples/app/game_of_life/src/main.cpp

Game of Life - Game of Life implementation that uses advanced large dynamic data rendering techniques such as ITexture, AImage to be GPU friendly. The computation is performed in AThreadPool.

    _<ITexture> mTexture;

    void updateTexture() {
        if (!mTexture) {
            mTexture = AWindow::current()->getRenderingContext()->renderer().getNewTexture();
        }

        CellsImage image(mCells->size());
        for (unsigned y = 0; y < image.height(); ++y) {
            for (unsigned x = 0; x < image.width(); ++x) {

examples/app/minesweeper/src/NewGameWindow.h

Minesweeper Game - Minesweeper game implementation driven by ass.

#include "AUI/Platform/AWindow.h"
#include "AUI/View/ANumberPicker.h"
#include "AUI/View/ALabel.h"

class NewGameWindow : public AWindow {
public:
    NewGameWindow(MinesweeperWindow* minesweeper);

private:
    MinesweeperWindow* mMinesweeper;

examples/ui/backdrop/src/main.cpp

Backdrop - Backdrop effects demo.

    return result;
}

AUI_ENTRY {
    auto window = _new<AWindow>("Backdrop test", 600_dp, 300_dp);

    window->setContents(headerWithContents(
        Centered {
          Vertical::Expanding {
            Centered {

examples/ui/contacts/src/view/ContactDetailsView.cpp

AUI Contacts - Usage of AUI_DECLARATIVE_FOR to make a contacts-like application.

        return;
    }

    // discard
    if (AMessageBox::show(dynamic_cast<AWindow*>(AWindow::current()), "Do you really want to discard?", "This action is irreversible!", AMessageBox::Icon::NONE, AMessageBox::Button::YES_NO) != AMessageBox::ResultButton::YES) {
        return;
    }
    mContact = mOriginalContact;
    mEditorMode = false;
}

examples/ui/minimal_ui_xmake/src/MainWindow.cpp

Minimal UI Template XMake - Minimal UI boilerplate template XMake.

#include <AUI/Platform/APlatform.h>

using namespace declarative;

MainWindow::MainWindow(): AWindow("Project template app", 300_dp, 200_dp) {
    setContents(
        Centered{
            Vertical{
                Centered { Label { "Hello world from AUI!" } },
                _new<AButton>("Visit GitHub repo").connect(&AView::clicked, this, [] {

examples/7guis/flight_booker/src/main.cpp

7GUIs Flight Booker - Flight Booker.

        };
    };
}

class FlightBookerWindow : public AWindow {
public:
    FlightBookerWindow() : AWindow("AUI - 7GUIs - Book Flight", 150_dp, 50_dp) {
        setExtraStylesheet(AStylesheet { {
          ass::c(".red"),
          ass::BackgroundSolid { AColor::RED },

examples/7guis/cells/src/main.cpp

7GUIs Cells - Spreadsheet processor (Excel).

private:
    _<State> mState;
};

class CellsWindow : public AWindow {
public:
    CellsWindow() : AWindow("AUI - 7GUIs - Cells", 500_dp, 400_dp) {
        setContents(Centered {
          AScrollArea::Builder()
                  .withContents(Horizontal { _new<CellsView>(_new<State>()) })

examples/7guis/circle_drawer/src/main.cpp

7GUIs Circle Drawer - Undo, redo, dialog control.

              .onAction =
                  [this, circle] {


                      auto radiusPopup = _new<AWindow>(
                          "", 200_dp, 50_dp, dynamic_cast<AWindow*>(AWindow::current()), WindowStyle::MODAL);
                      radiusPopup->setContents(Vertical {
                        Label { "Adjust diameter of circle at {}."_format(circle->position) },
                        _new<ASlider>() AUI_LET {
                                it->setValue(circle->radius / MAX_RADIUS);

examples/7guis/temperature_converter/src/main.cpp

7GUIs Temperature Converter - Fahrenheit to Celsius and vice versa.

        it->setMax(999);
    };
}

class TemperatureConverterWindow : public AWindow {
public:
    TemperatureConverterWindow() : AWindow("AUI - 7GUIs - TempConv", 300_dp, 50_dp) {
        setContents(Centered {
          Horizontal {
            myPicker() AUI_LET {

examples/7guis/counter/src/main.cpp

7GUIs Counter - Simple counter.

#include "AUI/View/ATextField.h"

using namespace declarative;

class CounterWindow: public AWindow {
public:
    CounterWindow(): AWindow("AUI - 7GUIs - Counter", 200_dp, 100_dp) {
        setContents(Centered {
          Horizontal {
            _new<ATextField>() AUI_LET {

examples/7guis/timer/src/main.cpp

7GUIs Timer - Timer example.

using namespace std::chrono_literals;

static constexpr high_resolution_clock::duration MAX_DURATION = 60s;

class TimerWindow : public AWindow {
public:
    TimerWindow() : AWindow("AUI - 7GUIs - Timer", 300_dp, 50_dp) {
        setContents(Centered {
          Vertical::Expanding {
            Horizontal {

examples/app/fractal/src/FractalWindow.h

Fractal Example - Fractal viewer application demonstrating usage of custom shaders.

#pragma once

#include <AUI/Platform/AWindow.h>

class FractalWindow : public AWindow {
public:
    FractalWindow();
};

examples/app/fractal/src/JumpToCoordsWindow.h

Fractal Example - Fractal viewer application demonstrating usage of custom shaders.

#include <AUI/Platform/AWindow.h>
#include "FractalView.h"

class JumpToCoordsWindow : public AWindow {
public:
    explicit JumpToCoordsWindow(_<FractalView> fractalView, AWindow* parent);
};

examples/app/fractal/src/FractalWindow.cpp

Fractal Example - Fractal viewer application demonstrating usage of custom shaders.

using namespace ass;
using namespace declarative;

FractalWindow::FractalWindow() : AWindow("Mandelbrot set") {
    setLayout(std::make_unique<AHorizontalLayout>());

    auto centerPosDisplay = _new<ALabel>("-");
    {
        centerPosDisplay->setCustomStyle({

examples/app/minesweeper/src/NewGameWindow.cpp

Minesweeper Game - Minesweeper game implementation driven by ass.

    mDifficultyLabel->setText(text);
}

NewGameWindow::NewGameWindow(MinesweeperWindow* minesweeper)
  : AWindow("New game", 100, 100, minesweeper), mMinesweeper(minesweeper) {
    setWindowStyle(WindowStyle::MODAL);

    setLayout(std::make_unique<AVerticalLayout>());
    setContents(Vertical {
      _form({

examples/app/minesweeper/src/MinesweeperWindow.cpp

Minesweeper Game - Minesweeper game implementation driven by ass.

#include "NewGameWindow.h"
#include "AUI/Platform/AMessageBox.h"
#include "AUI/Util/ARandom.h"

MinesweeperWindow::MinesweeperWindow() : AWindow("Minesweeper", 100_dp, 100_dp) {
    setContents(Vertical {
      Horizontal {
        Centered::Expanding {
          _new<AButton>("New game...").connect(&AButton::clicked, me::newGame),
        },

examples/ui/minimal_ui_xmake/src/MainWindow.h

Minimal UI Template XMake - Minimal UI boilerplate template XMake.

#pragma once

#include <AUI/Platform/AWindow.h>

class MainWindow: public AWindow {
public:
    MainWindow();
};

Public fields and Signals#


mFocusNextViewOnTab#

bool mFocusNextViewOnTab

defines if the next view must be focused on tab button pressed


maximized#

emits<> maximized

Window is maximized.


minimized#

emits<> minimized

Window is minimized (hidden to the taskbar, iconified).


moving#

emits<glm::vec2> moving

Window is moving.

client area position.


restored#

emits<> restored

Window is restored (shown from the taskbar, deiconified).

Public Methods#

AWindow#


AWindow::AWindow(std::nullptr_t)

Constructor for custom initialization logic

Please call windowNativePreInit

Examples#

examples/app/fractal/src/JumpToCoordsWindow.cpp

Fractal Example - Fractal viewer application demonstrating usage of custom shaders.

#include <AUI/Platform/AMessageBox.h>

using namespace declarative;

JumpToCoordsWindow::JumpToCoordsWindow(_<FractalView> fractalView, AWindow* parent)
  : AWindow("Jump to coords", 854_dp, 500_dp, parent, WindowStyle::NO_RESIZE) {
    auto re = _new<ATextField>();
    auto im = _new<ATextField>();
    auto scale = _new<ATextField>();
examples/app/game_of_life/src/main.cpp

Game of Life - Game of Life implementation that uses advanced large dynamic data rendering techniques such as ITexture, AImage to be GPU friendly. The computation is performed in AThreadPool.

    _<ITexture> mTexture;

    void updateTexture() {
        if (!mTexture) {
            mTexture = AWindow::current()->getRenderingContext()->renderer().getNewTexture();
        }

        CellsImage image(mCells->size());
        for (unsigned y = 0; y < image.height(); ++y) {
            for (unsigned x = 0; x < image.width(); ++x) {
examples/app/minesweeper/src/NewGameWindow.h

Minesweeper Game - Minesweeper game implementation driven by ass.

#include "AUI/Platform/AWindow.h"
#include "AUI/View/ANumberPicker.h"
#include "AUI/View/ALabel.h"

class NewGameWindow : public AWindow {
public:
    NewGameWindow(MinesweeperWindow* minesweeper);

private:
    MinesweeperWindow* mMinesweeper;
examples/ui/contacts/src/view/ContactDetailsView.cpp

AUI Contacts - Usage of AUI_DECLARATIVE_FOR to make a contacts-like application.

        return;
    }

    // discard
    if (AMessageBox::show(dynamic_cast<AWindow*>(AWindow::current()), "Do you really want to discard?", "This action is irreversible!", AMessageBox::Icon::NONE, AMessageBox::Button::YES_NO) != AMessageBox::ResultButton::YES) {
        return;
    }
    mContact = mOriginalContact;
    mEditorMode = false;
}
examples/ui/minimal_ui_xmake/src/MainWindow.cpp

Minimal UI Template XMake - Minimal UI boilerplate template XMake.

#include <AUI/Platform/APlatform.h>

using namespace declarative;

MainWindow::MainWindow(): AWindow("Project template app", 300_dp, 200_dp) {
    setContents(
        Centered{
            Vertical{
                Centered { Label { "Hello world from AUI!" } },
                _new<AButton>("Visit GitHub repo").connect(&AView::clicked, this, [] {
examples/7guis/flight_booker/src/main.cpp

7GUIs Flight Booker - Flight Booker.

        };
    };
}

class FlightBookerWindow : public AWindow {
public:
    FlightBookerWindow() : AWindow("AUI - 7GUIs - Book Flight", 150_dp, 50_dp) {
        setExtraStylesheet(AStylesheet { {
          ass::c(".red"),
          ass::BackgroundSolid { AColor::RED },
examples/7guis/cells/src/main.cpp

7GUIs Cells - Spreadsheet processor (Excel).

private:
    _<State> mState;
};

class CellsWindow : public AWindow {
public:
    CellsWindow() : AWindow("AUI - 7GUIs - Cells", 500_dp, 400_dp) {
        setContents(Centered {
          AScrollArea::Builder()
                  .withContents(Horizontal { _new<CellsView>(_new<State>()) })
examples/7guis/circle_drawer/src/main.cpp

7GUIs Circle Drawer - Undo, redo, dialog control.

              .onAction =
                  [this, circle] {


                      auto radiusPopup = _new<AWindow>(
                          "", 200_dp, 50_dp, dynamic_cast<AWindow*>(AWindow::current()), WindowStyle::MODAL);
                      radiusPopup->setContents(Vertical {
                        Label { "Adjust diameter of circle at {}."_format(circle->position) },
                        _new<ASlider>() AUI_LET {
                                it->setValue(circle->radius / MAX_RADIUS);
examples/7guis/temperature_converter/src/main.cpp

7GUIs Temperature Converter - Fahrenheit to Celsius and vice versa.

        it->setMax(999);
    };
}

class TemperatureConverterWindow : public AWindow {
public:
    TemperatureConverterWindow() : AWindow("AUI - 7GUIs - TempConv", 300_dp, 50_dp) {
        setContents(Centered {
          Horizontal {
            myPicker() AUI_LET {
examples/7guis/counter/src/main.cpp

7GUIs Counter - Simple counter.

#include "AUI/View/ATextField.h"

using namespace declarative;

class CounterWindow: public AWindow {
public:
    CounterWindow(): AWindow("AUI - 7GUIs - Counter", 200_dp, 100_dp) {
        setContents(Centered {
          Horizontal {
            _new<ATextField>() AUI_LET {
examples/7guis/timer/src/main.cpp

7GUIs Timer - Timer example.

using namespace std::chrono_literals;

static constexpr high_resolution_clock::duration MAX_DURATION = 60s;

class TimerWindow : public AWindow {
public:
    TimerWindow() : AWindow("AUI - 7GUIs - Timer", 300_dp, 50_dp) {
        setContents(Centered {
          Vertical::Expanding {
            Horizontal {
examples/app/fractal/src/FractalWindow.h

Fractal Example - Fractal viewer application demonstrating usage of custom shaders.

#pragma once

#include <AUI/Platform/AWindow.h>

class FractalWindow : public AWindow {
public:
    FractalWindow();
};
examples/app/fractal/src/JumpToCoordsWindow.h

Fractal Example - Fractal viewer application demonstrating usage of custom shaders.

#include <AUI/Platform/AWindow.h>
#include "FractalView.h"

class JumpToCoordsWindow : public AWindow {
public:
    explicit JumpToCoordsWindow(_<FractalView> fractalView, AWindow* parent);
};
examples/app/fractal/src/FractalWindow.cpp

Fractal Example - Fractal viewer application demonstrating usage of custom shaders.

using namespace ass;
using namespace declarative;

FractalWindow::FractalWindow() : AWindow("Mandelbrot set") {
    setLayout(std::make_unique<AHorizontalLayout>());

    auto centerPosDisplay = _new<ALabel>("-");
    {
        centerPosDisplay->setCustomStyle({
examples/app/minesweeper/src/NewGameWindow.cpp

Minesweeper Game - Minesweeper game implementation driven by ass.

    mDifficultyLabel->setText(text);
}

NewGameWindow::NewGameWindow(MinesweeperWindow* minesweeper)
  : AWindow("New game", 100, 100, minesweeper), mMinesweeper(minesweeper) {
    setWindowStyle(WindowStyle::MODAL);

    setLayout(std::make_unique<AVerticalLayout>());
    setContents(Vertical {
      _form({
examples/app/minesweeper/src/MinesweeperWindow.cpp

Minesweeper Game - Minesweeper game implementation driven by ass.

#include "NewGameWindow.h"
#include "AUI/Platform/AMessageBox.h"
#include "AUI/Util/ARandom.h"

MinesweeperWindow::MinesweeperWindow() : AWindow("Minesweeper", 100_dp, 100_dp) {
    setContents(Vertical {
      Horizontal {
        Centered::Expanding {
          _new<AButton>("New game...").connect(&AButton::clicked, me::newGame),
        },
examples/ui/minimal_ui_xmake/src/MainWindow.h

Minimal UI Template XMake - Minimal UI boilerplate template XMake.

#pragma once

#include <AUI/Platform/AWindow.h>

class MainWindow: public AWindow {
public:
    MainWindow();
};

allowDragNDrop#


void AWindow::allowDragNDrop()

Enables drag-n-drop for this window.

current#


static AWindowBase* AWindow::current()
Returns
Current window for current thread.

Examples#

examples/app/game_of_life/src/main.cpp

Game of Life - Game of Life implementation that uses advanced large dynamic data rendering techniques such as ITexture, AImage to be GPU friendly. The computation is performed in AThreadPool.

    _<ITexture> mTexture;

    void updateTexture() {
        if (!mTexture) {
            mTexture = AWindow::current()->getRenderingContext()->renderer().getNewTexture();
        }

        CellsImage image(mCells->size());
        for (unsigned y = 0; y < image.height(); ++y) {
            for (unsigned x = 0; x < image.width(); ++x) {
examples/ui/contacts/src/view/ContactDetailsView.cpp

AUI Contacts - Usage of AUI_DECLARATIVE_FOR to make a contacts-like application.

        return;
    }

    // discard
    if (AMessageBox::show(dynamic_cast<AWindow*>(AWindow::current()), "Do you really want to discard?", "This action is irreversible!", AMessageBox::Icon::NONE, AMessageBox::Button::YES_NO) != AMessageBox::ResultButton::YES) {
        return;
    }
    mContact = mOriginalContact;
    mEditorMode = false;
}
examples/7guis/circle_drawer/src/main.cpp

7GUIs Circle Drawer - Undo, redo, dialog control.

                  [this, circle] {


                      auto radiusPopup = _new<AWindow>(
                          "", 200_dp, 50_dp, dynamic_cast<AWindow*>(AWindow::current()), WindowStyle::MODAL);
                      radiusPopup->setContents(Vertical {
                        Label { "Adjust diameter of circle at {}."_format(circle->position) },
                        _new<ASlider>() AUI_LET {
                                it->setValue(circle->radius / MAX_RADIUS);
                                connect(
examples/7guis/cells/src/Spreadsheet.h

7GUIs Cells - Spreadsheet processor (Excel).

        struct RangeIterator {
            const Spreadsheet* spreadsheet;
            formula::Range range;
            glm::uvec2 current;

            RangeIterator operator++() {
                current.x += 1;
                if (current.x <= range.to.x) {
                    return *this;

isMaximized#


bool AWindow::isMaximized()
Returns
true if window maximized (fullscreen)

isMinimized#


bool AWindow::isMinimized()
Returns
true if window minimized (hidden in taskbar, iconified)

isRedrawWillBeEfficient#


static bool AWindow::isRedrawWillBeEfficient()

Checks whether last monitor frame is displayed and redraw will be efficient. If some object often updates UI thread for displaying some data it may cause extra CPU and GPU overload. AUI throttles window redraws and FPS does not go above 60 FPS but UI views may also cause extra CPU and GPU overload that does not have visual difference.

Returns
true if 16 milliseconds elapsed since last frame

mapPosition#


glm::ivec2 AWindow::mapPosition(const glm::ivec2& position)

Translates coordinates from the monitor's coordinate space to the coordinate space of this window.

Arguments
position
the coordinate in screen space
Returns
coordinates in the space of this window

mapPositionTo#


glm::ivec2 AWindow::mapPositionTo(const glm::ivec2& position, _<AWindow> other)

Translates coordinates from the coordinate space of this window to the coordinate space of another window.

Arguments
position
coordinates in the space of this window
other
other window
Returns
coordinates in the space of the other window

maximize#


void AWindow::maximize()

Maximizes window (makes window fullscreen)

minimize#


void AWindow::minimize()

Minimizes window (hide window to the taskbar, iconifies)

moveToCenter#


void AWindow::moveToCenter()

Moves the window to the center of monitor.

When using in series with setSize(), do the setSize() first, when moveToCenter().

quit#


void AWindow::quit()

Removes window from AWindowManager.

restore#


void AWindow::restore()

Restores window (shows window from taskbar)

setMobileScreenOrientation#


void AWindow::setMobileScreenOrientation(AScreenOrientation screenOrientation)

Controls mobile device's screen orientation when this window is on the foreground.

Affects only mobile OSes. On window-based interfaces (desktop) does nothing.

show#


void AWindow::show()

Shows the window.

Behavior under UI tests
Does not actually shows the window and don't even needed in graphics environment.

Examples#

examples/ui/contacts/src/view/ContactDetailsView.cpp

AUI Contacts - Usage of AUI_DECLARATIVE_FOR to make a contacts-like application.

        return;
    }

    // discard
    if (AMessageBox::show(dynamic_cast<AWindow*>(AWindow::current()), "Do you really want to discard?", "This action is irreversible!", AMessageBox::Icon::NONE, AMessageBox::Button::YES_NO) != AMessageBox::ResultButton::YES) {
        return;
    }
    mContact = mOriginalContact;
    mEditorMode = false;
}
examples/app/fractal/src/JumpToCoordsWindow.cpp

Fractal Example - Fractal viewer application demonstrating usage of custom shaders.

                    auto dScale = std::stod((*re->text()).toStdString());
                    fractalView->setPlotPositionAndScale(glm::dvec2 { dRe, dIm }, dScale);
                    close();
                } catch (...) {
                    AMessageBox::show(this, "Error", "Please check your values are valid numbers.");
                }
            }) AUI_LET { it->setDefault(); },
        _new<AButton>("Cancel").connect(&AButton::clicked, me::close),
      },
    });
examples/app/fractal/src/main.cpp

Fractal Example - Fractal viewer application demonstrating usage of custom shaders.

#include <AUI/Platform/Entry.h>
#include "FractalWindow.h"

AUI_ENTRY {
    _new<FractalWindow>()->show();
    return 0;
}
examples/app/fractal/src/FractalWindow.cpp

Fractal Example - Fractal viewer application demonstrating usage of custom shaders.

      },
      Vertical {
        _new<AButton>("Identity").connect(&AButton::clicked, AUI_SLOT(fractal)::reset),
        _new<AButton>("Jump to coords...")
            .connect(&AButton::clicked, this, [&, fractal]() { _new<JumpToCoordsWindow>(fractal, this)->show(); }),
        _new<ALabel>("Iterations:"),
        _new<ANumberPicker>().connect(
            &ANumberPicker::valueChanged, this, [fractal](int v) { fractal->setIterations(v); }) AUI_LET {
                it->setMax(1000);
                it->setValue(350);
examples/app/game_of_life/src/main.cpp

Game of Life - Game of Life implementation that uses advanced large dynamic data rendering techniques such as ITexture, AImage to be GPU friendly. The computation is performed in AThreadPool.

AUI_ENTRY {
    auto w = _new<GameOfLifeWindow>();
    w->pack();
    w->show();
    return 0;
}
examples/app/minesweeper/src/MinesweeperWindow.cpp

Minesweeper Game - Minesweeper game implementation driven by ass.

            c |= FieldCell::RED_BG;
            mReveal = true;
            emit customCssPropertyChanged();
            redraw();
            AMessageBox::show(this, "You lost!", "You lost! Ahahahhaa!");
        }
        return;
    }
    c |= FieldCell::OPEN;
    mOpenedCells += 1;
examples/app/minesweeper/src/main.cpp

Minesweeper Game - Minesweeper game implementation driven by ass.

#include <AUI/Platform/Entry.h>
#include "MinesweeperWindow.h"

AUI_ENTRY {
    _new<MinesweeperWindow>()->show();

    return 0;
}
examples/ui/backdrop/src/main.cpp

Backdrop - Backdrop effects demo.

                "Анне Павловне, поцеловал ее руку, подставив ей свою надушенную и сияющую лысину, и "
                "покойно уселся на диване.") } AUI_WITH_STYLE { MaxSize { 550_dp, {} }, Padding { 16_dp } },
        }));

    window->show();

    return 0;
}
examples/ui/views/tests/LayoutManagerTest.cpp

Views Example - All-in-one views building example.

public:
protected:
    void SetUp() override {
        UITest::SetUp();
        _new<ExampleWindow>()->show();
    }

    void TearDown() override {
        UITest::TearDown();
    }
examples/ui/views/src/main.cpp

Views Example - All-in-one views building example.

#include "ExampleWindow.h"
#include <AUI/Platform/Entry.h>

AUI_ENTRY {
    _new<ExampleWindow>()->show();
    return 0;
}
examples/ui/minimal_ui_xmake/src/main.cpp

Minimal UI Template XMake - Minimal UI boilerplate template XMake.

#include <AUI/Platform/Entry.h>
#include "MainWindow.h"

AUI_ENTRY {
    _new<MainWindow>()->show();
    return 0;
};
examples/7guis/flight_booker/src/main.cpp

7GUIs Flight Booker - Flight Booker.

        AString msg = "Departure - {}"_format(formatDate(mDepartureDate.parsed->value()));
        if (mIsReturnFlight) {
            msg += "\nReturn - {}"_format(formatDate(mReturnDate.parsed->value()));
        }
        AMessageBox::show(this, "You've booked the flight", msg);
    }
};

AUI_ENTRY {
    _new<FlightBookerWindow>()->show();
examples/7guis/cells/src/main.cpp

7GUIs Cells - Spreadsheet processor (Excel).

    }
};

AUI_ENTRY {
    _new<CellsWindow>()->show();
    return 0;
}
examples/7guis/circle_drawer/src/main.cpp

7GUIs Circle Drawer - Undo, redo, dialog control.

                              float mNewRadius;
                          };
                          mState->history.add(std::make_unique<ActionChangeRadius>(circle, oldRadius, circle->radius));
                      });
                      radiusPopup->show();
                  },
            },
        };
    }
examples/7guis/temperature_converter/src/main.cpp

7GUIs Temperature Converter - Fahrenheit to Celsius and vice versa.

    AProperty<int> mCelsius, mFahrenheit;
};

AUI_ENTRY {
    _new<TemperatureConverterWindow>()->show();
    return 0;
}
examples/7guis/counter/src/main.cpp

7GUIs Counter - Simple counter.

    AProperty<int> mCounter;
};

AUI_ENTRY {
    _new<CounterWindow>()->show();
    return 0;
}
examples/7guis/timer/src/main.cpp

7GUIs Timer - Timer example.

    void reset() { mStartTime = high_resolution_clock::now(); }
};

AUI_ENTRY {
    _new<TimerWindow>()->show();
    return 0;
}

unmapPosition#


glm::ivec2 AWindow::unmapPosition(const glm::ivec2& position)

Translates coordinates from the coordinate space of this window to the coordinate space of the monitor.

Arguments
position
coordinates in the space of this window
Returns
the coordinates in space of the monitor

wrapViewToWindow#


static _<AWindow> AWindow::wrapViewToWindow(const _<AView>& view, const AString& title, int width = 854 _dp, int height = 500 _dp, AWindow* parent = nullptr, WindowStyle ws = WindowStyle::DEFAULT)

Wraps your AView to window.

Arguments
view
view to wrap
title
window title
width
window width
height
window height
parent
parent window
ws
window style flags
Returns
created window, AWindow::show() is not called