MCPcopy Create free account
hub / github.com/NatLabRockies/SAM / UpdateView

Method UpdateView

src/widgets.cpp:584–909  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

582enum { ID_grid = wxID_HIGHEST, ID_singleVal, ID_applyVal, ID_copy, ID_paste };
583
584class MonthlyFactorDialog : public wxDialog
585{
586 wxNumericCtrl *numSV;
587 wxStaticText *lblDescription;
588 wxExtGridCtrl *grdData;
589public:
590 MonthlyFactorDialog(wxWindow *parent, const wxString &title )
591 : wxDialog( parent, wxID_ANY, title, wxDefaultPosition, wxScaleSize(400, 500), wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER )
592 {
593 lblDescription = new wxStaticText( this, wxID_ANY, "Values" );
594 grdData = new wxExtGridCtrl( this, ID_grid );
595 grdData->CreateGrid( 12, 1 );
596 grdData->DisableDragCell();
597 grdData->DisableDragColSize();
598 grdData->DisableDragRowSize();
599 grdData->DisableDragColMove();
600 grdData->DisableDragGridSize();
601
602 grdData->SetRowLabelValue(0, "Jan");
603 grdData->SetRowLabelValue(1, "Feb");
604 grdData->SetRowLabelValue(2, "Mar");
605 grdData->SetRowLabelValue(3, "Apr");
606 grdData->SetRowLabelValue(4, "May");
607 grdData->SetRowLabelValue(5, "Jun");
608 grdData->SetRowLabelValue(6, "Jul");
609 grdData->SetRowLabelValue(7, "Aug");
610 grdData->SetRowLabelValue(8, "Sep");
611 grdData->SetRowLabelValue(9, "Oct");
612 grdData->SetRowLabelValue(10, "Nov");
613 grdData->SetRowLabelValue(11, "Dec");
614 grdData->SetColLabelValue(0, "Value");
615
616 grdData->EnableEditing(true);
617 grdData->EnableCopyPaste(true);
618
619 grdData->SetRowLabelSize( wxGRID_AUTOSIZE );
620 grdData->SetColLabelSize( wxGRID_AUTOSIZE );
621
622 double d[12];
623 for (int i=0;i<12;i++) d[i] = 1;
624
625 SetData(d);
626
627 numSV = new wxNumericCtrl( this, ID_singleVal );
628
629 wxBoxSizer *tools = new wxBoxSizer( wxVERTICAL );
630 tools->Add( new wxButton( this, ID_copy, "Copy" ), 0, wxALL, 3 );
631 tools->Add( new wxButton( this, ID_paste, "Paste" ), 0, wxALL, 3 );
632 tools->Add( new wxStaticLine( this ), 0, wxALL|wxEXPAND, 2 );
633 tools->Add(new wxStaticText(this, wxID_ANY, "Enter single value:"), 0, wxALL | wxALIGN_RIGHT, 5);
634 tools->Add( numSV, 0, wxALL, 3 );
635 tools->Add( new wxButton( this, ID_applyVal, "Apply" ), 0, wxALL, 3 );
636 tools->AddStretchSpacer();
637
638 wxBoxSizer *center = new wxBoxSizer( wxHORIZONTAL );
639 center->Add( grdData, 1, wxALL|wxEXPAND, 4 );
640 center->Add( tools, 0, wxALL|wxEXPAND, 4 );
641

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.80
AddMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected