Project

General

Profile

Feature #12054

Microsoft TreeView ActiveX control: drag and drop, multi-select and the remaining members

Added by Greg Shah about 1 month 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 about 1 month ago

Microsoft TreeView ActiveX control: drag and drop, multi-select and the remaining members

Project: User Interface

Problem

FWD already maps the Microsoft TreeView control (MSComctlLib.TreeCtrl) onto TREEVIEW. Applications also use Nodes:Add, Key, Expanded, SelectedItem, SingleSel, FullRowSelect, HitTest, ImageList, LabelEdit and HotTracking, and the events NodeClick, Collapse, Expand, KeyDown, MouseUp, OLEDragDrop, OLEDragOver, OLEStartDrag and NodeCheck.

TREEVIEW has no drag and drop or multi-select, and drag and drop on TREEVIEW and TREELIST is reported broken in #7166.

Work

  1. Add OLE drag and drop between nodes and between controls (OLEStartDrag, OLEDragOver, OLEDragDrop, OLECompleteDrag), fixing #7166, or route the screens that need it to TREELIST.
  2. Check every member and event above against the control.
  3. Register the control's CLSID in the OCX registry (ocx-registry.xml), mapping it to the target widget, as #11919 did for ctToolBar.
  4. Decode the design-time state the control keeps in the .wrx storage at conversion time, so that it exists after conversion.
  5. Implement the members and events listed above on the target, with the vendor's semantics: argument types, return values, defaults, and the order in which events fire. Members of the type library that are not used become no-ops with a conversion warning, as the OCX pipeline already does.
  6. Follow the OCX emulation playbook attached to #11919: an OpenEdge test program with goldens for each member and event, recorded input sequences for the interactive parts, and Lyra automation.
  7. Update the gap marking and the OCX registry documentation.

Testcases

Each member and event above, exercised on Windows OpenEdge with the real control to produce goldens, then run against the FWD replacement on the web and Swing clients. The vendor help files are the reference where behaviour cannot be observed directly.

#2 Updated by Greg Shah 7 days ago

We have a project that drags items between TreeView controls and onto other widgets, and finds the target node with HitTest(x, y). The coordinates are computed in 4GL from the mouse position:

  • 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. For drag and drop to work, HitTest on the replacement TreeView must accept twips relative to the control's client area, and the conversion must use the same DPI that the #12040 GetDeviceCaps emulation returns, with ScreenToClient returning coordinates relative to the same origin the replacement control uses. The same applies to the x and y arguments of the mouse and OLE drag events, which the code also converts.

Testcases: HitTest with coordinates computed as above at several positions (first node, last visible node, below the last node, after scrolling), and at a non-default DPI if the emulation supports one; the drag and drop events' coordinates passed back to HitTest.

Also available in: Atom PDF