Kio4_Move Extension doesnt place button where I left it

Here is a simple example using canvas and five sprites. (Needs work on setting/un-setting visibility)

canvasSpritePositioning.aia (12.6 KB)

How are you setting the text for your buttons at present? Looks like you have lists of some kind ? I can work something up to set labels on the sprites.

1 Like

@TIMAI2 @Juan_Antonio thank you both for your efforts today. I just got home to my desk. 9pm here in Savannah, GA USA. I am beat.
I will start tomorrow morning on the next round here. about 9 hours maybe.

I am setting the button in Device.GotText That is where it gets json data from device, and does through a few comparisons. in the middle of the JSON string there are is a list of 6 temperatures, the first one is room temperature. it set red or green, all the others set yellow

http://73.182.6.222:8101/password/ will get you to the embedded web page of the first device
http://73.182.6.222:8101/password/?js= will return the JSON String

from that point you probably know more than me :slight_smile:

Im at my desk now. should be here all day unless im called away for service work

Im going to try real buttons, I think there was a difficulty in getting a component id for them but, ill work until i hit a whammie

You do not need ids, just make a button component list and work with that.

1 Like

can I add comments that are not erased when clearing Do It text?

Not sure I understand what you mean ?

Anyway, herewith a revised canvas/sprite method
canvasSpritePositioningV2.aia (21.1 KB)

You enter the text (multiline) before you 'create' a sprite, otherwise you get the hint text.
Turn on the menu to generate a menu when you click a sprite (turn off menu after use)

  • Delete clears the sprite for later re-use
  • Edit allows to change the displayed text

Credits to Jerin Jacob (component2Image) and Kevinkun (Regex) for their extensions

thank you !

When I add comments to my blocks to explain what they do etc, and the DO IT



I'm pretty sure the answer is no. if you clear the DO IT results, the comments also clear

Use a variable block with text above your action block.

2 Likes

Called to work. Ill be gone a few hours
Thank you again!

@Kevin_Kesler , I have put an example with real buttons in:

I'm testing this extension, there may be bugs.

@Juan_Antonio Thank you!
I finally made it back to my desk. gonna try to make some headway.




The last button in my list is moved whenever I click on another button

I downloaded a fresh copy of the Ki04_Move Extension, and that seems to help.

When using an Any Button Clicked event, take care to wrap its innards with a test for notAlreadyHandled, to allow other more specific button Click events to work outside of this
generic logic.

Your Screen must have other buttons that you DON'T want to move when you click them, right?

thank you , i have a test if in list. removed for debugging

Im not sure if i have syntax right but i have it there.

Still experiencing bugs. buttons move, and buttons glitch back into place , but they are not positioned correctly on refresh.





This app works with not issues. I THINK I'm doing exactly the same thing within my complete app. maybe I'm still moving faster than the file can be written??

I'm going to try to trigger the file writing only when that VA is set to invisible or some other event happens, Only storing the position in the variables until.

Rather than writing to file after Kio4_move1.position block, I added a button to write file manually.
Pressing the save button after positioning prevents most of the hiccups.

there is still a small glitch: the buttons all shift about 10 pixels left or right when I write, then read the file, and they shift opposite direction on the next write, read.

It toggles back and forth and I can manage with that, by hitting the save button twice, but still a glitch.

part of my issues have been narrowed down. in another area of my blocks, i have a timer that initiates a use of some of the global variables used in this area.

i set the timerenabled to false with the initiation of a move, and i set it to true after i manually save the file, in order to prevent a double access of the variable.
it is relaying the same information, so i cannot simply use a different variable.