recording:gui: dialog for creating a new recording

This commit is contained in:
Tyler Wilding 2018-07-02 20:54:48 -04:00 committed by lightningterror
parent ddd2e3f8f0
commit 0021ad66e0
2 changed files with 93 additions and 0 deletions

View File

@ -0,0 +1,66 @@
#include "PrecompiledHeader.h"
#include "NewRecordingFrame.h"
enum {
File,
Author,
From
};
NewRecordingFrame::NewRecordingFrame(wxWindow *parent)
: wxDialog(parent, wxID_ANY, "New Input Recording", wxDefaultPosition, wxDefaultSize, wxSTAY_ON_TOP | wxCAPTION)
{
wxPanel *panel = new wxPanel(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _("panel"));
wxFlexGridSizer *fgs = new wxFlexGridSizer(4, 2, 20, 20);
wxBoxSizer *container = new wxBoxSizer(wxVERTICAL);
m_fileLabel = new wxStaticText(panel, wxID_ANY, _("File Path"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER);
m_authorLabel = new wxStaticText(panel, wxID_ANY, _("Author"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER);
m_fromLabel = new wxStaticText(panel, wxID_ANY, _("Record From"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER);
m_filePicker = new wxFilePickerCtrl(panel, File, wxEmptyString, "File", L"p2m2 file(*.p2m2)|*.p2m2", wxDefaultPosition, wxDefaultSize, wxFLP_SAVE | wxFLP_OVERWRITE_PROMPT | wxFLP_USE_TEXTCTRL);
m_authorInput = new wxTextCtrl(panel, Author, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
wxArrayString choices;
choices.Add("Current Frame");
choices.Add("Power-On");
m_fromChoice = new wxChoice(panel, From, wxDefaultPosition, wxDefaultSize, choices);
m_fromChoice->SetSelection(0);
m_startRecording = new wxButton(panel, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize);
m_cancelRecording = new wxButton(panel, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize);
fgs->Add(m_fileLabel, 1);
fgs->Add(m_filePicker, 1);
fgs->Add(m_authorLabel, 1);
fgs->Add(m_authorInput, 1, wxEXPAND);
fgs->Add(m_fromLabel, 1);
fgs->Add(m_fromChoice, 1, wxEXPAND);
fgs->Add(m_startRecording, 1);
fgs->Add(m_cancelRecording, 1);
container->Add(fgs, 1, wxALL | wxEXPAND, 15);
panel->SetSizer(container);
panel->GetSizer()->Fit(this);
Centre();
}
wxString NewRecordingFrame::getFile() const
{
return m_filePicker->GetPath();
}
wxString NewRecordingFrame::getAuthor() const
{
return m_authorInput->GetValue();
}
int NewRecordingFrame::getFrom() const
{
return m_fromChoice->GetSelection();
}

View File

@ -0,0 +1,27 @@
#pragma once
#include <wx/wx.h>
#include <wx/filepicker.h>
/*
* The Dialog to pop-up when recording a new movie
*/
class NewRecordingFrame : public wxDialog
{
public:
NewRecordingFrame(wxWindow *parent);
wxString getFile() const;
wxString getAuthor() const;
int getFrom() const;
private:
wxStaticText *m_fileLabel;
wxFilePickerCtrl *m_filePicker;
wxStaticText *m_authorLabel;
wxTextCtrl *m_authorInput;
wxStaticText *m_fromLabel;
wxChoice *m_fromChoice;
wxButton *m_startRecording;
wxButton *m_cancelRecording;
};