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

View File

@ -4,7 +4,7 @@
ModemProperties::ModemProperties(wxWindow *parent, wxWindowID winid,
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 );