AMimedData#
Mime-type data associated storage.
| Header: | #include <AUI/Util/AMimedData.h> |
| CMake: | aui_link(my_target PUBLIC aui::views) |
Public Methods#
setText#
void AMimedData::setText(const AString& text)
Sets "text/plain".
Examples:
examples/app/minesweeper/src/NewGameWindow.cpp
Minesweeper Game — Minesweeper game implementation driven by ass.
case 8:
text += "low";
break;
}
mDifficultyLabel->setText(text);
}
NewGameWindow::NewGameWindow(MinesweeperWindow* minesweeper)
: AWindow("New game", 100, 100, minesweeper), mMinesweeper(minesweeper) {
setWindowStyle(WindowStyle::MODAL);
examples/app/fractal/src/FractalWindow.cpp
Fractal Example — Fractal viewer application demonstrating usage of custom shaders.
}
auto fractal = _new<FractalView>();
connect(fractal->centerPosChanged, this, [centerPosDisplay](const glm::dvec2& newPos, double scale) {
centerPosDisplay->setText("Center position: {} {}, scale: {}"_format(newPos.x, -newPos.y, scale));
});
setContents(Horizontal {
Stacked::Expanding {
fractal,
examples/app/fractal/src/JumpToCoordsWindow.cpp
Fractal Example — Fractal viewer application demonstrating usage of custom shaders.
auto im = _new<ATextField>();
auto scale = _new<ATextField>();
auto pos = fractalView->getPlotPosition();
re->setText(AString::number(pos.x));
im->setText(AString::number(pos.y));
scale->setText(AString::number(fractalView->getPlotScale()));
setContents(Vertical {
_form({
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.
connect(it->clicked, AUI_SLOT(mCells)::randomize);
},
_new<AButton>() AUI_LET {
it & mCells.isRunning > [](AButton& b, bool isRunning) {
b.setText(isRunning ? "Pause" : "Run");
};
connect(it->clicked, [&] { mCells.isRunning = !mCells.isRunning; });
},
} AUI_OVERRIDE_STYLE { LayoutSpacing { 4_dp } },
},
examples/ui/views/src/ExampleWindow.cpp
Views Example — All-in-one views building example.
.withContents(
Vertical {
Centered { _new<ALabel>("ALabel") },
Centered { _new<AButton>("AButton") },
Centered { _new<ATextField>() AUI_LET { it->setText("ATextField"); } },
}
<< ".all_views_wrap")
.withExpanding() });
}
};