THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/05/2010 at 11:51, xxxxxxxx wrote:
When doing coffee coding always check the console for errors
and put in println() for parts you want to see if it is working.
Yes, you need the main() for registering the expression.
Cheers
Lennart
Looked in the console for your code and corrected (see notes in code)
class MyExpressionPluginTag : ExpressionPluginTag
{
public:
MyExpressionPluginTag();
GetID();
MultipleAllowed();
DisplayAllowed();
GetIcon();
GetHelpText();
UseMenu();
GetName();
Edit();
Execute(doc, op);
}
MyExpressionPluginTag::MyExpressionPluginTag()
{ super();}
MyExpressionPluginTag::GetID()
{return 1025173;}
MyExpressionPluginTag::MultipleAllowed()
{return TRUE;}
MyExpressionPluginTag::DisplayAllowed()
{return TRUE;}
MyExpressionPluginTag::GetIcon()
{
var Icon = new(BaseBitmap,1,1);
var File = new(Filename);
File = GeGetRootFilename();
File->RemoveLast();
File->AddLast("ikona.tif");
Icon->Load(File);
return Icon; // <- You've called the bitmap Icon
}
MyExpressionPluginTag::GetHelpText()
{ return "Fluidplugin";}
MyExpressionPluginTag::UseMenu()
{
return TRUE;
}
MyExpressionPluginTag::GetName()
{
return "Fluid Plugin 4";
}
MyExpressionPluginTag::Edit()
{
var dlg = TextDialog("example", DLG_OK);
}
MyExpressionPluginTag::Execute(doc, op)
{//example code
if(!doc->FindObject("changed")){
var obj = doc->GetActiveObject();//<- missed the "()"
if(obj && obj->GetName() != "changed") // <- Check if obj and name
obj->SetName("changed");
}
}
/////////
// Main
main()
{
Register(MyExpressionPluginTag);
println("MEPL Loaded OK"); // <- Check if loaded in Console
}