载入中...
搜索中...
未找到
eve::ui::WidgetDesc结构体 参考

Declarative widget description (build once / on dirty → flatten into UIHost::Tree). 更多...

#include <Widget.h>

Public 成员函数

WidgetDescwithId (std::string v)
 
WidgetDescwithKey (std::string v)
 
WidgetDescwithText (std::string v)
 
WidgetDescwithValueText (std::string v)
 
WidgetDescwithVisible (bool v)
 
WidgetDescwithChecked (bool v)
 
WidgetDescwithOpen (bool v)
 
WidgetDescwithValue (float v)
 
WidgetDescwithRange (float lo, float hi)
 
WidgetDescwithSize (float w, float h)
 
WidgetDescwithMargin (float l, float t, float r, float b)
 
WidgetDescwithPadding (float l, float t, float r, float b)
 
WidgetDescwithMinSize (float w, float h)
 
WidgetDescwithMaxSize (float w, float h)
 
WidgetDescwithPercent (float w, float h)
 
WidgetDescwithAbsolute (float ax, float ay, float x=0.f, float y=0.f)
 
WidgetDescwithTint (float r, float g, float b, float a=1.f)
 
WidgetDescwithUv (float u0, float v0, float u1, float v1)
 
WidgetDescwithNinePatch (float l, float t, float r, float b)
 
WidgetDescwithCornerRadius (float radius)
 
WidgetDescwithWrap (float width)
 
WidgetDescwithItemHeight (float height)
 
WidgetDescwithGap (float g)
 
WidgetDescwithFlexDirection (FlexDirection d)
 
WidgetDescwithAlign (FlexAlign a)
 
WidgetDescwithJustify (FlexJustify j)
 
WidgetDescwithFlexGrow (float g)
 
WidgetDescwithClick (std::function< void()> fn)
 
WidgetDescwithToggle (std::function< void(bool)> fn)
 
WidgetDescwithValueFn (std::function< void(float)> fn)
 
WidgetDescwithTextChange (std::function< void(const std::string &)> fn)
 
WidgetDescchild (WidgetDesc c)
 
const std::string & reconcileKey () const
 

Public 属性

NodeType type = NodeType::Text
 
std::string id
 
std::string key
 Reconciliation key; defaults to id when empty.
 
std::string text
 
std::string valueText
 
bool visible = true
 
bool checked = false
 
bool open = true
 
float value = 0.f
 
float minValue = 0.f
 
float maxValue = 1.f
 
float sizeX = 0.f
 
float sizeY = 0.f
 
float marginL = 0.f
 
float marginT = 0.f
 
float marginR = 0.f
 
float marginB = 0.f
 
float paddingL = 0.f
 
float paddingT = 0.f
 
float paddingR = 0.f
 
float paddingB = 0.f
 
float minSizeX = 0.f
 
float minSizeY = 0.f
 
float maxSizeX = 0.f
 
float maxSizeY = 0.f
 
float percentW = 0.f
 
float percentH = 0.f
 
float anchorX = 0.f
 
float anchorY = 0.f
 
float posX = 0.f
 
float posY = 0.f
 
bool absolute = false
 
uint64_t textureId = 0
 
float tintR = 1.f
 
float tintG = 1.f
 
float tintB = 1.f
 
float tintA = 1.f
 
float uv0x = 0.f
 
float uv0y = 0.f
 
float uv1x = 1.f
 
float uv1y = 1.f
 
float borderL = 0.f
 
float borderT = 0.f
 
float borderR = 0.f
 
float borderB = 0.f
 
float cornerRadius = 0.f
 
float wrapWidth = 0.f
 
float itemHeight = 0.f
 
FlexDirection flexDirection = FlexDirection::Row
 
FlexAlign alignItems = FlexAlign::Start
 
FlexJustify justifyContent = FlexJustify::Start
 
float gap = -1.f
 
float flexGrow = 0.f
 
std::function< void()> onClick
 
std::function< void(bool)> onToggle
 
std::function< void(float)> onValue
 
std::function< void(const std::string &)> onTextChange
 
std::vector< WidgetDescchildren
 

详细描述

Declarative widget description (build once / on dirty → flatten into UIHost::Tree).

在文件 Widget.h13 行定义.

成员函数说明

◆ child()

WidgetDesc & eve::ui::WidgetDesc::child ( WidgetDesc  c)
inline

在文件 Widget.h226 行定义.

引用了 c , 以及 children.

◆ reconcileKey()

const std::string & eve::ui::WidgetDesc::reconcileKey ( ) const
inline

在文件 Widget.h231 行定义.

引用了 id , 以及 key.

◆ withAbsolute()

WidgetDesc & eve::ui::WidgetDesc::withAbsolute ( float  ax,
float  ay,
float  x = 0.f,
float  y = 0.f 
)
inline

Place absolutely inside a Flex parent: (ax,ay) anchor in parent, (x,y) offset.

在文件 Widget.h148 行定义.

引用了 absolute, anchorX, anchorY, posX, posY, x , 以及 y.

◆ withAlign()

WidgetDesc & eve::ui::WidgetDesc::withAlign ( FlexAlign  a)
inline

在文件 Widget.h198 行定义.

引用了 a , 以及 alignItems.

◆ withChecked()

WidgetDesc & eve::ui::WidgetDesc::withChecked ( bool  v)
inline

在文件 Widget.h96 行定义.

引用了 checked , 以及 v.

◆ withClick()

WidgetDesc & eve::ui::WidgetDesc::withClick ( std::function< void()>  fn)
inline

在文件 Widget.h210 行定义.

引用了 fn , 以及 onClick.

◆ withCornerRadius()

WidgetDesc & eve::ui::WidgetDesc::withCornerRadius ( float  radius)
inline

在文件 Widget.h178 行定义.

引用了 cornerRadius.

◆ withFlexDirection()

WidgetDesc & eve::ui::WidgetDesc::withFlexDirection ( FlexDirection  d)
inline

在文件 Widget.h194 行定义.

引用了 d , 以及 flexDirection.

◆ withFlexGrow()

WidgetDesc & eve::ui::WidgetDesc::withFlexGrow ( float  g)
inline

在文件 Widget.h206 行定义.

引用了 flexGrow.

◆ withGap()

WidgetDesc & eve::ui::WidgetDesc::withGap ( float  g)
inline

在文件 Widget.h190 行定义.

引用了 gap.

◆ withId()

WidgetDesc & eve::ui::WidgetDesc::withId ( std::string  v)
inline

在文件 Widget.h76 行定义.

引用了 v.

◆ withItemHeight()

WidgetDesc & eve::ui::WidgetDesc::withItemHeight ( float  height)
inline

在文件 Widget.h186 行定义.

引用了 height , 以及 itemHeight.

◆ withJustify()

WidgetDesc & eve::ui::WidgetDesc::withJustify ( FlexJustify  j)
inline

在文件 Widget.h202 行定义.

引用了 justifyContent.

◆ withKey()

WidgetDesc & eve::ui::WidgetDesc::withKey ( std::string  v)
inline

在文件 Widget.h80 行定义.

引用了 key , 以及 v.

被这些函数引用 eve::ui::listButtons() , 以及 eve::ui::virtualList().

◆ withMargin()

WidgetDesc & eve::ui::WidgetDesc::withMargin ( float  l,
float  t,
float  r,
float  b 
)
inline

在文件 Widget.h118 行定义.

引用了 b, marginB, marginL, marginR , 以及 marginT.

◆ withMaxSize()

WidgetDesc & eve::ui::WidgetDesc::withMaxSize ( float  w,
float  h 
)
inline

在文件 Widget.h137 行定义.

引用了 h, maxSizeX, maxSizeY , 以及 w.

◆ withMinSize()

WidgetDesc & eve::ui::WidgetDesc::withMinSize ( float  w,
float  h 
)
inline

在文件 Widget.h132 行定义.

引用了 h, minSizeX, minSizeY , 以及 w.

◆ withNinePatch()

WidgetDesc & eve::ui::WidgetDesc::withNinePatch ( float  l,
float  t,
float  r,
float  b 
)
inline

Nine-patch borders in px; keeps the middle stretchable.

在文件 Widget.h171 行定义.

引用了 b, borderB, borderL, borderR , 以及 borderT.

◆ withOpen()

WidgetDesc & eve::ui::WidgetDesc::withOpen ( bool  v)
inline

在文件 Widget.h100 行定义.

引用了 open , 以及 v.

◆ withPadding()

WidgetDesc & eve::ui::WidgetDesc::withPadding ( float  l,
float  t,
float  r,
float  b 
)
inline

在文件 Widget.h125 行定义.

引用了 b, paddingB, paddingL, paddingR , 以及 paddingT.

◆ withPercent()

WidgetDesc & eve::ui::WidgetDesc::withPercent ( float  w,
float  h 
)
inline

在文件 Widget.h142 行定义.

引用了 h, percentH, percentW , 以及 w.

◆ withRange()

WidgetDesc & eve::ui::WidgetDesc::withRange ( float  lo,
float  hi 
)
inline

在文件 Widget.h108 行定义.

引用了 maxValue , 以及 minValue.

◆ withSize()

WidgetDesc & eve::ui::WidgetDesc::withSize ( float  w,
float  h 
)
inline

在文件 Widget.h113 行定义.

引用了 h, sizeX, sizeY , 以及 w.

◆ withText()

WidgetDesc & eve::ui::WidgetDesc::withText ( std::string  v)
inline

在文件 Widget.h84 行定义.

引用了 text , 以及 v.

◆ withTextChange()

WidgetDesc & eve::ui::WidgetDesc::withTextChange ( std::function< void(const std::string &)>  fn)
inline

在文件 Widget.h222 行定义.

引用了 fn , 以及 onTextChange.

◆ withTint()

WidgetDesc & eve::ui::WidgetDesc::withTint ( float  r,
float  g,
float  b,
float  a = 1.f 
)
inline

在文件 Widget.h156 行定义.

引用了 a, b, tintA, tintB, tintG , 以及 tintR.

◆ withToggle()

WidgetDesc & eve::ui::WidgetDesc::withToggle ( std::function< void(bool)>  fn)
inline

在文件 Widget.h214 行定义.

引用了 fn , 以及 onToggle.

◆ withUv()

WidgetDesc & eve::ui::WidgetDesc::withUv ( float  u0,
float  v0,
float  u1,
float  v1 
)
inline

在文件 Widget.h163 行定义.

引用了 uv0x, uv0y, uv1x , 以及 uv1y.

◆ withValue()

WidgetDesc & eve::ui::WidgetDesc::withValue ( float  v)
inline

在文件 Widget.h104 行定义.

引用了 v , 以及 value.

◆ withValueFn()

WidgetDesc & eve::ui::WidgetDesc::withValueFn ( std::function< void(float)>  fn)
inline

在文件 Widget.h218 行定义.

引用了 fn , 以及 onValue.

◆ withValueText()

WidgetDesc & eve::ui::WidgetDesc::withValueText ( std::string  v)
inline

在文件 Widget.h88 行定义.

引用了 v , 以及 valueText.

◆ withVisible()

WidgetDesc & eve::ui::WidgetDesc::withVisible ( bool  v)
inline

在文件 Widget.h92 行定义.

引用了 v , 以及 visible.

◆ withWrap()

WidgetDesc & eve::ui::WidgetDesc::withWrap ( float  width)
inline

在文件 Widget.h182 行定义.

引用了 width , 以及 wrapWidth.

类成员变量说明

◆ absolute

bool eve::ui::WidgetDesc::absolute = false

在文件 Widget.h47 行定义.

被这些函数引用 eve::ui::measureNode() , 以及 withAbsolute().

◆ alignItems

FlexAlign eve::ui::WidgetDesc::alignItems = FlexAlign::Start

在文件 Widget.h66 行定义.

被这些函数引用 withAlign().

◆ anchorX

float eve::ui::WidgetDesc::anchorX = 0.f

在文件 Widget.h43 行定义.

被这些函数引用 withAbsolute().

◆ anchorY

float eve::ui::WidgetDesc::anchorY = 0.f

在文件 Widget.h44 行定义.

被这些函数引用 withAbsolute().

◆ borderB

float eve::ui::WidgetDesc::borderB = 0.f

在文件 Widget.h61 行定义.

被这些函数引用 withNinePatch().

◆ borderL

float eve::ui::WidgetDesc::borderL = 0.f

在文件 Widget.h58 行定义.

被这些函数引用 withNinePatch().

◆ borderR

float eve::ui::WidgetDesc::borderR = 0.f

在文件 Widget.h60 行定义.

被这些函数引用 withNinePatch().

◆ borderT

float eve::ui::WidgetDesc::borderT = 0.f

在文件 Widget.h59 行定义.

被这些函数引用 withNinePatch().

◆ checked

bool eve::ui::WidgetDesc::checked = false

在文件 Widget.h21 行定义.

被这些函数引用 withChecked().

◆ children

◆ cornerRadius

float eve::ui::WidgetDesc::cornerRadius = 0.f

在文件 Widget.h62 行定义.

被这些函数引用 withCornerRadius().

◆ flexDirection

FlexDirection eve::ui::WidgetDesc::flexDirection = FlexDirection::Row

在文件 Widget.h65 行定义.

被这些函数引用 eve::ui::measureNode() , 以及 withFlexDirection().

◆ flexGrow

float eve::ui::WidgetDesc::flexGrow = 0.f

在文件 Widget.h69 行定义.

被这些函数引用 withFlexGrow().

◆ gap

float eve::ui::WidgetDesc::gap = -1.f

在文件 Widget.h68 行定义.

被这些函数引用 eve::ui::UI::beginFlex() , 以及 withGap().

◆ id

std::string eve::ui::WidgetDesc::id

◆ itemHeight

float eve::ui::WidgetDesc::itemHeight = 0.f

在文件 Widget.h64 行定义.

被这些函数引用 withItemHeight().

◆ justifyContent

FlexJustify eve::ui::WidgetDesc::justifyContent = FlexJustify::Start

在文件 Widget.h67 行定义.

被这些函数引用 withJustify().

◆ key

std::string eve::ui::WidgetDesc::key

Reconciliation key; defaults to id when empty.

在文件 Widget.h17 行定义.

被这些函数引用 eve::ui::list(), reconcileKey() , 以及 withKey().

◆ marginB

float eve::ui::WidgetDesc::marginB = 0.f

在文件 Widget.h32 行定义.

被这些函数引用 eve::ui::measureNode() , 以及 withMargin().

◆ marginL

float eve::ui::WidgetDesc::marginL = 0.f

在文件 Widget.h29 行定义.

被这些函数引用 eve::ui::measureNode() , 以及 withMargin().

◆ marginR

float eve::ui::WidgetDesc::marginR = 0.f

在文件 Widget.h31 行定义.

被这些函数引用 eve::ui::measureNode() , 以及 withMargin().

◆ marginT

float eve::ui::WidgetDesc::marginT = 0.f

在文件 Widget.h30 行定义.

被这些函数引用 eve::ui::measureNode() , 以及 withMargin().

◆ maxSizeX

float eve::ui::WidgetDesc::maxSizeX = 0.f

在文件 Widget.h39 行定义.

被这些函数引用 withMaxSize().

◆ maxSizeY

float eve::ui::WidgetDesc::maxSizeY = 0.f

在文件 Widget.h40 行定义.

被这些函数引用 withMaxSize().

◆ maxValue

float eve::ui::WidgetDesc::maxValue = 1.f

在文件 Widget.h25 行定义.

被这些函数引用 withRange().

◆ minSizeX

float eve::ui::WidgetDesc::minSizeX = 0.f

在文件 Widget.h37 行定义.

被这些函数引用 withMinSize().

◆ minSizeY

float eve::ui::WidgetDesc::minSizeY = 0.f

在文件 Widget.h38 行定义.

被这些函数引用 withMinSize().

◆ minValue

float eve::ui::WidgetDesc::minValue = 0.f

在文件 Widget.h24 行定义.

被这些函数引用 withRange().

◆ onClick

std::function<void()> eve::ui::WidgetDesc::onClick

在文件 Widget.h70 行定义.

被这些函数引用 withClick().

◆ onTextChange

std::function<void(const std::string &)> eve::ui::WidgetDesc::onTextChange

在文件 Widget.h73 行定义.

被这些函数引用 withTextChange().

◆ onToggle

std::function<void(bool)> eve::ui::WidgetDesc::onToggle

在文件 Widget.h71 行定义.

被这些函数引用 withToggle().

◆ onValue

std::function<void(float)> eve::ui::WidgetDesc::onValue

在文件 Widget.h72 行定义.

被这些函数引用 withValueFn().

◆ open

bool eve::ui::WidgetDesc::open = true

在文件 Widget.h22 行定义.

被这些函数引用 withOpen().

◆ paddingB

float eve::ui::WidgetDesc::paddingB = 0.f

在文件 Widget.h36 行定义.

被这些函数引用 withPadding().

◆ paddingL

float eve::ui::WidgetDesc::paddingL = 0.f

在文件 Widget.h33 行定义.

被这些函数引用 eve::ui::measureNode() , 以及 withPadding().

◆ paddingR

float eve::ui::WidgetDesc::paddingR = 0.f

在文件 Widget.h35 行定义.

被这些函数引用 withPadding().

◆ paddingT

float eve::ui::WidgetDesc::paddingT = 0.f

在文件 Widget.h34 行定义.

被这些函数引用 eve::ui::measureNode() , 以及 withPadding().

◆ percentH

float eve::ui::WidgetDesc::percentH = 0.f

在文件 Widget.h42 行定义.

被这些函数引用 withPercent().

◆ percentW

float eve::ui::WidgetDesc::percentW = 0.f

在文件 Widget.h41 行定义.

被这些函数引用 withPercent().

◆ posX

float eve::ui::WidgetDesc::posX = 0.f

在文件 Widget.h45 行定义.

被这些函数引用 withAbsolute().

◆ posY

float eve::ui::WidgetDesc::posY = 0.f

在文件 Widget.h46 行定义.

被这些函数引用 withAbsolute().

◆ sizeX

float eve::ui::WidgetDesc::sizeX = 0.f

在文件 Widget.h26 行定义.

被这些函数引用 withSize().

◆ sizeY

float eve::ui::WidgetDesc::sizeY = 0.f

在文件 Widget.h27 行定义.

被这些函数引用 withSize().

◆ text

std::string eve::ui::WidgetDesc::text

在文件 Widget.h18 行定义.

被这些函数引用 withText().

◆ textureId

uint64_t eve::ui::WidgetDesc::textureId = 0

在文件 Widget.h49 行定义.

◆ tintA

float eve::ui::WidgetDesc::tintA = 1.f

在文件 Widget.h53 行定义.

被这些函数引用 withTint().

◆ tintB

float eve::ui::WidgetDesc::tintB = 1.f

在文件 Widget.h52 行定义.

被这些函数引用 withTint().

◆ tintG

float eve::ui::WidgetDesc::tintG = 1.f

在文件 Widget.h51 行定义.

被这些函数引用 withTint().

◆ tintR

float eve::ui::WidgetDesc::tintR = 1.f

在文件 Widget.h50 行定义.

被这些函数引用 withTint().

◆ type

◆ uv0x

float eve::ui::WidgetDesc::uv0x = 0.f

在文件 Widget.h54 行定义.

被这些函数引用 withUv().

◆ uv0y

float eve::ui::WidgetDesc::uv0y = 0.f

在文件 Widget.h55 行定义.

被这些函数引用 withUv().

◆ uv1x

float eve::ui::WidgetDesc::uv1x = 1.f

在文件 Widget.h56 行定义.

被这些函数引用 withUv().

◆ uv1y

float eve::ui::WidgetDesc::uv1y = 1.f

在文件 Widget.h57 行定义.

被这些函数引用 withUv().

◆ value

float eve::ui::WidgetDesc::value = 0.f

在文件 Widget.h23 行定义.

被这些函数引用 withValue().

◆ valueText

std::string eve::ui::WidgetDesc::valueText

在文件 Widget.h19 行定义.

被这些函数引用 withValueText().

◆ visible

bool eve::ui::WidgetDesc::visible = true

在文件 Widget.h20 行定义.

被这些函数引用 eve::ui::measureNode(), eve::ui::UIHost::setVisibleById() , 以及 withVisible().

◆ wrapWidth

float eve::ui::WidgetDesc::wrapWidth = 0.f

在文件 Widget.h63 行定义.

被这些函数引用 withWrap().


该结构体的文档由以下文件生成: