Audacity  2.2.2
Public Member Functions | Static Public Member Functions | List of all members
ShuttleGui Class Reference

Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI. More...

#include <ShuttleGui.h>

Inheritance diagram for ShuttleGui:
ShuttleGuiBase

Public Member Functions

 ShuttleGui (wxWindow *pParent, teShuttleMode ShuttleMode)
 
 ~ShuttleGui (void)
 
ShuttleGuiId (int id)
 
ShuttleGuiProp (int iProp)
 
GuiWaveTrack * AddGuiWaveTrack (const wxString &Name)
 
AttachableScrollBarAddAttachableScrollBar (long style=wxSB_HORIZONTAL)
 
void AddStandardButtons (long buttons=eOkButton|eCancelButton, wxButton *extra=NULL)
 
wxSizerItem * AddSpace (int width, int height)
 
wxSizerItem * AddSpace (int size)
 
void SetSizeHints (int minX=-1, int minY=-1)
 
void SetSizeHints (const wxArrayString &items)
 
void SetSizeHints (const std::vector< int > &items)
 
teShuttleMode GetMode ()
 
- Public Member Functions inherited from ShuttleGuiBase
 ShuttleGuiBase (wxWindow *pParent, teShuttleMode ShuttleMode)
 
 ~ShuttleGuiBase (void)
 
void Init ()
 
void AddPrompt (const wxString &Prompt)
 Right aligned text string. More...
 
void AddUnits (const wxString &Prompt)
 Left aligned text string. More...
 
void AddTitle (const wxString &Prompt)
 Centred text string. More...
 
wxWindow * AddWindow (wxWindow *pWindow, int Flags=wxALIGN_CENTRE|wxALL)
 
wxSlider * AddSlider (const wxString &Prompt, int pos, int Max, int Min=0)
 
wxSlider * AddVSlider (const wxString &Prompt, int pos, int Max)
 
wxSpinCtrl * AddSpinCtrl (const wxString &Prompt, int Value, int Max, int Min)
 
wxTreeCtrl * AddTree ()
 
wxRadioButton * AddRadioButton (const wxString &Prompt)
 
wxRadioButton * AddRadioButtonToGroup (const wxString &Prompt)
 
wxButton * AddButton (const wxString &Text, int PositionFlags=wxALIGN_CENTRE)
 
wxBitmapButton * AddBitmapButton (const wxBitmap &Bitmap, int PositionFlags=wxALIGN_CENTRE)
 
wxStaticText * AddVariableText (const wxString &Str, bool bCenter=false, int PositionFlags=0)
 
wxTextCtrl * AddTextBox (const wxString &Caption, const wxString &Value, const int nChars)
 
wxTextCtrl * AddNumericTextBox (const wxString &Caption, const wxString &Value, const int nChars)
 
wxTextCtrl * AddTextWindow (const wxString &Value)
 Multiline text box that grows. More...
 
wxListBox * AddListBox (const wxArrayString *pChoices, long style=0)
 
wxListCtrl * AddListControl ()
 
wxListCtrl * AddListControlReportMode ()
 
wxGrid * AddGrid ()
 
wxCheckBox * AddCheckBox (const wxString &Prompt, const wxString &Selected)
 
wxCheckBox * AddCheckBoxOnRight (const wxString &Prompt, const wxString &Selected)
 
wxComboBox * AddCombo (const wxString &Prompt, const wxString &Selected, const wxArrayString *pChoices, long style=0)
 
wxChoice * AddChoice (const wxString &Prompt, const wxString &Selected, const wxArrayString *pChoices)
 
wxMenuBar * AddMenuBar ()
 
wxMenu * AddMenu (const wxString &Title)
 
void AddIcon (wxBitmap *pBmp)
 
void AddIconButton (const wxString &Command, const wxString &Params, wxBitmap *pBmp)
 
void AddFixedText (const wxString &Str, bool bCenter=false)
 
void AddConstTextBox (const wxString &Caption, const wxString &Value)
 Single line text box of fixed size. More...
 
void StartHorizontalLay (int PositionFlags=wxALIGN_CENTRE, int iProp=1)
 
void EndHorizontalLay ()
 
void StartVerticalLay (int iProp=1)
 
void EndVerticalLay ()
 
wxScrolledWindow * StartScroller (int iStyle=0)
 
void EndScroller ()
 
