Creating a valid structure

You can right-click in the XML editor to add the nodes, and use the Error List pane to analyze and fix any syntax error.

Here is a brief description to the main XML nodes of a RibbonBar control which can help you understand what a valid structure looks like:

  • <RibbonBar> -- This is the root node. It provides property values for the RibbonBar controls.

    • <RibbonItems> -- This is the only-one second-level node. Only one <RibbonItems> is allowed here.

      • <ApplicationButton> -- Only one <ApplicationButton> is allowed here. It provides property values for the application button.

        • <ApplicationMenu> -- Only one <ApplicationMenu> is allowed here. <ApplicationMenu> can contain only one <Master> and only one <Recent>; and <Master> and <Recent> can contain multiple <Item>.

          • <Master> -- Only one <Master> is allowed here. <Master> can contain multiple <Item>.

            <Master> can have no more than two levels of <Item>.

            • <Item> -- Multiple <Item> are allowed.

              • <Item> -- Multiple <Item> are allowed.

          • <Recent> -- Only one <Recent> is allowed here.

            <Recent> can have only one level of <Item>. <Recent> can contain no more than 9 <Item>.

            • <Item> -- No more than 9 items are allowed.

      • <Categories> -- This is the only-one node for all of the categories.

        • <Category> -- Multiple <Category> are allowed.

          • <Panel> -- Multiple <Panel> are allowed. <Panel> can contain multiple <LargeButton>, <SmallButton>, <CheckBox>, <ComboBox>, and <Group>.

            • <Group> -- Multiple <Group> are allowed. <Group> can contain multiple <SmallButton>, <CheckBox>, and <ComboBox>, but cannot contain any <LargeButton>.

            • <SmallButton> -- Multiple <SmallButton> are allowed. <SmallButton> can contain only one <Menu>.

              • <Menu> -- Only one <Menu> is allowed.

                <Menu> can have no more than two levels of <Item>. <Menu> can have multiple <Item>.

                • <Item> -- Multiple <Item> are allowed.

                  • <Item> -- Multiple <Item> are allowed.

            • <LargeButton> -- Multiple <LargeButton> are allowed. <LargeButton> can contain only one <Menu>.

              • <Menu> -- Only one <Menu> is allowed.

                <Menu> can have no more than two levels of <Item>. <Menu> can have multiple <Item>.

                • <Item> -- Multiple <Item> are allowed.

                  • <Item> -- Multiple <Item> are allowed.

            • <CheckBox> -- Multiple <CheckBox> are allowed.

            • <ComboBox> -- Multiple <ComboBox> are allowed. <ComboBox> can contain multiple <Item>.

              • <Item> -- Multiple <Item> are allowed.

      • <TabButtons> -- This is the only-one node for all of the tab buttons.

        • <TabButton> -- Multiple <TabButton> are allowed. <TabButton> can contain only one <Menu>.

          • <Menu> -- Only one <Menu> is allowed.

            <Menu> can have no more than two levels of <Item>. <Menu> can have multiple <Item>.

            • <Item> -- Multiple <Item> are allowed.

              • <Item> -- Multiple <Item> are allowed.

After you finalize the design, you can save the XML scripts of the RibbonBar control to an XML or JSON file or as a string, and then load the file or string to create the RibbonBar in the application.

  • To load the XML file to create the RibbonBar, call the ImportFromXMLFile function

    Lnv_RibbonBar1.ImportFromXMLFile ("D:\RibbonBarXML\RibbonBar.xml")
  • To load the JSON file to create the RibbonBar, call the ImportFromJSONFile function

    Lnv_RibbonBar1.ImportFromJSONFile ("D:\RibbonBarXML\RibbonBar.json")
  • To load the XML string to create the RibbonBar, call the ImportXML function

    Lnv_RibbonBar1.ImportXML (XMLData)
  • To load the JSON string to create the RibbonBar, call the ImportJSON function

    Lnv_RibbonBar1.ImportJSON (JSONData)