예제 #1
0
void CGridLabThresholds::_SetColCount(int nCols)
{
  int nOldCount = m_bCreated ? GetNumberCols() : 0;
  int nCol;
  int nRow;
  _CreateGrid(m_nRows,nCols);
  if(nOldCount <= 1)
  {
    nOldCount = 0;
  }
  else
  {
    // ummerge all cells in first row
    for(nCol = 0; nCol < nOldCount; nCol++)
    {
      SetCellSize(0,nCol,1,1);
    }
  }

  // set Renderer and Editor
  for(nRow = 1; nRow < m_nRows; nRow++)
  {
    for(nCol = nOldCount; nCol < nCols; nCol++)
    {
      SetCellEditor(nRow,nCol,new wxGridCellFloatEditor(-1,4));
      SetReadOnly(nRow,nCol,m_bReadOnly);
    }
  }
}
예제 #2
0
bool CGridLabThresholdsSample::SetData(CLabThresholds *pData,
    const wxString &sKitName)
{
  const wxChar * const psLabels[] = 
  {
    FRACTION_MAX_PEAK,
    PULLUP_FRACTIONAL_FILTER,
    STUTTER_THRESHOLD,
    PLUS_STUTTER_THRESHOLD,
    ADENYLATION_THRESHOLD,
    wxS("Min. heterozygote balance (0 - 1.0) "),
    wxS("Min. homozygote threshold (RFU) "),
    NULL
  };
  bool bOK = _SetData(pData,sKitName,psLabels);
  if(bOK)
  {
    int nCols = GetNumberCols();
    int i;
    for(i = 0; i < nCols; i++)
    {
      SetCellEditor(
        ROW_MIN_BOUND_HOMOZYGOTE,i,new wxGridCellFloatEditor(-1,0));
    }
  }
  return bOK;
}
예제 #3
0
int wxPropertyList::AddPropertyToGrid(wxPropertyItem *pItem, int order)
{
    int row = 0;
    if(order == 1)
        InsertRows(0,1);
    else 
    {
        AppendRows(1);    
        row = GetNumberRows() - 1;
    }
    
    // initialise the type of renderer
    if(pItem->GetItemType() == wxPropertyList::CHECKBOX)
    {
        SetCellRenderer(row, 1, new wxGridCellBoolRenderer);
        SetCellEditor(row, 1, new wxGridCellBoolEditor);
    }

#ifdef __LINUX__
    // fix to make sure scrollbars are drawn properly
    wxGrid::AdjustScrollbars();
#endif
    
    // the property display is read only
    UpdatePropertyItem(pItem, row);
    return row;
}
예제 #4
0
void CGridLocus::_ImplementColumn(int nCol,bool bAmel)
{
    int nStart = nCol;
    int nStop = nCol;
    int i;
    int k;
    int n = GetNumberCols();
    if(nCol >= n)
    {
        AppendCols(nCol - n + 1);
        nStart = n;
    }
    for(k = nStart; k <= nStop; ++k)
    {
        s.Printf("Peak %d",k+1);
        SetColLabelValue(k,s);
        for(i = ROW_RO_FIRST; i <= ROW_RO_LAST; i++)
        {
            DisableEdit(i,k);
        }
        SetBoolCell(ROW_HOMOZYGOUS,k);
        SetBoolCell(ROW_OFF_LADDER,k);
        SetBoolCell(ROW_DISABLE,k);

        SetCellEditor(ROW_BPS,k,new wxGridCellFloatEditor(12,7));
        SetCellRenderer(ROW_BPS,k,new wxGridCellFloatRenderer(12,7));
        if(!bAmel)
        {
            wxGridCellFloatEditor *pfe1(new wxGridCellFloatEditor(5,1));
            wxGridCellFloatRenderer *pfr1(new wxGridCellFloatRenderer(5,1));
            SetCellEditor(ROW_ALLELE,k,pfe1);
            SetCellRenderer(ROW_ALLELE,k,pfr1);
        }
        else
        {
            wxGridCellTextEditor *pe(new wxGridCellTextEditor);
            pe->SetParameters(_T("1"));
            SetCellEditor(ROW_ALLELE,k,pe);
        }

        SetCellAlignment(wxALIGN_RIGHT,  ROW_ALLELE,k);
        SetCellAlignment(wxALIGN_RIGHT,  ROW_BPS,k);
        SetCellAlignment(wxALIGN_RIGHT,  ROW_RFU,k);
        SetCellAlignment(wxALIGN_RIGHT,  ROW_TIME,k);
        SetCellAlignment(wxALIGN_RIGHT,  ROW_PEAK_AREA,k);
    }
}
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);
}
예제 #6
0
void DataGrid::setRow(int row)
{
	SetCellAlignment(wxALIGN_RIGHT, row, IncomeIndex);
	SetCellAlignment(wxALIGN_RIGHT, row, OutlayIndex);
	SetCellAlignment(wxALIGN_RIGHT, row, BalanceIndex);
	SetReadOnly(row, IncomeIndex, false);
	SetReadOnly(row, OutlayIndex, false);
	SetReadOnly(row, DescIndex, false);
	SetReadOnly(row, CommentIndex, false);
	SetReadOnly(row, BalanceIndex);
	SetCellEditor(row, IncomeIndex, new wxGridCellFloatEditor(MONEY_LEN, 2));
	SetCellEditor(row, OutlayIndex, new wxGridCellFloatEditor(MONEY_LEN, 2));
	clearRow(row);
	for (int i = 0; i < ColumnNum; i++) {
		SetCellFont(row, i, GetDefaultCellFont());
		SetCellTextColour(row, i, GetDefaultCellTextColour());
	}
}
void CatheterGrid::formatDefaultRow(int row) {
    if (row >= GetNumberRows())
        return;
    const wxString direction_opts[] = { DIRNEGSTR, DIRPOSSTR };

    wxString channel_opts[NCHANNELS + 1];
    channel_opts[0] = GLOBALSTR;
    for (int i = 1; i <= NCHANNELS; i++)
        channel_opts[i] = wxString::Format("%d", i);

    SetCellEditor(row, CHANNEL_COL, new wxGridCellChoiceEditor(WXSIZEOF(channel_opts), (const wxString*)channel_opts));
    SetCellEditor(row, CURRENT_COL, new wxGridCellFloatEditor(3, 3));
    SetCellRenderer(row, CURRENT_COL, new wxGridCellFloatRenderer());
    SetCellEditor(row, DIRECTION_COL, new wxGridCellChoiceEditor(WXSIZEOF(direction_opts), direction_opts));
    SetCellEditor(row, DELAY_COL, new wxGridCellNumberEditor(0, MAX_DELAY));
    SetCellRenderer(row, DELAY_COL, new wxGridCellNumberRenderer());
	SetCellValue(row, DELAY_COL, wxT("0"));
    setRowReadOnly(row, true);
}
void GLIDebugVariableGrid::SetTypeSelectionBox(int row, int column, GLenum GLSLType)
{
  //Find the index to set
  uint assignIndex =0;
  for(uint i=0; i<WXSIZEOF(GLSLTypesEnum); i++)
  {
    //If the type is found, return the string
    if(GLSLTypesEnum[i].GLSLType == GLSLType)
    {
      assignIndex = i;
    }
  }

  //Add a combo box to select among the different GLSL types
  SetCellEditor(row, column, new wxGridCellChoiceEditor(WXSIZEOF(GLSLTypesStr), GLSLTypesStr));
  SetCellValue(row, column, GLSLTypesStr[assignIndex]);
}
예제 #9
0
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);
  }
}