Creating a namespace to a control is fine, but I am experiencing problems with a subclass, also defined in the plugin, which is put in the same module. Trying to update a sample project does not provide a choice when you want to choose the subclass. It is not listed. You can manually type it but then it says the superclass already implemented the event. Not sure what to think of this.
Further, if classes and controls live in a module, it appears that events of a control, having an argument to a class type belonging to the same namespace as the control, need to be changed to explicitly provide the namespace of this type. However, an event of a control, having an argument of another control type in the same namespace does not need to be modified. Is this difference intentional?
[code]REALclassDefinition* BasicScriptClasses[] = {
&ScriptLocationClass, // is mentioned in events of the control ProcessClass
&PostKeyboardClass, // a subclass of the control ProcessClass
&PostMouseClass, // a subclass of the control ProcessClass
&DelegateHandler,
&DelegateClass, // has a property type of the control ProcessClass
&TaskClass,
&ThreadNotRunningException,
&ThreadAllreadyWaitingException,
&ThreadSafeClass,
&BasClass,
};
REALcontrol* BasicScriptControls[] = {
&RBObjectClass, // has a property type of the control ProcessClass
&ProcessClass, // has events with argument types of ScriptLocationClass <-- needs the namespace
// and RBObjectClass <-- no need
};
REALmoduleDefinition Scripting = {
kCurrentREALControlVersion,
PLUGIN_NAME, // name of the module
nil,// // list of public module methods
0,// // number of entries in the method list
nil, // list of constants
0, // number of constants in the list
nil, // REALproperty *properties;
0,
nil, //REALstructure *structures;
0, //size_t structureCount;
nil, //REALenum *enums;
0, //size_t enumCount;
nil, //REALattribute *attributes;
0, //size_t attributeCount;
nil, //REALdelegate *delegates;
0, //size_t delegateCount;
BasicScriptClasses, //REALclassDefinition **classes;
_countof(BasicScriptClasses),
nil, //REALinterfaceDefinition *interfaces;// Assumes this module’s namespace
0, //size_t interfaceCount;
nil, //struct REALmoduleDefinition **modules;// Assumes this module’s namespace
0, //size_t moduleCount;
BasicScriptControls, //REALcontrol **controls; // Assumes this module’s namespace
_countof(BasicScriptControls) //size_t controlCount;
};
[/code]