Scale element

Represents the size and layout preference of a Group of controls through a {Group, SizeDefinition} pair.

Usage

<Scale
  Size = "xs:string"
  Group = "xs:positiveInteger or xs:string"
/>

Attributes

Attribute Type Required Description
Group
xs:positiveInteger or xs:string
Yes
Must correspond to an existing Group CommandName.

(xs:positiveInteger or xs:string)
A string or an integer value between 2 and 59999, inclusive, or 0x2 and 0xea5f in hexadecimal, inclusive.
The value must be unique within the Ribbon XML document.
Maximum length: 100 characters.
Size
xs:string
Yes
This value should correspond to one of the valid sizes for the SizeDefinition attribute of the associated Group of controls specified in Group.
Restricted to one of the following values:

(Popup)
Identical control layout to Large but hosted in a pop-up or a drop-down pane.
(Small)
Small SizeDefinition template.
(Medium)
Medium SizeDefinition template.
(Large)
Large SizeDefinition template.

Child elements

There are no child elements.

Parent elements

Element
ScalingPolicy
ScalingPolicy.IdealSizes

Remarks

Optional.

May occur one or more times for each ScalingPolicy or ScalingPolicy.IdealSizes.

Each (Group, Size) attribute pair must be unique.

Examples

The following example demonstrates how the appearance of controls in a Group can be customized through the adaptive layout functionality of Ribbon SizeDefinition templates.

The ScalingPolicy manifest in this example specifies a ScalingPolicy.IdealSizes SizeDefinition preference for each of four groups of controls on a Home tab. In addition, Scale elements are specified to influence the collapsing behavior, in descending size order, of each group.

<Tab CommandName="Home">
  <Tab.ScalingPolicy>
    <ScalingPolicy>
      <ScalingPolicy.IdealSizes>
        <Scale Group="GroupClipboard" Size="Medium"/>
        <Scale Group="GroupView" Size="Large"/>
        <Scale Group="GroupFont" Size="Large"/>
        <Scale Group="GroupParagraph" Size="Large"/>
      </ScalingPolicy.IdealSizes>
      <Scale Group="GroupClipboard" Size="Small"/>
      <Scale Group="GroupClipboard" Size="Popup"/>
      <Scale Group="GroupFont" Size="Medium"/>
      <Scale Group="GroupParagraph" Size="Medium"/>
      <!-- 
        GroupView group is associated with the OneButton SizeDefinition.
        Since this template is constrained to one size (Large) there
        is no need to declare further scaling preferences.
      -->
    </ScalingPolicy>
  </Tab.ScalingPolicy>

  <Group CommandName="GroupClipboard" SizeDefinition="FourButtons">
    <Button CommandName="Paste"/>
    <Button CommandName="Cut"/>
    <Button CommandName="Copy"/>
    <Button CommandName="SelectAll"/>
  </Group>

  <Group CommandName="GroupFont"  ApplicationModes="1">
    <FontControl CommandName="Font" FontType="FontWithColor" />
  </Group>

  <Group CommandName="GroupParagraph"  ApplicationModes="1" SizeDefinition="ButtonGroups">
    <ControlGroup>
      <ControlGroup>
        <ToggleButton CommandName="Numbered" />
        <ToggleButton CommandName="Bulleted" />
      </ControlGroup>
    </ControlGroup>
    <ControlGroup>
      <ControlGroup>
        <ToggleButton CommandName="LeftJustify" />
        <ToggleButton CommandName="CenterJustify" />
        <ToggleButton CommandName="RightJustify" />
      </ControlGroup>
      <ControlGroup/>
      <ControlGroup>
        <Button CommandName="Outdent" />
        <Button CommandName="Indent" />
      </ControlGroup>
    </ControlGroup>
  </Group>

  <Group CommandName="GroupView" SizeDefinition="OneButton" >
    <ToggleButton CommandName="ViewSource"/>
  </Group>

</Tab>

Element information

  • Minimum supported system: Windows 7
  • Can be empty: Yes

See also

Customizing a Ribbon Through Size Definitions and Scaling Policies