CGridLocus::CGridLocus( COARlocus *pLocusEdit, wxWindow *parent, wxWindowID id, bool bReadOnly) : _CGridEdit(parent,id,bReadOnly), m_pLocusEdited(pLocusEdit) { wxSize sz; size_t nCount = m_pLocusEdited->AlleleCount(); size_t j; int nCol = nCount ? (int) nCount : 1; int nRow = nCount ? nLABELS : 1; int i; int k; CreateGrid(nRow,nCol); if(!nCount) { SetRowLabelValue(0,wxEmptyString); SetColLabelValue(0,wxEmptyString); SetReadOnly(0,0,true); SetReadOnly(0,1,true); SetReadOnly(1,0,true); SetReadOnly(1,1,true); } else { bool bAmel = m_pLocusEdited->IsAmel(); for(i = 0; i < nRow; i++) { s = _T(labels[i]); SetRowLabelValue(i,s); SetRowLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTRE); } for(j = 0; j < nCount; j++) { k = (int)j; _ImplementColumn(k,bAmel); } TransferDataToWindow(); nwxGrid::UpdateLabelSizes(this); } DisableDragRowSize(); DisableDragColSize(); SetColLabelSize(GetRowSize(0)); s.Empty(); }
CGridColorGrid::CGridColorGrid( wxWindow *parent, wxWindowID id) : wxGrid(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE | wxWANTS_CHARS) { wxFont fnStatus = CGridAnalysis::GetFontStatus(); int nRow; size_t i; const size_t N = sizeof(aROWS) / sizeof(aROWS[0]); CreateGrid((int)ROW_COUNT,1); SetRowLabelSize(1); SetColLabelSize(1); DisableDragColSize(); DisableDragRowSize(); nwxGrid::SetAllReadOnly(this,true); fnStatus.SetPointSize(GetDefaultCellFont().GetPointSize()); SetColLabelValue(0,wxEmptyString); const ROW_INFO *pRow = aROWS; for(i = 0; i < N; i++) { nRow = (int) pRow->nRow; SetRowLabelValue(nRow,wxEmptyString); SetCellValue(nRow,0,pRow->psLabel); pRow++; } SetRowLabelValue((int)ROW_ATTN,wxEmptyString); SetCellFont((int) ROW_ATTN,0,fnStatus); SetCellValue((int) ROW_ATTN,0,CGridAnalysis::g_sStatusNeedsAttention); SetCellAlignment(wxALIGN_CENTRE,(int)ROW_ATTN,0); SetRowLabelValue((int)ROW_OK,wxEmptyString); SetCellFont((int) ROW_OK,0,fnStatus); SetCellValue((int) ROW_OK,0,CGridAnalysis::g_sStatusOK); SetCellAlignment(wxALIGN_CENTRE,(int)ROW_OK,0); }
void CListView::initWithReportItems() { // DisableDragColSize(); DisableDragColMove(); DisableDragRowSize(); DisableDragGridSize(); CreateGrid(0, 2, wxGridSelectRows); SetColLabelValue(0, wxT("├ч│к")); SetColLabelValue(1, wxT("ох")); wxGridSizesInfo info; info.m_sizeDefault = 20; SetRowSizes(info); wxGridCellAttr *attrRO = new wxGridCellAttr; attrRO->SetReadOnly(); SetColAttr(0, attrRO); registerItemWindow(); }
void CModifierSeqListView::initWithReportItems() { DisableDragColSize(); DisableDragColMove(); DisableDragRowSize(); DisableDragGridSize(); CreateGrid(8, 4, wxGridSelectRows); SetColLabelValue(0, wxT("修改器ID")); SetColLabelValue(1, wxT("参数1")); SetColLabelValue(2, wxT("参数2")); SetColLabelValue(3, wxT("参数3")); wxGridCellAttr *pAttr = new wxGridCellAttr; pAttr->SetEditor(new CTextButtonEditor(wxT("编辑"))); //pAttr->SetRenderer(new CGridCellTextButtonRenderer); SetColAttr(0, pAttr); wxGridSizesInfo info; info.m_sizeDefault = 30; SetRowSizes(info); }
CGridAttrGrid::CGridAttrGrid(wxWindow *parent, wxWindowID id) : wxGrid(parent,id,wxDefaultPosition,wxDefaultSize, wxBORDER_SIMPLE | wxWANTS_CHARS) { CreateGrid((int) ROW_ATTR_COUNT,1); SetRowLabelSize(1); SetColLabelSize(1); DisableDragColSize(); DisableDragRowSize(); nwxGrid::SetAllReadOnly(this,true); SetColLabelValue(0,wxEmptyString); const ROW_INFO *pRow = aROWS_ATTR; const size_t N = sizeof(aROWS_ATTR) / sizeof(aROWS_ATTR[0]); size_t i; int nRow; for(i = 0; i < N; i++) { nRow = (int) pRow->nRow; SetRowLabelValue(nRow,wxEmptyString); SetCellValue(nRow,0,pRow->psLabel); pRow++; } }
CGridAlerts::CGridAlerts( COARmessages *pMsgEdit, wxWindow *parent, wxWindowID id, int nType, bool bReadOnly) : _CGridEdit(parent,id,bReadOnly), m_pMsgEdit(pMsgEdit), m_nChannelColumn(-1), m_nLocusColumn(-1), m_nInCellChangeEvent(0) { int bChannel = !!(nType & TYPE_CHANNEL); int bLocus = !!(nType & TYPE_LOCUS); size_t nCount = m_pMsgEdit->GetMessageCount(); if(nCount) { const wxString sDisable(_T("Enabled")); int nColCount = 2 + bChannel + bLocus; int nCol = nColCount; CreateGrid((int)nCount,nColCount); SetColLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTRE); SetColLabelValue(--nCol,_T("Alert")); SetColLabelValue(--nCol,sDisable); if(bChannel) { SetColLabelValue(--nCol,LABEL_CHANNEL); m_nChannelColumn = nCol; } if(bLocus) { SetColLabelValue(--nCol,LABEL_LOCUS); m_nLocusColumn = nCol; } SetRowLabelSize(2); for(size_t j = 0; j < nCount; j++) { nCol = nColCount; SetCellAlignment((int)j,--nCol,wxALIGN_LEFT,wxALIGN_CENTRE); SetBoolCell((int)j,--nCol); SetCellAlignment((int)j,nCol,wxALIGN_CENTRE,wxALIGN_CENTRE); if(bChannel) { SetCellAlignment((int)j,m_nChannelColumn,wxALIGN_CENTRE,wxALIGN_CENTRE); SetReadOnly((int)j,m_nChannelColumn,true); } if(bLocus) { SetCellAlignment((int)j,m_nLocusColumn,wxALIGN_LEFT,wxALIGN_CENTRE); SetReadOnly((int)j,m_nLocusColumn,true); } SetRowLabelValue((int)j,wxEmptyString); } TransferDataToWindow(); SetColLabelSize(GetRowSize(0)); } else { CreateGrid(1,1); nwxGrid::SetMessageGrid(this,_T("There are no " COAR_NOTICE_DISPLAY)); } AutoSizeColumns(); DisableDragRowSize(); if(bReadOnly) { DisableDragColSize(); } }