1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV07313094"><META NAME="lcid" CONTENT="1033"><title>Custom toolbars in the User Interface developer sample form</title><link rel="stylesheet" type="text/css" href="office10.css"><script type="text/javascript" language="Javascript" src="ExpCollapse.js"></script><script type="text/javascript" language="JavaScript" src="inline.js"></script></head><body><p id="ExpandAllLine" class="ExpFav"><a href="#" onclick="ExpandAll()" onkeypress="ExpandAll()" class="DropDown"><img id="picHeader" border="0" src="expandtri.gif" alt="Show All"><span id="ExpandAll">Show All</span></a></p><h1>Custom toolbars in the User Interface developer sample form</h1><div class="ofvbanav"><span class="ofvbanavreuse" id="seealso" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="specifics" onclick="toggleList()" onkeypress="toggleList()"></span></div><p>The User Interface developer sample form implements a single custom
toolbar, the <b class="ui">CD Collection Toolbar</b>,
that allows users to add or remove a CD,
Track, or Label. By default,
Microsoft Office InfoPath 2003 has one built-in custom toolbar, the Form toolbar, that can be used to create custom
menu items that users can click to perform various actions on a
form.</p><p>To customize the Form toolbar in <a href="#" class="glossary" onclick="AppendPopup(this,'xddesignmode')" onkeypress="AppendPopup(this,'xddesignmode')">design mode</a>, you use the <b class="ui">Properties</b> dialog box for the particular
<a href="#" class="glossary" onclick="AppendPopup(this,'xdrepeatingsection')" onkeypress="AppendPopup(this,'xdrepeatingsection')">repeating section</a>, <a href="#" class="glossary" onclick="AppendPopup(this,'xdrepeatingtable')" onkeypress="AppendPopup(this,'xdrepeatingtable')">repeating table</a>, or <a href="#" class="glossary" onclick="AppendPopup(this,'xdoptionalsection')" onkeypress="AppendPopup(this,'xdoptionalsection')">optional section</a> that you are working
with. The <b class="ui">Properties</b> dialog box is accessed by
right-clicking
the section or table and clicking the
<b class="ui">Properties</b> menu item on the shortcut menu.
In the <b class="ui">Properties</b> dialog box for repeating tables and optional sections, you click <b class="ui">Customize
Commands</b>
to open the
<b class="ui">Commands</b> dialog box. For
repeating sections, the <b class="ui">Customize Command</b> button is available
in the
<b class="ui">Section Properties</b> dialog box that opens when you
choose to modify the default settings of a section.
The
<b class="ui">Commands</b> dialog box allows you to associate
certain editing actions with various command locations available on the menus
and toolbars in an InfoPath form. To create a custom toolbar, you select the
<b class="ui">Form
Toolbar</b> location. <p><b>Note</b> In the User Interface developer sample form, the command location is the <b class="ui">CD Collection Toolbar</b>, since the default name of the Form toolbar was modified. Modifications to the default name of a toolbar can be made manually in the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition (.xsf) file</a> by changing the value of the <b class="bterm"><a href="xsfatrcaption_3.htm" id="HV01021530" lcid=" ">caption</a></b> attribute of the <b class="bterm"><a href="xsfelmtoolbar.htm" id="HV01021506" lcid=" ">toolbar</a></b> element.</p></p><p>When you customize a toolbar, InfoPath creates entries in the
.xsf file using <b class="bterm"><a href="xsfelmbutton.htm" id="HV01021461" lcid=" ">button</a></b>
elements within the <b class="bterm">toolbar</b>
element. The caption that appears as the name of the toolbar is determined by
the <b class="bterm">caption</b>
attribute of the <b class="bterm">toolbar</b> element, and the caption that appears
as the name of a button on the toolbar is determined by the <b class="bterm"><a href="xsfatrcaption_4.htm" id="HV01021531" lcid=" ">caption</a></b>
attribute of a <b class="bterm">button</b> element.</p><p>As you associate editing actions with the custom toolbar using the
<b class="ui">Commands</b> dialog box, menu items are placed
directly on the toolbar. However, it is possible to create menus on the
toolbar and then add menu items to those menus. This is
accomplished by nesting the <b class="bterm">button</b> elements of the toolbar
within a <b class="bterm"><a href="xsfelmmenu.htm" id="HV01021489" lcid=" ">menu</a></b> element
in the .xsf file.</p><p>The following is a section from the .xsf file of the User Interface
developer sample form that contains the <b class="bterm">toolbar</b> element. Note
the use of the <b class="bterm">menu</b> element to create a menu on the
toolbar.</p><p>
<pre><code><xsf:toolbar
caption="CD Collection Toolbar"
name="CD Collection Toolbar">
<xsf:button
action="xCollection::insert"
xmlToEdit="CD_10"
caption="New CD"
showIf="always">
</xsf:button>
<xsf:button
action="xCollection::insert"
xmlToEdit="Track_14"
caption="New Track"
showIf="always">
</xsf:button>
<xsf:button
action="xOptional::insert"
xmlToEdit="Label_16"
caption="New Label"
showIf="always">
</xsf:button>
<xsf:menu
caption="Remove">
<xsf:button
action="xCollection::remove"
xmlToEdit="CD_10"
caption="CD"
showIf="always">
</xsf:button>
<xsf:button
action="xCollection::remove"
xmlToEdit="Track_14"
caption="Track"
showIf="always"></xsf:button>
<xsf:button
action="xOptional::remove"
xmlToEdit="Label_16"
caption="Label"
showIf="always">
</xsf:button>
</xsf:menu>
</xsf:toolbar>
</code></pre></p><p><b>Notes</b></p><ul><li>Adding menus to a toolbar is a feature of the .xsf file
and is not available when using the <b class="ui">Commands</b> dialog box in design mode.</li><li>While InfoPath implements a single custom toolbar, you can add multiple toolbars to a form by creating additional <b class="bterm">toolbar</b>
elements within the .xsf file. Once you have created the additional toolbars by
manually editing the .xsf file, those toolbars are available in the <b class="ui">Commands</b>
dialog box, and you can then associate editing actions with
them.</li></ul><script type="text/javascript" language="JScript" src="ofvbanl.js"></script><span id="ofVBAISpan" class="ofvbaispan"><iframe id="ofVBAIFrame" frameborder="0" marginheight="0" marginwidth="4" scrolling="auto" width="100%" src="../links/inconCustomToolbarsInUIForm_l.htm"></iframe></span><center><a href="XMLSchemaCopyright_HV01147162.htm">©2003-2004 Microsoft Corporation. All rights reserved.</a>
Permission to copy, display and distribute this document is available at: <a
href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT010988631033&CTT=11&Origin=HV011232471033"
target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>
|