Commit 15fa8cb0 authored by Alexander Wiebel's avatar Alexander Wiebel

[ADD] icon for module

parent 1efe3fcf
......@@ -34,6 +34,7 @@
#include "../../common/WColor.h"
#include "WMTemplate.h"
#include "template.xpm"
WMTemplate::WMTemplate():
WModule()
......@@ -81,6 +82,17 @@ boost::shared_ptr< WModule > WMTemplate::factory() const
return boost::shared_ptr< WModule >( new WMTemplate() );
}
const char** WMTemplate::getXPMIcon() const
{
// The template_xpm char array comes from the template.xpm file as included above.
// Such char arrays, i.e. files, can be easily created using an image manipulation program
// like GIMP. Be aware that the xpm file is a simple header file. Thus it contains real
// code. This code can be manipulated by hand. Unfortunately, you really have to fix the
// xpm files produced by gimp. You need to make the char array const in order to prevent
// compiler warnings or even errors.
return template_xpm;
}
const std::string WMTemplate::getName() const
{
// Specify your module name here. This name must be UNIQUE!
......
......@@ -72,6 +72,11 @@ public:
*/
virtual boost::shared_ptr< WModule > factory() const;
/**
* Get the icon for this module in XPM format.
*/
virtual const char** getXPMIcon() const;
protected:
/**
......
/* XPM */
static const char * template_xpm[] = {
"16 16 2 1",
" c None",
". c #000000",
" ",
" ",
" .......... ",
" .......... ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" .. ",
" "};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment