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

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.

Related

Selecting SAP grey box element in a list

I'm wondering if you guys have an idea on how to handle this problem.
Process:
First i iterate trough this collection. If the input value is the same as the item of the grid box it will stop and select this item.
View of SAP GridBox
Note that every spy mode will select EVERYTHING and the only way to actually read this is with SAP GrixBox.
The problem here is that i need to click the small grey square on the left of the selected Notification. I cannot select it with any hotkey or with a spy mode.
Small grey square MANUALLY selected
My idea was to use capture an highlighted item with the Region mode and then move 5px to the left. But this does not seem to work ...
Any suggestion are welcome!
If I recall correctly the shortcut for selecting an entire row in Sap Grid is Shift + Space. You need to have a cell selected first, though.

How to search a text using Enter key in blue prism

I have a search box where I can enter the search text however there is no search button next to it. So we use to press enter button after enter the search text in text box.
Please advise how to handle this in blue prism. I have tried using Global Send Keys however the focus moved out of the search box hence nothing happening
If the mouse focus is inside the text box then you can see a 'X' mark inside it
If I use the global sendkeys then the mouse focus is outside the text box as below
To go about this issue, I would first try to set the focus on the field, by sending a Global Mouse Click Center (not just focus) to the Textbox.
Next, send the "{ENTER}" or "~" key to the Textbox, using Send Global Keys.
I would assume that if that doesn't work, you have spied the container of the Textbox, not the Textbox itself somehow.
Alternatively, as a last resort you can also choose to send a Javascript command to the webpage, in order to trigger the form submission. This can be achieved by using the Navigate stage on the Application Model's top element (highest in hierarchy).
Good luck!

Excel VBA IE Get Element's Coordinates For Mouse Click

Is there a way to get an IE element's mouse coordinates then command a mouse move to that coordinates on the screen to click it? I tried searching for element.getAttribute but so far couldn't find what I need.
I simply need the mouse to move/point to an object and click it. I'm needing to do it this way without using element.click

Word - How to stick text to the bottom of page

https://SURU.tinytake.com/sf/MTQxMTgzOV81MDc2MDI2
I want to stick some text of the bottom of the page, like on the screen, just before footer always. When there is text (from mergefield), next should be new lines. I hope screenshot make it easier to see.
You can put the text in a text box or frame with position set to "Bottom
Relative to Margin". It's the only idea I have due you don't want to use a footer.
Or you can see this article
Basically it gives three options:
Negative left indent
Margin text box
Anchor to the header
I found the solution to the problem on Microsoft's page and I hope that this page comes up for as many people as possible.
Select the text you want to stick to the bottom (or top) of the page. Under Layout tab take a look at the bottom right of the page layout section and you should see a small arrow that, when clicked on, opens a new menu. In that menu, go to layout tab and set vertical alignment to be "bottom". IMPORTANT! Make sue that the next menu option (at the bottom of that window) is set to "apply to selected sections" otherwise, you will be writing from the bottom of the page upwards.
Here is the source image that helped me. https://filestore.community.support.microsoft.com/api/images/0382c4a8-ade9-4fc4-be66-bcd2c7101479?upload=true
Here is the visual representation:
Note that the person who took the screenshot set the last setting to whole document, not just selected sections.
If selected sections option isn't available, make sure you selected a text before opening the menu.
Hope this helps!

How do I allow user to select, but not edit, text in an excel userform control whose width is smaller than the text?

Context
I want the user to review some selections they made earlier. So I display some text describing each selection on a separate control in a userform. Some of the text on the controls is long, extending beyond the width of the control. This is fine; I just want the user to be able to see all of the text without being able to edit it. To do this, I use textboxes that are "Locked" (i.e. not editable) but "Enabled" (i.e. selectable). This way, they can just click and either mouse-drag or arrow-key over to scroll through all the text.
Problem
The (small, aesthetic) problem is that when the user clicks in one of the textboxes, they get a blinking cursor, which is misleading as that is normally associated with an editable textbox.
Possible solutions
Ideally, there would be some way of removing the blinking cursor, while still allowing selection but not edition. However, I'm open to other alternatives that don't have to do with changing the width, or having a scrollbar (the textbox is too short to fit a scrollbar). The best alternative I have so far is changing the background color to a gray to make it slightly more clear that it's not editable.
P.S. I'm very familiar with VBA, so if that's part of the solution, I'm cool with that.
Thanks all!
I had a similar issue, and solved it by using these instructions to create a hidden textbox that the cursor automatically appeared in (invisible to the user).

Resources