Positioning mouse cursor on another Application's List item entry based on its text value - windows

I want to do an automation using Excel VBA. First of all I am not sure if its possible so I need to explain the problem first.
I would launch an application which has a list of reports , that one can run by right clicking on any of these and selecting an entry from the popup menu caled say "Run this report". The problem is the report names are displayed in a listbox.
There are so many entries I only need to run a few of them based on their names.
To achieve this I thought about placing the mouse cursor on the text displaying the appropriate report name and then trigger the right click event. These can be done using Windows APIs.
The challenge I am facing is how to hover my mouse on any particular list item based on its display text.
I can enumerate all the windows controls based on the handle of the application's window, but is it possible to get the location of any item on the screen based on the text displayed on list item.

Related

UI guidelines - should a control get focus when changed?

I have a window which shows a table on the left half. On the right half I display properties of the item which is selected in the table. The user can now change these properties.
The properties are represented by different kinds of controls: textFields, sliders, numberSteppers and popUpButtons.
The user can - besides using the mouse - use the tab key to navigate through the UI Elements. When the table has the focus tab will select the first editable item on the right side, then tab walks through the items and after the last item will go to the table again.
When the table has focus and I change the value of a popUpButton or move a sliderthe default behaviour of the API (Apple's Cocoa) is to change the value but keep the focus on the table.
My intuition would tell me that after changing a control element it should have the focus (i.e. become firstResponder). But I checked some of macOS' preference panes and they behave similarly.
In Apple's Human Interface Guidelines I do not find mention of that specific topic.
So my question is:
Is there a guideline or at least best practice an app should follow regarding if a control element like a popUpButton or slidershould get the focus when clicked or edited?

Keyboard navigation for RadListBox with icons

I am using RadListBox to show a list of items. Each item has an icon. The requirement is jumping on the item when a the first letter of that item is pressed.
For example: It should focus on "Dock" when letter "D" is pressed
Is there any built-in feature to accomplish this>
This functionality is built into the RadListBox right out of the box.
You must have the list box focused and then type a key to select the item with the first letter matching the key that was pressed. In order to focus on the list box you can either: click with the mouse, tab to it, set focus in JS, or use the KeyboardNavigationSettings.CommandKey and KeyboardNavigationSettings.FocusKey to help aid with keyboard navigation.
Example:
RadListBox1 = new RadListBox()
RadListBox1.KeyboardNavigationSettings.CommandKey = KeyboardNavigationModifier.Alt;
RadListBox1.KeyboardNavigationSettings.FocusKey = KeyboardNavigationKey.L;
You can also use EnableMarkMatches to highlight more than one match if necessary and for typing more than one letter for selecting.
Reference: Telerik RadListBox Keyboard Navigation Demo << This has all the sample code you should need.
Seems this a Telerik bug, but i made a project, test situation and it's working.
download sample project here.
this project tested on google chrome Version 60.0.3112.113 (Official Build) (64-bit)
After run project press Alt+s or Alt+o or Alt+c
Remember change AccessKey property to change shortcut key:
RadListBox1.Items[0].AccessKey = "s";
I should say that this NOT a perfect solution.
RadListBox is a powerful ASP.NET AJAX control to display a list of items. It allows for multiple selection of items, reorder and transfer between two listboxes. Drag and drop is fully supported as well.

Getting the current value of a textbox in Access 2013 Custom Web App

in a List view I want a particular control (textbox) to have a red background color if it has a certain value. I have tried the following:
Click on the textbox then click the Data icon in the context sensitive controls that appear. I can then see that the name of the control is First_NameTextBox. I then click anywhere on the List view and click the Actions icon in the context controls that appear to the right of the view. I select "On Current". I then create two steps that should be executed whenever a new record is activated:
If [First_NameTextBox] = "somevalue" Then
SetProperty
Control Name [First_NameTextBox]
Property BackColor
Value #FF0000
End If
However, this turns the textbox red no matter what the value in First_NameTextBox is. How do I reference the CURRENT value of the textbox?
Conditional formatting based on a field value is not available for the List View in a Web App.
If you've built web pages (with or without a templating engine), the design limitations of Access can be frustrating.
Another kind of frustration comes from moving a form in Access from the native Access environment to a browser-based display.
I've felt the first kind of frustration, but so far I've avoided the second kind. I keep MS Access and HTML-rendered forms far away from each other.
Conditional Formatting in the List View of Access Web Apps is Available its just way harder than it should be.
Input "If Statement" under the "Current Macro" by clicking outside any text box or label then traveling to the top right of the view and you will see the Lightning bolt which allows two options, "On Load" and "On Current".
SELECT ON CURRENT
Don't forget You will need to set the control back to the original color by using the else. (also, for some reason I have to flip the Colors so where you would think red would go, Put White.
Example:
IF = "" True Then
White
Else
Red
END IF /DONT ASK ME WHY!
Summary: your Code is Sound, Just input it under the Views Current Macro Location
This is my first post, i spent DAYS looking for this information and found in the deep google somewhere so i hope this helps you.

Populate Numbers Pop-up Menu cell using AppleScript

I have a Numbers (iWork 09) spreadsheet where I want to be able to populate a Pop-up Menu cell with values to enable easy analysis of selected data.
I have the AppleScript to generate the values that I want put into the Pop-up Menu, but need a means of interacting with the Pop-up Menu's list of values.
Is it possible to use AppleScript to dynamically populate a Pop-up Menu cell?
If so, what is the code to populate the Pop-up Menu with options dynamically?
Applescript just automates what the application can already do on its own. So my question to you would be... can you populate that menu in Numbers? Of course Numbers populates the menu, but does Numbers give you the ability to determine what that menu holds. If not then there's no chance you can do it with applescript.
But you really don't need it. If you're running an applescript to generate the values then just popup a choose-from-list dialog box so you can choose the one you want to insert. Then after you choose one use applescript to insert the value into the currently selected cell in Numbers.

How do I edit a cell in an MFC Listbox?

I have a CListCtrl control that has 2 columns and any number of rows. I want the user to be able to click(or maybe double-click) a "cell" and be able edit the text therein.
What I mean is that I want to be able to click and edit any of the places where it says "TEST" by clicking on the text to make it editable.
How should I go about this? I suppose I should use a mouse click event but how would I make the cell editable?
This looks like a list control in report mode, which is different from a list box. A list box doesn't support editing contents at all. You can write code entirely on your own to get the contents of a line, copy that to an edit control, display the edit control exactly where the existing content was shown, allow the user to edit, and copy data back when/if the user hits return.
A list control allows editing of one (and only one) field. If you want to support more, you have a couple of choices. One would be about like above, creating your own edit control in the right place. The obvious alternative would be to look up one of the many grid controls. CodeProject has a number of variations.

Resources