<?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=Creating_a_simple_but_useful_plugin</id>
	<title>Creating a simple but useful plugin - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.codeblocks.org/index.php?action=history&amp;feed=atom&amp;title=Creating_a_simple_but_useful_plugin"/>
	<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Creating_a_simple_but_useful_plugin&amp;action=history"/>
	<updated>2026-05-04T13:17:05Z</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=Creating_a_simple_but_useful_plugin&amp;diff=7544&amp;oldid=prev</id>
		<title>LETARTARE: add &quot;include ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Creating_a_simple_but_useful_plugin&amp;diff=7544&amp;oldid=prev"/>
		<updated>2013-02-27T09:04:03Z</updated>

		<summary type="html">&lt;p&gt;add &amp;quot;include ...&amp;quot;&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 09:04, 27 February 2013&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-l53&quot; &gt;Line 53:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 53:&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;}&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;}&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;&amp;lt;/source&amp;gt;&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;&amp;lt;/source&amp;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;&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;There's one more thing we need to add before our application will compile. Jump to the beginning of the file and add the following code after the first group of other includes:&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;&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;''Upx.cpp''&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;&amp;lt;source lang=&amp;quot;cpp&amp;quot; line start=10&amp;gt;&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;#include &amp;lt;sdk.h&amp;gt; // Code::Blocks SDK&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;#include &amp;lt;configurationpanel.h&amp;gt;&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;#include &amp;quot;upx.h&amp;quot;&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;#include &amp;quot;popup.h&amp;quot;  // &amp;lt;- here&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;&amp;lt;/source&amp;gt;&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;&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;&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;See the [http://developer.berlios.de/project/showfiles.php?group_id=5358 sdk documentation] for full information on managers (and everything else).&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;See the [http://developer.berlios.de/project/showfiles.php?group_id=5358 sdk documentation] for full information on managers (and everything else).&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;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;Next, add an event handler to the OK button through wxSmith. This function will contain most of the action as very little needs to happen before or after it. There are two main jobs this fuction must complete: forming a command, and executing it.&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;Next, add an event handler to the OK button through wxSmith. This function will contain most of the action as very little needs to happen before or after it. There are two main jobs this fuction must complete: forming a command, and executing it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>LETARTARE</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Creating_a_simple_but_useful_plugin&amp;diff=6710&amp;oldid=prev</id>
		<title>Alpha: Created page with &quot;Category:Plugin development '''NOTE''': This is a work in progress. Also, if you have access to a non-Windows platform, please test to ensure interoperability.  ==Prerequisit...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Creating_a_simple_but_useful_plugin&amp;diff=6710&amp;oldid=prev"/>
		<updated>2011-08-20T21:15:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/index.php/Category:Plugin_development&quot; title=&quot;Category:Plugin development&quot;&gt;Category:Plugin development&lt;/a&gt; &amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;: This is a work in progress. Also, if you have access to a non-Windows platform, please test to ensure interoperability.  ==Prerequisit...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Plugin development]]&lt;br /&gt;
'''NOTE''': This is a work in progress. Also, if you have access to a non-Windows platform, please test to ensure interoperability.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
You may want to read the tutorial [[Creating a simple &amp;quot;Hello_World&amp;quot; plugin]] before starting this tutorial.&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes you have read through at least some of the [[wxSmith tutorials]], have a working version of Code::Blocks [[Installing Code::Blocks|installed]] and some knowledge of how to deal with projects, in particular how to compile them. To use the Code::Blocks SDK you must also have a working version of [http://www.wxwidgets.org/ wxWidgets] [[WxWindowsQuickRef|installed]].&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
This tutorial will guide you through the creation of a simple plugin, which acquires settings from the user to run [http://upx.sourceforge.net/ upx] on the project output.&lt;br /&gt;
&lt;br /&gt;
==Setting up the environment==&lt;br /&gt;
&lt;br /&gt;
Select the ''Plugin type:'' of ''Tool'' from the Code::Blocks Plugin Wizard.&lt;br /&gt;
Select ''wxSmith-&amp;gt;Add wxScrollingDialog''.&lt;br /&gt;
Select use ''Xrc File:''.&lt;br /&gt;
Add the xrc resource to the current project through ''Project-&amp;gt;Add Files...''. (This is not necessary, however, it is preferred as it ensures all files stay together.)&lt;br /&gt;
Add the xrc resource to the plugin's resource zip through selecting ''Project-&amp;gt;Build options...'', navigating to ''default-&amp;gt;Pre/post build steps'' and appending the xrc resource (PopUp.xrc) to the end of the first command 'zip -j9 Upx.zip manifest.xml'.&lt;br /&gt;
A proper setup is key, as, for example, failing to add the xrc resource to the plugin's resources will mysteriously crash Code::Blocks whenever the plugin is run.&lt;br /&gt;
&lt;br /&gt;
==Drafting the UI==&lt;br /&gt;
&lt;br /&gt;
Assuming you have read through some of the [[wxSmith tutorials]], constructing a dialog (off the wxScrollingDialog base added in the previous section) with these features should not be too difficult. The compression slider is set for 1-10, wxButtons were used for the OK and Cancel (not a wxStdDialogButtonSizer), and the Overlay drop-down includes &amp;lt;tt&amp;gt;copy&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;skip&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:PopUp.png]]&lt;br /&gt;
&lt;br /&gt;
You can, of course, choose to add or remove as many features as you would like.&lt;br /&gt;
&lt;br /&gt;
==Adding functionality==&lt;br /&gt;
&lt;br /&gt;
The first point is to call the dialog when the plugin is executed.  This can be achieved by changing the content (in the main source file, Upx.cpp) of the function&lt;br /&gt;
&lt;br /&gt;
''Upx.cpp''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line start=48&amp;gt;&lt;br /&gt;
int Upx::Execute()&lt;br /&gt;
{&lt;br /&gt;
    // do your magic ;)&lt;br /&gt;
    NotImplemented(_T(&amp;quot;Upx::Execute()&amp;quot;));&lt;br /&gt;
    return -1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
''Upx.cpp''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line start=48&amp;gt;&lt;br /&gt;
int UPX::Execute()&lt;br /&gt;
{&lt;br /&gt;
    PopUp dlg( Manager::Get()-&amp;gt;GetAppWindow() );&lt;br /&gt;
    dlg.ShowModal();&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
See the [http://developer.berlios.de/project/showfiles.php?group_id=5358 sdk documentation] for full information on managers (and everything else).&lt;br /&gt;
&lt;br /&gt;
Next, add an event handler to the OK button through wxSmith. This function will contain most of the action as very little needs to happen before or after it. There are two main jobs this fuction must complete: forming a command, and executing it.&lt;/div&gt;</summary>
		<author><name>Alpha</name></author>
	</entry>
</feed>