Modem property minsize tweak/def

This commit is contained in:
Charles J. Cliffe 2016-07-28 23:35:48 -04:00
parent a9f35a4c35
commit 11f3fb9c68
2 changed files with 9 additions and 8 deletions

View File

@ -42,7 +42,8 @@ wxEND_EVENT_TABLE()
#include "RigThread.h" #include "RigThread.h"
#endif #endif
#define APPFRAME_MODEMPROPS_SIZE 240 #define APPFRAME_MODEMPROPS_MINSIZE 20
#define APPFRAME_MODEMPROPS_MAXSIZE 240
AppFrame::AppFrame() : AppFrame::AppFrame() :
wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) { wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {
@ -112,8 +113,8 @@ AppFrame::AppFrame() :
modemPropertiesUpdated.store(false); modemPropertiesUpdated.store(false);
modemProps = new ModemProperties(demodPanel, wxID_ANY); modemProps = new ModemProperties(demodPanel, wxID_ANY);
modemProps->SetMinSize(wxSize(APPFRAME_MODEMPROPS_SIZE,-1)); modemProps->SetMinSize(wxSize(APPFRAME_MODEMPROPS_MAXSIZE,-1));
modemProps->SetMaxSize(wxSize(APPFRAME_MODEMPROPS_SIZE,-1)); modemProps->SetMaxSize(wxSize(APPFRAME_MODEMPROPS_MAXSIZE,-1));
modemProps->Hide(); modemProps->Hide();
demodTray->Add(modemProps, 15, wxEXPAND | wxALL, 0); demodTray->Add(modemProps, 15, wxEXPAND | wxALL, 0);
@ -1537,13 +1538,13 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
} }
if (modemProps->IsShown() && modemProps->isCollapsed() && modemProps->GetMinWidth() > 22) { if (modemProps->IsShown() && modemProps->isCollapsed() && modemProps->GetMinWidth() > 22) {
modemProps->SetMinSize(wxSize(22,-1)); modemProps->SetMinSize(wxSize(APPFRAME_MODEMPROPS_MINSIZE,-1));
modemProps->SetMaxSize(wxSize(22,-1)); modemProps->SetMaxSize(wxSize(APPFRAME_MODEMPROPS_MINSIZE,-1));
demodTray->Layout(); demodTray->Layout();
modemProps->fitColumns(); modemProps->fitColumns();
} else if (modemProps->IsShown() && !modemProps->isCollapsed() && modemProps->GetMinWidth() < 200) { } else if (modemProps->IsShown() && !modemProps->isCollapsed() && modemProps->GetMinWidth() < 200) {
modemProps->SetMinSize(wxSize(APPFRAME_MODEMPROPS_SIZE,-1)); modemProps->SetMinSize(wxSize(APPFRAME_MODEMPROPS_MAXSIZE,-1));
modemProps->SetMaxSize(wxSize(APPFRAME_MODEMPROPS_SIZE,-1)); modemProps->SetMaxSize(wxSize(APPFRAME_MODEMPROPS_MAXSIZE,-1));
demodTray->Layout(); demodTray->Layout();
modemProps->fitColumns(); modemProps->fitColumns();
} }

View File

@ -4,7 +4,7 @@
ModemProperties::ModemProperties(wxWindow *parent, wxWindowID winid, ModemProperties::ModemProperties(wxWindow *parent, wxWindowID winid,
const wxPoint& pos, const wxSize& size, long style, const wxString& name) : wxPanel(parent, winid, pos, size, style, name) { const wxPoint& pos, const wxSize& size, long style, const wxString& name) : wxPanel(parent, winid, pos, size, style, name) {
m_propertyGrid = new wxPropertyGrid(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxPG_DEFAULT_STYLE | wxPG_NO_INTERNAL_BORDER); m_propertyGrid = new wxPropertyGrid(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxPG_DEFAULT_STYLE);
bSizer = new wxBoxSizer( wxVERTICAL ); bSizer = new wxBoxSizer( wxVERTICAL );