Exemplo n.º 1
0
void CGridLabThresholds::DisableCell(int nRow, int nCol)
{
  SetReadOnly(nRow,nCol,true);
  SetCellBackgroundColour(nRow,nCol,
    GetGridLineColour());
  SetCellValue(wxEmptyString,nRow,nCol);
}
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();
}
Exemplo n.º 3
0
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();
}
Exemplo n.º 4
0
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();
}