| 161 | } |
| 162 | |
| 163 | void 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 |
no test coverage detected