创建功能区样式的应用程序 [英] Creating Ribbon Styled Applications

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

问题描述

使用标准的 Delphi TRibbon 组件时,我注意到它们并不那么出色.

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

  • 首先,它们看起来不如 Microsoft 的好,例如,TRibbon 中的发光效果和颜色看起来不像 Windows 7 中的 Wordpad 或 Paint 中使用的那么令人印象深刻.

  • 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.

其次,如果您想创建 Ribbon Styled 界面,我注意到没有独立于 TRibbon 的 Ribbon 样式菜单或弹出菜单.对于实际的功能区,有,但如果出于连续性目的,您希望将功能区样式弹出菜单分配给 TListbox 或 TListView,例如,似乎没有.

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.

最后,我发现尝试将容器组件(例如 TCombobox)放在一个组中非常繁琐.调整控件和位置等的大小真的很尴尬.

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.

我想我的观点是使用标准的 Delphi TRibbon 组件在视觉上和可用性上似乎都不是最佳方法.我怎样才能让 Ribbon 风格的应用程序看起来和工作得像 Microsoft 的应用程序一样整洁,就像我之前所说的那样,就像 Windows 7 中的写字板和画图一样?

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:

Delphi Ribbon 似乎不完整,除非我期望过高.我相信 Ribbon 组件可以为您的应用程序提供更好的视觉体验和更好的工作空间等.

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.

您有什么建议可以增强或使 TRibbon 工作并看起来像 Microsoft 的那样?

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

我不会一直使用 Ribbon Style Interfaces,所以购买 3rd Party Components 并不是我真正想做的事情.我看过 TMS 和 DevExpress 的,但就它们的价格而言,它们看起来也不那么好.TMS 看起来比标准的 Delphi TRibbon 更糟糕.

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.

推荐答案

要获得原生外观和感觉,请查看 Delphi 的 Windows 功能区框架.

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

这是一个围绕 Windows 功能区框架的开源包装器自 Windows 7 起可用(安装一些官方更新后的 Vista).这是 Windows 7 Word Pad 使用的 API.

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.

另请注意,您有两种布局:Office 2007 和 Office 2010.Delphi VCL Ribbon 实现 Office 2007 样式,而 Windows 7 WordPad 使用 Office 2010 样式.

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.

在我们为一些客户提供的一些项目中,我们使用了TMS 软件功能区组件.代码有点过大(很多重复或写得不好的东西,如组件持久性),但它运行良好,渲染良好,支持 2007 和 2010 Ribbon 样式.对于我们的客户来说,渲染才是最重要的.对于我们的开源框架,我们发布了用于构建类似 Ribbon 的 GUI 的双重解决方案,从代码生成:它将使用标准 VCL 组件进行基本布局,或者使用 TMS 组件进行完整的 Office 2007/2010 渲染.我们刚刚定义了一些类,由任一库实现.如果您使用 SQLite3ToolBar 中定义的通用组件(即 <代码>TSynForm、TSynToolBar、TSynToolButton、TSynPopupMenu、TSynPage、TSynPager、TSynBodyPager 和 TSynBodyPage 类)和 SynTaskDialog(对于 TSynButton)在您自己的代码中,USETMSPACK 条件将为您做所有的魔术.

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.

我们还没有使用 Delphi 2009 中引入的 Ribbon 组件.它的动作驱动设计不会让我们的用户界面处理的事件驱动设计变得容易,我们必须承认这个组件的名声很差(至少在 Delphi 2009 版本中).

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).

用于 Delphi 的出色的 Windows 功能区框架不符合我们对从代码动态生成功能区的需求.它的设计来自 Microsoft 实现本身,是从 XML 资源创建 UI,在编译时链接......所以它不适合我们的需求,但它可能适合你的,用于更静态"的应用程序 UI 设计.

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.

如果您在应用程序中使用类似 Office 的功能区,请注意 Office用户界面许可.

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

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

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