File: inconCustomMenusInUIForm.htm

package info (click to toggle)
office2003-schemas 1.0%2Bds-1
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm, forky, sid, trixie
  • size: 42,304 kB
  • sloc: javascript: 2,429; makefile: 29
file content (344 lines) | stat: -rw-r--r-- 20,927 bytes parent folder | download
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV07313093"><META NAME="lcid" CONTENT="1033"><title>Custom menus 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 menus 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>Microsoft Office InfoPath 2003 provides the ability to control where and
		  how you want menu items to appear within the user interface, primarily by enabling or disabling them on various built-in menus used with a form. Some of the menus that you can
		  customize
			include
		  
		  <b class="ui">View</b>, 
		  <b class="ui">Insert</b>, and
		  <b class="ui">Table</b>, as
		  well as shortcut menus that are displayed when a user
		  clicks the shortcut
		  menu button
		  associated with a certain <a href="#" class="glossary" onclick="AppendPopup(this,'xdrepeatingtable')" onkeypress="AppendPopup(this,'xdrepeatingtable')">repeating table</a>, <a href="#" class="glossary" onclick="AppendPopup(this,'xdrepeatingsection')" onkeypress="AppendPopup(this,'xdrepeatingsection')">repeating section</a>, or <a href="#" class="glossary" onclick="AppendPopup(this,'xdoptionalsection')" onkeypress="AppendPopup(this,'xdoptionalsection')">optional section</a>. Menus can be customized for
		  repeating tables,
		  repeating sections,
		  optional sections, and
		  <a href="#" class="glossary" onclick="AppendPopup(this,'xdview')" onkeypress="AppendPopup(this,'xdview')">views</a>.</p><p><b>Note</b>  Many  of the other standard InfoPath menus can also be customized; the User Interface developer sample form demonstrates how to customize  a select few.</p><p>Several
		  custom menus are implemented in the User Interface developer sample form. The
		  following table lists the views, tables, and sections of the User Interface
		  developer sample form, along with the custom menu items that were implemented
		  for each of them.</p><table>
			<tr><th>Name</th><th>Type</th><th>Custom menu items</th>
			</tr>
			<tr><td>CD Collection</td><td>View</td><td><b class="ui">CD
				  Collection</b> menu item on the 
				<b class="ui">View</b> menu.</td>
			</tr>
			<tr><td>All Tracks</td><td>View</td><td><b class="ui">All
				  Tracks</b> menu item on the 
				<b class="ui">View</b> menu.</td>
			</tr>
			<tr><td>CD</td><td>Repeating section</td><td><b class="ui">CD</b> menu
				item on the 
				<b class="ui">Section</b> submenu of the 
				<b class="ui">Insert</b> menu. 
				<p><b class="ui">Insert CD above</b>, 
				<b class="ui">Insert CD below</b>, and 
				<b class="ui">Remove CD</b> menu items on the shortcut menu
				for the CD table.</p></td>
			</tr>
			<tr><td>Track</td><td>Repeating table</td><td><b class="ui">Track</b> menu item on the 
				<b class="ui">Section</b> submenu of the 
				<b class="ui">Insert</b> menu. 
				<p><b class="ui">Insert Track</b> menu item on the shortcut
				menu for the CD table.</p><p><b class="ui">Insert Tracks</b> and 
				<b class="ui">Remove Tracks</b> menu items on the 
				<b class="ui">Table</b> menu. 
				</p><b class="ui">Insert Track
				  above</b>, 
				<b class="ui">Insert Track below</b>, and 
				<b class="ui">Remove Track</b> menu items on the
				shortcut menu for the Track table.</td>
			</tr>
			<tr><td>Label</td><td>Optional section</td><td><b class="ui">Label</b> menu item on the 
				<b class="ui">Section</b> submenu of the 
				<b class="ui">Insert</b> menu.<p><b class="ui">Insert Label</b> menu item on the shortcut
				menu for the CD table. 
				</p><b class="ui">Remove Label</b> menu item on the shortcut
				menu for the Label control.</td>
			</tr></table><p><b>Note</b>  When
		  you customize menus in InfoPath, those customizations are applied at the
		  view level. This means that the customizations you make are not globally
		  applied to all views. To
		  apply the same custom menus
		  to more than one view, you must
		  make the menu customizations in each view.</p><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Customizing the View menu</a></p><div id="ExpCol" class="collapsed" border="0">
				<p>The User Interface developer sample form implements two views:
			 CD
			 Collection
			 view is used to create a collection of CD information including Artist, Title,
			 Track,
			 and Label; 
			 All Tracks
			 view is used to list all of the tracks within the CD collection. CD
			 Collection
			 view is the default view that users see
			 when they first open the form. To
			 switch between the two views while filling out the form, users can select a
			 view from the 
			 <b class="ui">View</b> menu.</p>
				<p>To
			 make views
			 available to
			 users on the 
			 <b class="ui">View</b> menu, you
			 select
			 the <b class="ui">Show on the View menu when filling out the form</b>
			 check
					box
			 in the 
					<b class="ui">View
				Properties</b>
					dialog box in <a href="#" class="glossary" onclick="AppendPopup(this,'xddesignmode')" onkeypress="AppendPopup(this,'xddesignmode')">design mode</a>.
			 You can access the 
			 <b class="ui">View
				Properties</b> dialog
			 box  by selecting a view in the 
			 <b class="ui">Views</b> task pane
			 and clicking
					
					<b class="ui">View
				Properties</b>.<p><b>Note</b>  If you have only one view in your form, the <b class="ui">Show on the
				View menu when filling out the form</b>
				check
						box
				is
						disabled. Since there is only one view in the form, users do not need to select it because it is always the default view.</p></p>
				<p>When you create a view in InfoPath and enable it for the 
			 <b class="ui">View</b> menu, InfoPath creates an entry in the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition (.xsf) file</a>
					using a <b class="bterm"><a href="xsfelmmenuArea.htm" id="HV01021490" lcid=" ">menuArea</a></b>
			 element whose <b class="bterm"><a href="xsfatrname_8.htm" id="HV01021581" lcid=" ">name</a></b> attribute value is msoViewMenu. It also creates a <b class="bterm"><a href="xsfelmbutton.htm" id="HV01021461" lcid=" ">button</a></b>
			 element within the <b class="bterm">menuArea</b> element for each view that will have
			 a menu item on the 
			 <b class="ui">View</b> menu. The caption that appears as a menu
			 item
			 on the 
			 <b class="ui">View</b> menu is determined by the
			 <b class="bterm"><a href="xsfatrcaption_4.htm" id="HV01021531" lcid=" ">caption</a></b>
			 attribute of the <b class="bterm">button</b> element in the .xsf
			 file. InfoPath uses the name of the view for the
			 caption, but you can override this by changing the value of the
			 <b class="bterm">caption</b> attribute in the <b class="bterm">button</b> element.
			 <p><b>Note</b>  If you change the <b class="bterm">caption</b> attribute in the .xsf
				file, and later change some properties of the
				view by
				using the 
				<b class="ui">View
				  Properties</b>
				dialog
				box, InfoPath overwrites your changes in the .xsf file,
				so you must
				reset the value of the <b class="bterm">caption</b> attribute.</p></p>
				<p>The following is a section from the .xsf file of the User
			 Interface developer sample form that contains the <b class="bterm">menuArea</b>
			 element for the 
			 <b class="ui">View</b> menu:</p>
				<p>
					<pre><code>&lt;xsf:menuArea name="msoViewMenu"&gt;
   &lt;xsf:button
      caption="CD Collection"
      name="SwitchToView0"&gt;
   &lt;/xsf:button&gt;
   &lt;xsf:button
      caption="All Tracks"
      name="SwitchToView1"&gt;
   &lt;/xsf:button&gt;
