• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetNumberCols函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetNumberCols函数的典型用法代码示例。如果您正苦于以下问题:C++ GetNumberCols函数的具体用法?C++ GetNumberCols怎么用?C++ GetNumberCols使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetNumberCols函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetClientSize

int wxDDGrid::StretchIt()
{
	int new_width = GetClientSize().GetWidth() - GetRowLabelSize() - 10;
	int fixedWidth = 0, numStretches = 0, numStretched = 0;

	for( int i = 0; i < GetNumberCols(); ++i )
	{
		if( sf[i] == 0 ) fixedWidth += GetColSize(i);
		else if( sf[i] < 0 )
		{
			AutoSizeColumn(i, false);
			fixedWidth += GetColSize(i);
		}
		else
		{
			numStretches += sf[i];
			numStretched += 1;
		}
	}

	// Now either we have space for normal layout or resort to wxGrid default behaviour
	if( numStretched && ((fixedWidth + numStretched * 10) < new_width) )
	{
		int stretchSpace = (new_width - fixedWidth) / numStretches;
		//BeginBatch();
		int i, max = GetNumberCols();
		for(i = 0; i < max; ++i )
			if( sf[i] > 0 )
				SetColSize(i, stretchSpace * sf[i]);
		//EndBatch();
		return 1;
	}
	return 0;
}
开发者ID:AnnaSkawinska,项目名称:pgadmin3,代码行数:34,代码来源:ddGenerationWizard.cpp


示例2: return

//---------------------------------------------------------
bool CVIEW_Table_Control::Update_Table(void)
{
	if( GetBatchCount() > 0 )
	{
		return( false );
	}

	BeginBatch();

	//-----------------------------------------------------
	int	Difference	= (m_pTable->Get_Field_Count() - m_Field_Offset) - GetNumberCols();

	if( Difference > 0 )
	{
		AppendCols(Difference);
	}
	else if( (Difference = -Difference < GetNumberCols() ? -Difference : GetNumberCols()) > 0 )
	{	// here is (or was!?) a memory leak - solution: use own wxGridTableBase derived grid table class
		DeleteCols(0, Difference);
	}

	//-----------------------------------------------------
	for(int iCol=0, iField=m_Field_Offset; iField<m_pTable->Get_Field_Count(); iCol++, iField++)
	{
		SetColLabelValue(iCol, m_pTable->Get_Field_Name(iField));

		switch( m_pTable->Get_Field_Type(iField) )
		{
		default:
		case SG_DATATYPE_Byte:
		case SG_DATATYPE_Char:
		case SG_DATATYPE_String:
		case SG_DATATYPE_Date:
		case SG_DATATYPE_Binary:
			SetColFormatCustom(iCol, wxGRID_VALUE_STRING);
			break;

		case SG_DATATYPE_Bit:
		case SG_DATATYPE_Word:
		case SG_DATATYPE_Short:
		case SG_DATATYPE_DWord:
		case SG_DATATYPE_Int:
		case SG_DATATYPE_ULong:
		case SG_DATATYPE_Long:
		case SG_DATATYPE_Color:
			SetColFormatNumber(iCol);
			break;

		case SG_DATATYPE_Float:
		case SG_DATATYPE_Double:
			SetColFormatFloat(iCol);
			break;
		}
	}

	//-----------------------------------------------------
	EndBatch();

	return( _Set_Records() );
}
开发者ID:sinozope,项目名称:SAGA-GIS-git-mirror,代码行数:61,代码来源:view_table_control.cpp


示例3: SetMultiSelectMode

void CDDBaseGrid::SelectRow(long row)
{
   if (row >= 0 && row < GetNumberRows() && GetNumberCols() > 0)
   {
      SetMultiSelectMode(TRUE);
      GotoRow(row);
      SelectRange(0, row, (GetNumberCols() - 1), row);
   }
}
开发者ID:mpatwa,项目名称:CCEtoODB_Translator,代码行数:9,代码来源:UltimateGrid.cpp