wxPanel * StartPanel (int iStyle=0)
 
void EndPanel ()
 
void StartMultiColumn (int nCols, int PositionFlags=wxALIGN_LEFT)
 
void EndMultiColumn ()
 
void StartTwoColumn ()
 
void EndTwoColumn ()
 
void StartThreeColumn ()
 
void EndThreeColumn ()
 
wxStaticBox * StartStatic (const wxString &Str, int iProp=0)
 
void EndStatic ()
 
wxNotebook * StartNotebook ()
 
void EndNotebook ()
 
wxNotebookPageStartNotebookPage (const wxString &Name)
 
void StartNotebookPage (const wxString &Name, wxNotebookPage *pPage)
 
void EndNotebookPage ()
 
wxPanel * StartInvisiblePanel ()
 
void EndInvisiblePanel ()
 
void StartRadioButtonGroup (const wxString &SettingName)
 
void EndRadioButtonGroup ()
 
void StartRadioButtonGroup (const wxString &SettingName, const int iDefaultValue)
 
void StartRadioButtonGroup (const wxString &SettingName, const wxString &DefaultValue)
 
void DoDataShuttle (const wxString &Name, WrappedType &WrappedRef)
 
bool DoStep (int iStep)
 
int TranslateToIndex (const wxString &Value, const wxArrayString &Choices)
 String-to-Index. More...
 
wxString TranslateFromIndex (const int nIn, const wxArrayString &Choices)
 Index-to-String. More...
 
int TranslateToIndex (const int Value, const std::vector< int > &Choices)
 Int-to-Index (choices can be items like e.g 0x400120 ) More...
 
int TranslateFromIndex (const int nIn, const std::vector< int > &Choices)
 Index-to-int (choices can be items like e.g 0x400120 ) More...
 
