MCPcopy Create free account
hub / github.com/audacity/audacity / PopulateOrExchange

Method PopulateOrExchange

src/prefs/KeyConfigPrefs.cpp:173–321  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

171/// With KeyConfigPrefs all the exchanges are handled specially,
172/// so this is only used in populating the panel.
173void 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,

Callers

nothing calls this directly

Calls 15

StartStaticMethod · 0.80
PositionMethod · 0.80
StartPanelMethod · 0.80
EndPanelMethod · 0.80
AddVariableTextMethod · 0.80
AddWindowMethod · 0.80
ConnectRootMethod · 0.80
AddFixedTextMethod · 0.80
EndStaticMethod · 0.80
wxTextCtrlClass · 0.70
KeyViewClass · 0.70
wxSizeClass · 0.50

Tested by

no test coverage detected