aui icon indicating copy to clipboard operation
aui copied to clipboard

Declarative contracts concept

Open Alex2772 opened this issue 8 months ago • 1 comments

  • Closes #124
  • Vertical, Horizontal, Stacked, etc moved to declarative namespace (you'll probably need spread using namespace declarative;
  • declarative syntax of Button now requires an onClick handler:
Button { "1" },  // fail
Button { .text = "2", .onClick = []{} }, // ok
  • container-like declarative syntax of Button is moved to ButtonEx to match with AButtonEx

  • Fixed the following scenario:

Before:

_new<Label>() & mCounter.readProjected(AString::number<int>)

After:

Label { AUI_REACT("{}"_format(mCounter)) }

Alex2772 avatar Apr 20 '25 11:04 Alex2772

I thought operator& and operator&& is an expressive way to make bindings, but it is just make things a lot more complex. I found myself avoiding & and && by making these functor structs and static functions.

Alex2772 avatar Apr 29 '25 16:04 Alex2772

AUI is heading against OOP. FP is better for UIs. In OOP world, nothing more than basic types such as label, atext, ascrollarea, atextfield, atextarea and containers are needed. Everything else is just a composition of basic types.

Alex2772 avatar May 09 '25 21:05 Alex2772

/gemini review

Alex2772 avatar Oct 04 '25 17:10 Alex2772

/gemini review

Alex2772 avatar Oct 06 '25 16:10 Alex2772