[FREE] Component Tools Extension

Hello everyone,
Today i introduce my second extension which is component tools extension. This extension allows you to get and set some components features, move the component,overlap it, and reposition it, detect touches on it with full info about the touch, set its padding,set some shadows for it,And much more!

Blocks picture

Currently it have 48 blocks :wink:

Documantation

Error
component_event (1)
This event is triggered when an error occurs.
Error ~ String

MoveCanceled
component_event (2)
This event is triggered when the current movement cancels.
id ~ string

MoveCompleted
component_event (3)
This event is triggered when the current movement ends.
id ~ string

MoveStarted
component_event (4)
This event is triggered when the current movement ends.
id ~ string

Touched


This event is triggerred when a component is touched.The action is returned in the action parameter.
Component ~ Component ( the component which is clicked )
info ~ String ( A detailed info about the touch in json format )
x ~ int ( X positions of the first touch place )
y ~ int ( Y positions of the first touch place )
action ~ String ( Action name of the action occurred.)
Thanks for @Zia_Choudhary and @Maayur

Valid action types

ACTION_BUTTON_PRESS

ACTION_BUTTON_RELEASE

ACTION_CANCEL

ACTION_DOWN

ACTION_HOVER_ENTER

ACTION_HOVER_EXIT

ACTION_HOVER_MOVE

ACTION_MASK

ACTION_MOVE

ACTION_OUTSIDE

ACTION_POINTER_DOWN

ACTION_POINTER_INDEX_MASK

ACTION_POINTER_INDEX_SHIFT

ACTION_POINTER_UP

ACTION_SCROLL

ACTION_UP

CancelMovement
component_method (3)
Cancels The current movement.
id ~ string

GetBottomPosition
component_method (4)
Gets the bottom position of any component you want.
component ~ Component

GetX
component_method (5)
Gets the x position of any component you want .
component ~ component

GetY
component_method (6)
Gets the y position of any component you want .
component ~ component

GetLeftPosition
component_method (7)
Gets the left position of any component you want.
component ~ Component

GetPaddingBottom
component_method (9)
Gets the bottom padding of any component you want.
component ~ Component

GetPaddingLeft
component_method (10)
Gets the left padding of any component you want.
component ~ Component

GetPaddingRight
component_method (11)
Gets the right padding of any component you want.
component ~ Component

GetPaddingTop
component_method (12)
Gets the top padding of any component you want.
component ~ Component

GetRotation
component_method (13)
Gets the rotation of any component you want.
component ~ Component

GetRotationX
component_method (14)
Gets the rotation X of any component you want.
component ~ Component

GetRotationY
component_method (15)
Gets the rotation Y of any component you want.
component ~ Component

GetScaleX
component_method (16)
Gets the scale X of any component you want.
component ~ Component

GetScaleY
component_method (17)
Gets the scale Y of any component you want.
component ~ Component

GetShadowElevation


Gets the shadow elevation of any component you want.
component ~ Component

GetTopPosition
component_method (19)
Gets the top position of any component you want.
component ~ Component

GetZ
component_method (21)
Gets the Z position of any component you want.
component ~ Component

IsMovementPaused


Returns true if the movement is paused.
id ~ Component

IsMovementRunning


Returns true if the movement is running.
id ~ Component

MoveHorizontally
component_method (24)
Moves the component in horizontal way.
px ~ int
component ~ component
duration ~ int ( in milliseconds )

MoveVertically
component_method (25)
Moves the component in vertical way.
px ~ int
component ~ component
duration ~ int ( in milliseconds )

MoveInCustomPath


Moves the component in fully customizable path.
component ~ component
duration ~ int ( in milliseconds )
Left ~ int
Top ~ int
Right ~ int
Bottom~ int
StartAngle ~ int
SweepAngle ~ int
ForceMoveTo ~ int

PauseMovement
component_method (27)
Pauses the current movement.
id ~ Component

PerformClick
component_method (28)
Performs a click on any component you want .
component ~ component