wxTextCtrl * TieTextBox (const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
 
wxTextCtrl * TieTextBox (const wxString &Caption, wxString &Value, const int nChars=0)
 
wxTextCtrl * TieTextBox (const wxString &Prompt, int &Selected, const int nChars=0)
 
wxTextCtrl * TieTextBox (const wxString &Prompt, double &Value, const int nChars=0)
 
wxTextCtrl * TieNumericTextBox (const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
 
wxTextCtrl * TieNumericTextBox (const wxString &Caption, wxString &Value, const int nChars=0)
 
wxTextCtrl * TieNumericTextBox (const wxString &Prompt, int &Selected, const int nChars=0)
 
wxTextCtrl * TieNumericTextBox (const wxString &Prompt, double &Value, const int nChars=0)
 
wxCheckBox * TieCheckBox (const wxString &Prompt, WrappedType &WrappedRef)
 
wxCheckBox * TieCheckBox (const wxString &Prompt, const wxString &Selected)
 
wxCheckBox * TieCheckBox (const wxString &Prompt, bool &Var)
 
wxCheckBox * TieCheckBoxOnRight (const wxString &Prompt, WrappedType &WrappedRef)
 
wxCheckBox * TieCheckBoxOnRight (const wxString &Prompt, bool &Var)
 
wxChoice * TieChoice (const wxString &Prompt, WrappedType &WrappedRef, const wxArrayString *pChoices)
 
wxChoice * TieChoice (const wxString &Prompt, wxString &Selected, const wxArrayString *pChoices)
 
wxChoice * TieChoice (const wxString &Prompt, int &Selected, const wxArrayString *pChoices)
 
wxSlider * TieSlider (const wxString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
 
wxSlider * TieSlider (const wxString &Prompt, int &pos, const int max, const int min=0)
 
wxSlider * TieSlider (const wxString &Prompt, double &pos, const double max, const double min=0.0)
 
wxSlider * TieSlider (const wxString &Prompt, float &pos, const float fMin, const float fMax)
 
wxSlider * TieVSlider (const wxString &Prompt, float &pos, const float fMin, const float fMax)
 
wxRadioButton * TieRadioButton (const wxString &Prompt, WrappedType &WrappedRef)
 
wxRadioButton * TieRadioButton (const wxString &Prompt, const int iValue)
 This function must be within a StartRadioButtonGroup - EndRadioButtonGroup pair. More...
 
wxRadioButton * TieRadioButton (const wxString &Prompt, const wxString &Value)
 This function must be within a StartRadioButtonGroup - EndRadioButtonGroup pair. More...
 
wxSpinCtrl * TieSpinCtrl (const wxString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
 
wxSpinCtrl * TieSpinCtrl (const wxString &Prompt, int &Value, const int max, const int min=0)
 
wxCheckBox * TieCheckBox (const wxString &Prompt, const wxString &SettingName, const bool bDefault)
 
wxCheckBox * TieCheckBoxOnRight (const wxString &Prompt, const wxString &SettingName, const bool bDefault)
 
wxChoice * TieChoice (const wxString &Prompt, const wxString &SettingName, const wxString &Default, const wxArrayString &Choices, const wxArrayString &TranslatedChoices)
 
wxChoice * TieChoice (const wxString &Prompt, const wxString &SettingName, const int Default, const wxArrayString &Choices, const std::vector< int > &TranslatedChoices)
 
wxTextCtrl * TieTextBox (const wxString &Prompt, const wxString &SettingName, const wxString &Default, const int nChars)
 
wxTextCtrl * TieTextBox (const wxString &Prompt, const wxString &SettingName, const double &Default, const int nChars)
 
wxTextCtrl * TieNumericTextBox (const wxString &Prompt, const wxString &SettingName, const wxString &Default, const int nChars)
 
wxTextCtrl * TieNumericTextBox (const wxString &Prompt, const wxString &SettingName, const double &Default, const int nChars)
 
wxSlider * TieSlider (const wxString &Prompt, const wxString &SettingName, const int iDefault, const int max, const int min=0)
 
wxSpinCtrl * TieSpinCtrl (const wxString &Prompt, const wxString &SettingName, const int Value, const int max, const int min)
 
void EnableCtrl (bool bEnable)
 
void SetSizeHints (int minX, int minY)
 Used to modify an already placed Window. More...
 
void SetBorder (int Border)
 
void SetStyle (int Style)
 
void SetNoMatchSelector (int iSelector)
 
void SetSizerProportion (int iProp)
 
void SetStretchyCol (int i)
 Used to modify an already placed FlexGridSizer to make a column stretchy. More...
 
void SetStretchyRow (int i)
 Used to modify an already placed FlexGridSizer to make a row stretchy. More...
 
wxWindow * GetParent ()
 
ShuttleGuiBaseProp (int iProp)
 
void UseUpId ()
 
wxSizer * GetSizer ()
 

Static Public Member Functions

static void SetSizeHints (wxWindow *window, const wxArrayString &items)
 
static void SetSizeHints (wxWindow *window, const std::vector< int > &items)
 

Additional Inherited Members

- Protected Member Functions inherited from ShuttleGuiBase
void SetProportions (int Default)
 
void PushSizer ()
 
void PopSizer ()
 
void UpdateSizersCore (bool bPrepend, int Flags)
 
void UpdateSizers ()
 
void UpdateSizersC ()
 
void UpdateSizersAtStart ()
 
long Style (long Style)
 
- Protected Attributes inherited from ShuttleGuiBase
wxWindow * mpLastWind
 
wxWindow * mpDlg
 
wxSizer * pSizerStack [nMaxNestedSizers]
 
std::unique_ptr< ShuttlempShuttle
 
int miNoMatchSelector
 
teShuttleMode mShuttleMode
 Used in choices to determine which item to use on no match. More...
 
wxString mSettingName
 
int mRadioCount
 The setting controlled by a group. More...
 
WrappedType mRadioValue
 The index of this radio item. -1 for none. More...
 
wxString mRadioValueString
 The wrapped value associated with the active radio button. More...
 
int mRadioValueInt
 Unwrapped string value. More...
 
int miSizerProp
 Unwrapped integer value. More...
 
int mSizerDepth
 
int miBorder
 
long miStyle
 
int miProp
 
int miId
 
int miIdNext
 
int miIdSetByUser
 
int miPropSetByUser
 
std::unique_ptr< wxSizer > mpSubSizer
 
wxSizer * mpSizer
 
wxWindow * mpParent
 
wxWindow * mpWind
 
wxMenuBar * mpMenuBar
 
wxMenu * mpMenu
 

Detailed Description

Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.

ShuttleGui extends the idea of the data Shuttle class to include creation of dialog controls. As part of this it provides an interface to sizers that leads to shorter more readable code.

It also allows the code that is used to create dialogs to be reused to shuttle information in and out.

Most of the ShuttleGui functions are actually defined in ShuttleGuiBase.

There is documentation on how to use this class in The Shuttle System

Definition at line 366 of file ShuttleGui.h.

Constructor & Destructor Documentation

ShuttleGui::ShuttleGui ( wxWindow *  pParent,
teShuttleMode  ShuttleMode 
)

Definition at line 2013 of file ShuttleGui.cpp.

References eIsCreating, eIsCreatingFromPrefs, eIsGettingFromDialog, eIsSavingToPrefs, ShuttleGuiBase::Init(), ShuttleGuiBase::mpShuttle, and ShuttleGuiBase::mShuttleMode.

2013  :
2014  ShuttleGuiBase( pParent, ShuttleMode )
2015 {
2016  if( ShuttleMode == eIsCreatingFromPrefs )
2017  {
2019  Init(); // Wasn't fully done in base constructor because it is only done when eIsCreating is set.
2020  }
2021  else if( ShuttleMode == eIsSavingToPrefs )
2022  {
2024  }
2025  else
2026  {
2027  return;
2028  }
2029 
2030  mpShuttle = std::make_unique<ShuttlePrefs>();
2031  // In this case the client is the GUI, so if creating we do want to
2032  // store in the client.
2033  mpShuttle->mbStoreInClient = (mShuttleMode == eIsCreating );
2034 };
std::unique_ptr< Shuttle > mpShuttle
Definition: ShuttleGui.h:287
ShuttleGuiBase(wxWindow *pParent, teShuttleMode ShuttleMode)
Definition: ShuttleGui.cpp:114
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
ShuttleGui::~ShuttleGui ( void  )

Definition at line 2036 of file ShuttleGui.cpp.

2037 {
2038 }

Member Function Documentation

AttachableScrollBar * ShuttleGui::AddAttachableScrollBar ( long  style = wxSB_HORIZONTAL)

Definition at line 2065 of file ShuttleGui.cpp.

References eIsCreating, ShuttleGuiBase::miId, ShuttleGuiBase::miProp, ShuttleGuiBase::mpParent, ShuttleGuiBase::mpWind, ShuttleGuiBase::mShuttleMode, safenew, ShuttleGuiBase::UpdateSizers(), and ShuttleGuiBase::UseUpId().

2066 {
2067  UseUpId();
2068  if( mShuttleMode != eIsCreating )
2069  return (AttachableScrollBar*)NULL;
2070 // return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), AttachableScrollBar);
2071  AttachableScrollBar * pAttachableScrollBar;
2072  miProp=0;
2073  mpWind = pAttachableScrollBar = safenew AttachableScrollBar(
2074  mpParent,
2075  miId,
2076  wxDefaultPosition,
2077  wxDefaultSize,
2078  style
2079  );
2080  mpWind->SetMinSize(wxSize(10,20));
2081  UpdateSizers();
2082  return pAttachableScrollBar;
2083 }
An AttachableScrollBar is a scroll bar that can be attached to multiple items and so control their sc...
#define safenew
Definition: Audacity.h:223
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
GuiWaveTrack * ShuttleGui::AddGuiWaveTrack ( const wxString &  Name)

Definition at line 2047 of file ShuttleGui.cpp.

References eIsCreating, ShuttleGuiBase::miId, ShuttleGuiBase::miProp, ShuttleGuiBase::mpParent, ShuttleGuiBase::mpWind, ShuttleGuiBase::mShuttleMode, safenew, ShuttleGuiBase::UpdateSizers(), and ShuttleGuiBase::UseUpId().

2048 {
2049 #ifdef EXPERIMENTAL_TRACK_PANEL
2050  UseUpId();
2051  if( mShuttleMode != eIsCreating )
2052  return (GuiWaveTrack*)NULL;
2053 // return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), GuiWaveTrack);
2054  GuiWaveTrack * pGuiWaveTrack;
2055  miProp=1;
2056  mpWind = pGuiWaveTrack = safenew GuiWaveTrack(mpParent, miId, Name);
2057  mpWind->SetMinSize(wxSize(100,50));
2058  UpdateSizers();
2059  return pGuiWaveTrack;
2060 #else
2061  return NULL;
2062 #endif
2063 }
#define safenew
Definition: Audacity.h:223
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpWind
Definition: ShuttleGui.h:317
wxSizerItem * ShuttleGui::AddSpace ( int  width,
int  height 
)
wxSizerItem* ShuttleGui::AddSpace ( int  size)
inline

Definition at line 379 of file ShuttleGui.h.

References AddSpace().

Referenced by AddSpace().

379 { return AddSpace( size, size ); };
wxSizerItem * AddSpace(int width, int height)
void ShuttleGui::AddStandardButtons ( long  buttons = eOkButton | eCancelButton,
wxButton *  extra = NULL 
)

Definition at line 2206 of file ShuttleGui.cpp.

References CreateStdButtonSizer(), eIsCreating, ShuttleGuiBase::EndVerticalLay(), ShuttleGuiBase::miSizerProp, ShuttleGuiBase::mpParent, ShuttleGuiBase::mpSubSizer, ShuttleGuiBase::mShuttleMode, ShuttleGuiBase::PopSizer(), ShuttleGuiBase::StartVerticalLay(), and ShuttleGuiBase::UpdateSizers().

Referenced by ExportMP3::AskResample(), ContrastDialog::ContrastDialog(), EffectPresetsDialog::EffectPresetsDialog(), ErrorDialog::ErrorDialog(), FreqWindow::FreqWindow(), ImportRawDialog::ImportRawDialog(), EffectDialog::Init(), LangChoiceDialog::LangChoiceDialog(), AudacityProject::OnAudioDeviceInfo(), TagsEditor::OnEdit(), MeterPanel::OnPreferences(), RateMenuTable::OnRateOther(), AudacityProject::OnResample(), EffectUIHost::OnSaveAs(), LabelTrackMenuTable::OnSetFont(), SoundActivatedRecord::PopulateOrExchange(), TimeDialog::PopulateOrExchange(), BatchCommandDialog::PopulateOrExchange(), EditChainsDialog::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), EditCurvesDialog::PopulateOrExchange(), LadspaEffectOptionsDialog::PopulateOrExchange(), PluginRegistrationDialog::PopulateOrExchange(), FindDialog::PopulateOrExchange(), PrefsDialog::PrefsDialog(), DeviceToolBar::ShowComboDialog(), HelpSystem::ShowInfoDialog(), SliderDialog::SliderDialog(), and WarningDialog::WarningDialog().

2207 {
2208  if( mShuttleMode != eIsCreating )
2209  return;
2210 
2211  StartVerticalLay( false );
2212 
2213  miSizerProp = false;
2214  mpSubSizer = CreateStdButtonSizer( mpParent, buttons, extra );
2215  UpdateSizers();
2216  PopSizer();
2217 
2218  EndVerticalLay();
2219 }
std::unique_ptr< wxSizer > CreateStdButtonSizer(wxWindow *parent, long buttons, wxWindow *extra)
int miSizerProp
Unwrapped integer value.
Definition: ShuttleGui.h:301
void EndVerticalLay()
Definition: ShuttleGui.cpp:991
wxWindow * mpParent
Definition: ShuttleGui.h:316
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
std::unique_ptr< wxSizer > mpSubSizer
Definition: ShuttleGui.h:314
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:982
teShuttleMode ShuttleGui::GetMode ( )
inline

Definition at line 387 of file ShuttleGui.h.

References ShuttleGuiBase::mShuttleMode.

Referenced by ContrastDialog::ContrastDialog().

387 { return mShuttleMode; };
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
ShuttleGui & ShuttleGui::Id ( int  id)

Definition at line 2041 of file ShuttleGui.cpp.

References ShuttleGuiBase::miIdSetByUser.

Referenced by NyquistEffect::BuildEffectWindow(), NyquistEffect::BuildPromptWindow(), ContrastDialog::ContrastDialog(), EffectPresetsDialog::EffectPresetsDialog(), ExportCL::Export(), FreqWindow::FreqWindow(), HistoryWindow::HistoryWindow(), ImportRawDialog::ImportRawDialog(), BenchmarkDialog::MakeBenchmarkDialog(), BatchProcessDialog::OnApplyToFiles(), AudacityProject::OnAudioDeviceInfo(), SplashDialog::Populate(), DirectoriesPrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), RecordingPrefs::PopulateOrExchange(), WaveformPrefs::PopulateOrExchange(), LibraryPrefs::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), QualityPrefs::PopulateOrExchange(), KeyConfigPrefs::PopulateOrExchange(), BatchProcessDialog::PopulateOrExchange(), BatchCommandDialog::PopulateOrExchange(), ExportCLOptions::PopulateOrExchange(), ScreenFrame::PopulateOrExchange(), EffectClickRemoval::PopulateOrExchange(), EffectCompressor::PopulateOrExchange(), SpectrumPrefs::PopulateOrExchange(), EffectDtmf::PopulateOrExchange(), EffectChangeSpeed::PopulateOrExchange(), EffectAmplify::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), EditChainsDialog::PopulateOrExchange(), EffectReverb::PopulateOrExchange(), EffectBassTreble::PopulateOrExchange(), EffectWahwah::PopulateOrExchange(), TimerRecordDialog::PopulateOrExchange(), EffectPhaser::PopulateOrExchange(), ExportMultiple::PopulateOrExchange(), EffectDistortion::PopulateOrExchange(), ExportPCMOptions::PopulateOrExchange(), ExtImportPrefs::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), TagsEditor::PopulateOrExchange(), DependencyDialog::PopulateOrExchange(), ExportMP3Options::PopulateOrExchange(), EditCurvesDialog::PopulateOrExchange(), EffectNoiseReduction::Dialog::PopulateOrExchange(), PluginRegistrationDialog::PopulateOrExchange(), FindDialog::PopulateOrExchange(), and HelpSystem::ShowHtmlText().

2042 {
2043  miIdSetByUser = id;
2044  return *this;
2045 }
ShuttleGui& ShuttleGui::Prop ( int  iProp)
inline
void ShuttleGui::SetSizeHints ( int  minX = -1,
int  minY = -1 
)
void ShuttleGui::SetSizeHints ( const wxArrayString &  items)

Definition at line 2272 of file ShuttleGui.cpp.

References eIsCreating, ShuttleGuiBase::mpLastWind, ShuttleGuiBase::mShuttleMode, and SetSizeHints().

2273 {
2274  if( mShuttleMode != eIsCreating )
2275  return;
2276 
2277  SetSizeHints( mpLastWind, items );
2278 }
void SetSizeHints(int minX=-1, int minY=-1)
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpLastWind
Definition: ShuttleGui.h:283
void ShuttleGui::SetSizeHints ( const std::vector< int > &  items)

Definition at line 2280 of file ShuttleGui.cpp.

References eIsCreating, ShuttleGuiBase::mpLastWind, ShuttleGuiBase::mShuttleMode, and SetSizeHints().

2281 {
2282  if( mShuttleMode != eIsCreating )
2283  return;
2284 
2285  SetSizeHints( mpLastWind, items );
2286 }
void SetSizeHints(int minX=-1, int minY=-1)
teShuttleMode mShuttleMode
Used in choices to determine which item to use on no match.
Definition: ShuttleGui.h:291
wxWindow * mpLastWind
Definition: ShuttleGui.h:283
void ShuttleGui::SetSizeHints ( wxWindow *  window,
const wxArrayString &  items 
)
static