&lt;/xsf:menuArea&gt;
</code></pre></p></div><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Customizing the Insert menu</a></p><div id="ExpCol" class="collapsed" border="0">
				<p>The 
			 <b class="ui">Insert</b> menu is typically used to insert common
			 items such as tables, pictures, and hyperlinks while filling out a form.
			 However, you can customize the 
			 <b class="ui">Insert</b> menu to allow for insertion of
			 repeating tables, repeating sections, and optional sections. In the User
			 Interface developer sample form, the 
			 <b class="ui">Insert</b> menu is customized to allow for
			 insertion of a CD, Track, or Label.</p>
				<p>Two types of customizations can be made on the 
			 <b class="ui">Insert</b> menu. One is to add a menu item
			 directly on the 
			 <b class="ui">Insert</b> menu; the other is to create a menu
			 item on
			 the 
			 <b class="ui">Section</b> submenu of the 
			 <b class="ui">Insert</b> menu. The User Interface developer
			 sample form creates a menu item on the 
			 <b class="ui">Section</b> submenu.</p>
				<p>To customize the 
			 <b class="ui">Insert</b> menu
			 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 of the particular repeating section, repeating
			 table, or optional section that you want to appear on the menu.
			 The <b class="ui">Properties</b> dialog
			 box can be accessed by right-clicking
					the
			 
			 section or
				table
					that you are working with, and then clicking
			 the 
			 <b class="ui">Properties</b> menu item on
			 the shortcut menu. To
			 customize the <b class="ui">Insert</b> menu for repeating tables and optional sections,
			 
			 you can click
					<b class="ui">Customize
			 Commands</b>
					
			 on the 
			 <b class="ui">Data</b> tab to open the <b class="ui">Commands</b>
			 dialog
			 box. For
			 repeating sections, the <b class="ui">Customize Commands</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">Section Commands</b>
			 dialog
			 box allows you to associate certain editing actions
			 with various command locations available on the menus in an InfoPath form.
			 </p>
				<p>When you add custom menu
			 items to the 
			 <b class="ui">Insert</b> menu, InfoPath creates an entry in
			 the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition (.xsf) file</a> using a <b class="bterm"><a href="xsfelmmenu.htm" id="HV01021489" lcid=" ">menu</a></b> element, nested inside a <b class="bterm"><a href="xsfelmmenuArea.htm" id="HV01021490" lcid=" ">menuArea</a></b> element whose <b class="bterm"><a href="xsfatrname_6.htm" id="HV01021579" lcid=" ">name</a></b> attribute value is msoInsertMenu, with
			 <b class="bterm"><a href="xsfelmbutton.htm" id="HV01021461" lcid=" ">button</a></b> elements nested inside the <b class="bterm">menu</b> element. The <b class="bterm"><a href="xsfatrcaption_5.htm" id="HV01021532" lcid=" ">caption</a></b> attribute of the <b class="bterm">menu</b> element determines the section name that appears on the menu, and the <b class="bterm"><a href="xsfatrcaption_4.htm" id="HV01021531" lcid=" ">caption</a></b> attribute of the <b class="bterm">button</b> elements determines the names of the buttons on the submenu. In addition to the <b class="bterm">caption</b>
			 attribute, the <b class="bterm">button</b> element  also has a <b class="bterm"><a href="xsfatrshowIf.htm" id="HV01021603" lcid=" ">showIf</a></b>
			 attribute 
			 that determines when the menu item is
				enabled.</p>
				<p>The following is a section from the .xsf file of the User
			 Interface developer sample form that contains the <b class="bterm">menuArea</b>
			 element for the 
			 <b class="ui">Insert</b> menu:</p>
				<p>
					<pre><code>&lt;xsf:menuArea name="msoInsertMenu"&gt;
   &lt;xsf:menu caption="&amp;amp;Section"&gt;
      &lt;xsf:button
         action="xCollection::insert"
         xmlToEdit="CD_10"
         caption="CD"
         showIf="always"&gt;
      &lt;/xsf:button&gt;
      &lt;xsf:button
         action="xCollection::insert"
         xmlToEdit="Track_14"
         caption="Track"
         showIf="always"&gt;
      &lt;/xsf:button&gt;
      &lt;xsf:button
         action="xOptional::insert"
         xmlToEdit="Label_16"
         caption="Label"&gt;
      &lt;/xsf:button&gt;
   &lt;/xsf:menu&gt;
