Livecode: Detect cursor position inside the field - livecode

Is there a way to detect if the user has move the cursor somewhere in the field?
Looks like the field does not trigger any mouseDown or mouseUp event when I click the edit field.
Also, can we return the position of the cursor inside the field when the user click inside the field?

Use the selectionChanged message to detect changes in the cursor position. Use openField to find out when the user clicks in an unlocked field. The selectedChunk tells you exactly where the cursor is. If no text is selected, the first number in the selectedChunk is higher than the last number. If text is selected, the first number is lower than the second, e.g. char 3 to 10 of field 1.

Related

VBA-curser move

I have a user form, there are several frames inside each of them, there are many text boxes, I want to fill the information from top to bottom, but the cursor moves randomly (vertical and horizental)between the text boxes.
How can i enter data verticly from top to bottom and at end it should go to next coulmn?
You need to configure the TabIndex property of each one of the controls, so that at each enter stroke or tab stroke the next control is the one that has the next TabIndex value.
Here https://learn.microsoft.com/en-us/office/vba/language/concepts/forms/set-the-tab-order-using-the-tabindex-property you can find more on this.

How can I get the text position of a mouse click?

I want to click my mouse on a QTextEdit, and get the text position of that click from within the document. Where would my click be if the click resulted in a character being inserted? I'm hoping to subvert some of QTextEdit's functionality, so I do not want to simply get the position from the QTextCursor after the click has been processed. Basically I'm reimplementing mousePressEvent myself, but still need to know what the closest character gap is.

Userform Excel: finding the order of the code(buttons etc), inorder to change, so the user can press 'tab' on form and it will move to the next one

I want to fix the order of the cursor when the user presses 'tab' to go in order. Not sure where the order is, i've tried moving around everything in the VBA
Each object on the Userform has a TabIndex property, adjust the numbering for each object to adjust the order.

"Like" button for a database in Lotus Notes

Is there a way to implement a "Like" button for a database in Lotus Notes. I basically want to have a document in Notes, where is will be possible to click a button and its then liked.
At the moment I have a button but it can be pressed as many times as they want. If possible I would like to be able to only click it once?
Instead of counting the "likes", or incrementing a counter each time the button is pressed, instead save the current user's name to a list and then count the number of users in that list to tell you the number of likes.
On click this would be roughly:
ListOfLikes := #Unique(ListOfLikes:#UserName);
And then to display the count:
#Count(ListOfLikes)
Adding to #Ken's answer, you could use a pair of buttons for "Like" and "Unlike" with hide-when formulas. For the paragraph containing the Like button
!(#Username = ListOfLikes);
For the paragraph containing the Unlike button
#Username = ListOfLikes
(You don't need to use #IsMember for this, as comparing a scalar string against a list works the same way.)
The formula for the actual Unlike button would have to remove a name from the list, like this:
#Trim(#Replace(ListOfLikes;#Username;""));

TouchDevelop Deleting text

The Issue:
I have two buttons, button "Apple" and button "Cookie".
When I press the "Cookie" button, text should show saying "Cookie" on screen (which it does)
THEN, when I press the "Apple" button, the text should UPDATE to "Apple" instead of "Cookie"
The problem is, with my current code, whenever I press the second button (Apple) -- the original "Cookie" text isn't removed, it appears underneath the "Apple" text.
I'd like the "Cookie" text to be removed from the screen when I press the apple button or any other button (over 10 buttons)
How would I achieve this within touchdevelop?
Current Code:
Assistance is very much appreciated.
Try this project: http://tdev.ly/ydcl.
To change what is displayed when a button is clicked, set a global variable and change its value when on tapped is called. In TouchDevelop, the page display is refreshed automatically so that any changes made when a button is tapped will occur immediately. There is no need to hide or show part of the display; just include that section in an if statement and change the if statement condition when a button is tapped. If you wanted to show one of three possible layouts, use an if statement that tests the value of a string or number for one of three values and changes that value when a certain button is tapped or condition is met.

Resources