Skip to content

Commit

Permalink
Make FreeDV Reporter window resizable.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiw committed Jun 18, 2023
1 parent 1e7da21 commit 90fba77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
20 changes: 8 additions & 12 deletions src/freedv_reporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ FreeDVReporterDialog::FreeDVReporterDialog(wxWindow* parent, wxWindowID id, cons
, reporter_(nullptr)
{
// Create top-level of control hierarchy.
wxPanel* panel = new wxPanel(this);
wxBoxSizer* sectionSizer = new wxBoxSizer(wxVERTICAL);
wxFlexGridSizer* sectionSizer = new wxFlexGridSizer(2, 1, 0, 0);
sectionSizer->AddGrowableRow(0);

// Main list box
// =============================
m_listSpots = new wxListView(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_SINGLE_SEL | wxLC_REPORT | wxLC_HRULES);
m_listSpots = new wxListView(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_SINGLE_SEL | wxLC_REPORT | wxLC_HRULES);
m_listSpots->InsertColumn(0, wxT("Callsign"), wxLIST_FORMAT_CENTER);
m_listSpots->InsertColumn(1, wxT("Grid Square"), wxLIST_FORMAT_CENTER);
m_listSpots->InsertColumn(2, wxT("Version"), wxLIST_FORMAT_CENTER);
Expand All @@ -46,29 +46,25 @@ FreeDVReporterDialog::FreeDVReporterDialog(wxWindow* parent, wxWindowID id, cons
m_listSpots->InsertColumn(8, wxT("Last RX Mode"), wxLIST_FORMAT_CENTER);
m_listSpots->InsertColumn(9, wxT("SNR"), wxLIST_FORMAT_CENTER);
m_listSpots->InsertColumn(10, wxT("Last Update"), wxLIST_FORMAT_CENTER);

sectionSizer->Add(m_listSpots, 0, wxALL | wxEXPAND, 2);

// Bottom buttons
// =============================
wxBoxSizer* buttonSizer = new wxBoxSizer(wxHORIZONTAL);

m_buttonOK = new wxButton(panel, wxID_OK);
m_buttonOK = new wxButton(this, wxID_OK);
buttonSizer->Add(m_buttonOK, 0, wxALL, 2);

m_buttonSendQSY = new wxButton(panel, wxID_ANY, _("Request QSY"));
m_buttonSendQSY = new wxButton(this, wxID_ANY, _("Request QSY"));
m_buttonSendQSY->Enable(false); // disable by default unless we get a valid selection
buttonSizer->Add(m_buttonSendQSY, 0, wxALL, 2);

sectionSizer->Add(buttonSizer, 0, wxALL | wxALIGN_CENTER, 2);

// Trigger auto-layout of window.
// ==============================
panel->SetSizer(sectionSizer);

wxBoxSizer* panelSizer = new wxBoxSizer(wxVERTICAL);
panelSizer->Add(panel, 0, wxEXPAND, 0);
this->SetSizerAndFit(panelSizer);
this->SetSizerAndFit(sectionSizer);

this->Layout();
this->Centre(wxBOTH);
Expand Down
2 changes: 1 addition & 1 deletion src/freedv_reporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class FreeDVReporterDialog : public wxDialog
wxWindowID id = wxID_ANY, const wxString& title = _("FreeDV Reporter"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL | wxMINIMIZE_BOX);
long style = wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL | wxMINIMIZE_BOX | wxRESIZE_BORDER);
~FreeDVReporterDialog();

void setReporter(FreeDVReporter* reporter);
Expand Down

0 comments on commit 90fba77

Please sign in to comment.