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 691 of file Import.cpp.

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

692  :
693 wxDialogWrapper( parent, id, title, position, size, style | wxRESIZE_BORDER )
694 {
695  SetName(GetTitle());
696 
697  mFile = _mFile;
699  for (wxInt32 i = 0; i < scount; i++)
700  mFile->SetStreamUsage(i, FALSE);
701 
702  wxBoxSizer *vertSizer;
703  {
704  auto uVertSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
705  vertSizer = uVertSizer.get();
706 
707  auto choices = mFile->GetStreamInfo();
708  StreamList = safenew wxListBox(this, -1, wxDefaultPosition, wxDefaultSize, choices, wxLB_EXTENDED | wxLB_ALWAYS_SB);
709 
710  vertSizer->Add(StreamList, 1, wxEXPAND | wxALIGN_LEFT | wxALL, 5);
711 
712  vertSizer->Add(CreateStdButtonSizer(this, eCancelButton | eOkButton).release(), 0, wxEXPAND);
713 
714  SetAutoLayout(true);
715 
716  SetSizer(uVertSizer.release());
717  }
718 
719  vertSizer->Fit( this );
720 
721  SetSize( 400, 200 );
722 }
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:223
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 724 of file Import.cpp.

725 {
726 
727 }

Member Function Documentation

void ImportStreamDialog::OnCancel ( wxCommandEvent &  event)
private

Definition at line 738 of file Import.cpp.

739 {
740  EndModal( wxID_CANCEL );
741 }
void ImportStreamDialog::OnOk ( wxCommandEvent &  event)
private

Definition at line 729 of file Import.cpp.

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

730 {
731  wxArrayInt selitems;
732  int sels = StreamList->GetSelections(selitems);
733  for (wxInt32 i = 0; i < sels; i++)
734  mFile->SetStreamUsage(selitems[i],TRUE);
735  EndModal( wxID_OK );
736 }
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: