Flex PopUpButton 的编程换肤

发布于 2024-12-01 15:05:10 字数 294 浏览 0 评论 0原文

我正在尝试以编程方式在 Flex Builder 中设置 PopUpButton 控件的外观,但没有成功。据我所知,这需要编写自定义外观类或创建控件类本身的修改版本(因为控件是 MX 而不是 Spark)。再次澄清一下,我想以编程方式修改外观,而不仅仅是设置样式属性或显示图像。我已经能够使用其他 MX 控件(例如选项卡导航器中的选项卡)以编程方式执行此操作,但不能使用 PopUpButton。

我认为部分问题可能在于该控件实际上是由两个单独的按钮组成的,因此您不能在整个控件上仅绘制一个矩形区域。有谁知道如何解决这个问题?

感谢您的帮助!

I am trying to programmatically skin a PopUpButton control in Flex Builder, but having no luck. As far as I know this requires writing a custom skin class or creating a modified version the control class itself (since the control is MX and not Spark). Again, just to clarify, I want to programmatically modify the appearance not simply set styling properties or display an image. I've been able to do this programmatically with other MX controls (e.g. tabs in a tab navigator), but not with the PopUpButton.

I think part of the problem may be that the control is actually composed of two separate buttons, so you cannot draw just one rectangular area over the whole control. Does anyone know how to approach this?

Thanks for the help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

×眷恋的温暖 2024-12-08 15:05:10

我选择的解决方案是使用包含两个 Spark 按钮的自定义 MXML 组件。有一个菜单打开按钮(即带有箭头的按钮)和一个用于执行从菜单中选择的最新命令的按钮。每个按钮都有一个自定义皮肤。

按下打开按钮会显示最初在组件的“CreationComplete”例程中创建的菜单。
有关菜单的更多信息,请访问:http://www.flexafterdark.com/docs/Flex-Menus
(或者因为我尝试时页面已关闭: http://webcache.googleusercontent.com/search?q=cache:http://www.flexafterdark.com/docs/Flex-Menus

您也可以使用按钮来执行此操作自定义 MXML 内的下拉列表组件,但这似乎不适用于我想在下拉菜单中使用的多级分层 XML。

如果有人想出更好的东西,拜托,拜托,一定要发布......

The solution I have settled on is using a custom MXML component that contains two spark buttons. There's a menu opening button (i.e. the button with the arrow) and a button to execute the most recent command selected from the menu. Each of these buttons has a custom skin.

Pressing the opening button shows an menu that is initially created in the component's "CreationComplete" routine.
More on menus here: http://www.flexafterdark.com/docs/Flex-Menus
(or since the page was down when I tried it: http://webcache.googleusercontent.com/search?q=cache:http://www.flexafterdark.com/docs/Flex-Menus)

You could also do this with a button and a dropdownlist inside a custom MXML component, but that didn't seem to work with the mult-level hierarchical XML I wanted to use in my dropdown menu.

If someone comes up with something better, please, please, do post it...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文