[Solved] Setting tab title

Dec 15, 2009 at 7:54 PM

Hello to all.

Let me send you this post to see if it is normal that the wording of my "tabs" and "groups" are preceded by the word "label"?

How can I fix this?

Here is an example of the XML source file.

Thank you for your responses.

D. Detrain

 

<?xml version='1.0' encoding='utf-8'?>
<Application xmlns='http://schemas.microsoft.com/windows/2009/Ribbon'>
	<Application.Commands>
		<Command Name="CMDSave"
					Id="1001"
					LabelTitle="&amp;Enregistrer"
					LabelDescription="A voir 1"
					TooltipTitle="Enregistrer"
					TooltipDescription="Enregistrer le signaletique en cours.">
			<Command.LargeImages>
				<Image>c:\prog\evolcta.fts\pic\save32.bmp</Image>
			</Command.LargeImages>
			<Command.SmallImages>
				<Image>c:\prog\evolcta.fts\pic\save16.bmp</Image>
			</Command.SmallImages>
		</Command>
  		<Command Name="CMDCancel"
					Id="1002"
					LabelTitle="&amp;Annuler"
					LabelDescription="A voir "
					TooltipTitle="Annuler"
					TooltipDescription="Annule la création ou la modification du signalétique en cours.">
			<Command.LargeImages>
				<Image>c:\prog\evolcta.fts\pic\cancel32.bmp</Image>
			</Command.LargeImages>
			<Command.SmallImages>
				<Image>c:\prog\evolcta.fts\pic\cancel16.bmp</Image>
			</Command.SmallImages>
		</Command>
  		<Command Name="CMDDelete"
					Id="1003"
					LabelTitle="&amp;Supprimer"
					LabelDescription="A voir"
					TooltipTitle="Supprimer"
					TooltipDescription="Supprimer le signalétique en cours.">
			<Command.LargeImages>
				<Image>c:\prog\evolcta.fts\pic\delete32.bmp</Image>
			</Command.LargeImages>
			<Command.SmallImages>
				<Image>c:\prog\evolcta.fts\pic\delete16.bmp</Image>
			</Command.SmallImages>
		</Command>
  		<Command Name="CMDExit"
					Id="1004"
					LabelTitle="&amp;Quitter"
					LabelDescription="A voir"
					TooltipTitle="Quitter"
					TooltipDescription="Abandonne l'encodage en cours et quitte le programme.">
			<Command.LargeImages>
				<Image>c:\prog\evolcta.fts\pic\exit32.bmp</Image>
			</Command.LargeImages>
			<Command.SmallImages>
				<Image>c:\prog\evolcta.fts\pic\exit16.bmp</Image>
			</Command.SmallImages>
		</Command>
	</Application.Commands>

 <Application.Views>
  <Ribbon>
    <Ribbon.Tabs>
      <Tab CommandName="cmdTabMain">
        <!-- scary part -->
        <Tab.ScalingPolicy>
          <ScalingPolicy>
            <ScalingPolicy.IdealSizes>
              <Scale Group="cmdGroupFileActions" Size="Large" />
              <Scale Group="cmdGroupExit" Size="Large" />
            </ScalingPolicy.IdealSizes>
            <Scale Group="cmdGroupFileActions" Size="Medium" />
          </ScalingPolicy>
        </Tab.ScalingPolicy>
        <!-- useful part -->
        <Group CommandName="cmdGroupFileActions" SizeDefinition="ThreeButtons">
          <Button CommandName="CMDSave" />
          <Button CommandName="CMDCancel" />
          <Button CommandName="CMDDelete" />
        </Group>
        <Group CommandName="cmdGroupExit" SizeDefinition="OneButton">
          <Button CommandName="CMDExit" />
        </Group>
      </Tab>
      <Tab CommandName ="cmdTabDrop">
        <Group CommandName="cmdGroupDrop" SizeDefinition="ThreeButtons">
          <Button CommandName="cmdButtonDropA" />
          <Button CommandName="cmdButtonDropB" />
          <Button CommandName="cmdButtonDropC" />
        </Group>
      </Tab>
    </Ribbon.Tabs>
  </Ribbon>
</Application.Views>
</Application>

Coordinator
Dec 15, 2009 at 9:54 PM

This behavior is expected from your markup code.
You set the command name of your tab (and groups) to a non existing one: cmdTabMain.
What you see is the default behavior of the ribbon framework when the specfied command doesn't exists, or has its LabelTitle attribute missing.

To fix this you should add a command definition for your tabs and groups and define the LabelTitle.
For example:

<Command Name="cmdTabMain"
                  Id="1005"
                  LabelTitle="Main"
</Command>

Dec 16, 2009 at 7:41 AM

Dear Arik,

Unfortunately, when I bring this amendment, I can no longer convert the xml to a cr.

The error is: "LabelTitle attribute is not defined in the DTD schema.

The pattern I use is as follows: <Application xmlns='http://schemas.microsoft.com/windows/2009/Ribbon'>

Can you help me.

I take this opportunity to congratulate you on your remarkable work.

D. Detrain

Coordinator
Dec 16, 2009 at 7:59 AM

I had a small typo there, it should be:

<Command Name="cmdTabMain"
             Id="1011"
             LabelTitle="Main">
    </Command>

Anyway, please try to compile and run the "04-TabGroupHelp" sample, the markup code there works and shows it.

Just to be on the safe side, I remind you that the prerequistes are:
Windows 7 (not beta nor RC).
Windows 7 SDK (not beta nor RC).

 

Dec 16, 2009 at 8:16 AM

Dear Arik,

Thank you for your reply.

It works perfectly now. I just put the wrong clause LabelTitle "

Best regards.

D. Detrain