LogMessagesViewer::LogMessagesViewer( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxGrid( parent, id, pos, size, style, name ), _timer( this ) { // grid CreateGrid( 0, 4 ); EnableEditing( false ); EnableGridLines( false ); EnableDragGridSize( false ); SetMargins( 0, 0 ); // columns //EnableDragColMove( false ); EnableDragColSize( true ); SetColLabelSize( 20 ); SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); // rows EnableDragRowSize( true ); SetRowLabelSize( 40 ); SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); // label appearance SetColLabelValue( 0, _T( "description" ) ); SetColLabelValue( 1, _T( "source" ) ); SetColLabelValue( 2, _T( "line" ) ); SetColLabelValue( 3, _T( "clock" ) ); // cell defaults SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); coca::getLogger().addHandler( *this ); _timer.Start( 200 ); }
void CGridLabThresholds::_CreateGrid(int nRows, int nCols) { int nPrevCols = 0; int nPrevRows = 0; int nCol; if(!m_bCreated) { m_bCreated = true; CreateGrid(nRows,nCols); SetRowLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTRE); EnableDragColSize(false); EnableDragRowSize(false); SetDefaultCellAlignment(wxALIGN_RIGHT,wxALIGN_CENTRE); } else { nPrevRows = GetNumberRows(); nPrevCols = GetNumberCols(); nwxGrid::SetRowColCount(this,nRows,nCols); } for(nCol = nPrevCols; nCol < nCols; nCol++) { // set alignment for Channel row SetCellAlignment(0,nCol,wxALIGN_CENTRE, wxALIGN_CENTRE); } }
CGridAnalysis::CGridAnalysis(wxWindow *pParent) : wxGrid(pParent,IDgrid), m_bgBold(255,255,160), m_bgNormal(255,255,255), m_bgRowHasAlert(255,255,218), m_fgBold(192,0,0), m_fgNormal(0,0,0), m_pDC(NULL), m_nLabelSize(0), m_nLabelType(-1), m_nXScroll(0), m_nYScroll(0), m_nIDmenuSort(IDmenuSortFileName) { CreateGrid(1,1); SetRowLabelValue(0,wxEmptyString); SetColLabelValue(0,wxEmptyString); SetReadOnly(0,0,true); SetRowLabelAlignment(wxALIGN_LEFT,wxALIGN_CENTRE); m_fontNormal = GetDefaultCellFont(); m_fontItalic = m_fontNormal; m_fontBold = m_fontNormal; m_fontBold.SetWeight(wxFONTWEIGHT_BOLD); m_fontBoldItalic = m_fontBold; m_fontBoldItalic.SetStyle(wxFONTSTYLE_ITALIC); m_fontItalic.SetStyle(wxFONTSTYLE_ITALIC); #if USE_WINGDINGS g_fontStatus.SetPointSize(m_fontNormal.GetPointSize()); #else // X11 if ever implemented g_fontStatus = m_fontBold; #endif }
CGridSampleLimits::CGridSampleLimits(wxWindow *parent, wxWindowID id) : _CGridEdit(parent,id), m_pValidatePct(NULL), m_pData(NULL), m_pMessageBook(NULL) //,m_bReadOnly(false) { wxString PEAKS(_T("peaks")); CreateGrid(ROW_MESSAGE_BOOK_OFFSET,2); EnableDragColSize(false); EnableDragRowSize(false); EnableScrolling(false,true); SetRowLabelValue(ROW_PULLUP,_T("Max. No. of pullups peaks per sample")); SetCellValue(ROW_PULLUP,1,PEAKS); SetRowLabelValue(ROW_STUTTER,_T("Max. No. of stutter peaks per sample")); SetCellValue(ROW_STUTTER,1,PEAKS); SetRowLabelValue(ROW_ADENYLATION,_T("Max. No. of adenylation peaks per sample")); SetCellValue(ROW_ADENYLATION,1,PEAKS); SetRowLabelValue(ROW_OFF_LADDER,_T("Max. off-ladder alleles per sample:")); SetCellValue(ROW_OFF_LADDER,1,PEAKS); SetRowLabelValue(ROW_RESIDUAL,_T("Max. residual for allele (<0.5 bp):")); SetCellValue(ROW_RESIDUAL,1,_T("Sample/Ladder BP alignment")); SetCellEditor(ROW_RESIDUAL,0,new wxGridCellFloatEditor(-1,4)); SetDefaultCellValidator(new nwxGridCellUIntRangeValidator(0,1000000,true)); SetCellValidator( new nwxGridCellDoubleRangeValidator(0.0,0.5,true), ROW_RESIDUAL,0); SetRowLabelValue(ROW_EXCESSIVE_RESIDUAL,_T("Max. No. of peaks with excessive residual:")); SetCellValue(ROW_EXCESSIVE_RESIDUAL,1,PEAKS); SetRowLabelValue(ROW_RFU_INCOMPLETE_SAMPLE,_T("Incomplete profile threshold for Reamp More/Reamp Less:")); SetCellValue(ROW_RFU_INCOMPLETE_SAMPLE,1,_T("RFU")); SetRowLabelValue(ROW_MIN_BPS_ARTIFACTS,_T("Ignore artifacts smaller than:")); SetCellValue(ROW_MIN_BPS_ARTIFACTS,1,_T("bps")); m_clrBackground = GetLabelBackgroundColour(); wxFont fnLabel = GetLabelFont(); for(int nRow = 0; nRow < ROW_MESSAGE_BOOK_OFFSET; nRow++) { SetCellBackgroundColour(nRow,1,m_clrBackground); SetReadOnly(nRow,1,true); SetCellFont(nRow,1,fnLabel); SetCellAlignment(nRow,0,wxALIGN_RIGHT, wxALIGN_CENTRE); } SetDefaultEditor(new wxGridCellFloatEditor(1,0)); SetColLabelValue(0,_T("Value")); SetColLabelValue(1,_T("Units")); SetRowLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTRE); SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); }
MyGrid::MyGrid(wxNotebook * parent) : wxGrid(parent, wxID_ANY) { CreateGrid(30, 30); SetRowLabelSize(50); SetColLabelSize(25); SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); SetLabelFont(wxFont(9, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD)); for (int i = 0; i < 30; i++) { this->SetRowSize(i, 25); } }
//--------------------------------------------------------- CActive_Attributes_Control::CActive_Attributes_Control(wxWindow *pParent) : wxGrid(pParent, -1, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS) { m_pTable = new CSG_Table; m_bEditing = false; SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); Set_Row_Labeling(false); CreateGrid(0, m_pTable->Get_Field_Count()); Update_Table(); }
//--------------------------------------------------------- void CVIEW_Table_Control::Set_Labeling(bool bOn) { if( bOn && m_Field_Offset == 0 ) { m_Field_Offset = 1; SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); } else if( !bOn && m_Field_Offset != 0 ) { m_Field_Offset = 0; SetRowLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); Freeze(); for(int i=0; i<GetRows(); i++) { SetRowLabelValue(i, wxString::Format("%d", 1 + i)); } Thaw(); } }
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(); }
CGridRFULimits::CGridRFULimits(wxWindow *parent, wxWindowID id) : nwxGrid(parent,id), m_pData(NULL) { int i; int j; CreateGrid(ROW_COUNT,COL_COUNT); SetDefaultCellValidator( new nwxGridCellUIntRangeValidator( mainApp::RFU_MIN_ENTER,mainApp::RFU_MAX_ENTER,true)); EnableDragColSize(false); EnableDragRowSize(false); SetDefaultCellAlignment(wxALIGN_RIGHT,wxALIGN_CENTRE); for(i = 0; i < ROW_COUNT; i++) { for(j = 0; j < COL_COUNT; j++) { SetCellValue(i,j,_T("00000000")); // used for size if(_DisabledCell(i,j)) { SetCellBackgroundColour(i,j,GetGridLineColour()); } } } SetDefaultEditor(new wxGridCellFloatEditor(1,0)); SetColLabelValue(COL_SAMPLE,_T("Sample")); SetColLabelValue(COL_LADDER,_T("Ladder")); SetColLabelValue(COL_ILS,_T(" ILS ")); SetRowLabelValue(ROW_RFU_MIN,_T("Analysis Threshold (RFU)")); SetRowLabelValue(ROW_RFU_INTERLOCUS,_T("Min. Interlocus RFU")); SetRowLabelValue(ROW_RFU_MAX,_T("Max. RFU")); SetRowLabelValue(ROW_DETECTION,_T("Detection Threshold (RFU)")); SetRowLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTRE); SetMargins(0,0); nwxGrid::UpdateLabelSizes(this); AutoSize(); _DisableUnused(); }
void CGridRFULimits::_Build() { wxFont fontChannel = GetDefaultCellFont(); wxFont fontDefault = fontChannel; fontChannel.SetWeight(wxFONTWEIGHT_BOLD); const CChannelColors *pChannelColors = NULL; int nCurrentColCount = GetNumberCols(); int i; int j; if(nCurrentColCount < m_nCOL_COUNT) { InsertCols(m_nCOL_CHANNEL_START, m_nCOL_COUNT - nCurrentColCount); _UpdateReadOnly(); } else if(nCurrentColCount > m_nCOL_COUNT) { DeleteCols(m_nCOL_CHANNEL_START,nCurrentColCount - m_nCOL_COUNT); } InitValidators(); SetDefaultCellValidator( new nwxGridCellUIntRangeValidator( mainApp::RFU_MIN_ENTER,mainApp::RFU_MAX_ENTER,true)); nwxGridCellUIntRangeValidator *pVreqd = new nwxGridCellUIntRangeValidator( mainApp::RFU_MIN_ENTER,mainApp::RFU_MAX_ENTER,false); // does not allow empty SetCellValidator(pVreqd,ROW_RFU_MIN,m_nCOL_SAMPLE); SetCellValidator(pVreqd,ROW_RFU_MIN,m_nCOL_ILS); SetCellValidator(pVreqd,ROW_RFU_MIN,m_nCOL_LADDER); EnableDragColSize(false); EnableDragRowSize(false); SetDefaultCellAlignment(wxALIGN_RIGHT,wxALIGN_CENTRE); for(i = 0; i < ROW_COUNT; i++) { for(j = 0; j < m_nCOL_COUNT; j++) { SetCellValue(i,j,"00000000"); // used for size if(_DisabledCell(i,j)) { SetCellBackgroundColour(i,j,GetGridLineColour()); } } } SetDefaultEditor(new wxGridCellFloatEditor(1,0)); SetColLabelValue(m_nCOL_SAMPLE,"Sample"); SetColLabelValue(m_nCOL_LADDER,"Ladder"); SetColLabelValue(m_nCOL_ILS," ILS "); SetRowLabelValue(ROW_RFU_MIN,"Analysis Threshold (RFU)"); SetRowLabelValue(ROW_RFU_INTERLOCUS,"Min. Interlocus RFU"); SetRowLabelValue(ROW_RFU_MAX,"Max. RFU"); SetRowLabelValue(ROW_DETECTION,"Detection Threshold (RFU)"); SetRowLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTRE); SetMargins(0,0); ChannelNumberIterator itrChannelCol; int nCol; const wxChar *psDye = NULL; wxString sLabel; for(itrChannelCol = m_vnChannelNumbers.begin(), nCol = m_nCOL_CHANNEL_START; itrChannelCol != m_vnChannelNumbers.end(); ++itrChannelCol, ++nCol) { if(m_pKitColors != NULL) { pChannelColors = m_pKitColors->GetColorChannel(*itrChannelCol); psDye = (pChannelColors == NULL) ? NULL : (const wxChar *) pChannelColors->GetDyeName(); } CGridLocusColumns::FORMAT_CHANNEL_DYE(&sLabel,*itrChannelCol,psDye); SetColLabelValue(nCol,sLabel); if(pChannelColors != NULL) { _SetupChannelColumn(nCol,pChannelColors->GetColorAnalyzed(),fontChannel); } else { _SetupDefaultChannelColumn(nCol); } } nwxGrid::UpdateLabelSizes(this); AutoSize(); _DisableUnused(); }
void CGridRFURunBase::_Build() // called from _SetupKit(); { nwxLabelGridBatch x(this); ClearAll(); // nwxGrid.h nwxLabelGrid::ClearAll(); wxFont fontChannel = GetDefaultCellFont(); wxFont fontLabel = fontChannel; fontChannel.SetWeight(wxFONTWEIGHT_BOLD); fontLabel.SetStyle(wxFONTSTYLE_ITALIC); SetDefaultLabelFont(fontLabel); SetDefaultLabelTextColour(wxColour(192, 192, 192)); const CChannelColors *pChannelColors = NULL; int nCurrentRowCount = GetNumberRows(); int i; int j; if(nCurrentRowCount < m_nROW_COUNT) { InsertRows(m_nROW_CHANNEL_START, m_nROW_COUNT - nCurrentRowCount); _UpdateReadOnly(); } else if(nCurrentRowCount > m_nROW_COUNT) { DeleteRows(m_nROW_CHANNEL_START,nCurrentRowCount - m_nROW_COUNT); } SetDefaultCellValidator( new nwxGridCellUIntRangeValidator( mainApp::RFU_MIN_ENTER,mainApp::RFU_MAX_ENTER,true)); EnableDragColSize(false); EnableDragRowSize(false); SetDefaultCellAlignment(wxALIGN_RIGHT,wxALIGN_CENTRE); for(i = 0; i < m_nROW_COUNT; i++) { for(j = 0; j < COL_COUNT; j++) { SetCellValue(i,j,"00000000"); // used for size if(_DisabledCell(i,j)) { SetCellBackgroundColour(i,j,GetGridLineColour()); } } } SetDefaultEditor(new wxGridCellFloatEditor(1,0)); SetRowLabelValue(m_nROW_SAMPLE,"Sample"); SetRowLabelValue(m_nROW_LADDER,"Ladder"); SetRowLabelValue(m_nROW_ILS," ILS "); SetColLabelValue(COL_ANALYSIS,"Analysis"); SetColLabelValue(COL_DETECTION,"Detection"); SetColLabelValue(COL_INTERLOCUS,"Interlocus"); SetRowLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTRE); SetMargins(0,0); ChannelNumberIterator itrChannelCol; int nRow; const wxChar *psDye = NULL; wxString sLabel; for(itrChannelCol = m_vnChannelNumbers.begin(), nRow = m_nROW_CHANNEL_START; itrChannelCol != m_vnChannelNumbers.end(); ++itrChannelCol, ++nRow) { if(m_pKitColors != NULL) { pChannelColors = m_pKitColors->GetColorChannel(*itrChannelCol); psDye = (pChannelColors == NULL) ? NULL : (const wxChar *) pChannelColors->GetDyeName(); } CGridLocusColumns::FORMAT_CHANNEL_DYE(&sLabel,*itrChannelCol,psDye); SetRowLabelValue(nRow,sLabel); if(pChannelColors != NULL) { _SetupChannelRow(nRow,pChannelColors->GetColorAnalyzed(),fontChannel); } else { _SetupDefaultChannelRow(nRow); } } nwxGrid::UpdateLabelSizes(this); AutoSize(); _DisableUnused(); }
CGridCMF::CGridCMF( CDialogCMF *parent, wxWindowID id, COARfile *pFile, COARsampleSort *pSort) : _CGridEdit(parent,id,false), m_pParent(parent), m_pFile(pFile), m_pSort(pSort) { wxString s; vector<int> vnSample; COARsample *pSample; size_t n = m_pFile->GetSampleCount(); size_t i; int j = 0; m_vpSample.reserve(n); vnSample.reserve(n); // a little overkill because of ladders and controls for(i = 0; i < n; i++) { j++; pSample = m_pSort->GetSample(i); if(pSample->IsSampleType() && !pSample->IsDisabled()) { m_vpSample.push_back(pSample); vnSample.push_back(j); } } n = m_vpSample.size(); if(!n) { CreateGrid(1,1); SetCellValue(0,0,"There are no samples"); SetReadOnly(0,0,true); AutoSize(); } else { int ii; CreateGrid((int)n, (int)COLUMN_COUNT); SetRowLabelAlignment(wxALIGN_LEFT,wxALIGN_CENTRE); for(i = 0; i < n; i++) { ii = (int)i; pSample = m_vpSample.at(i); s = CGridAnalysis::FormatRowLabel( vnSample.at(i), (int)n, pSample->GetName()); SetRowLabelValue((int)i,s); SetBoolCell(ii,EXCLUDE); SetBoolCell(ii,PARTIAL); SetCellEditor(ii,SPECIMEN_TYPE,_CreateTypeEditor()); SetReadOnly(ii,EMPTY_LOCI,true); } for(i = 0; i < (size_t) COLUMN_COUNT; i++) { s = COL_LABELS[i]; SetColLabelValue((int)i,s); } SetColLabelAlignment(wxALIGN_LEFT,wxALIGN_CENTRE); } }