me#
Passes the current class and type of the current class separated by comma. It's convenient to use with the connect function:
| Header: | #include <AUI/Util/kAUI.h> |
| CMake: | aui_link(my_target PUBLIC aui::core) |
Definition#
Detailed Description#
| without | with |
Examples#
examples/app/notes/src/main.cpp
Notes App - Note taking app that demonstrates usage of AListModel, AProperty, user data saving and loading.
},
});
load();
connect(mNotes.changed, me::markDirty);
setContents(Vertical {
ASplitter::Horizontal()
.withItems({
Vertical {
examples/ui/contacts/src/main.cpp
AUI Contacts - Usage of AUI_DECLARATIVE_FOR to make a contacts-like application.
auto d = _new<ContactDetailsView>(contact);
connect(contact->displayName.changed, d, [this] {
*mContacts.writeScope() |= CONTACTS_SORT;
});
connect(d->deleteAction, me::deleteCurrentContact);
return d;
}
};
AUI_ENTRY {
examples/7guis/crud/src/main.cpp
7GUIs CRUD - Create/Read/Update/Delete example.
}) AUI_WITH_STYLE { LayoutSpacing { 4_dp } },
},
} AUI_WITH_STYLE { LayoutSpacing { 4_dp } },
Horizontal {
Button { Label { "Create" }, {me::createClicked} } & mCreateEnabled > &AView::setEnabled,
Button { Label { "Update" }, {me::updateClicked} } & mUpdateEnabled > &AView::setEnabled,
Button { Label { "Delete" }, {me::deleteClicked} } & mDeleteEnabled > &AView::setEnabled,
} AUI_WITH_STYLE { LayoutSpacing { 4_dp } },
} AUI_WITH_STYLE { LayoutSpacing { 4_dp } });
}
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.
for (auto s : { &mStorage, &mNextPopulation }) {
s->resize(size.x * size.y);
}
connect(mTimer->fired, me::frame);
connect(isRunning.changed, AUI_SLOT(mTimer)::setRunning);
}
void frame() {
mFrame = AThreadPool::global() * [&] {
examples/7guis/circle_drawer/src/main.cpp
7GUIs Circle Drawer - Undo, redo, dialog control.
BackgroundSolid(AColor::WHITE),
Border(1_px, AColor::GRAY),
AOverflow::HIDDEN_FROM_THIS,
});
connect(mState->circles.changed, me::redraw);
connect(mHoveredCircle.changed, me::redraw);
}
void render(ARenderContext ctx) override {
AView::render(ctx);
examples/app/minesweeper/src/NewGameWindow.cpp
Minesweeper Game - Minesweeper game implementation driven by ass.
Horizontal {
_new<ASpacerExpanding>(),
_new<AButton>("Start game") AUI_LET {
it->setDefault();
connect(it->clicked, me::begin);
},
_new<AButton>("Cancel").connect(&AButton::clicked, me::close),
} AUI_WITH_STYLE { LayoutSpacing { 4_dp } },
} AUI_WITH_STYLE { LayoutSpacing { 4_dp } });
examples/app/fractal/src/JumpToCoordsWindow.cpp
Fractal Example - Fractal viewer application demonstrating usage of custom shaders.
} catch (...) {
AMessageBox::show(this, "Error", "Please check your values are valid numbers.");
}
}) AUI_LET { it->setDefault(); },
_new<AButton>("Cancel").connect(&AButton::clicked, me::close),
} AUI_WITH_STYLE { LayoutSpacing { 4_dp } },
} AUI_WITH_STYLE { LayoutSpacing { 4_dp } });
pack();
}
examples/7guis/cells/src/main.cpp
7GUIs Cells - Spreadsheet processor (Excel).
examples/7guis/timer/src/main.cpp
7GUIs Timer - Timer example.
} AUI_WITH_STYLE { Expanding { 1, 0 } },
} AUI_WITH_STYLE { LayoutSpacing { 4_dp } },
_new<AButton>("Reset Timer") AUI_WITH_STYLE {
Expanding { 1, 0 },
} AUI_LET { connect(it->clicked, me::reset); },
} AUI_WITH_STYLE { LayoutSpacing { 4_dp } },
});
connect(mTimer->fired, me::update);
mTimer->start();
Examples#
examples/app/minesweeper/src/MinesweeperWindow.cpp
Minesweeper Game - Minesweeper game implementation driven by ass.
MinesweeperWindow::MinesweeperWindow() : AWindow("Minesweeper", 100_dp, 100_dp) {
setContents(Vertical {
Horizontal {
Centered::Expanding {
_new<AButton>("New game...").connect(&AButton::clicked, me::newGame),
},
},
_container<AStackedLayout>(
{ // also assign ".frame" ASS class in place
mGrid = _new<AViewContainer>() << ".frame" }),
examples/ui/contacts/src/view/ContactDetailsView.cpp
AUI Contacts - Usage of AUI_DECLARATIVE_FOR to make a contacts-like application.
}),
Centered {
Horizontal::Expanding {
SpacerExpanding(),
Button { Label { mEditorMode ? "Discard" : "Delete" }, {me::drop} },
Button { Label { mEditorMode ? "Done" : "Edit" }, {me::toggleEdit} },
} AUI_WITH_STYLE { MaxSize(EDITOR_CONTENT_MAX_WIDTH, {}), Padding(4_dp), LayoutSpacing { 4_dp } },
},
});
});