Properties
Similar Topics
Statistics
Comments
2
Participants
3
Subscribers
0
Votes
1
Views
1270
Share
Attach Input Box to a Point?
Answered
Is there a way to attache an INPUT BOX to a point, similar to attaching a text box to a point?
Thanks in advance!
 GeoGebra
 Help
 Partners

Contact us
 Feedback & Questions
 This email address is being protected from spambots. You need JavaScript enabled to view it.
 +43 677 6137 2693
© 2021 International GeoGebra Institute
Hi, it's not so easy even if exists : http://wiki.geogebra.org/en/SetCoords_Command because it uses absolute coordinates + in pixels. So you have to change the origin and the unity.
b: the InputBox
A : the free point
cx = x(Corner[5] / x(Corner[3]  Corner[1]))
cy = y(Corner[5] / y(Corner[3]  Corner[1]))
write this GeoGebra script for A, OnUpdate :
SetCoords[b,cx (x(A)x(Corner[1])),cy (y(A)y(Corner[3]))]
https://ggbm.at/567743
When attaching an input box to a point it places the point you choose in pixels.
SetCoords[InputBox, 100, 200] will place the input box 100 pixels to the right of the top left corner of the applet and 200 pixels below the top left corner of the applet.
In order to attach the input box to a point, you must convert the coordinates of the point to pixels, which I believe is what the previous user is demonstrating.
I use a variable called ScreenTopRightCornerInPixels and set it equal to Corner[5].
From there, you need a ScreenTopRightCornerInXAndY units and set it equal to Corner[3]
From there, you should be able to convert between the two, but as previous post mentioned, it can be complicated. For one thing, what if the pixels on your monitor are rectangular. I've rarely seen this, but whoa daddy!
Comments have been locked on this page!