<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.trinitydesktop.net/index.php?action=history&amp;feed=atom&amp;title=Defining_menus_and_toolbars_%28KDE3_Architecture%29</id>
	<title>Defining menus and toolbars (KDE3 Architecture) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.trinitydesktop.net/index.php?action=history&amp;feed=atom&amp;title=Defining_menus_and_toolbars_%28KDE3_Architecture%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;action=history"/>
	<updated>2026-05-25T00:48:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=2204&amp;oldid=prev</id>
		<title>Blu256: -Applicable to TDE (redundant), float TOC on the right to save space</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=2204&amp;oldid=prev"/>
		<updated>2022-04-21T15:33:00Z</updated>

		<summary type="html">&lt;p&gt;-Applicable to TDE (redundant), float TOC on the right to save space&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:33, 21 April 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&amp;lt;div style=&quot;float: right;&quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;{{Applicable to TDE}}&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;__TOC__&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;= Introduction =&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;While the [[Action Pattern (KDE3 Architecture)|Action Pattern]] allows to encapsulate&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;While the [[Action Pattern (KDE3 Architecture)|Action Pattern]] allows to encapsulate&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mwdb:diff:wikidiff2:1.12:old-1678:rev-2204:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=1678&amp;oldid=prev</id>
		<title>Blu256: Fixed heading levels</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=1678&amp;oldid=prev"/>
		<updated>2021-08-22T20:12:11Z</updated>

		<summary type="html">&lt;p&gt;Fixed heading levels&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:12, 22 August 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 138:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 138:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;the file &amp;lt;tt&amp;gt;tdeui/ui_standards.rc&amp;lt;/tt&amp;gt; in the tdelibs sources.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;the file &amp;lt;tt&amp;gt;tdeui/ui_standards.rc&amp;lt;/tt&amp;gt; in the tdelibs sources.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/del&gt;= An example: Toolbars in Konqueror &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;= An example: Toolbars in Konqueror =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;For the discussion of toolbars, we switch to Konqueror&#039;s GUI&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;For the discussion of toolbars, we switch to Konqueror&#039;s GUI&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 164:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 164:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;*&#039;&#039;&#039;&amp;lt;tt&amp;gt;position&amp;lt;/tt&amp;gt;&#039;&#039;&#039;: The default for this attribute is &quot;top&quot;, meaning that the toolbar is positioned under the menu bar. For programs with many tools, such as graphics programs, it may be interesting to replace this with &quot;left&quot;, &quot;right&quot; or &quot;bottom&quot;.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;*&#039;&#039;&#039;&amp;lt;tt&amp;gt;position&amp;lt;/tt&amp;gt;&#039;&#039;&#039;: The default for this attribute is &quot;top&quot;, meaning that the toolbar is positioned under the menu bar. For programs with many tools, such as graphics programs, it may be interesting to replace this with &quot;left&quot;, &quot;right&quot; or &quot;bottom&quot;.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/del&gt;= Dynamical menus &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;= Dynamical menus =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;Obviously, an XML can only contain a static description of a user interface.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;Obviously, an XML can only contain a static description of a user interface.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 213:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 213:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;menu.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;menu.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/del&gt;= Context menus &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;= Context menus =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;The examples above only contained cases where a main window&#039;s menubar and &lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;The examples above only contained cases where a main window&#039;s menubar and &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mwdb:diff:wikidiff2:1.12:old-1677:rev-1678:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=1677&amp;oldid=prev</id>
		<title>Blu256: Added Table of Contents</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=1677&amp;oldid=prev"/>
		<updated>2021-08-22T20:11:32Z</updated>

		<summary type="html">&lt;p&gt;Added Table of Contents&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:11, 22 August 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;{{Applicable to TDE}}&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;{{Applicable to TDE}}&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;__TOC__&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;= Introduction =&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;= Introduction =&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mwdb:diff:wikidiff2:1.12:old-1676:rev-1677:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=1676&amp;oldid=prev</id>
		<title>Blu256: Updated article for TDE (classes, documentation links), little formatting fixes</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=1676&amp;oldid=prev"/>
		<updated>2021-08-22T20:10:05Z</updated>

		<summary type="html">&lt;p&gt;Updated article for TDE (classes, documentation links), little formatting fixes&lt;/p&gt;
&lt;a href=&quot;https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;amp;diff=1676&amp;amp;oldid=233&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=233&amp;oldid=prev</id>
		<title>imported&gt;Eliddell at 21:15, 30 May 2014</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=233&amp;oldid=prev"/>
		<updated>2014-05-30T21:15:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:15, 30 May 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;== Introduction ==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;== Introduction ==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;While the [[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;../Action_Pattern|action&lt;/del&gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pattern&lt;/del&gt;]] allows to encapsulate&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;While the [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Action&lt;/ins&gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Pattern&lt;/ins&gt;]] allows to encapsulate&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;actions triggered by the user in an object which can be &quot;plugged&quot; somewhere in&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;actions triggered by the user in an object which can be &quot;plugged&quot; somewhere in&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;the menu bars or toolbars, it does not by itself solve the problem of &lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;the menu bars or toolbars, it does not by itself solve the problem of &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mwdb:diff:wikidiff2:1.12:old-232:rev-233:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>imported&gt;Eliddell</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=232&amp;oldid=prev</id>
		<title>imported&gt;Eliddell at 21:13, 30 May 2014</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=232&amp;oldid=prev"/>
		<updated>2014-05-30T21:13:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:13, 30 May 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 83:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 83:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;The XML file begins with a document type declaration. The DTD for kpartgui can&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;The XML file begins with a document type declaration. The DTD for kpartgui can&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;be found in the kdelibs sources in &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;{{path|&lt;/del&gt;kdeui/kpartgui.dtd&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;}}&lt;/del&gt;. The outermost&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;be found in the kdelibs sources in kdeui/kpartgui.dtd. The outermost&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;element of the file contains the instance name of the application as attribute.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;element of the file contains the instance name of the application as attribute.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;It can also contain a version number in the form &quot;version=2&quot;. This is useful&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;It can also contain a version number in the form &quot;version=2&quot;. This is useful&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;when you release new versions of an application with a changed menu structure,&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;when you release new versions of an application with a changed menu structure,&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;e.g. with more features. If you bump up the version number of the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;{{path|&lt;/del&gt;ui.rc&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;}}&lt;/del&gt; file, &lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;e.g. with more features. If you bump up the version number of the ui.rc file, &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;KDE makes sure that any customized version of the file is discarded and the new &lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;KDE makes sure that any customized version of the file is discarded and the new &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;file is used instead.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;file is used instead.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mwdb:diff:wikidiff2:1.12:old-231:rev-232:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>imported&gt;Eliddell</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=231&amp;oldid=prev</id>
		<title>imported&gt;Eliddell: Created page with &quot;== Introduction ==  While the action pattern allows to encapsulate actions triggered by the user in an object which can be &quot;plugged&quot; somewhere in the men...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=Defining_menus_and_toolbars_(KDE3_Architecture)&amp;diff=231&amp;oldid=prev"/>
		<updated>2014-05-30T21:11:42Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Introduction ==  While the [[../Action_Pattern|action pattern]] allows to encapsulate actions triggered by the user in an object which can be &amp;quot;plugged&amp;quot; somewhere in the men...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
While the [[../Action_Pattern|action pattern]] allows to encapsulate&lt;br /&gt;
actions triggered by the user in an object which can be &amp;quot;plugged&amp;quot; somewhere in&lt;br /&gt;
the menu bars or toolbars, it does not by itself solve the problem of &lt;br /&gt;
constructing the menus themselves. In particular, you have build all popup menus&lt;br /&gt;
in C++ code and explicitly insert the actions in a certain order, under &lt;br /&gt;
consideration of the style guide for standard actions. This makes it pretty&lt;br /&gt;
difficult to allow the user to customize the menus or change shortcuts to&lt;br /&gt;
fit his needs, without changing the source code.&lt;br /&gt;
&lt;br /&gt;
This problem is solved by a set of classes called &amp;#039;&amp;#039;XMLGUI&amp;#039;&amp;#039;. Basically,&lt;br /&gt;
this separates actions (coded in C++) from their appearance in menu bars&lt;br /&gt;
and tool bars (coded in XML). Without modifying any source code, menus&lt;br /&gt;
can be simply customized by adjusting an XML file. Furthermore, it helps&lt;br /&gt;
to make sure that standard actions (such as &amp;lt;tt&amp;gt;File-&amp;amp;gt;Open&amp;lt;/tt&amp;gt; or &lt;br /&gt;
&amp;lt;tt&amp;gt;Help-&amp;amp;gt;About&amp;lt;/tt&amp;gt;) appear in the locations suggested by the style guide.&lt;br /&gt;
XMLGUI is especially important for modular programs, where the items &lt;br /&gt;
appearing in the menu bar may come from many different plugins or parts.&lt;br /&gt;
&lt;br /&gt;
KDE&amp;#039;s class for toplevel windows,&lt;br /&gt;
[http://api.kde.org/3.5-api/kdelibs-apidocs/kdeui/html/classKMainWindow.html KMainWindow],&lt;br /&gt;
inherits &lt;br /&gt;
[http://api.kde.org/3.5-api/kdelibs-apidocs/kdeui/html/classKMainWindow.html KXMLGUIClient]&lt;br /&gt;
and therefore supports XMLGUI out of the box. All actions created within it must&lt;br /&gt;
have the client&amp;#039;s actionCollection() as parent. A call to createGUI() will then &lt;br /&gt;
build the whole set of menu and tool bars defined the applications XML file &lt;br /&gt;
(conventionally with the suffix ui.rc). &lt;br /&gt;
&lt;br /&gt;
== An example: Menu in KView ==&lt;br /&gt;
&lt;br /&gt;
In the following, we take KDE&amp;#039;s image view KView as example. It has a ui.rc &lt;br /&gt;
file kviewui.rc, which is installed with the Makefile.am snippet&lt;br /&gt;
&lt;br /&gt;
 rcdir = $(kde_datadir)/kview&lt;br /&gt;
 rc_DATA = kviewui.rc&lt;br /&gt;
&lt;br /&gt;
Here is an excerpt from the kviewui.rc file. For simplicity, we show &lt;br /&gt;
only the definition of the View menu.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE kpartgui&amp;gt;&lt;br /&gt;
&amp;lt;kpartgui name=&amp;quot;kview&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;MenuBar&amp;gt;&lt;br /&gt;
    &amp;lt;Menu name=&amp;quot;view&amp;quot; &amp;gt;&lt;br /&gt;
      &amp;lt;Action name=&amp;quot;zoom50&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;Action name=&amp;quot;zoom100&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;Action name=&amp;quot;zoom200&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;Action name=&amp;quot;zoomMaxpect&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;Separator/&amp;gt;&lt;br /&gt;
      &amp;lt;Action name=&amp;quot;fullscreen&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/Menu&amp;gt;&lt;br /&gt;
  &amp;lt;/MenuBar&amp;gt;&lt;br /&gt;
&amp;lt;/kpartgui&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding part of the setup in C++ is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
KStdAction::zoomIn (this, SLOT(slotZoomIn()), actionCollection());&lt;br /&gt;
KStdAction::zoomOut(this, SLOT(slotZoomOut()), actionCollection());&lt;br /&gt;
KStdAction::zoom   (this, SLOT(slotZoom()), actionCollection());&lt;br /&gt;
new KAction        (i18n(&amp;quot;&amp;amp;Half size&amp;quot;), ALT+Key_0,&lt;br /&gt;
                    this, SLOT(slotHalfSize()),&lt;br /&gt;
                    actionCollection(), &amp;quot;zoom50&amp;quot;);&lt;br /&gt;
new KAction        (i18n(&amp;quot;&amp;amp;Normal size&amp;quot;), ALT+Key_1,&lt;br /&gt;
                    this, SLOT(slotDoubleSize()),&lt;br /&gt;
                    actionCollection(), &amp;quot;zoom100&amp;quot;);&lt;br /&gt;
new KAction        (i18n(&amp;quot;&amp;amp;Double size&amp;quot;), ALT+Key_2,&lt;br /&gt;
                    this, SLOT(slotDoubleSize()),&lt;br /&gt;
                    actionCollection(), &amp;quot;zoom200&amp;quot;);&lt;br /&gt;
new KAction        (i18n(&amp;quot;&amp;amp;Fill Screen&amp;quot;), ALT+Key_3,&lt;br /&gt;
                    this, SLOT(slotFillScreen()),&lt;br /&gt;
                    actionCollection(), &amp;quot;zoomMaxpect&amp;quot;);&lt;br /&gt;
new KAction        (i18n(&amp;quot;Fullscreen &amp;amp;Mode&amp;quot;), CTRL+SHIFT+Key_F,&lt;br /&gt;
                    this, SLOT(slotFullScreen()),&lt;br /&gt;
                    actionCollection(), &amp;quot;fullscreen&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The View menu resulting from this GUI definition looks like in this&lt;br /&gt;
screenshot:&lt;br /&gt;
&lt;br /&gt;
[[Image:k3view-menu.png|frame|center|KView menu screenshot]]&lt;br /&gt;
&lt;br /&gt;
The XML file begins with a document type declaration. The DTD for kpartgui can&lt;br /&gt;
be found in the kdelibs sources in {{path|kdeui/kpartgui.dtd}}. The outermost&lt;br /&gt;
element of the file contains the instance name of the application as attribute.&lt;br /&gt;
It can also contain a version number in the form &amp;quot;version=2&amp;quot;. This is useful&lt;br /&gt;
when you release new versions of an application with a changed menu structure,&lt;br /&gt;
e.g. with more features. If you bump up the version number of the {{path|ui.rc}} file, &lt;br /&gt;
KDE makes sure that any customized version of the file is discarded and the new &lt;br /&gt;
file is used instead.&lt;br /&gt;
&lt;br /&gt;
The next line, &amp;amp;lt;MenuBar&amp;amp;gt; contains a declaration of a menu bar. You can&lt;br /&gt;
also insert any number of &amp;amp;lt;ToolBar&amp;amp;gt; declarations in order to create some&lt;br /&gt;
tool bars. The menu contains a submenu with the name &amp;quot;view&amp;quot;. This name is&lt;br /&gt;
already predefined, and thus you see a translated version of the word &amp;quot;View&amp;quot;&lt;br /&gt;
in the screenshot. If you declare your own submenus, you have to add the title&lt;br /&gt;
explicitly. For example, KView has a submenu with the title &amp;quot;Image&amp;quot; which is&lt;br /&gt;
declared as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Menu name=&amp;quot;image&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;text&amp;gt;&amp;amp;amp;Image&amp;lt;/text&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
&amp;lt;/Menu&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In KDE&amp;#039;s automake framework, such titles are automatically extracted and put &lt;br /&gt;
into the application&amp;#039;s [kde-i18n-howto.html &amp;lt;tt&amp;gt;.po&amp;lt;/tt&amp;gt;] file, so &lt;br /&gt;
it is considered by translators. Note that you have to write the accelerator &lt;br /&gt;
marker &amp;quot;&amp;amp;&amp;quot; in the XML compliant form &amp;quot;&amp;amp;amp;amp;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Let us come back to the example. KView&amp;#039;s View menu contains a couple of custom&lt;br /&gt;
actions: zoom50, zoom100, zoom200, zoomMaxpect and fullscreen, declared with a&lt;br /&gt;
&amp;amp;lt;Action&amp;amp;gt; element. The separator in the screenshots corresponds with the&lt;br /&gt;
&amp;amp;lt;Separator&amp;amp;gt; element. &lt;br /&gt;
&lt;br /&gt;
You will note that some menu items have a corresponding element in&lt;br /&gt;
the XML file. These are &amp;#039;&amp;#039;standard actions&amp;#039;&amp;#039;. Standard actions are created by &lt;br /&gt;
the class &lt;br /&gt;
[http://api.kde.org/3.5-api/kdelibs-apidocs/kdeui/html/kstdaction_8h-source.html KStdAction].&lt;br /&gt;
When you create such actions in your application (such as in the C++ example&lt;br /&gt;
above), they will automatically be inserted in a prescribed position, and&lt;br /&gt;
possibly with an icon and a shortcut key. You can look up these locations in&lt;br /&gt;
the file &amp;lt;tt&amp;gt;kdeui/ui_standards.rc&amp;lt;/tt&amp;gt; in the kdelibs sources.&lt;br /&gt;
&lt;br /&gt;
== An example: Toolbars in Konqueror ==&lt;br /&gt;
&lt;br /&gt;
For the discussion of toolbars, we switch to Konqueror&amp;#039;s GUI&lt;br /&gt;
definition. This excerpt defines the location bar, which contains the input&lt;br /&gt;
field for URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ToolBar name=&amp;quot;locationToolBar&amp;quot; fullWidth=&amp;quot;true&amp;quot; newline=&amp;quot;true&amp;quot; &amp;gt;&lt;br /&gt;
  &amp;lt;text&amp;gt;Location Toolbar&amp;lt;/text&amp;gt;&lt;br /&gt;
  &amp;lt;Action name=&amp;quot;clear_location&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Action name=&amp;quot;location_label&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Action name=&amp;quot;toolbar_url_combo&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Action name=&amp;quot;go_url&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/ToolBar&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first thing we notice is that there are a lot more attributes than for&lt;br /&gt;
menu bars. These include:&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;fullWidth&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;: Tells XMLGUI that the toolbar has the same width as the toplevel window. If this is &amp;quot;false&amp;quot;, the toolbar only takes as much space as necessary, and further toolbars are put in the same row.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;newline&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;: This is related to the option above. If newline is &amp;quot;true&amp;quot;, the toolbar starts a new row. Otherwise it may be put in the row together with the previous toolbar. The &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;newline&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; option should not be used with the &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;top&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; option. The toolbars defined after the toolbar with the newline option will automatically start on the same newline. These toolbars can contain the top option, but will not be placed above the newline. &lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;noEdit&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;: Normally toolbars can be customized by the user, e.g. in &amp;lt;tt&amp;gt;Settings-&amp;amp;gt;Configure Toolbars&amp;lt;/tt&amp;gt; in Konqueror. Setting this option to &amp;quot;true&amp;quot; marks this toolbar as not editable. This is important for toolbars which are filled with items at runtime, e.g. Konqueror&amp;#039;s bookmark toolbar.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;iconText&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;: Tells XMLGUI to show the text of the action next to the icon. Normally, the text is only shown as a tooltip when the mouse cursor remains over the icon for a while. Possible values for this attribute are &amp;quot;icononly&amp;quot; (shows only the icon), &amp;quot;textonly&amp;quot; (shows only the text), &amp;quot;icontextright&amp;quot; (shows the text on the right side of the icon) and &amp;quot;icontextbottom&amp;quot; (shows the text beneath the icon).&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;hidden&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;: If this is &amp;quot;true&amp;quot;, the toolbar is not visible initially and must be activated by some menu item.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;position&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;: The default for this attribute is &amp;quot;top&amp;quot;, meaning that the toolbar is positioned under the menu bar. For programs with many tools, such as graphics programs, it may be interesting to replace this with &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot; or &amp;quot;bottom&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Dynamical menus ==&lt;br /&gt;
&lt;br /&gt;
Obviously, an XML can only contain a static description of a user interface.&lt;br /&gt;
Often, there are menus which change at runtime. For example, Konqueror&amp;#039;s&lt;br /&gt;
&amp;lt;tt&amp;gt;Location&amp;lt;/tt&amp;gt; menu contains a set of items &amp;lt;tt&amp;gt;Open with Foo&amp;lt;/tt&amp;gt; with&lt;br /&gt;
the applications able to load a file with a given MIME type. Each time the&lt;br /&gt;
document shown changes, the list of menu items is updated. XMLGUI is prepared&lt;br /&gt;
to handle such cases with the notion of &amp;#039;&amp;#039;action lists&amp;#039;&amp;#039;. An action list &lt;br /&gt;
is declared as one item in the XML file, but consists of several actions which&lt;br /&gt;
are plugged into the menu at runtime. The above example is implemented with&lt;br /&gt;
the following declaration in Konqueror&amp;#039;s XML file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Menu name=&amp;quot;file&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;text&amp;gt;&amp;amp;amp;Location&amp;lt;/text&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;ActionList name=&amp;quot;openwith&amp;quot;&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/Menu&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function KXMLGUIClient::plugActionList() is then used to add actions to be&lt;br /&gt;
displayed, whereas the function KXMLGuiClient::unplugActionList() removes all&lt;br /&gt;
plugged actions. The routine responsible for updating looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
void MainWindow::updateOpenWithActions()&lt;br /&gt;
{&lt;br /&gt;
    unplugActionList(&amp;quot;openwith&amp;quot;);&lt;br /&gt;
    openWithActions.clear();&lt;br /&gt;
    for ( /* iterate over the relevant services */ ) {&lt;br /&gt;
        KAction *action = new KAction( ...);&lt;br /&gt;
        openWithActions.append(action);&lt;br /&gt;
    }&lt;br /&gt;
    plugActionList(&amp;quot;openwith&amp;quot;, openWithActions);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that in contrast to the static actions, the ones created here are &lt;br /&gt;
&amp;#039;&amp;#039;not&amp;#039;&amp;#039; constructed with the action collection as parent, and you are &lt;br /&gt;
responsible for deleting them for yourself. The simplest way to achieve this&lt;br /&gt;
is by using &amp;lt;tt&amp;gt;openWithActions.setAutoDelete(true)&amp;lt;/tt&amp;gt; in the above&lt;br /&gt;
example.&lt;br /&gt;
&lt;br /&gt;
Also note that to be able to extend menus this way, you need to call&lt;br /&gt;
&amp;lt;tt&amp;gt;createGUI()&amp;lt;/tt&amp;gt; with the second parameter (conserveMemory) set to &amp;quot;false&amp;quot;.&lt;br /&gt;
If you don&amp;#039;t, you won&amp;#039;t get any error but your actions won&amp;#039;t appear in the&lt;br /&gt;
menu.&lt;br /&gt;
&lt;br /&gt;
== Context menus ==&lt;br /&gt;
&lt;br /&gt;
The examples above only contained cases where a main window&amp;#039;s menubar and &lt;br /&gt;
toolbars were created. In the cases, the processes of constructing these&lt;br /&gt;
containers is completely hidden from you behind the createGUI() call&lt;br /&gt;
(except if you have custom containers). However, there are cases, where&lt;br /&gt;
you want to construct other containers and populate them with GUI definitions&lt;br /&gt;
from the XML file. One such example are context menus. In order to get a&lt;br /&gt;
pointer to a context menu, you have to ask the client&amp;#039;s factory for it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
void MainWindow::popupRequested()&lt;br /&gt;
{&lt;br /&gt;
    QWidget *w = factory()-&amp;gt;container(&amp;quot;context_popup&amp;quot;, this);&lt;br /&gt;
    QPopupMenu *popup = static_cast&amp;lt;QPopupMenu *&amp;gt;(w);&lt;br /&gt;
    popup-&amp;gt;exec(QCursor::pos());&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The method KXMLGUIFactory::container() used above looks whether it finds a&lt;br /&gt;
container in the XML file with the given name. Thus, a possible definition&lt;br /&gt;
could look as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;Menu name=&amp;quot;context_popup&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Action name=&amp;quot;file_add&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;Action name=&amp;quot;file_remove&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/Menu&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Initial Author:&amp;#039;&amp;#039; [mailto:bernd@kdevelop.org Bernd Gehrmann]&lt;br /&gt;
&lt;br /&gt;
[[Category:KDE3]]&lt;br /&gt;
[[Category:Architecture]]&lt;br /&gt;
[[Category:Developers]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Eliddell</name></author>
	</entry>
</feed>