&lt;/xsf:menuArea&gt;
</code></pre><p><b>Note</b>  Using the <code>&amp;amp;</code> predefined entity reference in the <b class="bterm">caption</b> attribute of the <b class="bterm">menu</b> element makes the character immediately following the entity reference the keyboard shortcut for the menu item.</p></p></div><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Customizing the Table menu</a></p><div id="ExpCol" class="collapsed" border="0">
				<p>The 
			 <b class="ui">Table</b> menu is typically used to insert, delete,
			 and work with tables when filling out a form. However, you
			 can customize the 
			 <b class="ui">Table</b> menu to allow for insertion or removal of
			 repeating tables, repeating sections, and optional sections. In the User
			 Interface developer sample form, the 
			 <b class="ui">Table</b> menu is customized to allow for insertion
			 or removal of CD Tracks. While it is possible to use the 
			 <b class="ui">Table</b> menu to work with repeating and optional sections, the <b class="ui">Table</b> menu is optimized for, and generally best for, working with repeating tables.</p>
				<p>To customize the 
			 <b class="ui">Table</b> menu in <a href="#" class="glossary" onclick="AppendPopup(this,'xddesignmode')" onkeypress="AppendPopup(this,'xddesignmode')">design mode</a>, you click <b class="ui">Customize
			 Commands</b> in the <b class="ui">Repeating Tables Properties</b> dialog box for the repeating
			 table you are working with. Then you select the editing action and set its command location to
			 <b class="bterm">Table menu</b>
					in the <b class="ui">Table Commands</b> dialog box. When you customize the 
			 <b class="ui">Table</b> menu, menu items are placed directly on
			 the 
			 <b class="ui">Table</b> menu. However, it is possible to create
			 submenus on the 
			 <b class="ui">Table</b> menu to which you can add menu items. This is accomplished by nesting the
			 <b class="bterm"><a href="xsfelmbutton.htm" id="HV01021461" lcid=" ">button</a></b> elements within a <b class="bterm"><a href="xsfelmmenu.htm" id="HV01021489" lcid=" ">menu</a></b> element
			 in the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition (.xsf) file</a>. The caption that appears for the submenu is determined by the <b class="bterm"><a href="xsfatrcaption_5.htm" id="HV01021532" lcid=" ">caption</a></b> attribute of the <b class="bterm">menu</b> element.</p>
				<p><b>Note</b>  Using submenus in custom menus is a feature of the .xsf file and is not available when using the <b class="ui">Customize Commands</b> dialog box in
			 design mode.</p>
				<p>The following is a section from the .xsf file of the User
			 Interface developer sample form that contains the <b class="bterm"><a href="xsfelmmenuArea.htm" id="HV01021490" lcid=" ">menuArea</a></b>
			 element for the 
			 <b class="ui">Table</b> menu:</p>
				<p>
					<pre><code>&lt;xsf:menuArea name="msoTableMenu"&gt;
   &lt;xsf:menu caption="Insert Tracks"&gt;
      &lt;xsf:button
         action="xCollection::insertBefore"
         xmlToEdit="Track_14"
         caption="Above"
         showIf="always"&gt;
      &lt;/xsf:button&gt;
      &lt;xsf:button
         action="xCollection::insertAfter"
         xmlToEdit="Track_14"
         caption="Below"
         showIf="always"&gt;
      &lt;/xsf:button&gt;
   &lt;/xsf:menu&gt;
   &lt;xsf:menu caption="Remove Tracks"&gt;
      &lt;xsf:button
         action="xCollection::remove"
         xmlToEdit="Track_14"
         caption="Remove Current Row"
         showIf="always"&gt;
      &lt;/xsf:button&gt;
   &lt;/xsf:menu&gt;
&lt;/xsf:menuArea&gt;
</code></pre></p></div><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Customizing shortcut menus</a></p><div id="ExpCol" class="collapsed" border="0">
				<p>The shortcut menus that are associated with repeating sections,
			 repeating tables, and optional sections can be customized to allow users to
			 select various editing actions. Users access them by clicking the
			 shortcut menu button when a certain section, table, or field on a form is selected.</p>
				<p>To customize the shortcut menu in <a href="#" class="glossary" onclick="AppendPopup(this,'xddesignmode')" onkeypress="AppendPopup(this,'xddesignmode')">design mode</a>, you click
					<b class="ui">Customize
			 Commands</b>
					in the <b class="ui">Properties</b> dialog box for the repeating table or optional section you are working with, select the editing action,
			 and set its command location to <b class="bterm">Shortcut
				menu</b>
					in the <b class="ui">Commands</b> dialog box. For
			 repeating sections, the <b class="ui">Customize Commands</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.</p>
				<p>When you
			 customize a shortcut menu, InfoPath creates an entry in the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition (.xsf) file</a> using a
			 <b class="bterm"><a href="xsfelmmenuArea.htm" id="HV01021490" lcid=" ">menuArea</a></b> element whose <b class="bterm"><a href="xsfatrname_6.htm" id="HV01021579" lcid=" ">name</a></b> attribute value is msoStructuralEditingContextMenu, along with nested <b class="bterm"><a href="xsfelmbutton.htm" id="HV01021461" lcid=" ">button</a></b> elements. In
			 the User Interface developer sample form, many of the default captions used for
			 menu items on the shortcut menu were overridden by modifying the value of the
			 <b class="bterm"><a href="xsfatrcaption_4.htm" id="HV01021531" lcid=" ">caption</a></b> attribute in the <b class="bterm">button</b> elements of 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">menuArea</b>
			 element for the shortcut menu:</p>
				<p>
					<pre><code>&lt;xsf:menuArea name="msoStructuralEditingContextMenu"&gt;
   &lt;xsf:button
      action="xCollection::insertBefore"
      xmlToEdit="CD_10"
      caption="Insert CD above"
      showIf="immediate"&gt;
   &lt;/xsf:button&gt;
   &lt;xsf:button
      action="xCollection::insertBefore" 
      xmlToEdit="Track_14" 
      caption="Insert Track above" 
      showIf="immediate"&gt;
   &lt;/xsf:button&gt;
   ...
&lt;/xsf:menuArea&gt;
</code></pre></p></div><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/inconCustomMenusInUIForm_l.htm"></iframe></span><center><a href="XMLSchemaCopyright_HV01147162.htm">&copy;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&amp;CTT=11&amp;Origin=HV011232471033" 

target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>