diff --git a/mkdocs/acelements.md b/mkdocs/acelements.md index 4d2d91c..3de44b6 100644 --- a/mkdocs/acelements.md +++ b/mkdocs/acelements.md @@ -72,7 +72,21 @@ The enumerators for *ACElement_t* are as follows: - AutoConnectText: **AC_Text** - Uninitialized element: **AC_Unknown** -Furthermore, to convert an entity that is not an AutoConnectElement to its native type, you must [re-interpret](https://en.cppreference.com/w/cpp/language/reinterpret_cast) that type with c++. +Furthermore, to convert an entity that is not an AutoConnectElement to its native type, you must [re-interpret](https://en.cppreference.com/w/cpp/language/reinterpret_cast) that type with c++. Or, you can be coding the sketch more easily with using the [**as**](apielements.md#ast62) function. + +```cpp hl_lines="6" +AutoConnectAux customPage; + +AutoConnectElementVT& elements = customPage.getElements(); +for (AutoConnectElement& elm : elements) { + if (elm.type() == AC_Text) { + AutoConnectText& text = customPage[elm.name].as(); + text.style = "color:gray;"; + // Or, it is also possible to write the code further reduced as follows. + // customPage[elm.name].as().style = "color:gray;"; + } +} +``` ## AutoConnectButton @@ -151,10 +165,10 @@ A checked is a Boolean value and indicates the checked status of the checkbox. T ## AutoConnectFile -AutoConnectFile generates asn HTML `#!html ` tag and a `#!html