What Kind of Tiff for the Icon's Menu?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 27/05/2008 at 08:22, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R10.5 
Platform:   Windows  ;   
Language(s) :   C.O.F.F.E.E  ;

---------
Hi.
I can not put an icon to my PlugIn. My source code is:

PlugInMenu::GetIcon()
{
var fn = GeGetRootFilename();
fn->RemoveLast();            
fn->AddLast("icon.tif");
var bm = new(BaseBitmap, 1, 1);
bm->Load(fn);
return bm;
}

And even that I work well with other icons (tiff) of other PlugIns, with the icon that I made (Photoshop) not work ... Why?

Thanks

Please, sorry for my very bad English... :-(

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 27/05/2008 at 12:20, xxxxxxxx wrote:

Hi!

You want to add an icon to the entry of your Plugin in the PluginMenü? Look at the position of the plugin-registry.

//Hook to register Plugin
//*---------------------------------------------------------------------------*
Bool RegisterEditorEntry(void)
//*---------------------------------------------------------------------------*
{
     
     return RegisterCommandPlugin(YOUR_ID,String("I am a CommandPlugin"),false,ICON,String("opens the CommandPlugin"), gNew TheCommandClass);
}

Hi, look at ICON. Replace it with a function, to get youricon.

> <code>
> static BaseBitmap* GetMyGroupIcon()
> {
> //Naturally you can replace the following part with something
> like icon->Init(Filename...) Look after the BaseBitmap Class in the doc
> static AutoAlloc<BaseBitmap> icon;
> if (!icon) return NULL;
> if (icon->GetBw() == 0)
> {
>     icon->Init(24, 24);
>     icon->Clear(200, 0, 0);
> }
> return icon;
> }
> </code>

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 27/05/2008 at 15:03, xxxxxxxx wrote:

He's using COFFEE, not C++ (I've done this myself about a million times). :)

Examine this code to see how it should be done:

// Included symbols
include "c4d_symbols.h"

// Global references
var resource;
var plugin_path;
var plugin_icon;
var d;

// CLASS: Drop Object Menu - Register plugin in menu
class DropObject_MenuPlugin : MenuPlugin
{
     public:
          DropObject_MenuPlugin();
          GetID();
          GetIcon();
          GetName();
          GetHelp();
          Execute(doc);
          RestoreLayout(secret);
}
DropObject_MenuPlugin::DropObject_MenuPlugin()     { super(); }
DropObject_MenuPlugin::GetID()                         { return PLUGIN_MENU_ID; }
DropObject_MenuPlugin::GetIcon()                    { return plugin_icon; }
DropObject_MenuPlugin::GetName()                    { return resource->GetString(PLUGIN_MENU_TEXT); }
DropObject_MenuPlugin::GetHelp()                    { return resource->GetString(PLUGIN_MENU_HELP_TEXT); }
DropObject_MenuPlugin::Execute(doc)
{
     // Perform operation
     d->Open(TRUE,-1,-1);
}
DropObject_MenuPlugin::RestoreLayout(secret)
{
     // Called by C4D to restore the dialog
     if (!d) d = new(FloorDialog);
     d->RestoreLayout(secret);
}

// Start of plugin
main()
{
     // Load Resource
     if (!(plugin_path = GeGetRootFilename())) println("Unable to find plugin!");
     plugin_path->RemoveLast();
     if (!(resource = new(GeResource, plugin_path))) println("Unable to load resource!");

// Load Icons
     var icon_file = plugin_path->GetClone();
     icon_file->AddLast("pluginicon.tif");
     plugin_icon = new(BaseBitmap,1,1);
     plugin_icon->Load(icon_file);

// Register Plugins
     Register(DropObject_MenuPlugin);

// Create non-modal dialog
     d = new(FloorDialog);
}