Part IV: Professional Database Development
1038
Here is a sample label definition:
<group id=“grpFonts” label=“Settings”>
<labelControl id=“lbl1” label=“Font Things” />
<separator id=“s1”/>
<labelControl id=“lc2” label=“Choose Font Settings” />
<check box id=“chk1” label=“Bold” onAction=“SetBold”/>
<check box id=“chk2” label=“Italics” onAction=“SetItalics”/>
</group>
This XML contains three labels, a separator, and two check boxes. The text in each of these labels
is hard-coded, rather than returned by a callback procedure. Earlier, in the “Step 2: Write the call-
back routines” section, you read how to use the getLabel attribute to specify a callback that
returns a label’s text.
The Button control
The Button control is, perhaps, the most useful and fundamental of all of the ribbon controls. A
button is very simple. A button has a label, an imageMso attribute for setting the button’s image,
and an onAction attribute that names the callback routine. An example of button XML is
<button id=“MyButton1” size=“large”
label=“MyButton1”
imageMso=“OutlookGlobe”
onAction=“nyi” />
The nyi referenced in the onAction attribute is a simple procedure in the Chapter29.accdb
sample database, and stands for not yet implemented. This procedure is just a placeholder for
you to insert your own callback routine. The Button ribbon control does not support double-click
actions, so tying a button to a callback procedure is very simple.
Separators
A separator is a graphical element that divides items in a group, as shown in Figure 29.24.
Separators contain no text and appear as a vertical line within a group. By themselves, they’re not
very interesting, but they graphically separate controls that would otherwise be too close within a
group.
FIGURE 29.24
Separators provide a way to divide controls within a group.
Separator controls