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

Method OnSize

src/widgets/ExpandingToolBar.cpp:168–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void ExpandingToolBar::OnSize(wxSizeEvent & WXUNUSED(event))
169{
170 if (mFrameParent || mDialogParent || mAreaParent)
171 return;
172
173 // At the time of construction, it wasn't "safe" to tell
174 // our parent that we've just joined the window, so we check
175 // for it during our first OnSize event.
176
177 if (!mFrameParent) {
178 ToolBarFrame *toolBarParent =
179 dynamic_cast<ToolBarFrame *>(GetParent());
180 if (toolBarParent) {
181 // We were placed into a floating window
182 mFrameParent = toolBarParent;
183 toolBarParent->SetChild(this);
184 }
185 }
186
187 if (!mDialogParent) {
188 ToolBarDialog *toolBarParent =
189 dynamic_cast<ToolBarDialog *>(GetParent());
190 if (toolBarParent) {
191 // We were placed into a dialog
192 mDialogParent = toolBarParent;
193 toolBarParent->SetChild(this);
194 }
195 }
196
197 if (!mAreaParent) {
198 ToolBarArea *toolBarParent =
199 dynamic_cast<ToolBarArea *>(GetParent());
200 if (toolBarParent) {
201 // We were placed into an area full of other toolbars
202 mAreaParent = toolBarParent;
203 toolBarParent->AddChild(this);
204 }
205 }
206}
207
208void ExpandingToolBar::OnToggle(wxCommandEvent & WXUNUSED(event))
209{

Callers

nothing calls this directly

Calls 3

GetParentFunction · 0.85
SetChildMethod · 0.80
AddChildMethod · 0.80

Tested by

no test coverage detected