Project

General

Profile

Feature #3857

implement a widget that replaces the Microsoft ListView OCX (VB 6.0 common control)

Added by Greg Shah almost 8 years ago. Updated 7 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

History

#1 Updated by Greg Shah almost 8 years ago

See https://docs.microsoft.com/en-us/windows/desktop/controls/list-view-control-reference for documentation.

This represents a list in multiple views (details view which is a simple table, icon view, list view, tile view).

#2 Updated by Hynek Cihlar over 7 years ago

  • Follows Feature #3856: implement a widget that replaces the Microsoft ImageList OCX (VB 6.0 common control) added

#3 Updated by Hynek Cihlar over 7 years ago

  • Follows deleted (Feature #3856: implement a widget that replaces the Microsoft ImageList OCX (VB 6.0 common control))

#4 Updated by Greg Shah about 1 month ago

We have a project that uses the Microsoft ListView control, so this task needs to be done. FWD's LISTVIEW widget, built on the TreeList infrastructure, covers report view and single selection. The project also uses:

  • ColumnHeaders:Add (including at an index), ColumnHeaders:Clear, ListItems:Add, ListSubItems:Add, SelectedItem, Arrange, Icons and SmallIcons, HideColumnHeaders, LabelEdit, MultiSelect, OLEDropMode, HitTest and HWND;
  • the events ItemClick, ColumnClick, DblClick, MouseUp, OLEStartDrag, OLECompleteDrag, OLEDragDrop, KeyDown and ItemCheck.

What is missing today: the other views, multi-select, check boxes, drag and drop between lists, the right mouse up event, and the two ColumnHeaders TODOs.

The same project uses a DBI ctList list grid much more heavily, and its replacement is a list grid widget on the same TreeList infrastructure. The ListView work should share that widget, so the two should be planned together.

The work should follow the OCX emulation playbook attached to #11919: register the control in the OCX registry, decode the .wrx state, and test against Windows OpenEdge goldens with Lyra automation.

#5 Updated by Greg Shah 7 days ago

One more requirement from the same project. It finds the item under the mouse in a ListView with HitTest(x, y), computing the coordinates in 4GL:

  • GetCursorPos and ScreenToClient (with the control-frame's HWND) give pixels relative to the control;
  • GetDC / GetDeviceCaps(LOGPIXELSX) / ReleaseDC give the screen DPI;
  • the pixels are converted to twips (x * 1440 / dpi) and passed to HitTest.

These Win32 entry points are emulated in #12040. HitTest on the replacement ListView must accept twips relative to the control's client area, consistent with the DPI the #12040 GetDeviceCaps emulation returns and with the origin of its ScreenToClient result. It is used for drag and drop between lists (OLEDragDrop), so the event's x and y arguments must use the same units.

Testcases: HitTest with coordinates computed as above on the first item, the last visible item, empty space and after scrolling, in report view; coordinates from OLEDragDrop passed back to HitTest.

Also available in: Atom PDF