PerformLongClick
component_method (29)
Performs a long click on any component you want .
component ~ component

RegisterComponent
component_method (30)
Register component so the extension can detect touches on it.
Component ~ Component

ResumeMovement
component_method (31)
Resumes the current movement.
id ~ Component

SetBottomPosition
component_method (32)
Sets the bottom position of any component you want .
component ~ component

SetLeftPosition
component_method (33)
Sets the left position of any component you want .
component ~ component
left ~ int

SetPadding
component_method (34)
Sets the padding of any component you want .
component ~ component
left ~ int
top~int
right~int
bottom~int

SetRightPosition
component_method (35)
Sets the right position of any component you want .
component ~ component
right ~ int

SetRotation
component_method (36)
Sets the rotation of any component you want .
component ~ component
rotation ~ int

SetRotationX
component_method (37)
Sets the rotation X of any component you want .
component ~ component
rotationX ~ int

SetRotationY
component_method (38)
Sets the rotation Y of any component you want .
component ~ component
rotationY ~ int

SetScaleX
component_method (39)
Sets the Scale X of any component you want .
component ~ component
ScaleX ~ int

SetScaleY
component_method (40)
Sets the Scale Y of any component you want .
component ~ component
ScaleY ~ int

SetShadowElevation
component_method (41)
Sets the Shadow elevation of any component you want .
component ~ component
shadowElevation ~ int

SetTopPosition
component_method (42)
Sets the top position of any component you want .
component ~ component
top ~ int

SetX
component_method (43)
Sets the X position of any component you want .
component ~ component
x ~ int

SetY
component_method (44)
Sets the y position of any component you want .
component ~ component
y ~ int

SetZ
component_method (45)
Sets the Z position of any component you want.
Component ~ Component
z ~ int
Thanks for @broekmancompany

LastUsedID
component_set_get
Gets the last used id by the movement blocks.

Download links

AIX: io.mohamed.ComponentTools (4).aix (21.9 KB) ( V1 )

Credits

Thanks for any one supported and helped me.I hope you like this extension :slightly_smiling_face:
Please if you have any suggestions or improvements please tell me :hugs:
If you liked, don't forgot to hit the like button below :grin:.

Regards,
Mohamed Tamer

15 Likes

Excellent contribution! Thank you! :+1:

3 Likes

you're welcome @Italo :grinning:

2 Likes

Great Extension @mohamed_tamer :upside_down_face:

2 Likes

Thanks @Maayur :hearts:

1 Like

Hi mohamed, can you link an aia using example ?

1 Like

I've a one but its compatible with kodular, i will make it in app inventor and send it again, thanks :slightly_smiling_face:

in particular I did not understand how to use SetBottomPosition

1 Like

For the parameter Component : add the component you want to set the bottom position of. For the bottom position parameter : add an integer value with how much you would like the bottom position be, an examples are:





OK thank you, why SetBottom instead of SetHeight ?

SetBottomPosition , changes the position of the bottom of the component only, setHeight changes the whole component height and position.Here is the difference:


With setBottomPosition:



With set Height block:


blocks (59)
__
I think you can understand the change from Text for Button 1 :slightly_smiling_face:

OK, why SetBottomPosition does not run in Screen.Initialize?

1 Like

Most probably , it's a method that is called in the components source code after the bottom position is set which rests the bottom position.After testing in companion it looks like the bottom position got set and then it resets again.I will see what can i made, right now, don't use set bottom position at screen initialization.

this is why i asked you how to use SetBottomPosition, i had put it in Screen.Initialize and it didn't work. Thanks for your time.

1 Like

How can I move a button to bottom without knowing the screen dimensions in pixel ?

I think this formula can work, although i'm not sure:

1 Like

I am not able to perform a event when my arrangement is clicked.

Didn't understand you, you mean the touched even isn't triggered ?

Yes, I want to listen for a compoent click.

So the touched event isn't triggered, have you registered the component?