这篇教程C++ GetNumberCols函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetNumberCols函数的典型用法代码示例。如果您正苦于以下问题:C++ GetNumberCols函数的具体用法?C++ GetNumberCols怎么用?C++ GetNumberCols使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetNumberCols函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetClientSizeint 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,
示例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,
示例3: SetMultiSelectModevoid 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,
示例4: PQntuplesvoid 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,
示例5: GetNumberColsbool 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,
示例6: GetNumberColsvoid 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,
示例7: GetNumberRowsvoid 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,
示例8: wxSbool 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,
示例9: GetClientSizevoid 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,
示例10: GetCellValueconst 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,
示例11: SetColSizevoid 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,
示例12: GetLabelFontvoid 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,
示例13: tkzvoid 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,
示例14: GetExportLinewxString 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,
示例15: GetNumberColsvoid 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,
示例16: GetCellvoid 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,
示例17: GetNumberRowsvoid 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,
示例18: CreateGridvoid 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,
示例19: xvoid 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,
示例20: GetNumberColsvoid 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,
示例21: GetColLabelValuewxString wxDbGridTableBase::GetColLabelValue(int col){ if (GetNumberCols() > col) { return m_ColInfo[col].Title; } wxFAIL_MSG (_T("unknown column")); return wxString();}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:9,
示例22: On_Size//---------------------------------------------------------void CVIEW_Table_Control::On_Size(wxSizeEvent &event)//&WXUNUSED(event)){ if( m_Field_Offset && GetNumberCols() && GetClientSize().x > GetRowLabelSize() ) { SetColSize(0, GetClientSize().x - GetRowLabelSize()); } event.Skip();}
开发者ID:sinozope,项目名称:SAGA-GIS-git-mirror,代码行数:10,
示例23: GetValuewxString wxGISTable::GetValue(int row, int col){ if(GetNumberCols() <= col || GetNumberRows() <= row) return wxString(); //fetch more data wxBusyCursor wait; return m_pwxGISDataset->GetAsString(row, col);}
开发者ID:jacklibj,项目名称:r5,代码行数:9,
示例24: Open_Application//---------------------------------------------------------void CVIEW_Table_Control::On_LClick(wxGridEvent &event){ int iField = m_Field_Offset + event.GetCol(); CSG_Table_Record *pRecord = m_pRecords[event.GetRow()]; //----------------------------------------------------- if( event.AltDown() ) { if( m_pTable->Get_Field_Type(iField) == SG_DATATYPE_String ) { if( event.ControlDown() ) { g_pData->Open (pRecord->asString(iField)); } else { Open_Application(pRecord->asString(iField)); } } } //----------------------------------------------------- else if( event.ControlDown() ) { m_pTable->Select(pRecord, true); Update_Selection(); } else if( event.ShiftDown() ) { SelectBlock(event.GetRow(), 0, GetGridCursorRow(), GetNumberCols(), false); } else { SelectRow(event.GetRow(), false); if( pRecord && iField >= m_Field_Offset && iField < m_pTable->Get_Field_Count() && m_pTable->Get_Field_Type(iField) == SG_DATATYPE_Color ) { long lValue; if( DLG_Color(lValue = pRecord->asInt(iField)) ) { pRecord->Set_Value(iField, lValue); SetCellBackgroundColour(event.GetRow(), event.GetCol(), Get_Color_asWX(pRecord->asInt(iField))); ForceRefresh(); } } } //----------------------------------------------------- SetGridCursor(event.GetRow(), event.GetCol());}
开发者ID:sinozope,项目名称:SAGA-GIS-git-mirror,代码行数:57,
示例25: SetTitleBOOL CTWenUGCtrlEx::SetTitle(int nCol, CString cStrTitleName, int nColWidth, int nTitleNO){ if(nCol>=GetNumberCols()) return FALSE; QuickSetText(nCol, nTitleNO, cStrTitleName); QuickSetFont(nCol, nTitleNO, m_nFontID_Title); SetColWidth(nCol, nColWidth); return TRUE;}
开发者ID:Wanghuaichen,项目名称:SignalProcess,代码行数:10,
示例26: GetColLabelValueconst std::string wex::grid::build_page(){ wxString text; text << "<TABLE "; if (GridLinesEnabled()) text << "border=1"; else text << "border=0"; text << " cellpadding=4 cellspacing=0 >/n"; text << "<tr>/n"; // Add the col labels only if they are shown. if (GetColLabelSize() > 0) { for (int c = 0 ; c < GetNumberCols(); c++) { text << "<td><i>" << GetColLabelValue(c) << "</i>/n"; } } for (int i = 0 ; i < GetNumberRows(); i++) { text << "<tr>/n"; for (int j = 0 ; j < GetNumberCols(); j++) { text << "<td>" << (GetCellValue(i, j).empty() ? " ": GetCellValue(i, j)) << "/n"; } } text << "</TABLE>/n"; // This can be useful for testing, paste in a file and // check in your browser (there indeed rules are okay). // clipboard_add(text); return text;}
开发者ID:antonvw,项目名称:wxExtension,代码行数:42,
示例27: GetValuewxString wxGISGridTable::GetValue(int row, int col){ if(GetNumberCols() <= col || GetNumberRows() <= row) return wxEmptyString; //fetch more data wxGISFeature Feature = m_pGISDataset->GetFeature(row); if(Feature.IsOk()) return Feature.GetFieldAsString(col); return wxEmptyString;}
开发者ID:Mileslee,项目名称:wxgis,代码行数:11,
示例28: SwapRowvoid CTWenUGCtrlEx::SwapRow(long i, long j){ CUGCell ci, cj; for(int cols=0; cols<GetNumberCols(); cols++) { GetCell(cols, i, &ci); GetCell(cols, j, &cj); SetCell(cols, i, &cj); SetCell(cols, j, &ci); }}
开发者ID:Wanghuaichen,项目名称:SignalProcess,代码行数:11,
注:本文中的GetNumberCols函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetNumberOfConsoleInputEvents函数代码示例 C++ GetNumber函数代码示例 |