开发者

Spark Panel Skin + target topGroup?

开发者 https://www.devze.com 2023-02-25 01:57 出处:网络
Hey there-How do I addElement() to the topGroup of a Spark Panel component skin?For instance, if I create a custom UIComponent, then create an associative skin that uses the Spark Panel as a default,

Hey there- How do I addElement() to the topGroup of a Spark Panel component skin? For instance, if I create a custom UIComponent, then create an associative skin that uses the Spark Panel as a default, how do I add elements to the topGroup from with开发者_运维知识库in the skin? Thanks!


Why didn't you inherit from Panel for your custom component?

  1. Create a component that inherits from Panel
  2. Declare a new SkinPart with a the same type as the element you want to add to the topGroup
  3. Override the partAdded/partRemoved methods. In the partAdded, simply add the SkinPart defined to the topGroup. Something like :

    if (instance == yourSkinPartId) topGroup.addElement(yourSkinPartId)

0

精彩评论

暂无评论...
验证码 换一张
取 消