Здравствуйте, Александр.
отвечаю на письмо от 28 июля 2024 г., 3:44:39:
А> Поправлю собственную поправку. Лучше не назначать ни SayWord, ни
А> SayLine, а искать какое-то другое решение (если кто найдёт - напишите).
в default.jss находим функцию
void function ObjStateChangedEvent(handle hObj, optional int iObjType, int nChangedState, int nState, int nOldState)
; спускаемся вниз до моего коментария.
dumpWinformsListItemGlobals () ; alt+up and down arrow in winForms list boxes
if hObj != GetFocus() then
return
EndIf
if nSelectingText then
return
EndIf
if HJDialogObjStateChangeSpoken(hObj,iObjType,nChangedState,nState,nOldState) then
return
EndIf
if ShouldWinformsControlBeSilent (hObj) return endIf
var string windowClass = GetWindowClass(hObj)
;Announce the list item when it changes state:
if iObjType == wt_ListBoxItem
|| iObjType == wt_ExtendedSelect_ListBox
|| iObjType == wt_MultiSelect_ListBox then
if (!nState || nChangedState == CTRL_SELECTED)
&& !InHJDialog()
&& windowClass != cwc_ComboLBox
return ObjStateChangedForListBoxxes(hObj, iObjType, nChangedState, nState, nOldState)
EndIf
EndIf
if iObjType == wt_ListViewItem
;a listview item may have a control state of 0 if the item is not selected,
;which causes nothing to be spoken for the control state.
;Since it would be useful to announce the item is being deselected,
;we'll test the old state to determine if we should announce deselection:
if !nChangedState && (nOldState & CTRL_SELECTED)
Say(cscNotSelected, ot_item_state)
else
IndicateControlState(iObjType, nChangedState)
endIf
; здесь вставляем функцию:
SayLine ()
; проверяем.
return
endIf
;For the rest of the object types, do not announce change to unavailable state:
if nState == CTRL_GRAYED then
return
EndIf
if iObjType == wt_RadioButton then
;if the radio buttons are items in a treeview,
;then speak them as we would speak a treeview item:
if GetObjectSubtypeCode(GetFocus()) == wt_TreeView then
SayTreeViewItem()
elif IsJavaWindow(hObj) then
IndicateControlState(iObjType, nChangedState)
elif IsVirtualPCCursor() then
;when the button has focus but the state has not been toggled,
;as in after using MoveToField script,
;obj state changed event will fire when the state changes.
;If the button has been arrowed to,
;the focus changes event fires and the obj state changed event does not.
;To be consistent with the way the button is announced when the focus change happens,
;the entire object is announced on state change,
;not merely the state change.
SayObjectTypeAndText()
EndIf
;For all other radio buttons, focusChangedEvent should announce when radio buttons gain focus.
return
EndIf
if iObjType == WT_TREEVIEW
|| iObjType == WT_TREEVIEWITEM then
;don't do this if the old state is selected and the new state is not selected
if ((nOldState&CTRL_SELECTED) && !(nState&CTRL_SELECTED)) then
;do nothing
else
SayTreeViewLevel (InHjDialog ())
EndIf
ElIf iObjType == wt_button
|| iObjType == wt_StartButton
|| iObjType == wt_Checkbox then
;for buttons, we do not want announcement of the pressed state.
if !(nState & ctrl_pressed) then
if nState & CTRL_Indeterminate then
;announce only partially checked, not the checked which is also set
;Must also indicate required or invalid states so can't just pass CONTROL_INDETERMINATE, instead,
;mask off checked and unchecked
IndicateControlState(iObjType,nState&~(CTRL_CHECKED|CTRL_UNCHECKED))
else
IndicateControlState(iObjType,(nState & ~ctrl_selected))
EndIf
EndIf
elif ( iObjType == WT_TOGGLE_BUTTON
&& nOldState == CTRL_PRESSED ) then
IndicateControlState(iObjType, 0, cmsgNotPressed_l )
else
;Add check for menus of header bar controls:
if iObjType == WT_MENU
&& ! ( nState & ( CTRL_UNCHECKED | CTRL_CHECKED ) )
&& nOldState & CTRL_CHECKED then
Let nChangedState = ( nChangedState | CTRL_UNCHECKED )
Let iObjType = WT_CHECKBOX ; so state indication will be right
endIf
IndicateControlState(iObjType, nChangedState)
endIf
EndFunction