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

Function ShowMultiDialog

libraries/lib-wx-init/MultiDialog.cpp:174–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174int ShowMultiDialog(const TranslatableString &message,
175 const TranslatableString &title,
176 const TranslatableStrings &buttons,
177 const ManualPageID &helpPage,
178 const TranslatableString &boxMsg, bool log)
179{
180 wxWindow * pParent = wxTheApp->GetTopWindow();
181
182 // We want a parent we can display over, so don't make it a parent if top
183 // window is a STAY_ON_TOP.
184 if (pParent) {
185 if ((pParent->GetWindowStyle() & wxSTAY_ON_TOP) == wxSTAY_ON_TOP)
186 pParent = NULL;
187 }
188 MultiDialog dlog(pParent,
189 message, title, buttons, helpPage, boxMsg, log);
190 // If dialog does not have a parent, cannot be centred on it.
191 if (pParent != NULL)
192 dlog.CentreOnParent();
193 else {
194 dlog.CenterOnScreen();
195 // and after centring move the dialog left by the size of the dialog.
196 // Likely to help if we have the splash screen visible, or if
197 // we're spanning two equally sized monitors.
198 // Unlikely to make things worse.
199 wxSize Size = dlog.GetSize();
200 Size.SetHeight( 10 );
201 wxPoint Pos = dlog.GetPosition() -Size;
202 dlog.Move(Pos);
203 }
204 return dlog.ShowModal();
205}

Callers 1

DoMultiDialogMethod · 0.70

Calls 3

MoveMethod · 0.80
GetSizeMethod · 0.45
ShowModalMethod · 0.45

Tested by

no test coverage detected