You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NVDA uses NVDAObjects.window.edit.Edit for windows with the "edit" window class. The associated TextInfo class is EditTextInfo for non rich edit cases. This NVDAObject class relies on the NVDAObjects.window.Window.windowText to get the text content. For plain text content, this NVDAObject class functions quite well.
For several text windows, NVDA now relies on the display model to get text contents. Examples of those are text controls with specific window classes in delphi applications. Though displayModel.EditableTextDisplayModelTextInfo has the advantage of providing bold, italic and color information, it also has the down side of being unreliable in some cases, especially when inserting or deleting text. It is important to note that, in several delphi text controls I stumbled upon in the wild also expose the text using the windowText property on the object. It is also possible to get selection offsets with the EM_GETSEL window message.
Proposed fix
In Window.findOverlayClasses, before falling back to the DisplayModelEditableText, send the EM_GETLINECOUNT message to the window. If greater than 0, use a new UnidentifiedEdit NVDAObject class instead of the DisplayModelEditableText. The API version for this UnidentifiedEdit class could be set to -1, and the use of iTextDocument should be attempted when constructing a TextInfo for this class. Note the following information about EM_GETLINECOUNT from msdn:
The return value is an integer specifying the total number of text lines in the multiline edit control or rich edit control. If the control has no text, the return value is 1. The return value will never be less than 1.
Testing reveals that this window message also returns 1 for single line edit controls.
The text was updated successfully, but these errors were encountered:
It also turns out that the rich edit viewer in Inno setup installers supports the ITextDocument interface, while this control is using the RichEdit class that doesn't use iTextDocument. The RichEdit class assumes api 1.0. According to Wikipedia, the text object model should normally be supported for version 1.0 controls.
Description of issue
NVDA uses NVDAObjects.window.edit.Edit for windows with the "edit" window class. The associated TextInfo class is EditTextInfo for non rich edit cases. This NVDAObject class relies on the NVDAObjects.window.Window.windowText to get the text content. For plain text content, this NVDAObject class functions quite well.
For several text windows, NVDA now relies on the display model to get text contents. Examples of those are text controls with specific window classes in delphi applications. Though displayModel.EditableTextDisplayModelTextInfo has the advantage of providing bold, italic and color information, it also has the down side of being unreliable in some cases, especially when inserting or deleting text. It is important to note that, in several delphi text controls I stumbled upon in the wild also expose the text using the windowText property on the object. It is also possible to get selection offsets with the EM_GETSEL window message.
Proposed fix
In Window.findOverlayClasses, before falling back to the DisplayModelEditableText, send the EM_GETLINECOUNT message to the window. If greater than 0, use a new UnidentifiedEdit NVDAObject class instead of the DisplayModelEditableText. The API version for this UnidentifiedEdit class could be set to -1, and the use of iTextDocument should be attempted when constructing a TextInfo for this class. Note the following information about EM_GETLINECOUNT from msdn:
Testing reveals that this window message also returns 1 for single line edit controls.
The text was updated successfully, but these errors were encountered: