Skip to content

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#

#define me this, &std::remove_reference_t<decltype(*this)>

Detailed Description#

without with
connect(clicked, this, &MyObject::handleClicked);
connect(clicked, me::handleClicked);

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/7guis/crud/src/main.cpp

7GUIs CRUD - Create/Read/Update/Delete example.

              }),
            },
          },
          Horizontal {
            Button { "Create" }.connect(&AView::clicked, me::createClicked) & mCreateEnabled > &AView::setEnabled,
            Button { "Update" }.connect(&AView::clicked, me::updateClicked) & mUpdateEnabled > &AView::setEnabled,
            Button { "Delete" }.connect(&AView::clicked, me::deleteClicked) & mDeleteEnabled > &AView::setEnabled,
          },
        });
    }

examples/ui/contacts/src/main.cpp

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

                  if (editor != nullptr) {
                      connect(selectedContact->displayName.changed, editor, [this] {
                          *mContacts.writeScope() |= CONTACTS_SORT;
                      });
                      connect(editor->deleteAction, me::deleteCurrentContact);
                  }
                  return editor;
              }) AUI_WITH_STYLE { Expanding(), MinSize(300_dp), BackgroundSolid { AColor::WHITE } },
            } AUI_WITH_STYLE {
              Padding(0),

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),
      },
    });

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/timer/src/main.cpp

7GUIs Timer - Timer example.

                  },
            },
            _new<AButton>("Reset Timer") AUI_WITH_STYLE {
                  Expanding { 1, 0 },
                } AUI_LET { connect(it->clicked, me::reset); },
          },
        });

        connect(mTimer->fired, me::update);
        mTimer->start();

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),
      },
    });

    pack();
}

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/7guis/flight_booker/src/main.cpp

7GUIs Flight Booker - Flight Booker.

                },
            dateTextField(mDepartureDate),
            dateTextField(mReturnDate) AUI_LET { connect(mIsReturnFlight, AUI_SLOT(it)::setEnabled); },
            _new<AButton>("Book") AUI_LET {
                    connect(it->clicked, me::book);
                    connect(mIsValid, AUI_SLOT(it)::setEnabled);
                },
          },
        });
    }

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

7GUIs Cells - Spreadsheet processor (Excel).

                      [](const AString& v) -> _<AView> { return Label { "{}"_format(v) }; },
                      [](const formula::Range& v) -> _<AView> { return Label { "#RANGE?" }; },
                    },
                    v));
            connect(getViews().first()->clicked, me::inflateEditor);
        });
    }

    void inflateEditor() {
        mState->currentExpression = mCell.expression;

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 { mEditorMode ? "Discard" : "Delete" } AUI_LET { connect(it->clicked, me::drop); },
              Button { mEditorMode ? "Done" : "Edit" } AUI_LET { connect(it->clicked, me::toggleEdit); },
            } AUI_WITH_STYLE { MaxSize(EDITOR_CONTENT_MAX_WIDTH, {}), Padding(4_dp) },
          },
        });
    });