Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This greatly simplifies the creation code. Now, all you need to do is learn the XML structure. Note that the main page for the SRP Ribbon Control documentation has a section listing all supported XML tags. If you are new to the control, you'll want to start by looking at the <Control> tag, which is the root tag of the XML passed to the Init method.

Sample XML

Here is a sample XML using images that come with OpenInsight.

Code Block
languagexml
<Control Name="OLE_RIBBON" Window="NDW_RIBBON_TEST">

    <Commands>
        <Command Key="CHANGECASE" Caption="Change Case" SmallIcon="BMPS\menu_ChangeCase.bmp" Tooltip="Sets the selection to uppercase." />
        <Command Key="CLEARFORMATTING" Caption="Clear Formatting" SmallIcon="BMPS\menu_Unerase.bmp" Tooltip="Removes all text formatting." />
        <Command Key="CLOSE" Caption="Close" KeyboardTip="X" Tooltip="Closes the application." />
        <Command Key="COPY" Caption="Copy" KeyboardTip="C" Shortcut="Ctrl+C" SmallIcon="BMPS\Menu_editCopy.bmp" Tooltip="Copies the selection to the clipboard." />
        <Command Key="CUT" Caption="Cut" KeyboardTip="X" Shortcut="Ctrl+X" SmallIcon="BMPS\Menu_editCut.bmp" Tooltip="Copies the selection to the clipboard then deletes it." />
        <Command Key="FONTSIZEINCREASE" Caption="Increase Font Size" SmallIcon="BMPS\menu_MoveUp.bmp" Tooltip="Increases font size by one point." />
        <Command Key="FONTSIZEDECREASE" Caption="Decrease Font Size" SmallIcon="BMPS\menu_Movedown.bmp" Tooltip="Decreases font size by one point." />
        <Command Key="INFO" Caption="Info" KeyboardTip="I" SmallIcon="BMPS\menu_help.bmp" Tooltip="The document's metadata." />
        <Command Key="MINIMIZE" Caption="Minimize" Tooltip="Toggles the Ribbon." />
        <Command Key="OPEN" Caption="Open" KeyboardTip="O" SmallIcon="BMPS\menu_open.bmp" Tooltip="Opens a new document." />
        <Command Key="PASTE" Caption="Paste" Shortcut="Alt+F1" LargeIcon="BMPS\dbmanager.bmp" SmallIcon="BMPS\Menu_editPaste.bmp" Tooltip="Inserts text from the clipboard." />
        <Command Key="PASTEMERGE" Caption="Merge Formatting" Enabled="False" SmallIcon="BMPS\menu_MaxWidth.bmp" Tooltip="Inserts text from the clipboard using the current selection's formatting." />
        <Command Key="PASTETEXTONLY" Caption="Keep Text Only" SmallIcon="BMPS\menu_Font.bmp" Tooltip="Inserts text only from the clipboard." />
        <Command Key="PASTEWITHFORMAT" Caption="Keep Source Formatting" SmallIcon="BMPS\menu_ed9.bmp" Tooltip="Inserts formatted text from the clipboard." />
        <Command Key="PRINT" Caption="Print" KeyboardTip="P" SmallIcon="Images\16x16\print.png" Tooltip="Prints the document." />
        <Command Key="SAVE" Caption="Save" Enabled="False" SmallIcon="BMPS\menu_Save.bmp" Tooltip="Saves the document." />
        <Command Key="SAVEAS" Caption="Save As" KeyboardTip="A" Tooltip="Saves the document to the selected file." />
        <Command Key="UNDO" Caption="Undo" SmallIcon="BMPS\Menu_editUndo.bmp" Tooltip="Reverts the last change." />
    </Commands>

    <Tabs>
        <Tab Key="HOME" Caption="Home" KeyboardTip="H">
            <Group Key="CLIPBOARD" Caption="Clipboard">
                <SplitButton Key="PASTE" Command="PASTE">
                    <Button Key="PASTEMERGE" Command="PASTEMERGE" />
                    <Button Key="PASTETEXTONLY" Command="PASTETEXTONLY" />
                    <Button Key="PASTEWITHFORMAT" Command="PASTEWITHFORMAT" />
                </SplitButton>
                <Button Key="CUT" Command="CUT" />
                <Button Key="COPY" Command="COPY" />
            </Group>
            <Group Key="FONT" Caption="Font" OptionButton="true" GroupControls="true" Tooltip="Displays the Font Chooser.">
                <ComboBox Key="COB_FONTFACE" Tooltip="Sets the selection's\r\nfont family." EnableEdit="true">
                    <Item>Arial Black</Item>
                    <Item>Segoe UI</Item>
                    <Item>Tahoma</Item>
                </ComboBox>
                <ComboBox Key="COB_FONTSIZE" Width="32" Tooltip="Sets theselection's font size.">
                    <Item>8</Item>
                    <Item>9</Item>
                    <Item>10</Item>
                    <Item>11</Item>
                    <Item>12</Item>
                </ComboBox>
                <Button Key="BTN_FONTSIZEINCREASE" Command="FONTSIZEINCREASE" BeginGroup="true" />
                <Button Key="BTN_FONTSIZEDECREASE" Command="FONTSIZEDECREASE" />
                <Button Key="BTN_CHANGECASE" Command="CHANGECASE" BeginGroup="true" />
                <Button Key="BTN_CLEARFORMATTING" Command="CLEARFORMATTING" BeginGroup="true" />
            </Group>
            <Group Key="OTHERCONTROLS" Caption="Other Controls" OptionButton="true" GroupControls="true" Tooltip="These are other controls support by SRP Ribbon.">
                <CheckBox Key="CHB_TEST" Caption="Check Box" Shortcut="Ctrl+H" Tooltip="This is a check box." />
                <EditField Key="EDL_TEST" Hint="Edit Field" />
                <Label Key="STA_TEST" Caption="Label" Height="22" BeginGroup="true" />
                <DateField Key="DTF_TEST" Width="144" Height="22" Tooltip="This is a date field." />
            </Group>
        </Tab>
        <Tab Key="CUSTOMERS" Caption="Customers" KeyboardTip="I">
        </Tab>
        <Tab Key="INVENTORY" Caption="Inventory" KeyboardTip="I">
        </Tab>
        <Tab Key="USERS" Caption="Users" ContextColor="Red" ContextCaption="Administrator" Visible="true">
        </Tab>
        <Tab Key="SETTINGS" Caption="Settings" ContextColor="Red" ContextCaption="Administrator" Visible="true">
        </Tab>
    </Tabs>
    
    <QuickAccessControls>
        <Button Key="BTN_SAVE" Command="SAVE" />
        <Button Key="BTN_UNDO" Command="UNDO" />
    </QuickAccessControls>
    
    <Backstage>
        <Button Command="SAVE" />
        <Button Command="SAVEAS" />
        <Button Command="OPEN" />
        <Page Key="INFO" Command="INFO" />
        <Button Command="CLOSE" />
    </Backstage>
    
    <TabBarControls>
        <Button Key="BTN_MINIMIZE" Command="MINIMIZE" />
    </TabBarControls>
    
</Control>