mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-21 16:37:12 +01:00
ProjectWindowPlacement wraps project's frame, toolkit-neutrally
This commit is contained in:
@@ -14,7 +14,8 @@
|
||||
|
||||
#include "KeyboardCapture.h"
|
||||
#include "TempDirectory.h"
|
||||
#include "./widgets/ErrorDialog.h"
|
||||
#include "widgets/ErrorDialog.h"
|
||||
#include "widgets/wxWidgetsBasicUI.h"
|
||||
|
||||
#include <wx/display.h>
|
||||
#include <wx/filename.h>
|
||||
@@ -199,6 +200,15 @@ AUDACITY_DLL_API const wxFrame &GetProjectFrame( const AudacityProject &project
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<const BasicUI::WindowPlacement>
|
||||
ProjectFramePlacement( AudacityProject *project )
|
||||
{
|
||||
if (!project)
|
||||
return std::make_unique<BasicUI::WindowPlacement>();
|
||||
return std::make_unique<wxWidgetsWindowPlacement>(
|
||||
&GetProjectFrame(*project));
|
||||
}
|
||||
|
||||
AUDACITY_DLL_API wxWindow &GetProjectPanel( AudacityProject &project )
|
||||
{
|
||||
auto ptr = project.GetPanel();
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
class wxFrame;
|
||||
class wxWindow;
|
||||
namespace BasicUI { class WindowPlacement; }
|
||||
|
||||
class AudacityProject;
|
||||
|
||||
@@ -176,6 +177,11 @@ inline const wxFrame *FindProjectFrame( const AudacityProject *project ) {
|
||||
return project ? &GetProjectFrame( *project ) : nullptr;
|
||||
}
|
||||
|
||||
//! Make a WindowPlacement object suitable for `project` (which may be null)
|
||||
/*! @post return value is not null */
|
||||
AUDACITY_DLL_API std::unique_ptr<const BasicUI::WindowPlacement>
|
||||
ProjectFramePlacement( AudacityProject *project );
|
||||
|
||||
///\brief Get the main sub-window of the project frame that displays track data
|
||||
// (as a wxWindow only, when you do not need to use the subclass TrackPanel)
|
||||
AUDACITY_DLL_API wxWindow &GetProjectPanel( AudacityProject &project );
|
||||
|
||||
Reference in New Issue
Block a user