This method handles a menu selection. Each menu item in the application has an associated integer as defined in IconDocument::DoMakeMenuBar(); this maps these integers to appropriate action.
Command *IconDocument::DoMenuCommand(int cmd)
{
RGB c;
switch(cmd-IconEditRange()) {
case cZOOMIN:
fat->SetScale(fat->GetScale()*2);
break;
case cZOOMOUT:
fat->SetScale(fat->GetScale()/2);
break;
case cZOOM100:
fat->SetScale(1);
break;
[ ... other menu choices ... ]
default:
return Document::DoMenuCommand(cmd);
}
return gNoChanges;
}