Extension of Duceland Designer
Duceland Designer can extent by DLLs. The DLL project may there are follow Export functoins :
DLLEXPORT
void WINAPI SetFunctions(GlobalEnvVariant *env);
It call InitEnvVariant() function in ShareData.cpp.To set structure GlobalEnvVariant.
DLLEXPORT
bool WINAPI BuildinInitLib(TForm *owner);
To do initial global variants of this library.
DLLEXPORT
void WINAPI BuildinReleaseLib();
To do release global variants of this library.
DLLEXPORT
int WINAPI BuildinGetUmlElementCount();
Return the count of this library supported.
DLLEXPORT
LElement * WINAPI BuildinGetUmlElement(int index);
Return global element supported int this library by index
DLLEXPORT
LElement * WINAPI BuildinGetUmlElementByName(char *name);
Return global element supported int this library by ClassName.
DLLEXPORT
bool WINAPI BuildinDestroyUmlElement(LElement *theObject);
Destroy the element if that supported int this library, and return true.
Otherwise, return NULL.
DLLEXPORT
LElement * WINAPI BuildinCreateUmlElement(int index,TForm *owner);
Create a element supported int this library by index, and return it.
DLLEXPORT
LElement * WINAPI BuildinCreateUmlElementByName(char *name,TForm *owner,char
*Address);
Create a element supported int this library by ClassName of element, and
return it.
Define Element
To define Element, inherit LElement class, and overide the virtual member functions of it. These are the important function :
void Paint(LCanvas *canvas);//override it, to change the element shape.
void Rebuild(); //override it, to recalculate member data when other relative element changes.
void ShowProperty(TForm *form);//When user double click the element, show a property dialog.
void PropertyOK(bool bClosed);//When user click OK button on property
dialog. Here would be restore property values.
