Search code examples
delphiribbon

Delphi creating ribbon from TCustomRibbon does not show component editor


My idea is to create my own ribbon that will inherit from TCustomRibbon. However, I cannot the basic functionality to work. After installing my new ribbon, it does not show the component editor options such as 'Add Application Menu'.

The code for my own ribbon is an exact copy of the code from TRibbon

 type
  TProkonRibbon = class(TCustomRibbon)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }

published
{ Published declarations }
property ActionManager;
property ScreenTips;
property Align default alTop;
property Anchors;
property ApplicationMenu;
property BiDiMode;
property Caption;
property DocumentName;
property Enabled;
property Font;
property Height default TCustomRibbon.cRibbonHeight;
property HideTabs;
property ParentBiDiMode;
property ParentFont;
property QuickAccessToolbar;
property ShowHelpButton;
property Style;
property Tabs;
// Tab Index must be streamed after the Tabs collection
property TabIndex;
property UseCustomFrame;
property OnHelpButtonClick;
property OnRecentItemClick;
property OnTabChange;
property OnTabVisibleChanged;
end;

Solution

  • The ribbon control has both runtime and a designtime parts. The designtime aspects of the control are built on top of the runtime aspect. That is the designtime code has a dependency on the runtime code.

    The VCL ships with source code for the runtime part of the control, but not the designtime part. The designtime part of the control is what adds items to the context menu and shows custom designers etc. You are missing that code. You can't get the source for that code so you'd need to create it yourself.