There are several things to define when creating modules consisting of menus and/or buttons. This article will elaborate the elementary parameters that can be present. Notice that these parameters must only be defined in a button or a menu - never in the command line.
Labels
When defining a label, use the parameter label
and type in specific name of button or menu, like this:
label="This is a label"
Note: Special characters like "&" or "<" needs to be escaped xml, and need to be inputted twice in succession in the label.
Sometimes it can be handy to hide the label, e.g. if the menu or button is small. To do this, use the parameter showLabel
and set value as false
:
showLabel="false"
This will hide the label and only show the menu or button with an icon.
Note: showLabel parameter does not work on nested levels.
It is also possible to add labels to menus in ribbon. Here is an example of how it looks:
The command for doing so:
<Label label="Insert label here"/>
The command must be inserted as the first command after the menu tag. Here is an example:
<Menu label="Edit Content" icon="DeleteSlideContextual"> <Label label="Options"/> <Button label="Remove Row" icon="DeleteRows">
<Cmd case="BaseExtensions:delete-content" type="row" identifier="delete"/>
</Button>
<Button label="Remove Column" icon="DeleteColumns">
<Cmd case="BaseExtensions:delete-content" type="column" identifier="delete"/>
</Button>
.. </Menu>
Tip text
Tip texts are great to describe further what the exact menu or button can do. Use the parameter tip_text
and type in your tip text:
tip_text="This is a tip text"
Icon
To add an icon to your menu or button, use the parameter icon
and define the name of the icon:
icon="Insert icon name"
There are a lot of icons to choose from, which can be found in the document called Office2010IconsGallery.docx located from this path:
SD.Production\Ikonbibliotek
Open the document and go til File. Icons can be seen here:
Here, you will see the different icons with their respective names. This is the name you must insert in the aforementioned parameter. Here is an example:
It is also an opportunity to adjust the icon to a specific color using RGB or accents. This can be handy if the module, for instance, changes font or fill to a color. Here is an example of how it should be configured:
icon="rgb:66.143.244"
To adjust the color of an icon by using accent colors, the buttons must be in a dynamic menu. When using accent colors, you must replace the RGB color code with "Accent." followed by its attribute value (1-6). Here is an example:
icon="rgb:Accent.1"
We can also use the light/dark accents. Just as in the example above, replace the RGB color code with "Light." or "Dark." followed by its attribute value (1 or 2). Here is an example:
icon="rgb:Light.2"
Finally, custom icons can be added to the \common\icons
folder.
Note: Custom icons should be created in a 32x32 pixels resolution.
Size
Menus and buttons will be small as default. That means, if you don't define the size in your menu or button, it will automatically be small in ribbon. However, you are able to change the size by using the parameter size
and set it to be large:
size="large"
It is also possible to define the size of buttons within a menu to be large. To do so, use the parameter itemSize
in the menu and set it to be large. In this case, it can be a good idea to add a description to the particular button(s) in the menu by using the parameter description
in the button. Here is an example:
<Menu label="Series Color" icon="ColorPickerCalendar" size="large" itemSize="large">
<Button label="Dark Blue" icon="rgb:59.84.99" description="Red: 59 Green: 84 Blue: 99">
<Cmd case="CorporateCharts:change-color" color="59,84,99"/>
</Button>
</Menu>
Visibility in different programs
We have a lot of features that are only compatible in one or two of the Office programs. Therefore, if your module is only working in, for instance, PowerPoint, it is a good idea to include some parameters that will hide the menu or button in Word and Excel. It is also possible to hide a module in Outlook. To hide a module in specific programs use these parameters if needed and set value to false
:
showInWord="false"
showInPowerPoint="false"
showInExcel="false"
showInOutlook="false"
It is not necessary to set value to true
if it should be shown in a program. Modules will automatically be visible in PowerPoint, Word, and Excel if the above parameter is not used.
Visibility depended on plugin
This parameter is great to make use of as it makes sure that the visibility of the module depends on its plugin. This means, if the plugin defined in the parameter dependency1
is not present in your Plugin folder, the module will be hidden. Here, it is important to define the plugin based on the feature in your module, e.g. if it is a BaseExtensions feature, BaseExtensions should be defined in the parameter.
dependency1="Plugin name"
If there are several features in one menu or button that contain several plugins, add a new parameter called dependency2
where you define the second plugin and so on.
Key shortcuts
It is possible to add shortcut keys to your module. Read more in this article.
Layout in ribbon
Sometimes it can be a good idea to insert separators between different modules in ribbon. Read more about these in this article.
Also, it is possible to change the structure in ribbon. Normally, modules are aligned vertically, but they can also be aligned horizontally by creating boxes. Read more in this article.
Comments
0 comments
Article is closed for comments.