Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6625293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:45:27+00:00 2026-05-25T21:45:27+00:00

On Windows platform, with the VCL , when we want to add a separator

  • 0

On Windows platform, with the VCL, when we want to add a separator in a menu, we add a TMenuItem with a Caption := '-';

With FireMonkey, we add a TMenuItem with a Text := '-';

It works as expected on Windows platform, the item with the Text=’-‘ is displayed as a separator.

But, when I run the same application on OSX, I have the minus sign visible…

I haven’t found any property on the TMenuItem to specify it is a separator…

I have tried with a TMainMenu and a TMenuBar (UseOSMenu := True|False;) and I still have this issue.

Any idea to create a real separator? (otherwise, I will check the OS and remove it if OSX…)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:45:28+00:00Added an answer on May 25, 2026 at 9:45 pm

    This is a bug in FireMonkey. I am sure they will solve it. But meanwhile you can use the below code. Call the procedure FixSeparatorItemsForMac in the OnActivate event of your main form.

    Dont forget mac specific files in the uses list.

    uses
    ...
      {$IFDEF MACOS}
      ,Macapi.ObjectiveC,MacApi.AppKit,MacApi.Foundation,FMX.Platform.Mac
      {$ENDIF}
    
    {$IFDEF MACOS}
    
    Procedure FixSeparatorItemsForMenuItem(MenuItem:NSMenuItem);
    var i:Integer;
        subItem:NSMenuItem;
    begin
      if (MenuItem.hasSubmenu = false) then exit;
      for i := 0 to MenuItem.submenu.itemArray.count -1 do
      begin
        subItem := MenuItem.submenu.itemAtIndex(i);
        if (subItem.title.isEqualToString(NSSTR('-'))= true) then
        begin
          MenuItem.submenu.removeItemAtIndex(i);
          MenuItem.submenu.insertItem(TNSMenuItem.Wrap(TNSMenuItem.OCClass.separatorItem),i);
        end else begin
          FixSeparatorItemsForMenuItem(subItem);
        end;
      end;
    end;
    
    Procedure FixSeparatorItemsForMac;
    var NSApp:NSApplication;
        MainMenu:NSMenu;
        AppItem: NSMenuItem;
        i: Integer;
    begin
      NSApp := TNSApplication.Wrap(TNSApplication.OCClass.sharedApplication);
      MainMenu := NSApp.mainMenu;
      if (MainMenu <> nil) then
      begin
        for i := 0 to MainMenu.itemArray.count -1 do
        begin
          AppItem := mainMenu.itemAtIndex(i);
          FixSeparatorItemsForMenuItem(AppItem);
        end;
    
      end;
    end;
    {$ENDIF}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a static library (.lib file) on Windows platform, I want to know
I am using Qt on windows platform. i want to get and display vendor
I have my application on Windows platform and want a java function to be
I'm working on a windows platform and want to be able to auto sync
I want to learn programming C++ (native) on Windows platform for RPC communication. I
I have written a server based on boost::asio in windows platform. I want to
I want to know the following information: For each process on the windows platform:
I want to implement my own policy for DNS look up on Windows platform
Using unmanaged C++ on a Windows platform, is there a simple way to detect
Does Visual C++ runtime imply Windows platform? I mean if I write a program

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.