22#if wxUSE_ACCESSIBILITY
24WindowAccessible::WindowAccessible(wxWindow* win)
27 if (win) win->SetAccessible(
this);
30wxAccStatus WindowAccessible::GetName(
int childId, wxString*
name)
32 wxCHECK( GetWindow() !=
nullptr, wxACC_FAIL);
36 return wxACC_NOT_IMPLEMENTED;
38 *
name = GetWindow()->GetName();
57wxAccStatus SliderAx::GetChild(
int childId, wxAccessible** child )
59 if( childId == wxACC_SELF )
72wxAccStatus SliderAx::GetChildCount(
int* childCount)
85wxAccStatus SliderAx::GetDefaultAction(
int WXUNUSED(childId), wxString *actionName )
93wxAccStatus SliderAx::GetDescription(
int WXUNUSED(childId), wxString *description )
104wxAccStatus SliderAx::GetFocus(
int* childId, wxAccessible** child)
113wxAccStatus SliderAx::GetHelpText(
int WXUNUSED(childId), wxString *helpText )
122wxAccStatus SliderAx::GetKeyboardShortcut(
int WXUNUSED(childId), wxString *shortcut )
131wxAccStatus SliderAx::GetLocation( wxRect& rect,
int WXUNUSED(elementId) )
133 wxSlider *s = wxDynamicCast( GetWindow(), wxSlider );
136 rect.SetPosition( s->GetParent()->ClientToScreen( rect.GetPosition() ) );
142wxAccStatus SliderAx::GetName(
int WXUNUSED(childId), wxString*
name)
144 wxSlider *s = wxDynamicCast( GetWindow(), wxSlider );
146 *
name = s->GetName();
152wxAccStatus SliderAx::GetRole(
int childId, wxAccRole* role)
157 *role = wxROLE_SYSTEM_SLIDER;
162 *role = wxROLE_SYSTEM_PUSHBUTTON;
166 *role = wxROLE_SYSTEM_INDICATOR;
181wxAccStatus SliderAx::GetSelections( wxVariant * WXUNUSED(selections) )
183 return wxACC_NOT_IMPLEMENTED;
187wxAccStatus SliderAx::GetState(
int childId,
long* state)
189 wxSlider *s = wxDynamicCast( GetWindow(), wxSlider );
194 *state = wxACC_STATE_SYSTEM_FOCUSABLE;
198 if( s->GetValue() == s->GetMin() )
200 *state = wxACC_STATE_SYSTEM_INVISIBLE;
205 if( s->GetValue() == s->GetMax() )
207 *state = wxACC_STATE_SYSTEM_INVISIBLE;
221wxAccStatus SliderAx::GetValue(
int childId, wxString* strValue)
223 wxSlider *s = wxDynamicCast( GetWindow(), wxSlider );
227 strValue->Printf( mFmt.Translation(), s->GetValue() );
232 return wxACC_NOT_SUPPORTED;
Holds a msgid for the translation catalog; may also bind format arguments.
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.