Audacity  2.2.2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ImportStreamDialog Class Referencefinal

#include <Import.h>

Inheritance diagram for ImportStreamDialog:
wxDialogWrapper wxTabTraversalWrapper< wxDialog >

Public Member Functions

 ImportStreamDialog (ImportFileHandle *_mFile, wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
 
virtual ~ImportStreamDialog ()
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const wxString &name=_("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const wxString &name=_("Dialog"))
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&...args)
 

Private Member Functions

void OnOk (wxCommandEvent &event)
 
void OnCancel (wxCommandEvent &event)
 

Private Attributes

ImportFileHandlemFile
 
wxInt32 scount
 
wxListBox * StreamList
 

Detailed Description

Definition at line 160 of file Import.h.

Constructor & Destructor Documentation

ImportStreamDialog::ImportStreamDialog ( ImportFileHandle _mFile,
wxWindow *  parent,
wxWindowID  id,
const wxString &  title,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER 
)

Definition at line 686 of file Import.cpp.

References CreateStdButtonSizer(), eCancelButton, eOkButton, and safenew.

687  :
688 wxDialogWrapper( parent, id, title, position, size, style | wxRESIZE_BORDER )
689 {
690  SetName(GetTitle());
691 
692  mFile = _mFile;
694  for (wxInt32 i = 0; i < scount; i++)
695  mFile->SetStreamUsage(i, FALSE);
696 
697  wxBoxSizer *vertSizer;
698  {
699  auto uVertSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
700  vertSizer = uVertSizer.get();
701 
702  auto choices = mFile->GetStreamInfo();
703  StreamList = safenew wxListBox(this, -1, wxDefaultPosition, wxDefaultSize, choices, wxLB_EXTENDED | wxLB_ALWAYS_SB);
704 
705  vertSizer->Add(StreamList, 1, wxEXPAND | wxALIGN_LEFT | wxALL, 5);
706 
707  vertSizer->Add(CreateStdButtonSizer(this, eCancelButton | eOkButton).release(), 0, wxEXPAND);
708 
709  SetAutoLayout(true);
710 
711  SetSizer(uVertSizer.release());
712  }
713 
714  vertSizer->Fit( this );
715 
716  SetSize( 400, 200 );
717 }
std::unique_ptr< wxSizer > CreateStdButtonSizer(wxWindow *parent, long buttons, wxWindow *extra)
virtual void SetStreamUsage(wxInt32 StreamID, bool Use)=0
wxInt32 scount
Definition: Import.h:173
#define safenew
Definition: Audacity.h:230
virtual wxInt32 GetStreamCount()=0
virtual const wxArrayString & GetStreamInfo()=0
wxListBox * StreamList
Definition: Import.h:174
ImportFileHandle * mFile
Definition: Import.h:172
ImportStreamDialog::~ImportStreamDialog ( )
virtual

Definition at line 719 of file Import.cpp.

720 {
721 
722 }

Member Function Documentation

void ImportStreamDialog::OnCancel ( wxCommandEvent &  event)
private

Definition at line 733 of file Import.cpp.

734 {
735  EndModal( wxID_CANCEL );
736 }
void ImportStreamDialog::OnOk ( wxCommandEvent &  event)
private

Definition at line 724 of file Import.cpp.

References mFile, ImportFileHandle::SetStreamUsage(), and StreamList.

725 {
726  wxArrayInt selitems;
727  int sels = StreamList->GetSelections(selitems);
728  for (wxInt32 i = 0; i < sels; i++)
729  mFile->SetStreamUsage(selitems[i],TRUE);
730  EndModal( wxID_OK );
731 }
virtual void SetStreamUsage(wxInt32 StreamID, bool Use)=0
wxListBox * StreamList
Definition: Import.h:174
ImportFileHandle * mFile
Definition: Import.h:172

Member Data Documentation

ImportFileHandle* ImportStreamDialog::mFile
private

Definition at line 172 of file Import.h.

Referenced by OnOk().

wxInt32 ImportStreamDialog::scount
private

Definition at line 173 of file Import.h.

wxListBox* ImportStreamDialog::StreamList
private

Definition at line 174 of file Import.h.

Referenced by OnOk().


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