CubicSDR/src/FrequencyDialog.cpp

24 lines
892 B
C++
Raw Normal View History

2015-05-04 19:44:03 -04:00
#include "FrequencyDialog.h"
wxBEGIN_EVENT_TABLE(FrequencyDialog, wxDialog) wxEND_EVENT_TABLE()
FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxString & title, const wxPoint & position, const wxSize & size, long style) :
wxDialog(parent, id, title, position, size, style) {
wxString freqStr = "105.7Mhz";
dialogText = new wxTextCtrl(this, -1, freqStr, wxPoint(6, 1), wxSize(size.GetWidth() - 20, size.GetHeight() - 70), wxTE_PROCESS_ENTER);
dialogText->SetFont(wxFont(20, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
Connect(wxEVT_TEXT_ENTER, wxCommandEventHandler(FrequencyDialog::OnEnter));
SetEscapeId(wxID_CANCEL);
Centre();
2015-05-04 23:03:55 -04:00
dialogText->SetSelection(-1, -1);
2015-05-04 19:44:03 -04:00
}
void FrequencyDialog::OnEnter(wxCommandEvent &event) {
std::cout << dialogText->GetValue().ToStdString() << std::endl;
Close();
}