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 );
}
/* make settings for the grid here instead in the constructor */ 
void CBOINCGridCtrl::Setup() {
	//make grid cursor invisible
	SetCellHighlightPenWidth(0);
	SetCellHighlightROPenWidth(0);
	//change default selection colours
	SetSelectionBackground(*wxLIGHT_GREY);
	SetSelectionForeground(*wxBLACK);
	//
	SetRowLabelSize(1);//hide row labels
	SetColLabelSize(20); //make header row smaller as default
	SetColLabelAlignment(wxALIGN_LEFT,wxALIGN_CENTER);
	EnableGridLines(false);
	EnableDragRowSize(false);//prevent the user from changing the row height with the mouse
	EnableDragCell(false);
	EnableEditing(false);//make the whole grid read-only
	SetDefaultCellBackgroundColour(*wxWHITE);
#ifdef __WXMAC__
	SetLabelFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
	SetDefaultCellFont(wxFont(12, wxSWISS, wxNORMAL, wxNORMAL, FALSE));
#else
	SetLabelFont(*wxNORMAL_FONT);
#endif
	this->SetScrollLineX(5);
	this->SetScrollLineY(5);
}
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);
}
示例#4
0
ctlSQLGrid::ctlSQLGrid(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
	: wxGrid(parent, id, pos, size, wxWANTS_CHARS | wxVSCROLL | wxHSCROLL)
{
	// Set cells font
	wxFont fntCells(settings->GetSQLFont());
	SetDefaultCellFont(fntCells);
	// Set labels font
	wxFont fntLabel(settings->GetSystemFont());
	fntLabel.SetWeight(wxBOLD);
	SetLabelFont(fntLabel);
	SetColLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTER);
	SetRowLabelSize(50);
	SetDefaultRowSize(fntCells.GetPointSize() * 2);
	SetColLabelSize(fntLabel.GetPointSize() * 4);
	SetDefaultCellOverflow(false);

	Connect(wxID_ANY, wxEVT_GRID_LABEL_LEFT_DCLICK, wxGridEventHandler(ctlSQLGrid::OnLabelDoubleClick));
}
GLIDebugVariableGrid::GLIDebugVariableGrid(wxWindow *parent,
                                           wxWindowID id,
                                           uint displayFlags,
                                           const wxPoint& pos,
                                           const wxSize& size,
                                           long style,
                                           const wxString& name):
wxGrid(parent, id, pos, size, style, name),
gridFlags(displayFlags),
internalCellEditCounter(0)
{
  //Create a drag target
  SetDropTarget(new GridDnDText(this));

  //Create the grid of 3 columns
  CreateGrid(0, 3, wxGrid::wxGridSelectRows);

  //Set the label values
  SetColLabelValue(NAME_COLUMN_INDEX,  wxT("Name"));
  SetColLabelValue(VALUE_COLUMN_INDEX, wxT("Value"));
  SetColLabelValue(TYPE_COLUMN_INDEX,  wxT("Type"));
  SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_TOP);
  SetColLabelSize(17);

  //Set the column sizes
  SetColSize(NAME_COLUMN_INDEX,  125);
  SetColSize(VALUE_COLUMN_INDEX, 200);
  SetColSize(TYPE_COLUMN_INDEX,  115);

  //Turn off row labels
  SetRowLabelSize(0);

  //Turn off cell overflowing
  SetDefaultCellOverflow(false);

  //Setup default colours
  SetDefaultCellBackgroundColour(*wxWHITE);
  SetDefaultCellTextColour      (*wxBLACK);
  SetGridLineColour       (gridGrey);
  SetLabelBackgroundColour(gridGrey);
  SetLabelTextColour      (*wxBLACK);
}
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();
  }
}
示例#7
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);
  }
}