创建丝带样式的应用程序 [英] Creating Ribbon Styled Applications

查看:187
本文介绍了创建丝带样式的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




  • 使用标准的Delphi TRibbon组件,我注意到它们并不那么漂亮。例如,微软的发光效果和色彩在TRIBOB中看起来不如在Windows 7中用于写字板或Paint中的颜色。


  • 其次如果你想要创建Ribbon Styled界面,我注意到没有Ribbon风格菜单或独立于TRibbon的弹出式菜单。对于实际的功能区来说,但是如果说出于连续性目的,你想要分配给一个TListbox或者TListView的Ribbon风格弹出菜单,似乎不是一个。


  • 第三,有时在功能区动作被禁用的情况下,它仍然会显示焕然一新效果,就好像将鼠标悬停在动作上,即使它被禁用。


  • 最后我发现它很容易地将容器组件(如TCombobox)放在一个组中。这是非常尴尬的大小控制和位置等。




我想我的观点是使用标准的Delphi TRibbon组件似乎不是在视觉上和可用的最好的方法。如何使Ribbon风格的应用程序看起来像微软那样整齐地工作,就像我在Windows 7中写的那样,就像我所说的那样?



有看看这个比较截图,以获得更好的主意:





Delphi功能区似乎不完整,除非我期待太多。我相信Ribbon Components将为您的应用程序提供更好的体验,为最终用户提供视觉和更好的工作空间等。



您可以提出什么建议来增强或使Tribbon工作,看起来像微软?



我不会使用功能区样式界面,所以购买第三方组件不是我真正想做的事情。我看过TMS和DevExpress,但是对于他们的价格,他们也看起来也不好。这些TMS看起来比标准的Delphi TRibbon更差。

解决方案

对于本机的外观,请查看 Windows Ribbon Framework for Delphi



这是一个围绕 Windows Ribbon Framework 可用,因为Windows 7(和安装了官方更新后的Vista)。这是Windows 7 Word Pad使用的API。



还要注意,您有两种布局:Office 2007和Office 2010. Delphi VCL功能区实现Office 2007而Windows 7写字板则使用Office 2010样式。



在某些客户端的某些项目中,我们使用了 TMS软件功能区组件。代码有点过大(很多重复或不好的书写东西,如组件持久性),但它的工作和渲染都很好,支持2007年和2010年的Ribbon样式。对于我们的客户来说,渲染是重要的。对于我们的开源框架,我们发布了一个双重解决方案,用于构建Ribbon-like GUI < a>,从代码生成:它将使用标准VCL组件进行基本布局,也可以使用完整的Office 2007/2010渲染的TMS组件。我们只是定义了一些类,由两个库实现。如果您使用 SQLite3ToolBar 中定义的通用组件(即 TSynForm,TSynToolBar,TSynToolButton,TSynPopupMenu,TSynPage,TSynPager,TSynBodyPager TSynBodyPage 类)和 SynTaskDialog (对于 TSynButton ), USETMSPACK条件将为您做所有的魔法。



我们没有使用在Delphi 2009中引入的Ribbon组件。其动作驱动的设计不会使其易于与我们的用户界面处理的事件驱动设计进行交互,我们必须承认这个组件的声誉很差(至少在Delphi 2009版本中)。



伟大的Windows功能框架的Delphi将不适合我们需要一个即时生成的功能区从代码。它的设计,从微软的实现本身,是创建从一个XML资源的UI,在编译链接...所以它不符合我们的需要,但它可能适合您的更多的静态应用程序UI设计。



如果您在应用程序中使用类似Office的功能区,请注意 Office UI Licensing


Using the standard Delphi TRibbon components I noticed they are not that brilliant.

  • Firstly they dont look as nice as the Microsoft ones, for example the glow effects and colors in the TRibbon dont look as impressive as the ones used in Wordpad or Paint in Windows 7.

  • Secondly if you want to create Ribbon Styled interfaces, I noticed that there is no Ribbon style menus or popup menus independent of the TRibbon. For the actual Ribbon there is, but if say for continuity purposes you wanted the Ribbon style popup menus assigned to a TListbox or TListView for example, there doesnt appear to be one.

  • Thirdly, sometimes when a Ribbon Action is disabled, it still shows the Hot glow effect as if hovering over the Action, even though it is disabled.

  • Finally I find it very fiddly trying to place container components such as a TCombobox in a group. It is really awkward sizing the controls and position etc.

I guess my point is that using the standard Delphi TRibbon components appears to be not the best approach both visually and useably. How can I make a Ribbon styled Application look and work as neatly as the Microsoft ones do just like I said before the way that Wordpad and Paint do in Windows 7?

Have a look at this comparison screenshot to get a better idea:

The Delphi Ribbon seems incomplete, unless I am expecting too much. I believed the Ribbon Components are to provide your Application with a better experience for the end user both visually and better workspace etc.

What suggestions could you give to enhance or make the TRibbon work and look like the Microsoft ones?

I dont use Ribbon Style Interfaces all the time so purchasing 3rd Party Components is not something I really want to do. I have looked at the TMS and DevExpress ones but for the price of them, they dont look as good either. The TMS ones look worse than the standard Delphi TRibbon.

解决方案

For a native look and feel, check the Windows Ribbon Framework for Delphi.

This is an Open Source wrapper around the Windows Ribbon Framework available since Windows 7 (and Vista after some official update is installed). This is the API used by the Windows 7 Word Pad.

Note also that you have two kind of layout: Office 2007 and Office 2010. The Delphi VCL Ribbon implements Office 2007 style, whereas the Windows Seven WordPad uses an Office 2010 style.

In some of our projects for some clients, we used TMS software Ribbon components. The code is a bit over-sized (a lot of duplicates or bad written stuff like component persistence) but it works and renders well, supporting both 2007 and 2010 Ribbon styles. For our Clients, rendering was what mattered. For our Open Source framework, we published a dual solution for building a Ribbon-like GUI, generated from code: it will use either standard VCL components for a basic layout, either the TMS components for a full Office 2007/2010 rendering. We just defined some classes, implemented by either libraries. If you use the generic components as defined in SQLite3ToolBar (i.e. the TSynForm, TSynToolBar, TSynToolButton, TSynPopupMenu, TSynPage, TSynPager, TSynBodyPager and TSynBodyPage classes) and SynTaskDialog (for TSynButton) in your own code, the USETMSPACK conditional will do all the magic for you.

We didn't use yet the Ribbon component as was introduced in Delphi 2009. Its action-driven design won't make it easy to interface with the event-driven design of our User Interface handling, and we have to confess that this component has rather bad reputation (at least in the Delphi 2009 version).

The great Windows Ribbon Framework for Delphi won't fit our need of a on-the-fly generated Ribbon from code. Its design, from the Microsoft implementation itself, is to create the UI from an XML resource, linked at compilation... so it won't fit our needs, but it probably fit yours, for a more "static" application UI design.

If you use a Office-like Ribbon in your application, be aware of the Office UI Licensing.

这篇关于创建丝带样式的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