mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 08:09:32 +02:00
Add ShuttleGui functions to make simple book controls...
... analogous to StartNotebook() and EndNotebook() This will be needed to rewrite export dialogs
This commit is contained in:
parent
1802b9316e
commit
3b69a038c8
@ -107,6 +107,7 @@ for registering for changes.
|
||||
#include <wx/grid.h>
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/notebook.h>
|
||||
#include <wx/simplebook.h>
|
||||
#include <wx/treectrl.h>
|
||||
#include <wx/spinctrl.h>
|
||||
#include <wx/stattext.h>
|
||||
@ -977,12 +978,33 @@ void ShuttleGuiBase::EndNotebook()
|
||||
}
|
||||
|
||||
|
||||
wxSimplebook * ShuttleGuiBase::StartSimplebook()
|
||||
{
|
||||
UseUpId();
|
||||
if( mShuttleMode != eIsCreating )
|
||||
return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxSimplebook);
|
||||
wxSimplebook * pNotebook;
|
||||
mpWind = pNotebook = safenew wxSimplebook(GetParent(),
|
||||
miId, wxDefaultPosition, wxDefaultSize, GetStyle( 0 ));
|
||||
SetProportions( 1 );
|
||||
UpdateSizers();
|
||||
mpParent = pNotebook;
|
||||
return pNotebook;
|
||||
}
|
||||
|
||||
void ShuttleGuiBase::EndSimplebook()
|
||||
{
|
||||
//PopSizer();
|
||||
mpParent = mpParent->GetParent();
|
||||
}
|
||||
|
||||
|
||||
wxNotebookPage * ShuttleGuiBase::StartNotebookPage( const wxString & Name )
|
||||
{
|
||||
if( mShuttleMode != eIsCreating )
|
||||
return NULL;
|
||||
// return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
|
||||
wxNotebook * pNotebook = (wxNotebook*)mpParent;
|
||||
auto pNotebook = static_cast< wxBookCtrlBase* >( mpParent );
|
||||
wxNotebookPage * pPage = safenew wxPanelWrapper(GetParent());
|
||||
pPage->SetName(Name);
|
||||
|
||||
@ -1004,7 +1026,7 @@ void ShuttleGuiBase::StartNotebookPage( const wxString & Name, wxNotebookPage *
|
||||
if( mShuttleMode != eIsCreating )
|
||||
return;
|
||||
// return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
|
||||
wxNotebook * pNotebook = (wxNotebook*)mpParent;
|
||||
auto pNotebook = static_cast< wxBookCtrlBase* >( mpParent );
|
||||
// wxNotebookPage * pPage = safenew wxPanelWrapper(GetParent());
|
||||
pPage->Create( mpParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, wxT("panel"));
|
||||
pPage->SetName(Name);
|
||||
|
@ -58,6 +58,7 @@ class wxTreeCtrl;
|
||||
class wxTextCtrl;
|
||||
class wxSlider;
|
||||
class wxNotebook;
|
||||
class wxSimplebook;
|
||||
typedef wxWindow wxNotebookPage; // so far, any window can be a page
|
||||
class wxButton;
|
||||
class wxBitmapButton;
|
||||
@ -360,11 +361,16 @@ public:
|
||||
wxNotebook * StartNotebook();
|
||||
void EndNotebook();
|
||||
|
||||
wxSimplebook * StartSimplebook();
|
||||
void EndSimplebook();
|
||||
|
||||
// Use within any kind of book control:
|
||||
// IDs of notebook pages cannot be chosen by the caller
|
||||
wxNotebookPage * StartNotebookPage( const wxString & Name );
|
||||
void StartNotebookPage( const wxString & Name, wxNotebookPage * pPage );
|
||||
|
||||
void EndNotebookPage();
|
||||
|
||||
wxPanel * StartInvisiblePanel();
|
||||
void EndInvisiblePanel();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user