Normally in classes derived from PrefsPanel this function is used both to populate the panel and to exchange data with it. With KeyConfigPrefs all the exchanges are handled specially, so this is only used in populating the panel.
| 171 | /// With KeyConfigPrefs all the exchanges are handled specially, |
| 172 | /// so this is only used in populating the panel. |
| 173 | void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S) |
| 174 | { |
| 175 | ChoiceSetting Setting{ L"/Prefs/KeyConfig/ViewBy", |
| 176 | { |
| 177 | { wxT("tree"), XXO("&Tree") }, |
| 178 | { wxT("name"), XXO("&Name") }, |
| 179 | { wxT("key"), XXO("&Key") }, |
| 180 | }, |
| 181 | 0 // tree |
| 182 | }; |
| 183 | |
| 184 | S.SetBorder(2); |
| 185 | |
| 186 | S.StartStatic(XO("Key Bindings"), 1); |
| 187 | { |
| 188 | S.StartHorizontalLay(wxEXPAND, 0); |
| 189 | { |
| 190 | S.Position(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL).AddTitle(XO("View by:")); |
| 191 | |
| 192 | // Bug 2692: Place button group in panel so tabbing will work and, |
| 193 | // on the Mac, VoiceOver will announce as radio buttons. |
| 194 | S.StartPanel(); |
| 195 | { |
| 196 | S.StartHorizontalLay(); |
| 197 | { |
| 198 | S.StartRadioButtonGroup(Setting); |
| 199 | { |
| 200 | mViewByTree = S.Id(ViewByTreeID) |
| 201 | .Name(XO("View by tree")) |
| 202 | .TieRadioButton(); |
| 203 | mViewByName = S.Id(ViewByNameID) |
| 204 | .Name(XO("View by name")) |
| 205 | .TieRadioButton(); |
| 206 | mViewByKey = S.Id(ViewByKeyID) |
| 207 | .Name(XO("View by key")) |
| 208 | .TieRadioButton(); |
| 209 | #if !defined(__WXMAC__) && wxUSE_ACCESSIBILITY |
| 210 | // so that name can be set on a standard control |
| 211 | if (mViewByTree) mViewByTree->SetAccessible(safenew WindowAccessible(mViewByTree)); |
| 212 | if (mViewByName) mViewByName->SetAccessible(safenew WindowAccessible(mViewByName)); |
| 213 | if (mViewByKey) mViewByKey->SetAccessible(safenew WindowAccessible(mViewByKey)); |
| 214 | #endif |
| 215 | } |
| 216 | S.EndRadioButtonGroup(); |
| 217 | } |
| 218 | S.EndHorizontalLay(); |
| 219 | } |
| 220 | S.EndPanel(); |
| 221 | |
| 222 | S.AddSpace(wxDefaultCoord, wxDefaultCoord, 1); |
| 223 | |
| 224 | S.StartHorizontalLay(wxALIGN_CENTER_VERTICAL, 0); |
| 225 | { |
| 226 | mFilterLabel = S.Position(wxALIGN_CENTER_VERTICAL).AddVariableText(XO("Searc&h:")); |
| 227 | |
| 228 | if (!mFilter) { |
| 229 | mFilter = safenew wxTextCtrl(S.GetParent(), |
| 230 | FilterID, |
nothing calls this directly
no test coverage detected