Andreik Posted August 19, 2013 Posted August 19, 2013 I am working to create the design of a ribbon menu and I don't know how could I set the size of my buttons something like 64x64 instead of 32x32. Right now my button is defined in xml like so: <?xml version="1.0" encoding="utf-8"?> <Application xmlns="http://schemas.microsoft.com/windows/2009/Ribbon"> <Application.Commands> <Command Name="Tab2" Id="2" LabelTitle="Collection" LabelDescription="" TooltipTitle="Collection" TooltipDescription="" Keytip="C" /> <Command Name="Group2" Id="7" LabelTitle="Collection" LabelDescription="" TooltipTitle="Collection" TooltipDescription="" Keytip="CC" /> <Command Name="Button2" Id="22" LabelTitle="New" LabelDescription="" TooltipTitle="New" TooltipDescription="" Keytip="CCN"> <Command.LargeImages> <Image Source="C:MiscIcocollection_new.bmp" /> </Command.LargeImages> </Command> </Application.Commands> <Application.Views> <Ribbon> <Ribbon.Tabs> <Tab CommandName="Tab2"> <Group CommandName="Group2" SizeDefinition="OneButton"> <Button CommandName="Button2" /> </Group> </Tab> </Ribbon.Tabs> </Ribbon> </Application.Views> </Application> How could I set the size of a button when I design it in xml?
trancexx Posted August 19, 2013 Posted August 19, 2013 (edited) I'm not sure you can do that, with ribbons it's all about ratios and relations. What you can though, is specify the size of your button compared wit other buttons in group (which you don't have ).Read this. That means you can do this:expandcollapse popup<?xml version="1.0" encoding="utf-8"?> <Application xmlns="http://schemas.microsoft.com/windows/2009/Ribbon"> <Application.Commands> <Command Name="Tab2" Id="2" LabelTitle="Collection" LabelDescription="" TooltipTitle="Collection" TooltipDescription="" Keytip="C" /> <Command Name="Group2" Id="7" LabelTitle="Collection" LabelDescription="" TooltipTitle="Collection" TooltipDescription="" Keytip="CC" /> <Command Name="Button2" Id="22" LabelTitle="New" LabelDescription="" TooltipTitle="New" TooltipDescription="" Keytip="CCN"> <Command.LargeImages> <Image Source="C:\Misc\Ico\collection_new.bmp" /> </Command.LargeImages> </Command> <Command Name="Button2x" Id="23" LabelTitle="Old" LabelDescription="" TooltipTitle="Aah" TooltipDescription="" Keytip="CCNx"> <Command.LargeImages> <Image Source="C:\Misc\Ico\collection_new.bmp" /> </Command.LargeImages> </Command> <Command Name="Button2y" Id="24" LabelTitle="Whatever" LabelDescription="" TooltipTitle="Bzz" TooltipDescription="" Keytip="CCNy"> <Command.LargeImages> <Image Source="C:\Misc\Ico\collection_new.bmp" /> </Command.LargeImages> </Command> </Application.Commands> <Application.Views> <Ribbon> <Ribbon.Tabs> <Tab CommandName="Tab2"> <Tab.ScalingPolicy> <ScalingPolicy> <ScalingPolicy.IdealSizes> <Scale Group="Group2" Size="Small" /> </ScalingPolicy.IdealSizes> </ScalingPolicy> </Tab.ScalingPolicy> <Group CommandName="Group2" SizeDefinition="ThreeButtons-OneBigAndTwoSmall"> <Button CommandName="Button2" /> <Button CommandName="Button2x" /> <Button CommandName="Button2y" /> </Group> </Tab> </Ribbon.Tabs> </Ribbon> </Application.Views> </Application> Edited August 19, 2013 by trancexx ♡♡♡ . eMyvnE
Andreik Posted August 19, 2013 Author Posted August 19, 2013 I used just SizeDefinition for groups and the buttons are displayed as I want in layout and at your suggestion I tried ScalingPolicy small/large but without any visible modification. Maybe my eyes are weak but I see the buttons too small.
Andreik Posted August 20, 2013 Author Posted August 20, 2013 By the way, how could I obtain a button like Paste button from office. All I tried I got nothing better than this dropdown button.
trancexx Posted August 20, 2013 Posted August 20, 2013 Did you make it horizontal or vertical? I think it's horizontal by default. What's the xml? ♡♡♡ . eMyvnE
Andreik Posted August 20, 2013 Author Posted August 20, 2013 (edited) I couldn't find any property to set it on vertical or horizontal, it's default. Here's the xml: expandcollapse popup<?xml version="1.0" encoding="utf-8"?> <!--Created with RibbonMarkupCreator, to be found at http://sites.google.com/site/huyvantan/start/my-programs/ribbonmarkupcreator/--> <Application xmlns="http://schemas.microsoft.com/windows/2009/Ribbon"> <Application.Commands> <Command Name="AppMenu" Id="59999" LabelTitle="Application Menu" LabelDescription="" TooltipTitle="" TooltipDescription="" Keytip="M" /> <Command Name="Tab1" Id="2" LabelTitle="Test" LabelDescription="" TooltipTitle="" TooltipDescription="" Keytip="" /> <Command Name="Group1" Id="3" LabelTitle="MyGroup" LabelDescription="" TooltipTitle="" TooltipDescription="" Keytip="" /> <Command Name="SplitButton1" Id="6" LabelTitle="Main Button" LabelDescription="" TooltipTitle="" TooltipDescription="" Keytip="" /> <Command Name="Button1" Id="4" LabelTitle="First Button" LabelDescription="" TooltipTitle="" TooltipDescription="" Keytip="" /> <Command Name="Button2" Id="5" LabelTitle="Second Button" LabelDescription="" TooltipTitle="" TooltipDescription="" Keytip="" /> <Command Name="QuickAccessToolbar" Id="59998" /> <Command Name="HelpButton" /> </Application.Commands> <Application.Views> <Ribbon> <Ribbon.QuickAccessToolbar> <QuickAccessToolbar CommandName="QuickAccessToolbar" /> </Ribbon.QuickAccessToolbar> <Ribbon.ApplicationMenu> <ApplicationMenu CommandName="AppMenu" /> </Ribbon.ApplicationMenu> <Ribbon.HelpButton> <HelpButton CommandName="HelpButton" /> </Ribbon.HelpButton> <Ribbon.Tabs> <Tab CommandName="Tab1"> <Group CommandName="Group1" SizeDefinition="OneButton"> <SplitButton CommandName="SplitButton1"> <Button CommandName="Button1" /> <Button CommandName="Button2" /> </SplitButton> </Group> </Tab> </Ribbon.Tabs> </Ribbon> </Application.Views> </Application> LE: I got it with SizeDefinition (check XML) looking like here Edited August 20, 2013 by Andreik
trancexx Posted August 20, 2013 Posted August 20, 2013 ^^Yea I tried with four buttons and got pretty much the same as you showed on office pic. ♡♡♡ . eMyvnE
Andreik Posted August 20, 2013 Author Posted August 20, 2013 Those SplitButtons have always the text of one subitem? As you can see in my above post image, even if the label name of the split buton is "Main Button" in ribbon is displayed the text of the first button.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now