X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=docs%2Fcontent%2Fshared-javascript-and-cpp-documentation%2Fcreating-custom-controls.md;h=741097859e88fe03b701099f52ebaffe3e2012b8;hp=b40262bf566f8a3c674b3f8b6d005b725cd831de;hb=e9d852fcdacc5788785bfe0b617bd757794e8208;hpb=56f4cd606601820e4ea20059dc909fc701584474 diff --git a/docs/content/shared-javascript-and-cpp-documentation/creating-custom-controls.md b/docs/content/shared-javascript-and-cpp-documentation/creating-custom-controls.md index b40262b..7410978 100644 --- a/docs/content/shared-javascript-and-cpp-documentation/creating-custom-controls.md +++ b/docs/content/shared-javascript-and-cpp-documentation/creating-custom-controls.md @@ -327,6 +327,93 @@ void AppFunction() customControl.MyCustomSignal.Connect( this, &AppFunction ); ~~~ + +___________________________________________________________________________________________________ + +### Children Added/Removed {#creating-controls-children} + +Methods are provided that can be overridden if notification is required when a child is added or removed from our control. +An up call to the Control class is necessary if these methods are overridden. + +~~~{.cpp} +// C++ +void MyUIControlImpl::OnChildAdd( Actor& child ); +{ + // Up call to Control first + Control::OnChildAdd( child ); + + // Do any other operations required upon child addition +} +~~~ +~~~{.cpp} +// C++ +void MyUIControlImpl::OnChildRemove( Actor& child ); +{ + // Do any other operations required upon child removal + + // Up call to Control at the end + Control::OnChildRemove( child ); +} +~~~ + +Avoid adding or removing the child again within these methods. + +___________________________________________________________________________________________________ + +### Stage Connection {#creating-controls-stage} + +Methods are provided that can be overridden if notification is required when our control is connected to or disconnected from the stage. +An up call to the Control class is necessary if these methods are overridden. + +~~~{.cpp} +// C++ +void MyUIControlImpl::OnStageConnection( int depth ) +{ + // Up call to Control first + Control::OnStageConnection( depth ); + + // Do any other operations required upon stage connection +} +~~~ +~~~{.cpp} +// C++ +void MyUIControlImpl::OnStageDisconnection() +{ + // Do any other operations required upon stage disconnection + + // Up call to Control at the end + Control::OnStageDisconnection(); +} +~~~ + +___________________________________________________________________________________________________ + +### Size {#creating-controls-size} + +Methods are provided that can be overridden if notification is required when our control's size is manipulated. +An up call to the Control class is necessary if these methods are overridden. + +~~~{.cpp} +// C++ +void MyUIControlImpl::OnSizeSet( const Vector3& targetSize ) +{ + // Up call to Control + Control::OnSizeSet( targetSize ); + + // Do any other operations required upon size set +} +~~~ +~~~{.cpp} +// C++ +void MyUIControlImpl::OnSizeAnimation( Animation& animation, const Vector3& targetSize ) +{ + // Up call to Control + Control::OnSizeAnimation( animation, targetSize ); + + // Do any other operations required upon size animation +} +~~~ + ___________________________________________________________________________________________________ ### Other Features {#creating-controls-other}