15Elements Split(
const std::string& the_text) {
17 std::stringstream ss(the_text);
19 while (std::getline(ss, word,
' ')) {
20 output.push_back(
text(word));
25Element Split(
const std::string& paragraph,
26 const std::function<
Element(std::string)>& f) {
28 std::stringstream ss(paragraph);
30 while (std::getline(ss, line,
'\n')) {
31 output.push_back(f(line));
33 return vbox(std::move(output));
50 return Split(the_text, [](
const std::string& line) {
52 return flexbox(Split(line), config);
61 return Split(the_text, [](
const std::string& line) {
64 return flexbox(Split(line), config);
73 return Split(the_text, [](
const std::string& line) {
74 static const auto config =
76 return flexbox(Split(line), config);
85 return Split(the_text, [](
const std::string& line) {
89 words.push_back(
text(
"") | xflex);
90 return flexbox(std::move(words), config);
FlexboxConfig & SetGap(int gap_x, int gap_y)
Définit la direction de flex (flex direction) de la flexbox.
@ Center
Les éléments sont centrés le long de la ligne.
@ FlexEnd
Les éléments sont alignés à la fin de la direction du flexbox.
FlexboxConfig & Set(FlexboxConfig::Direction)
Définit la direction de la flexbox.
Element paragraphAlignRight(const std::string &text)
Renvoie un élément affichant le paragraphe sur plusieurs lignes, aligné à droite.
Element paragraphAlignCenter(const std::string &text)
Renvoie un élément affichant le paragraphe sur plusieurs lignes, aligné au centre.
Element text(std::wstring text)
Affiche un morceau de texte unicode.
Element paragraphAlignLeft(const std::string &text)
Renvoie un élément affichant le paragraphe sur plusieurs lignes, aligné à gauche.
Element paragraphAlignJustify(const std::string &text)
Renvoie un élément affichant le paragraphe sur plusieurs lignes, aligné en utilisant un alignement ju...
Element vbox(Elements)
Un conteneur affichant les éléments verticalement un par un.
FlexboxConfig est une structure de configuration qui définit les propriétés de mise en page pour un c...
L'espace de noms FTXUI ftxui::
Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
Un conteneur affichant des éléments sur des lignes/colonnes et capable de passer à la colonne/ligne s...
std::shared_ptr< Node > Element
std::vector< Element > Elements
Elements paragraph(std::wstring text)