TMSFNCRibbon - adding controls at designtime

TMSFNC UI Pack 2.0.0.0 / Lazarus 1.6.4 / fpc 3.02 / qt4 & gtk2 widgets


Currently when adding a TMSFNCRibbonToolbar or adding any of the TMSFNCToolbar controls by the toolbar context menu, I need to save the form, close the form and reopen it to see the controls in the form deklaration and in the Object inspector.

With best regards

This issue has already been reported and fixed, and the fix is included in the latest release. If you are using the latest official release and still can reproduce this issue, please contact us for an incremental source update for the designtime package.

Lazarus 1.6.4 / fpc 3.0.2 / FNC UI pack 2.0.0.0 / Windows 7


I reported this already for the RC version of the FNC UI package. As far as I remember the behaviour of the RC package right, saving the form, and reopen it was a workaround. Now in the current released version of the FNC UI package, newly inserted elements are in the property editor but not in the form declaration  after saving and reopen the form. Only when changing the names of the elements inside the property editor, the declarations are inserted.

Step 1: - take an empty form and insert a TMSFNCRibbonControl :

  TForm1 = class(TForm)
    TMSFNCRibbon1: TTMSFNCRibbon;
    TMSFNCRibbon1BottomContainer: TTMSFNCRibbonBottomContainer;
    TMSFNCRibbon1Caption: TTMSFNCRibbonCaption;
    TMSFNCRibbon1Icon: TTMSFNCRibbonIcon;
    TMSFNCRibbon1PageControl: TTMSFNCRibbonPageControl;
    TMSFNCRibbon1PageControlContainer: TTMSFNCRibbonContainer;
    TMSFNCRibbon1PageControlFileButton: TTMSFNCRibbonFileButton;
    TMSFNCRibbon1PageControlPage0: TTMSFNCRibbonPageControlContainer;
    TMSFNCRibbon1PageControlPage1: TTMSFNCRibbonPageControlContainer;
    TMSFNCRibbon1PageControlPage2: TTMSFNCRibbonPageControlContainer;
    TMSFNCRibbon1QAT: TTMSFNCRibbonQAT;
    TMSFNCRibbon1SystemMenu: TTMSFNCRibbonSystemMenu;
    TMSFNCRibbon1SystemMenuCloseButton: TTMSFNCRibbonSystemMenuToolBarButton;
    TMSFNCRibbon1SystemMenuHelpButton: TTMSFNCRibbonSystemMenuToolBarButton;
    TMSFNCRibbon1SystemMenuMaximizeButton: TTMSFNCRibbonSystemMenuToolBarButton;
    TMSFNCRibbon1SystemMenuMinimizeButton: TTMSFNCRibbonSystemMenuToolBarButton;
    TMSFNCRibbon1Wrapper: TTMSFNCRibbonToolBarWrapper;
  private
    { private declarations }
  public
    { public declarations }
  end;        


Step 2 : Add a TTMSFNCRibbonToolBar

Its not visible in the form declaration and not available for the property editor

Step 3 : Save the form, close it, reopen it :

By selecting the toolbar on the form, its avaialble in the property editor, but not in the form declaration :

  TForm1 = class(TForm)
    TMSFNCRibbon1: TTMSFNCRibbon;
    TMSFNCRibbon1BottomContainer: TTMSFNCRibbonBottomContainer;
    TMSFNCRibbon1Caption: TTMSFNCRibbonCaption;
    TMSFNCRibbon1Icon: TTMSFNCRibbonIcon;
    TMSFNCRibbon1PageControl: TTMSFNCRibbonPageControl;
    TMSFNCRibbon1PageControlContainer: TTMSFNCRibbonContainer;
    TMSFNCRibbon1PageControlFileButton: TTMSFNCRibbonFileButton;
    TMSFNCRibbon1PageControlPage0: TTMSFNCRibbonPageControlContainer;
    TMSFNCRibbon1PageControlPage1: TTMSFNCRibbonPageControlContainer;
    TMSFNCRibbon1PageControlPage2: TTMSFNCRibbonPageControlContainer;
    TMSFNCRibbon1QAT: TTMSFNCRibbonQAT;
    TMSFNCRibbon1SystemMenu: TTMSFNCRibbonSystemMenu;
    TMSFNCRibbon1SystemMenuCloseButton: TTMSFNCRibbonSystemMenuToolBarButton;
    TMSFNCRibbon1SystemMenuHelpButton: TTMSFNCRibbonSystemMenuToolBarButton;
    TMSFNCRibbon1SystemMenuMaximizeButton: TTMSFNCRibbonSystemMenuToolBarButton;
    TMSFNCRibbon1SystemMenuMinimizeButton: TTMSFNCRibbonSystemMenuToolBarButton;
    TMSFNCRibbon1Wrapper: TTMSFNCRibbonToolBarWrapper;
  private
    { private declarations }
  public
    { public declarations }
  end;                            

