none
Word 2010 Ribbon XML Font Group RRS feed

  • Question

  • This is as close as I can get to recreating the font group in Word 2010 xml.  This exercise generates the following questions:

    1.  How does one insert a separator inside a horizontal box group (which the native font group seems to have done)?

    2.  How do you narrow the gap between two combo boxes (the way the native font group has done)

    3.  How do you widen the space between the two rows, while still using the center vertically option in a group (which the native font group managed)

    I thought the same controls were exposed to ribbon developers as MS is using...

     

    <group id="grpFontCustom" label="Font (new)" visible="true" imageMso="FontColorPicker" insertBeforeMso="GroupFont" autoScale="true" centerVertically="true" >
     <box id="bxFont1" boxStyle="horizontal">
      <comboBox idMso="Font" visible="true" sizeString="Times New Rom" />
      <comboBox idMso="FontSize" visible="true"/>
      <button idMso="FontSizeIncreaseWord" visible="true"/>
      <button idMso="FontSizeDecreaseWord" visible="true"/>
      <gallery idMso="ChangeCaseGallery" visible="true" />
      <gallery idMso="ChangeCaseGallery" visible="true" />
      <button idMso="ClearFormatting" visible="true"/>
     </box>
     <box id="bxFont2" boxStyle="horizontal">
      <toggleButton idMso="Bold" visible="true"/>
      <toggleButton idMso="Italic" visible="true"/>
      <gallery idMso="UnderlineGallery" visible="true" />
      <toggleButton idMso="Strikethrough" visible="true"/>
      <toggleButton idMso="Subscript" visible="true"/>
      <toggleButton idMso="Superscript" visible="true" />
      <gallery idMso="TextEffectsGallery" visible="true" />
      <gallery idMso="TextHighlightColorPicker" visible="true"/>
      <gallery idMso="FontColorPicker" visible="true"/>
     </box>
     <dialogBoxLauncher>
      <button idMso="FontDialog" visible="true"/>
     </dialogBoxLauncher> </group>

     


    Sunday, August 7, 2011 7:07 PM

Answers

  • Thanks, Cindy.  Yes, that is the work-around I came up with (although the enabled=false is nice, since that gives it a nice grey).  However, it's still a pretty ugly (and "squat") separator.  My next attempt at a work-around will be to try and use a custom image.  And it still leaves the other items unsolvable.  The vertical spacing is more of a cosmetic issue, but the horizontal spacing is fairly impactful (although I've mitigated it some by using the same labelControl with just a space character, that's pretty klugey.

    Just to clarify for anyone else reading this: you *can* make two rows, if you use two horizontal boxes.  What I don't understand is why MS disallows the use of the separator control within a box.  Seems like it would be a relatively minor change to the schema.  The other issues (some kind of verticalSpacingDistributed="true" as a Box property, and horizontalSpacingDistributed="true" as a Box property) would, I'm sure, be more difficult, but still not earth-shattering.

    In any event, thanks for the help, Cindy, as this seems to be the best that can be achieved, given the limitations of the current schema.

    <group id="grpFontCustom" label="Font (new)" visible="true" imageMso="FontColorPicker" insertBeforeMso="GroupFont" autoScale="true" centerVertically="true" >
     <box id="bxFont1" boxStyle="horizontal">
      <comboBox idMso="Font" visible="true" sizeString="Times New Rom" />
      <comboBox idMso="FontSize" visible="true"/>
      <button idMso="FontSizeIncreaseWord" visible="true"/>
      <button idMso="FontSizeDecreaseWord" visible="true"/>
      <labelControl id="lblSep1" label="| " enabled="false"/>
      <gallery idMso="ChangeCaseGallery" visible="true" />
      <labelControl id="lblSep2" label="| " enabled="false"/>
      <button idMso="ClearFormatting" visible="true"/>
     </box>
     <box id="bxFont2" boxStyle="horizontal">
      <toggleButton idMso="Bold" visible="true"/>
      <toggleButton idMso="Italic" visible="true"/>
      <gallery idMso="UnderlineGallery" visible="true" />
      <toggleButton idMso="Strikethrough" visible="true"/>
      <toggleButton idMso="Subscript" visible="true"/>
      <toggleButton idMso="Superscript" visible="true" />
      <labelControl id="lblSep3" label="| " enabled="false"/>
      <gallery idMso="TextEffectsGallery" visible="true" />
      <labelControl id="lblSep4" label=" " enabled="false"/>
      <gallery idMso="TextHighlightColorPicker" visible="true"/>
      <labelControl id="lblSep5" label=" " enabled="false"/>
      <gallery idMso="FontColorPicker" visible="true"/>
     </box>
     <dialogBoxLauncher>
      <button idMso="FontDialog" visible="true"/>
     </dialogBoxLauncher>
    </group>
    


    Monday, August 8, 2011 5:12 PM

All replies

  • Hi Jason

    <<I thought the same controls were exposed to ribbon developers as MS is using...>>

    No. Unfortunately. Certain things MS has reserved for itself.

    There's no way you can make two rows, the way the Font group does. And you can't influence the spacing in detail (narrowing spaces).

    You should be able to put a <separator> element into a box, same as any other element.

    EDIT: I see a separator isn't acceptable. How about this: <labelControl id="test" label="|" enabled="false" />


    Cindy Meister, VSTO/Word MVP
    Monday, August 8, 2011 7:13 AM
    Moderator
  • Thanks, Cindy.  Yes, that is the work-around I came up with (although the enabled=false is nice, since that gives it a nice grey).  However, it's still a pretty ugly (and "squat") separator.  My next attempt at a work-around will be to try and use a custom image.  And it still leaves the other items unsolvable.  The vertical spacing is more of a cosmetic issue, but the horizontal spacing is fairly impactful (although I've mitigated it some by using the same labelControl with just a space character, that's pretty klugey.

    Just to clarify for anyone else reading this: you *can* make two rows, if you use two horizontal boxes.  What I don't understand is why MS disallows the use of the separator control within a box.  Seems like it would be a relatively minor change to the schema.  The other issues (some kind of verticalSpacingDistributed="true" as a Box property, and horizontalSpacingDistributed="true" as a Box property) would, I'm sure, be more difficult, but still not earth-shattering.

    In any event, thanks for the help, Cindy, as this seems to be the best that can be achieved, given the limitations of the current schema.

    <group id="grpFontCustom" label="Font (new)" visible="true" imageMso="FontColorPicker" insertBeforeMso="GroupFont" autoScale="true" centerVertically="true" >
     <box id="bxFont1" boxStyle="horizontal">
      <comboBox idMso="Font" visible="true" sizeString="Times New Rom" />
      <comboBox idMso="FontSize" visible="true"/>
      <button idMso="FontSizeIncreaseWord" visible="true"/>
      <button idMso="FontSizeDecreaseWord" visible="true"/>
      <labelControl id="lblSep1" label="| " enabled="false"/>
      <gallery idMso="ChangeCaseGallery" visible="true" />
      <labelControl id="lblSep2" label="| " enabled="false"/>
      <button idMso="ClearFormatting" visible="true"/>
     </box>
     <box id="bxFont2" boxStyle="horizontal">
      <toggleButton idMso="Bold" visible="true"/>
      <toggleButton idMso="Italic" visible="true"/>
      <gallery idMso="UnderlineGallery" visible="true" />
      <toggleButton idMso="Strikethrough" visible="true"/>
      <toggleButton idMso="Subscript" visible="true"/>
      <toggleButton idMso="Superscript" visible="true" />
      <labelControl id="lblSep3" label="| " enabled="false"/>
      <gallery idMso="TextEffectsGallery" visible="true" />
      <labelControl id="lblSep4" label=" " enabled="false"/>
      <gallery idMso="TextHighlightColorPicker" visible="true"/>
      <labelControl id="lblSep5" label=" " enabled="false"/>
      <gallery idMso="FontColorPicker" visible="true"/>
     </box>
     <dialogBoxLauncher>
      <button idMso="FontDialog" visible="true"/>
     </dialogBoxLauncher>
    </group>
    


    Monday, August 8, 2011 5:12 PM