<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.codeblocks.org/index.php?action=history&amp;feed=atom&amp;title=Script_plugins</id>
	<title>Script plugins - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.codeblocks.org/index.php?action=history&amp;feed=atom&amp;title=Script_plugins"/>
	<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Script_plugins&amp;action=history"/>
	<updated>2026-04-21T15:53:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Script_plugins&amp;diff=6783&amp;oldid=prev</id>
		<title>Alpha: Added category</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Script_plugins&amp;diff=6783&amp;oldid=prev"/>
		<updated>2011-09-03T02:08:34Z</updated>

		<summary type="html">&lt;p&gt;Added category&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 02:08, 3 September 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&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;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Developer Documentation]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Scripting Code::Blocks]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Script plugins are plugins that are written entirely in script. They are great for smaller-scale plugins or for quick prototyping. Their main practical difference compared to simple scripts is that a script plugin ''can add entries in context menus''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Script plugins are plugins that are written entirely in script. They are great for smaller-scale plugins or for quick prototyping. Their main practical difference compared to simple scripts is that a script plugin ''can add entries in context menus''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Alpha</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Script_plugins&amp;diff=4321&amp;oldid=prev</id>
		<title>Mandrav at 12:57, 15 December 2006</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Script_plugins&amp;diff=4321&amp;oldid=prev"/>
		<updated>2006-12-15T12:57:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Script plugins are plugins that are written entirely in script. They are great for smaller-scale plugins or for quick prototyping. Their main practical difference compared to simple scripts is that a script plugin ''can add entries in context menus''.&lt;br /&gt;
&lt;br /&gt;
Let's look at a sample plugin (by coincidence, this is shipped with Code::Blocks):&lt;br /&gt;
&lt;br /&gt;
 // Script plugins must extend cbScriptPlugin&lt;br /&gt;
 &lt;br /&gt;
 class TestPlugin extends cbScriptPlugin&lt;br /&gt;
 {&lt;br /&gt;
     // mandatory to setup the plugin's info&lt;br /&gt;
     constructor()&lt;br /&gt;
     {&lt;br /&gt;
         info.name = _T(&amp;quot;TestPlugin&amp;quot;);&lt;br /&gt;
         info.title = _T(&amp;quot;Test script&amp;quot;);&lt;br /&gt;
         info.version = _T(&amp;quot;0.1a&amp;quot;);&lt;br /&gt;
         info.license = _T(&amp;quot;GPL&amp;quot;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     // optional to create menubar items&lt;br /&gt;
     function GetMenu()&lt;br /&gt;
     {&lt;br /&gt;
         local entries = ::wxArrayString();&lt;br /&gt;
         entries.Add(_T(&amp;quot;Project/7:-Export Makefile&amp;quot;), 1);&lt;br /&gt;
         return entries;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     // optional to create context menu entries&lt;br /&gt;
     function GetModuleMenu(who, data)&lt;br /&gt;
     {&lt;br /&gt;
         local entries = ::wxArrayString();&lt;br /&gt;
 &lt;br /&gt;
         if (who == ::mtEditorManager)&lt;br /&gt;
         {&lt;br /&gt;
             local f = wxFileName();&lt;br /&gt;
             f.Assign(data.GetFolder(), ::wxPATH_NATIVE);&lt;br /&gt;
             entries.Add(_T(&amp;quot;Work with &amp;quot;) + f.GetFullName(), 1);&lt;br /&gt;
 &lt;br /&gt;
             entries.Add(_T(&amp;quot;Sample entry&amp;quot;), 1);&lt;br /&gt;
         }&lt;br /&gt;
 &lt;br /&gt;
         return entries;&lt;br /&gt;
     }&lt;br /&gt;
     &lt;br /&gt;
     // optional to support ExecutePlugin(pluginNameString)&lt;br /&gt;
     function Execute()&lt;br /&gt;
     {&lt;br /&gt;
         ::ShowMessage(_T(&amp;quot;Ho-ho was here ;)&amp;quot;));&lt;br /&gt;
         return 0;&lt;br /&gt;
     }&lt;br /&gt;
     &lt;br /&gt;
     // optional calback for menubar items clicking&lt;br /&gt;
     function OnMenuClicked(index)&lt;br /&gt;
     {&lt;br /&gt;
         if (index == 0)&lt;br /&gt;
             ::ShowMessage(_T(&amp;quot;Exporting Makefile...&amp;quot;));&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     // optional calback for context menu items clicking&lt;br /&gt;
     function OnModuleMenuClicked(index)&lt;br /&gt;
     {&lt;br /&gt;
         if (index == 0)&lt;br /&gt;
             ::ShowMessage(_T(&amp;quot;Working with file&amp;quot;));&lt;br /&gt;
         else if (index == 1)&lt;br /&gt;
             ::ShowMessage(_T(&amp;quot;Sample entry not working yet&amp;quot;));&lt;br /&gt;
         else&lt;br /&gt;
             ::ShowMessage(_T(&amp;quot;?!? Functionality not implemented yet&amp;quot;));&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // this call actually registers the script plugin with Code::Blocks&lt;br /&gt;
 RegisterPlugin(TestPlugin());&lt;br /&gt;
 &lt;br /&gt;
 // if you want to call this plugin's Execute() function, use this in a script:&lt;br /&gt;
 // ExecutePlugin(_T(&amp;quot;TestPlugin&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
As you can see it is well documented so it should be easy to grasp. The one thing that might strike you odd is the following line in &amp;lt;tt&amp;gt;GetMenu()&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 entries.Add(_T(&amp;quot;Project/7:-Export Makefile&amp;quot;), 1);&lt;br /&gt;
&lt;br /&gt;
What &amp;quot;7:-Export Makefile&amp;quot; does is explained in [[Scripting commands#ScriptingManager|ScriptingManager's notes]]. In simple words it means &amp;quot;''insert'' &amp;lt;tt&amp;gt;'Export Makefile'&amp;lt;/tt&amp;gt; menu item at position ''7'' of the &amp;lt;tt&amp;gt;'Project'&amp;lt;/tt&amp;gt; menu, prepending a separator line before the menu item&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Mandrav</name></author>
	</entry>
</feed>