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

Function InitProjectWindow

src/ProjectManager.cpp:163–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163void InitProjectWindow( ProjectWindow &window )
164{
165 auto pProject = window.FindProject();
166 if (!pProject)
167 return;
168 auto &project = *pProject;
169 auto &viewport = Viewport::Get(project);
170
171 auto statusBar = window.CreateProjectStatusBar();
172
173 auto &viewInfo = ViewInfo::Get( project );
174
175 // LLL: Read this!!!
176 //
177 // Until the time (and cpu) required to refresh the track panel is
178 // reduced, leave the following window creations in the order specified.
179 // This will place the refresh of the track panel last, allowing all
180 // the others to get done quickly.
181 //
182 // Near as I can tell, this is only a problem under Windows.
183 //
184
185 //
186 // Create the ToolDock
187 //
188 ToolManager::Get( project ).CreateWindows();
189 ToolManager::Get( project ).LayoutToolBars();
190
191 //
192 // Create the TrackPanel and the scrollbars
193 //
194
195 auto topPanel = window.GetTopPanel();
196
197 {
198 auto ubs = std::make_unique<wxBoxSizer>(wxVERTICAL);
199 ubs->Add( ToolManager::Get( project ).GetTopDock(), 0, wxEXPAND | wxALIGN_TOP );
200 topPanel->SetSizer(ubs.release());
201 }
202
203 wxBoxSizer *bs;
204 {
205 auto ubs = std::make_unique<wxBoxSizer>(wxVERTICAL);
206 bs = ubs.get();
207 bs->Add(topPanel, 0, wxEXPAND | wxALIGN_TOP);
208 bs->Add(window.GetContainerWindow(), 1, wxEXPAND);
209 bs->Add( ToolManager::Get( project ).GetBotDock(), 0, wxEXPAND );
210 window.SetAutoLayout(true);
211 window.SetSizer(ubs.release());
212 }
213 bs->Layout();
214
215 auto &trackPanel = TrackPanel::Get( project );
216
217 // LLL: When Audacity starts or becomes active after returning from
218 // another application, the first window that can accept focus
219 // will be given the focus even if we try to SetFocus(). By
220 // making the TrackPanel that first window, we resolve several

Callers 1

NewMethod · 0.85

Calls 15

GetFunction · 0.85
MainStatusBarFieldFunction · 0.85
CreateWindowsMethod · 0.80
GetTopPanelMethod · 0.80
GetTopDockMethod · 0.80
GetContainerWindowMethod · 0.80
GetBotDockMethod · 0.80
GetTrackListWindowMethod · 0.80
GetSizerMethod · 0.80
GetLeftOffsetMethod · 0.80

Tested by

no test coverage detected