Viewに表示する要素です
More...
#include <webcface/component_view.h>
|
| ViewComponent () |
|
| ViewComponent (const std::shared_ptr< message::ViewComponentData > &msg_data, const std::weak_ptr< internal::ClientData > &data_w, const SharedString &id) |
|
| ViewComponent (const ViewComponent &) |
|
ViewComponent & | operator= (const ViewComponent &) |
|
| ViewComponent (ViewComponent &&) noexcept |
|
ViewComponent & | operator= (ViewComponent &&) noexcept |
|
| ~ViewComponent () noexcept |
|
wcfViewComponent | cData () const |
|
wcfViewComponentW | cDataW () const |
|
std::string | id () const |
| そのview内で一意のid
|
|
std::wstring | idW () const |
| そのview内で一意のid (wstring)
|
|
bool | operator== (const ViewComponent &other) const |
| 要素の比較
|
|
bool | operator!= (const ViewComponent &other) const |
|
ViewComponentType | type () const |
| 要素の種類
|
|
std::string | text () const |
| 表示する文字列を取得
|
|
std::wstring | textW () const |
| 表示する文字列を取得 (wstring)
|
|
template<typename Func_ = Func, bool = ::webcface::traits::assertCompleteFunc < std::enable_if_t<std::is_same_v< Func_, Func >, Func_>>()> |
std::optional< Func_ > | onClick () const |
| クリック時に実行される関数を取得
|
|
template<typename Func_ = Func, bool = ::webcface::traits::assertCompleteFunc < std::enable_if_t<std::is_same_v< Func_, Func >, Func_>>()> |
std::optional< Func_ > | onChange () const |
| inputの値の変化時に実行される関数を取得
|
|
template<typename Variant_ = Variant, bool = ::webcface::traits::assertCompleteVariant < std::enable_if_t<std::is_same_v< Variant_, Variant >, Variant_>>()> |
std::optional< Variant_ > | bind () const |
| inputの現在の値を取得
|
|
ViewColor | textColor () const |
| 文字色を取得
|
|
ViewColor | bgColor () const |
| 背景色を取得
|
|
std::optional< double > | min () const |
| 最小値を取得する。
|
|
std::optional< double > | max () const |
| 最大値を取得する。
|
|
std::optional< double > | step () const |
| 数値の刻み幅を取得する。
|
|
std::vector< ValAdaptor > | option () const |
| 引数の選択肢を取得する。
|
|
int | width () const |
| 要素の幅を取得する。
|
|
int | height () const |
| 要素の高さを取得する。
|
|
template<typename T , bool > |
std::optional< T > | onChange () const |
|
template<typename T , bool > |
std::optional< T > | onClick () const |
|
template<typename T , bool > |
std::optional< T > | bind () const |
|
Viewに表示する要素です
- ver2.0〜: get専用(ViewComponent)とset用(TemporalComponent)で分けている。
- ver2.0〜: データはshared_ptrの中に持つ。(pimpl)
- moveが多いしメンバ変数多いので、 make_sharedのコストはあまり気にしなくてもいい?
- 作成時
- components::text() など →ViewComponent
- v << move(component)
- vb->addVC(move(component))
- vb->add(move(component))
- vb->components_.push_back(move(component))
- setSend(make_shared(move(components_)))
- 取得時
- getRecv()
- vector<ViewComponent> v;
- 1要素ずつ再構築
◆ ViewComponent() [1/4]
msg_dataはnullptrになり、内容にアクセスしようとするとruntime_errorを投げる
◆ ViewComponent() [2/4]
◆ ViewComponent() [3/4]
◆ ViewComponent() [4/4]
◆ ~ViewComponent()
◆ bgColor()
◆ bind() [1/2]
template<typename Variant_ = Variant, bool = ::webcface::traits::assertCompleteVariant < std::enable_if_t<std::is_same_v< Variant_, Variant >, Variant_>>()>
inputの現在の値を取得
- Since
- ver1.10
- 値の変更はonChange()に新しい値を渡して呼び出す (onChange()->runAsync(value) など)
- ver2.0〜 戻り値をText型からVariant型に変更
◆ bind() [2/2]
template<typename T , bool >
◆ cData()
◆ cDataW()
◆ height()
◆ id()
そのview内で一意のid
- Since
- ver1.10
- 要素が増減したり順序が変わったりしなければ、 同じ要素には常に同じidが振られる。
- (ver2.5〜) view作成側でidを指定した場合その値が返る。
◆ idW()
std::wstring idW |
( |
| ) |
const |
そのview内で一意のid (wstring)
- Since
- ver2.5
- 要素が増減したり順序が変わったりしなければ、 同じ要素には常に同じidが振られる。
- view作成側でidを指定した場合その値が返る。
◆ max()
std::optional< double > max |
( |
| ) |
const |
◆ min()
std::optional< double > min |
( |
| ) |
const |
◆ onChange() [1/2]
template<typename Func_ = Func, bool = ::webcface::traits::assertCompleteFunc < std::enable_if_t<std::is_same_v< Func_, Func >, Func_>>()>
template std::optional< Func > onChange< Func, true > |
( |
| ) |
const |
inputの値の変化時に実行される関数を取得
- Since
- ver1.10
onChange()に新しい値を渡して呼び出すことで値を変更させる (onChange()->runAsync(value) など)
内部データはonClickと共通
◆ onChange() [2/2]
template<typename T , bool >
template std::optional< Func > onChange< Func, true > |
( |
| ) |
const |
◆ onClick() [1/2]
template<typename Func_ = Func, bool = ::webcface::traits::assertCompleteFunc < std::enable_if_t<std::is_same_v< Func_, Func >, Func_>>()>
template std::optional< Func > onClick< Func, true > |
( |
| ) |
const |
◆ onClick() [2/2]
template<typename T , bool >
template std::optional< Func > onClick< Func, true > |
( |
| ) |
const |
◆ operator!=()
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
要素の比較
- Since
- ver1.11
要素のプロパティが完全一致すればtrue
例外としてbindの中身は別のTextオブジェクトで管理されるので、 ここでは比較の対象ではない
◆ option()
引数の選択肢を取得する。
- Since
- ver1.10
◆ step()
std::optional< double > step |
( |
| ) |
const |
数値の刻み幅を取得する。
- Since
- ver1.10
◆ text()
std::string text |
( |
| ) |
const |
◆ textColor()
◆ textW()
std::wstring textW |
( |
| ) |
const |
表示する文字列を取得 (wstring)
- Since
- ver2.0
◆ type()
◆ width()
The documentation for this class was generated from the following files: