Exemplo n.º 1
0
CRegisterView::CRegisterView(wxWindow *parent, wxWindowID id)
	: wxGrid(parent, id)
{
	SetTable(new CRegTable(), true);
	SetRowLabelSize(0);
	SetColLabelSize(0);
	DisableDragRowSize();

	AutoSizeColumns();
}
Exemplo n.º 2
0
DSPRegisterView::DSPRegisterView(wxWindow *parent, wxWindowID id)
	: wxGrid(parent, id, wxDefaultPosition, wxSize(130, 120))
{
	SetTable(new CDSPRegTable(), true);
	SetRowLabelSize(0);
	SetColLabelSize(0);
	DisableDragRowSize();

	AutoSizeColumns();
}
Exemplo n.º 3
0
CWatchView::CWatchView(wxWindow* parent, wxWindowID id) : wxGrid(parent, id)
{
  m_watch_table = new CWatchTable();

  SetTable(m_watch_table, true);
  SetRowLabelSize(0);
  SetColLabelSize(0);
  DisableDragRowSize();

  Bind(wxEVT_GRID_CELL_RIGHT_CLICK, &CWatchView::OnMouseDownR, this);
  Bind(wxEVT_MENU, &CWatchView::OnPopupMenu, this);
}
Exemplo n.º 4
0
CRegisterView::CRegisterView(wxWindow* parent, wxWindowID id) : wxGrid(parent, id)
{
  m_register_table = new CRegTable();

  SetTable(m_register_table, true);
  SetRowLabelSize(0);
  SetColLabelSize(0);
  DisableDragRowSize();

  Bind(wxEVT_GRID_CELL_RIGHT_CLICK, &CRegisterView::OnMouseDownR, this);
  Bind(wxEVT_MENU, &CRegisterView::OnPopupMenu, this);

  AutoSizeColumns();
}
Exemplo n.º 5
0
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();
}
Exemplo n.º 6
0
DataGrid::DataGrid(wxWindow* parent, wxWindowID id)
: wxGrid(parent, id)
, m_data(NULL)
{
	SetColMinimalAcceptableWidth(70);
	DisableDragRowSize();
	CreateGrid(0, ColumnNum);
	SetColLabelValue(IncomeIndex, HaStrings::strIncome);
	SetColLabelValue(OutlayIndex, HaStrings::strOutlay);
	SetColLabelValue(BalanceIndex, HaStrings::strBalance);
	SetColLabelValue(DescIndex, HaStrings::strDesc);
	SetColLabelValue(CommentIndex, HaStrings::strComment);
	SetColFormatFloat(IncomeIndex, MONEY_LEN, 2);
	SetColFormatFloat(OutlayIndex, MONEY_LEN, 2);
	SetColFormatFloat(BalanceIndex, MONEY_LEN, 2);
	AppendRows(2);
	for (int i = 0; i < ColumnNum; i++) SetReadOnly(0, i);
}
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);

}
Exemplo n.º 8
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++;
  }
}
Exemplo n.º 11
0
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();
  }
}