Definition at line 2229 of file ShuttleGui.cpp.

2230 {
2231  int maxw = 0;
2232 
2233  for( size_t i = 0; i < items.GetCount(); i++ )
2234  {
2235  int x;
2236  int y;
2237 
2238  window->GetTextExtent(items[i], &x, &y );
2239  if( x > maxw )
2240  {
2241  maxw = x;
2242  }
2243  }
2244 
2245  // Would be nice to know the sizes of the button and borders, but this is
2246  // the best we can do for now.
2247 #if defined(__WXMAC__)
2248  maxw += 50;
2249 #elif defined(__WXMSW__)
2250  maxw += 50;
2251 #elif defined(__WXGTK__)
2252  maxw += 50;
2253 #else
2254  maxw += 50;
2255 #endif
2256 
2257  window->SetSizeHints( maxw, -1 );
2258 }
void ShuttleGui::SetSizeHints ( wxWindow *  window,
const std::vector< int > &  items 
)
static

Definition at line 2260 of file ShuttleGui.cpp.

References SetSizeHints().

2261 {
2262  wxArrayString strs;
2263 
2264  for( size_t i = 0; i < items.size(); i++ )
2265  {
2266  strs.Add( wxString::Format( wxT("%d"), items[i] ) );
2267  }
2268 
2269  SetSizeHints( window, strs );
2270 }
void SetSizeHints(int minX=-1, int minY=-1)

The documentation for this class was generated from the following files: