Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
661 views
in Technique[技术] by (71.8m points)

delphi - Creating Ribbon Styled Applications

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:

enter image description here

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...