LPNMLVCUSTOMDRAW Get row ID - winapi

How do I determine the row that is being drawn from the LPNMLVCUSTOMDRAW structure got via the NM_CUSTOMDRAW message?

The fist element of the NMLVCUSTOMDRAW structure is a NMCUSTOMDRAW structure. Here, there is a DWORD_PTR dwItemSpec field. This is the item's "row index".

The first entry of the NMLVCUSTOMDRAW structure is an NMCUSTOMDRAW. It contains a lItemlParam for use by the application. It holds the information stored in the LVITEM's lParam member when an item is created. An application can store arbitrary data in this member, including an item's row index.

Related

Table Extraction in UIPath if table has images

I am trying to extract the Table which has the following format
When I want to extract i should have either put some character on place up icon or i dont want that either the case is fine..
But UIPath brings this way.. 78,59,237806 all as one text which is misleading.. How to resolve this issue..
Thanks
Take a look at the Find Children activity. You can specify an item via selector (the table) and use Find Children to return a collection of type UiElement.
So set the filter to extract the "<webctrl tag='tr' />" which will effectively give you a collection of the rows.
Use a For Each to iterate through each UiElement you got from the first Find Children activity, and use that element to run another Find Children. In this case, set the filter to extract the elements with a class of "mid-wrap". This gives you a collection of the elements in the row which match that requirement, and this will exclude the data-up value, since that's a different class.
You can then loop over this collection to get the innertext attribute, which will give you the actual values you're looking for each cell in the row. Use something like Add Data Row to add the values to a datatable, and let the For Each run over the next row in the collection.

GWT (smartgwt) grid sort selected records top

I have a grid where the user can select records via checkbox in front of every record. Now I have a requirement to sort the records based on their selection, so that all selected records should be placed top, followed by the not selected ones.
Is there any standard function to achieve this? As an alternative I thought of saving the selection state as an attribute on every record and sort based on the attribute.
The code for the column is:
gridRealmDt.setSelectionType(SelectionStyle.SIMPLE);
gridRealmDt.setSelectionAppearance(SelectionAppearance.CHECKBOX);
I try to describe the code I use as the affected code is deeply nested in our own framework classes.
gridRealmDt is a subclass of smartgwt ListGrid. In my Dialog a create an instance of the grid which creates an instance of a database bound datasource. When the dialog is loaded the records are fetched from the database and after that a registered an dataArrivedHandler where I select the records which match records from another table.
I tried to place the selection attribute in an extra field and use that for sortig before my other sort criteria, but this does not work. Here is the code for the field I am using.
ListGridField txtSelected = new ListGridField(SELECTED, "");
txtSelected.setHidden(true);
txtSelected.setSortByDisplayField(true);
txtSelected.setCanSortClientOnly(true);
When I do not set the canSortClientOnly property the order by is sent to my database resulting in an error, as the table does not contain that field, so I set the property. Now I get following error
Removing field from the sort Specifier array because it specifies canSort Client Only: true and all data is not yet client-side.
I also tried to use a sortNormilizer on the Name field which is my main sort criteria, but the normalizer is called before the selection value is set to the record.
record.setAttribute(CARealmDS.SELECTED,selected ? "a" : "b");
I also cannnot find a way to call the normalizer when selection changes.
Currently we are using Smart GWT Version 6.0p.
I don't think there is any standard function. Just use grid store update. Place checked items first.

How to identify a Specific WebElement which is a child of WebTable in UFT

I have a WebTable, which has some WebElements. I want to verify the text of one of the WebElements and take action on it. Can you help, how to proceed on this?
As Vinoth said if you know which row and column the element is in you can use ChildItem.
Typically UFT flattens the elements (so that a WebElement in a WebTable will appear as the WebTables sibling if both are added to the repository. However something that many people do not know is that if you manually put an element under the WebTable (or any other element) then UFT will look for it under the parent object.
This means that you can describe the nested element and UFT will only look under the table and not in the rest of the page.
Browser("B").Page("P").WebTable("T").WebElement("innertext:=.*bla.*").Click
You can use ChildItem method of WebTable.
Set MyWebElement = Browser("CreationTime:=0").Page("micclass:=Page").Webtable("name=TableName").ChildItem(Row, Column, micclass, Index)
Row - Required. A long integer value.
The row number where the cell is located. The first row in the table is numbered 1.
Column - Required. A long integer value.
The column number where the cell is located. The first column in the table is numbered 1.
MicClass - Required. A String value.
The object type.
Index - Required. A long integer value.
The index of the object of type MicClass in the cell. This index indicates the desired element when there is more then one object of type MicClass in the cell. The first object has an index of 0.
MyWebElement is the element you wanted. You can access any methods/properties of WebElement. For ex, to click,
MyWebElement.Click

Saving Table of Int Arrays

I have a Table full of players. Each of these players can have a list of Items that they own. What I need to do is store that list of items for each player. Each item has an ID which is unique.
What I want to do is store an array of these items as a field in the Player Table. Does anyone know how this could be accomplished?
You can either go database route and create table of "ItemId to PlayerId" and query all items for given player by ID.
Or you can serialize data in XML/byte array using default .Net serialization and than dump it in BLOB field of "playerId to PlayerBLOB" table (XML/text can also be stored as text field - will be more readable).
You can store it as a delimited text. BUT! store it as xml instead, this will allow you to store complex weapon list and configuration in a column.

Core Data, NSTableView and getting Selected Row Value

I'm pretty new to Core Data and managed to get the NSTableView to show my Core Data values. The entity that the table uses is Emotes that have the two properties, Emote (string) and Usage (integer 16)
When a user selects a item, it will allow a person to copy that emote to clipboard. In order to do that, I need to get the ManagedObject of the selected row and send the Emote value in the object to the clipboard. I got the clipboard part, but stuck on the part in retrieving the data of the selected row from the data source.
What is the easiest way in getting the value of the selected row?
What is the easiest way in getting the value of the selected row?
The easiest way is to query the NSArrayController for
- (NSArray *)selectedObjects
You don't have to worry about what rows are selected; the table view will tell you what rows to copy by sending you (the data source) a tableView:writeRowsWithIndexes:toPasteboard: message.
Whatever you do in your implementation of tableView:objectValueForTableColumn:row:, you'll implement that method pretty much the same way, except that instead of retrieving and returning a single column value, you'll write (or at least promise) all of them at once, in whatever formats make sense, to the pasteboard.

Resources