Step 4 : Reneame the toolbar from "TMSFNCRibbonToolBar1" to "ToolBar1"

  TForm1 = class(TForm)
    TMSFNCRibbon1: TTMSFNCRibbon;
    TMSFNCRibbon1BottomContainer: TTMSFNCRibbonBottomContainer;
    TMSFNCRibbon1Caption: TTMSFNCRibbonCaption;
    TMSFNCRibbon1Icon: TTMSFNCRibbonIcon;
    TMSFNCRibbon1PageControl: TTMSFNCRibbonPageControl;
    TMSFNCRibbon1PageControlContainer: TTMSFNCRibbonContainer;
    TMSFNCRibbon1PageControlFileButton: TTMSFNCRibbonFileButton;
    TMSFNCRibbon1PageControlPage0: TTMSFNCRibbonPageControlContainer;
    TMSFNCRibbon1PageControlPage1: TTMSFNCRibbonPageControlContainer;
    TMSFNCRibbon1PageControlPage2: TTMSFNCRibbonPageControlContainer;
    TMSFNCRibbon1QAT: TTMSFNCRibbonQAT;
    TMSFNCRibbon1SystemMenu: TTMSFNCRibbonSystemMenu;
    TMSFNCRibbon1SystemMenuCloseButton: TTMSFNCRibbonSystemMenuToolBarButton;
    TMSFNCRibbon1SystemMenuHelpButton: TTMSFNCRibbonSystemMenuToolBarButton;
    TMSFNCRibbon1SystemMenuMaximizeButton: TTMSFNCRibbonSystemMenuToolBarButton;
    TMSFNCRibbon1SystemMenuMinimizeButton: TTMSFNCRibbonSystemMenuToolBarButton;
    TMSFNCRibbon1Wrapper: TTMSFNCRibbonToolBarWrapper;
    ToolBar1: TTMSFNCRibbonToolBar;
  private
    { private declarations }
  public
    { public declarations }
  end;                            


Hi, 


Can you verify the Unit LCLTMSFNCRibbonDE.pas contains statements like:
GlobalDesignHook.SelectOnlyThis(tbb); 

If so, then you are using the latest code, and you try by re-installing the designtime package. If you do not have this code in the units, this issue has been fixed and awaits release.

I found this code line 1x in 


procedure TTMSFNCRibbonToolBarEditor.MenuItemTest(Sender: TObject);  

        {$IFNDEF LCLLIB}
        Designer.SelectComponent(tbb);
        {$ENDIF}
        {$IFDEF LCLLIB}
        GlobalDesignHook.SelectOnlyThis(tbb);
        {$ENDIF}           

I reinstalled the designtime package - LCLTMSFNCUIPackPkgDE.lpk - no changes

We are not able to reproduce this issue here. Can you try if selecting the component (clicking on it, event if it is already selected) is inserting the component in the structure window?

You mean the component tree? Yes, that happens for all new inserted elements (ToolBar, Buttons, etc)

We'll further investigate this here.

Normaly I don't use the component tree inside the object inspector but using it the behaviour is maybe slightly different to what I wrote before. All new inserted objects in the TMSFNCRibbon are visible and accessible in the component tree without saving and reopen the form. The only thing which is not happen is, there is not object declaration inside the form declaration. As soon as I change the names of the newly inserted ribbon objects with the help of the object inspector, they will be inserted in the form declaration.


I hope that description is somehow more helpful for you

Best regards

Hi, 


Thank you for the clarification. We were able to reproduce this issue now in the IDE. We are still searching for a solution though. It's currently unclear why this behaviour has changed, as it was working in an older version of Lazarus. We hope to found a solution as soon as possible.