Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

New To Ribbon Control

I've used other SRP Controls extensively but am new to the Ribbon Control. I have been using the XML code from the Ribbon doc as my sample code on my MDI form. I have a few newbie questions.
1. Can I place the Ribbon control on our MDI form but eliminate the Tab control portion?
2. Can the backstage control portion be disabled? I will use it on other data entry forms but not on the MDI form. I want the 'circle' with our logo to appear but disabled from clicking.
3. It seems regardless of where I place the OI OLE control on the form the Ribbon control with tabs always appears at the top of my form. Can I have it display lower on the form with other OI controls above it?
4. Can we use SET_PROPERTY on the Ribbon Control or do we set properties only through XML code?


  • Morning,

    Until a more informed response appears, here's my two cents from my experience.
    Firstly, what I tend to do is open a copy of word and/or excel so I have a point of reference. This is what the ribbon is intended/designed to replicate. That way I keep in mind how it's supposed to work but it also gives me little ideas of what features I may be able to introduce.
    1. Yes, you can place it on the MDI but you can't eliminate the Tab portion. The closest you could come would be to have just one tab. Maybe rethink what the tabs could represent. Two possibilities for an mdi that I would suggest is to either provide an alternative to the file menu structure you may have on your current mdi. Eg: top level menus might be tabs and sub menus could be groups or buttons. Alternatively, if your app can be split into modules, perhaps each tab could represent a different module.
    2. I don't believe the backstage can be disabled, so it then just requires a rethink on what you might use it for. There's nothing stopping it from being minimalistic. I've seen an mdi implementation where the backstage is just a detailed "About" type window. Doesn't do anything except provide info to the user that they might otherwise find by clicking "Help", "About".
    3. This one is by design. The ribbon will always be at the top just as in word or excel.
    4. The XML is for simple initialisation of the ribbon. You can and should use set_property for changes after the initial setup. Eg: to make a control invisible... Set_Property(@Window:".OLE_RIBBON", "OLE.ControlVisible[BTN_COPY]", 0)
  • Thanks for your response AusMarkB. You answered my questions and provided a better understanding of the intent of the ribbon. And using Word and Excel as examples is also helpful in how it's been used in other apps.
    Next question...can the circle at the top of the backstage be filled with an image?
  • Mark, thanks for responding so thoroughly and accurately.

    Phil, you can have an icon in the circle button. The Ribbon automatically uses whatever icon you associate to the form in the Form Designer.
  • I'm going to have to let that one go through to the keeper.

    I'm pretty sure you could and pretty sure I had in the early days of testing but I can't remember how and can't find any reference to it in the wiki.
  • and there's the keeper... :)
  • Kevin
    "The Ribbon automatically uses whatever icon you associate to the form in the Form Designer. "
    I'm not clear on that Kevin. Is the icon image set as some property on the form?
  • Phil - This is the icon you specify in the Window Properties dialog where it is labelled "Icon Entity" and is above the label "Bitmap Entity". It is also something you can set using the Window ICON property.
  • Got it. Thanks
  • I'm back. Been doing other stuff. Now that I have our basic MDI ribbon designed through the XML record and also qualified the SRP OLE Ribbon control on the form, how do I capture a click event on any of my ribbon icons and process through my form's commuter module? Is it similar to the other SRP controls or is this handled through the XML. I'm missing some of the basics on this control.
  • Anything associated with a command fires the OnCommand event when clicked. All other control types, such as combo boxes, have their own event.
  • My understanding now is that the ribbon control is defined, with xml, and displayed at the MDI level. The xml can then either be programmed within the MDI commuter module or stored and read from a record. Each launched form from the MDI can then use the AddTab, AddGroup, and AddControl (and their Remove counterparts) to dynamically change the ribbon per form. Use of the Set_property will reference back to the MDI frame as the parent for the ribbon. Ribbons are not to be defined per form. Is this correct?
  • Close. The way I designed it was for performance. If you want a tab on your ribbon to be context sensitive (only to appear when a certain form is visible), it's better to create the tab in advance and simply hide it until you need to show it. In other words, your XML should define all possible tabs and buttons in advance. This will maximize performance and reduce the code needed to maintain everything.
  • Got it. Thanks Kevin.
  • edited November 2016
    Should clicking on a Tab also fire the OnCommand event?
  • No. There is currently no event fired when a tab is clicked.
  • edited November 2016
    You confirmed my conclusion., Thanks
    I've got the basic concepts and implementation in place now. The Quick Access sub section has icons for the basic I/O events (Save, Clear, Delete, Close, Search). In this AREV to OI conversion I was looking for the best strategy for implementing 'AREV softkeys'. The plan was to use a simple ribbon with a tab per softkey. It may be best use a 'Softkey' tab (renamed to something else) and make better use of Groups within tabs.
  • What is the opposite of HideCommands? ie. what will show hidden commands?
    I understand Add\Remove commands.
  • Funny. I never added a ShowCommands. I guess it was because I needed a HideCommands for FrameWorks. The closest work around (for now) is to use the ControlVisible property, which I admit is a bit more work than you have liked to hear.
  • But a bit less work than if there was no HideCommands
  • Thanks. In the meantime I've been using the Add\Remove Controls and it's been working but I'll revisit with your suggestion.

    The icons are not displaying within the tab control groups. All of my icons are 'png' format within an Icons folder under the OI folder. I'm using the Office2013 theme and within the XML I've set Icon, SmallIcon, and LargeIcon with no success. Any suggestions?
  • Can you post the XML your using to setup the Group. I assume this is regarding a group. Note that group icons only appear when a group is collapsed.
  • edited March 2018
    Here is the code. We are experimenting with email, skype, and calling 'people' based on data on a data entry screen. I initially had the image folder as a variable but have since hard coded it in this example.
    The ribbon is set in the MDI frame and each screen has an Add ribbon and Remove ribbon routine on the create and close events respectively. The ribbon code works. It's the image that does not display within each group for the 'Communication' tab. I've checked and all images exists with the image folder and are spelled correctly.
    May it be due to the size of the image?

    add_ribbon: image_folder = drive():'\PM_IconSets' Xml = '' Xml := '<AddTabs>' Xml := ' <Tab Key="COMMUNICATION" Caption="Communication">' Xml := ' <Group Key="EMAIL" Caption="Email User" Icon = "O:\oi\PM_IconSets\mail-user.png">' Xml := ' <Button Key="EMAIL_BTN" Key="EMAIL" LargeIcon = "O:\oi\PM_IconSets\mail-user.png" SmallIcon = "o:\oi\PM_IconSets\mail-user.png" />' Xml := ' </Group>' Xml := ' <Group Key="SKYPE" Caption="Skype User" Icon = "O:\oi\PM_IconSets\social_skype.png">' Xml := ' <Button Key="SKYPE_BTN" Key="SKYPE" LargeIcon = "O:\oi\PM_IconSets\mail-user.png" SmallIcon = "o:\oi\PM_IconSets\mail-user.png" />' Xml := ' </Group>' Xml := ' <Group Key="OFFICE_PHONE" Caption="Call Users Office Phone" Icon = "O:\oi\PM_IconSets\phone_discussion-user.png">' Xml := ' <Button Key="OFFICE_PHONE_BTN" Key="OFFICE_PHONE" LargeIcon = "O:\oi\PM_IconSets\phone_discussion-user.png" SmallIcon = "o:\oi\PM_IconSets\phone_discussion-user.png" />' Xml := ' </Group>' Xml := ' <Group Key="CELL_PHONE" Caption="Call Users Cell Phone" Icon = "O:\oi\PM_IconSets\phone_discussion-user.png">' Xml := ' <Button Key="CELL_PHONE_BTN" Key="CELL_PHONE" LargeIcon = "O:\oi\PM_IconSets\phone_discussion-user.png" SmallIcon = "o:\oi\PM_IconSets\phone_discussion-user.png" />' Xml := ' </Group>' Xml := ' </Tab>' Xml := '</AddTabs>' Send_Message(mdiframe:".OLE_RIBBON", "OLE.AddTabs", Xml) return
  • edited November 2016
    Just so I'm clear, the image appears fine on the Buttons, just not in the Groups? You have tested resizing the ribbon until the Groups collapse into a single button?
  • Images appear in the Quick Access section of the ribbon. The mages do not appear in the group(s) within a tab.
    There are three groups within this one 'Communication' tab.
    I'm not sure what you are referring to with 'resizing the ribbon until the Groups collapse into a single button.'
  • I think the best way for me to get my head around this is for you to email me your PNGs and maybe a screenshot of your Ribbon.
  • Kevin
    If nothing stands out with my code, syntax, use of the full path name to the image file, or use of 'Add Tabs' then I'll play around with the images and resize them. Maybe they are too big but are displaying. I'll get back to you after I work on that.
Sign In or Register to comment.