mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-26 09:28:07 +02:00
ShuttleGui can specify orientation and minimum size...
... This will be needed for rewrite of EffectUIHost dialog
This commit is contained in:
parent
bb3159c758
commit
f825c32a50
@ -120,21 +120,22 @@ for registering for changes.
|
|||||||
#include "widgets/WindowAccessible.h"
|
#include "widgets/WindowAccessible.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ShuttleGuiBase::ShuttleGuiBase(wxWindow * pParent, teShuttleMode ShuttleMode )
|
ShuttleGuiBase::ShuttleGuiBase(
|
||||||
|
wxWindow * pParent, teShuttleMode ShuttleMode, bool vertical, wxSize minSize )
|
||||||
: mpDlg{ pParent }
|
: mpDlg{ pParent }
|
||||||
{
|
{
|
||||||
wxASSERT( (pParent != NULL ) || ( ShuttleMode != eIsCreating));
|
wxASSERT( (pParent != NULL ) || ( ShuttleMode != eIsCreating));
|
||||||
mpbOptionalFlag = nullptr;
|
mpbOptionalFlag = nullptr;
|
||||||
mpParent = pParent;
|
mpParent = pParent;
|
||||||
mShuttleMode = ShuttleMode;
|
mShuttleMode = ShuttleMode;
|
||||||
Init();
|
Init( vertical, minSize );
|
||||||
}
|
}
|
||||||
|
|
||||||
ShuttleGuiBase::~ShuttleGuiBase()
|
ShuttleGuiBase::~ShuttleGuiBase()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShuttleGuiBase::Init()
|
void ShuttleGuiBase::Init(bool vertical, wxSize minSize)
|
||||||
{
|
{
|
||||||
mpShuttle = NULL;
|
mpShuttle = NULL;
|
||||||
mpSizer = NULL;
|
mpSizer = NULL;
|
||||||
@ -172,10 +173,11 @@ void ShuttleGuiBase::Init()
|
|||||||
|
|
||||||
if( !mpSizer )
|
if( !mpSizer )
|
||||||
{
|
{
|
||||||
mpParent->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL));
|
mpParent->SetSizer(
|
||||||
|
mpSizer = safenew wxBoxSizer(vertical ? wxVERTICAL : wxHORIZONTAL));
|
||||||
}
|
}
|
||||||
PushSizer();
|
PushSizer();
|
||||||
mpSizer->SetMinSize(250,100);
|
mpSizer->SetMinSize(minSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShuttleGuiBase::ResetId()
|
void ShuttleGuiBase::ResetId()
|
||||||
@ -2198,13 +2200,14 @@ void SetIfCreated( wxStaticText *&Var, wxStaticText * Val )
|
|||||||
#include "../extnpanel-src/GuiWaveTrack.h"
|
#include "../extnpanel-src/GuiWaveTrack.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ShuttleGui::ShuttleGui(wxWindow * pParent, teShuttleMode ShuttleMode) :
|
ShuttleGui::ShuttleGui(
|
||||||
ShuttleGuiBase( pParent, ShuttleMode )
|
wxWindow * pParent, teShuttleMode ShuttleMode, bool vertical, wxSize minSize)
|
||||||
|
: ShuttleGuiBase( pParent, ShuttleMode, vertical, minSize )
|
||||||
{
|
{
|
||||||
if( ShuttleMode == eIsCreatingFromPrefs )
|
if( ShuttleMode == eIsCreatingFromPrefs )
|
||||||
{
|
{
|
||||||
mShuttleMode = eIsCreating;
|
mShuttleMode = eIsCreating;
|
||||||
Init(); // Wasn't fully done in base constructor because it is only done when eIsCreating is set.
|
Init( vertical, minSize ); // Wasn't fully done in base constructor because it is only done when eIsCreating is set.
|
||||||
}
|
}
|
||||||
else if( ShuttleMode == eIsSavingToPrefs )
|
else if( ShuttleMode == eIsSavingToPrefs )
|
||||||
{
|
{
|
||||||
|
@ -256,9 +256,14 @@ struct Item {
|
|||||||
class AUDACITY_DLL_API ShuttleGuiBase /* not final */
|
class AUDACITY_DLL_API ShuttleGuiBase /* not final */
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ShuttleGuiBase(wxWindow * pParent,teShuttleMode ShuttleMode);
|
ShuttleGuiBase(
|
||||||
|
wxWindow * pParent,
|
||||||
|
teShuttleMode ShuttleMode,
|
||||||
|
bool vertical, // Choose layout direction of topmost level sizer
|
||||||
|
wxSize minSize
|
||||||
|
);
|
||||||
virtual ~ShuttleGuiBase();
|
virtual ~ShuttleGuiBase();
|
||||||
void Init();
|
void Init( bool vertical, wxSize minSize );
|
||||||
void ResetId();
|
void ResetId();
|
||||||
|
|
||||||
//-- Add functions. These only add a widget or 2.
|
//-- Add functions. These only add a widget or 2.
|
||||||
@ -596,7 +601,11 @@ AUDACITY_DLL_API std::unique_ptr<wxSizer> CreateStdButtonSizer( wxWindow *parent
|
|||||||
class AUDACITY_DLL_API ShuttleGui /* not final */ : public ShuttleGuiBase
|
class AUDACITY_DLL_API ShuttleGui /* not final */ : public ShuttleGuiBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ShuttleGui(wxWindow * pParent,teShuttleMode ShuttleMode);
|
ShuttleGui(
|
||||||
|
wxWindow * pParent, teShuttleMode ShuttleMode,
|
||||||
|
bool vertical = true, // Choose layout direction of topmost level sizer
|
||||||
|
wxSize minSize = { 250, 100 }
|
||||||
|
);
|
||||||
~ShuttleGui(void);
|
~ShuttleGui(void);
|
||||||
public:
|
public:
|
||||||
ShuttleGui & Optional( bool & bVar );
|
ShuttleGui & Optional( bool & bVar );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user