示例4: PQntuples

void ctlResultGrid::fillGrid( PGresult * result )
{
    int    rowCount = PQntuples( result );
    int    colCount = PQnfields( result );

    // If this PGresult represents a non-query command 
    // (like an INSERT), there won't be any columns in 
    // the result set - just return

    if( colCount == 0 )
        return;

    // Disable repaints to we don't flicker too much

    BeginBatch();

    // Clear out the old results (if any) and resize 
    // grid to match the result set

    if( GetNumberRows())
        DeleteRows( 0, GetNumberRows());
    if( GetNumberCols())
        DeleteCols( 0, GetNumberCols());

    AppendRows( rowCount );
    AppendCols( colCount );

    EnableEditing( false );

    // Copy the column names from the result set into the column headers

    for( int col = 0; col < colCount; ++col )
        SetColLabelValue( col, wxString( PQfname( result, col ), wxConvUTF8 ));

    // Now copy each value from the result set into the grid

    for( int row = 0; row < rowCount; ++row )
    {
        for( int col = 0; col < colCount; ++col )
        {
            if( PQgetisnull( result, row, col ))
                SetCellValue( row, col, wxT( "" ));
            else
                SetCellValue( row, col, wxString( PQgetvalue( result, row, col ), wxConvUTF8 ));
        }
    }

    // Resize each column to fit its content

    AutoSizeColumns( false );

    // Enable repaints

    EndBatch();
}
开发者ID:xiul,项目名称:Database-Designer-for-pgAdmin,代码行数:55,代码来源:ctlResultGrid.cpp


示例5: GetNumberCols

bool CGridLabThresholds::_SetData(
  CLabThresholds *pData, 
  const wxString &sKitName,
  const wxChar * const *psLabels)
{
  m_pData = pData;
  bool bOK = CGridLocusColumns::SetupKit(
    this,sKitName,true,m_bILS,true,true);

      // set row labels
  if(bOK)
  {
    const wxChar * const *pRowLabel;
    int nColCount = GetNumberCols();
    int j = 1;
    for(pRowLabel = psLabels; (*pRowLabel) != NULL; pRowLabel++)
    {
      SetRowLabelValue(j++,*pRowLabel);
    }
    // put junk in row 1 to set cell width
    _CreateGrid(m_nRows,nColCount);
    for(j = 0; j < nColCount ; j++)
    {
      SetCellValue(1,j,"0000000000");  // set cell width
    }
    nwxGrid::UpdateLabelSizes(this);
    AutoSize();
  }
  return bOK;
}
开发者ID:ImAWolf,项目名称:osiris,代码行数:30,代码来源:CGridLabThresholds.cpp


示例6: GetNumberCols

void CLayerTypeGrid::OnDClicked(int col,long row, RECT *rect,POINT *point,BOOL processed)
{
   int lastColIndx = GetNumberCols() - 1;
   CString cellText(QuickGetText(lastColIndx, row));
   int layerType = atoi(cellText);

   // Edit color if a layerType row (not a group name row)
   // and double click was not in the layer type column.
   if (layerType > -1 && col > 0)
   {
      CUGCell cell;
      GetCell(col, row, &cell); 

      COLORREF color = cell.GetBackColor(); // current color

	   CPersistantColorDialog dialog(color);
	   if (dialog.DoModal() == IDOK)
      {
	      color = dialog.GetColor();
         cell.SetBackColor(color);
         SetCell(col, row, &cell);
         RedrawAll();
      }
   }
}
开发者ID:mpatwa,项目名称:CCEtoODB_Translator,代码行数:25,代码来源:LyrType.cpp


示例7: GetNumberRows

void CGridAlleleBase::CheckRowCount()
{
  wxString s;
  int nRows = GetNumberRows();
  int nCols = GetNumberCols();
  int nStart = nRows - 2;
  int nCol;
  int nRow;

  if(nStart < 0)
  {
    nStart = 0;
  }
  for(nRow = nStart; nRow < nRows; nRow++)
  {
    for(nCol = 0; nCol < nCols; nCol++)
    {
      s = GetCellValue(nRow,nCol);
      nwxString::Trim(&s);
      if(s.Len())
      {
        nwxGrid::SetRowCount(nRows + 4);
        nCol = nCols;  // loop exit
        nRow = nRows;
      }
    }
  }
}
开发者ID:HelloWilliam,项目名称:osiris,代码行数:28,代码来源:CGridAllele.cpp


示例8: wxS

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;
}
开发者ID:ImAWolf,项目名称:osiris,代码行数:27,代码来源:CGridLabThresholds.cpp


示例9: GetClientSize

void ctPropertyEditorGrid::OnSize(wxSizeEvent& event)
{
    if (m_stretchableColumn != -1)
    {
        // This window's client size = the internal window's
        // client size if it has no borders
        wxSize sz = GetClientSize();

        int totalSize = 0;
        int i;
        for (i = 0; i < GetNumberCols(); i ++)
        {
            if (i != m_stretchableColumn)
            {
                totalSize += GetColSize(i);
            }
        }

        // Allow for grid lines
        totalSize += 1;

        int stretchSize = wxMax(5, sz.x - totalSize);
        SetColSize(m_stretchableColumn, stretchSize);
    }

    event.Skip();
}
开发者ID:Duion,项目名称:Torsion,代码行数:27,代码来源:propeditor.cpp


示例10: GetCellValue

const std::string wex::grid::get_selected_cells_value() const
{
  // This does not work, only filled in for singly selected cells.
  // wxGridCellCoordsArray cells = GetSelectedCells();
  wxString text;

  for (int i = 0; i < GetNumberRows(); i++)
  {
    bool value_added = false;

    for (int j = 0; j < GetNumberCols(); j++)
    {
      if (IsInSelection(i, j))
      {
        if (value_added)
        {
          text << "\t";
        }

        text << GetCellValue(i, j);

        value_added = true;
      }
    }

    if (value_added)
    {
      text << "\n";
    }
  }

  return text;
}
开发者ID:antonvw,项目名称:wxExtension,代码行数:33,代码来源:grid.cpp


示例11: SetColSize

void ctlSQLGrid::AutoSizeColumn(int col, bool setAsMin, bool doLimit)
{
	ColKeySizeHashMap::iterator it = colSizes.find(GetColKeyValue(col));
	if (it != colSizes.end()) // Restore user-specified size
		SetColSize(col, it->second);
	else
		wxGrid::AutoSizeColumn(col, setAsMin);

	if (doLimit)
	{
		int newSize, oldSize;
		int maxSize, totalSize = 0, availSize;

		oldSize = GetColSize(col);
		availSize = GetClientSize().GetWidth() - GetRowLabelSize();
		maxSize = availSize / 2;
		for (int i = 0 ; i < GetNumberCols() ; i++)
			totalSize += GetColSize(i);

		if (oldSize > maxSize && totalSize > availSize)
		{
			totalSize -= oldSize;
			/* Shrink wide column to maxSize.
			 * If the rest of the columns are short, make sure to use all the remaining space,
			 *   but no more than oldSize (which is enough according to AutoSizeColumns())
			 */
			newSize = wxMin(oldSize, wxMax(maxSize, availSize - totalSize));
			SetColSize(col, newSize);
		}
	}
}
开发者ID:SokilV,项目名称:pgadmin3,代码行数:31,代码来源:ctlSQLGrid.cpp


示例12: GetLabelFont

void ctlSQLGrid::OnMouseWheel(wxMouseEvent &event)
{
	if (event.ControlDown() || event.CmdDown())
	{
		wxFont fontlabel = GetLabelFont();
		wxFont fontcells = GetDefaultCellFont();
		if (event.GetWheelRotation() > 0)
		{
			fontlabel.SetPointSize(fontlabel.GetPointSize() - 1);
			fontcells.SetPointSize(fontcells.GetPointSize() - 1);
		}
		else
		{
			fontlabel.SetPointSize(fontlabel.GetPointSize() + 1);
			fontcells.SetPointSize(fontcells.GetPointSize() + 1);
		}
		SetLabelFont(fontlabel);
		SetDefaultCellFont(fontcells);
		SetColLabelSize(fontlabel.GetPointSize() * 4);
		SetDefaultRowSize(fontcells.GetPointSize() * 2);
		for (int index = 0; index < GetNumberCols(); index++)
			SetColSize(index, -1);
		ForceRefresh();
	}
	else
		event.Skip();
}
开发者ID:SokilV,项目名称:pgadmin3,代码行数:27,代码来源:ctlSQLGrid.cpp


示例13: tkz

void wex::grid::set_cells_value(
  const wxGridCellCoords& start_coords, 
  const std::string& data)
{
  tokenizer tkz(data, "\n");

  auto start_at_row = start_coords.GetRow();

  while (tkz.has_more_tokens())
  {
    const auto line(tkz.get_next_token());

    tokenizer tkz(line, "\t");

    auto next_col = start_coords.GetCol();

    while (tkz.has_more_tokens() && next_col < GetNumberCols())
    {
      const std::string value = tkz.get_next_token();

      if (!IsReadOnly(start_at_row, next_col))
      {
        set_grid_cell_value(wxGridCellCoords(start_at_row, next_col), value);
      }

      next_col++;
    }

    start_at_row++;
  }
}
开发者ID:antonvw,项目名称:wxExtension,代码行数:31,代码来源:grid.cpp


示例14: GetExportLine

wxString ctlSQLGrid::GetExportLine(int row, wxArrayInt cols)
{
	wxString str;
	unsigned int col;

	if (GetNumberCols() == 0)
		return str;

	for (col = 0 ; col < cols.Count() ; col++)
	{
		if (col > 0)
			str.Append(settings->GetCopyColSeparator());

		wxString text = GetCellValue(row, cols[col]);

		bool needQuote  = false;
		if (settings->GetCopyQuoting() == 1)
		{
			needQuote = IsColText(cols[col]);
		}
		else if (settings->GetCopyQuoting() == 2)
			/* Quote everything */
			needQuote = true;

		if (needQuote)
			str.Append(settings->GetCopyQuoteChar());
		str.Append(text);
		if (needQuote)
			str.Append(settings->GetCopyQuoteChar());
	}
	return str;
}
开发者ID:SokilV,项目名称:pgadmin3,代码行数:32,代码来源:ctlSQLGrid.cpp


示例15: GetNumberCols

void CGridAlleleBase::_FitString(const wxString &s, int nStartColumn)
{
  int nCols = GetNumberCols();
  int nRows = GetNumberRows();
  int nCol;
  int nRow;
  if(nStartColumn < 0)
  {
    nStartColumn = (int)m_vsLeftColumns.size();
  }
  if(nRows > 1 && nCols > 0)
  {
    for(nCol = nStartColumn; nCol < nCols; nCol++)
    {
      SetCellValue(1,nCol,s);
    }
    for(nRow = 0; nRow < nRows; nRow++)
    {
      SetRowLabelValue(nRow,wxEmptyString);
    }
    UpdateLabelSizes();
    SetRowLabelSize(2);
    AutoSize();
  }
}
开发者ID:HelloWilliam,项目名称:osiris,代码行数:25,代码来源:CGridAllele.cpp


示例16: GetCell

void CTWenUGCtrlEx::AppendRow_ButtonAdd(void)
{
	int nRow = CUGCtrl::GetNumberRows();

	if(nRow > 0)
	{
		CUGCell cell;
		GetCell(0, nRow-1, &cell);

		if(cell.GetBitmap()==GetBitmap(m_nIndexBMP_Add))//如果有增加行
		{
			return;
		}
	}

	if(AppendRow() != UG_SUCCESS) return;

	int nCol = GetNumberCols();

	JoinCells(1, nRow, nCol-1, nRow);

	if(nCol>1)
	{
		QuickSetBackColor(1, nRow, RGB(240,240,240));
		QuickSetBorder(1, nRow, UG_BDR_RAISED|UG_BDR_LTHIN|UG_BDR_RTHIN|UG_BDR_TTHIN|UG_BDR_BTHIN); 
	}

	QuickSetBitmap(0, nRow, m_nIndexBMP_Add);
}
开发者ID:Wanghuaichen,项目名称:SignalProcess,代码行数:29,代码来源:CTWenUGCtrlEx.cpp


示例17: GetNumberRows

void wxSheetValueProviderBase::Clear()
{
    const int numRows = GetNumberRows();
    const int numCols = GetNumberCols();
    if (numRows > 0) UpdateRows(0, -numRows);
    if (numCols > 0) UpdateCols(0, -numCols);
}
开发者ID:GWRon,项目名称:wx.mod,代码行数:7,代码来源:sheetval.cpp


示例18: CreateGrid

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);
  }
}
开发者ID:ImAWolf,项目名称:osiris,代码行数:26,代码来源:CGridLabThresholds.cpp


示例19: x

void CGridAlerts::OnCellChange(wxGridEvent &e)
{
  if( !(m_nInCellChangeEvent || IsTableReadOnly()) )
  {
    CIncrementer x(m_nInCellChangeEvent);
    nwxGridBatch xxxx(this);
    int nRow = e.GetRow();
    int nCol = e.GetCol();
    COARmessage *pMsg = m_pMsgEdit->GetMessage((size_t) nRow);
    int nCols = GetNumberCols();
    const wxString &sName(pMsg->GetMessageName());
    if(nCol == (nCols - 1))
    {
      UpdateTextFromRow(nRow,pMsg);
    }
    else if(nCol == (nCols - 2))
    {
      UpdateDisabledFromRow(nRow,pMsg);
      if((!sName.IsEmpty()) && GetBoolValue(nRow,nCol))
      {
        // a row has been enabled
        // check for mutually exclusive rows
        // that are enabled and disable them

        set<wxString> ss;
        const COARmsgExportMap *pMsgExp = m_pMsgEdit->GetMsgExport();
        if(pMsgExp->GetGroupsByMsgName(sName,&ss))
        {
          // we found group names
          size_t nCount = m_pMsgEdit->GetMessageCount();
          size_t iRow;
          for(iRow = 0; iRow < nCount; iRow++)
          {
            if(iRow == (size_t)nRow)
            {}
            else if(!GetBoolValue(iRow,nCol))
            {} // already unchecked, fuhgeddaboudit.
            else
            {
              COARmessage *pMsgA = m_pMsgEdit->GetMessage(iRow);
              const wxString &sNameA(pMsgA->GetMessageName());
              if(sNameA.IsEmpty())
              {}
              else if( (sNameA == sName) ||
                  (pMsgExp->HasGroupByMsgName(sNameA,ss)) )
              {
                // need to uncheck message
                SetBoolValue(iRow,nCol,false);
                UpdateDisabledFromRow(iRow,pMsgA);
              }
            }
          }
        }
      }
    }
  }
  e.Skip(true);
}
开发者ID:ForensicBioinformatics,项目名称:osiris,代码行数:58,代码来源:CGridAlerts.cpp


示例20: GetNumberCols

void CGridAlerts::UpdateDisabledFromRow(
  int nRow, COARmessage *pMsg)
{
  int nCols = GetNumberCols() - 2;
  bool bHidden = !GetBoolValue(nRow,nCols++);
  pMsg->SetHidden(bHidden);
  DisableEdit(nRow,nCols,bHidden);
  Refresh();
}
开发者ID:ForensicBioinformatics,项目名称:osiris,代码行数:9,代码来源:CGridAlerts.cpp



注:本文中的GetNumberCols函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetNumberOfConsoleInputEvents函数代码示例发布时间:2022-05-30
下一篇:
C++ GetNumber函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap