您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetColumn函数代码示例

51自学网 2021-06-01 21:05:16
  C++
这篇教程C++ GetColumn函数代码示例写得很实用,希望能帮到您。

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

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

示例1: GetColumn

void TableSettings::OnRemoveColumnClick(wxCommandEvent& event){    Column *col = GetColumn( GetSelectedColumnName() );    if( col ) {		// delete associated keys		SerializableList keys;		GetConstraints( keys, col->GetName() );		for(SerializableList::iterator it = keys.begin(); it != keys.end(); ++it ) {			Constraint *key = (Constraint*) *it;			m_lstKeys.DeleteObject( key );			delete key;		}		// delete the column        m_lstColumns.DeleteObject( col );        delete col;        UpdateView();    }}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:18,


示例2: GetColumn

void wxHeaderCtrlBase::OnSeparatorDClick(wxHeaderCtrlEvent& event){    const unsigned col = event.GetColumn();    const wxHeaderColumn& column = GetColumn(col);    if ( !column.IsResizeable() )    {        event.Skip();        return;    }    int w = GetColumnTitleWidth(column);    if ( !UpdateColumnWidthToFit(col, w) )        event.Skip();    else        UpdateColumn(col);}
开发者ID:chromylei,项目名称:third_party,代码行数:18,


示例3: GetScrollPos

BOOL CSHListCtrl::AddHeaderToolTip(int nCol, LPCTSTR sTip ){	const int TOOLTIP_LENGTH = 80;	char buf[TOOLTIP_LENGTH+1];	CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);	int nColumnCount = pHeader->GetItemCount();	if( nCol >= nColumnCount)		return FALSE;	if( (GetStyle() & LVS_TYPEMASK) != LVS_REPORT )		return FALSE;	// Get the header height	RECT rect;	pHeader->GetClientRect( &rect );	int height = rect.bottom;	RECT rctooltip;	rctooltip.top = 0;	rctooltip.bottom = rect.bottom;	// Now get the left and right border of the column	rctooltip.left = 0 - GetScrollPos( SB_HORZ );	for( int i = 0; i < nCol; i++ )		rctooltip.left += GetColumnWidth( i );	rctooltip.right = rctooltip.left + GetColumnWidth( nCol );	if( sTip == NULL )	{		// Get column heading		LV_COLUMN lvcolumn;		lvcolumn.mask = LVCF_TEXT;		lvcolumn.pszText = buf;		lvcolumn.cchTextMax = TOOLTIP_LENGTH;		if( !GetColumn( nCol, &lvcolumn ) )			return FALSE;	}	m_tooltip.AddTool( GetDlgItem(0), sTip ? sTip : buf, &rctooltip, nCol+1 );	return TRUE;}
开发者ID:fredrikjonsson,项目名称:cadof72bian,代码行数:44,


示例4: wxASSERT

bool CBOINCListCtrl::OnSaveState(wxConfigBase* pConfig) {    wxString    strBaseConfigLocation = wxEmptyString;    wxListItem  liColumnInfo;    wxInt32     iIndex = 0;    wxInt32     iColumnCount = 0;    wxASSERT(pConfig);    // Retrieve the base location to store configuration information    // Should be in the following form: "/Projects/"    strBaseConfigLocation = pConfig->GetPath() + wxT("/");    // Convert to a zero based index    iColumnCount = GetColumnCount() - 1;    // Which fields are we interested in?    liColumnInfo.SetMask(        wxLIST_MASK_TEXT |        wxLIST_MASK_WIDTH |        wxLIST_MASK_FORMAT    );    // Cycle through the columns recording anything interesting    for (iIndex = 0; iIndex <= iColumnCount; iIndex++) {        GetColumn(iIndex, liColumnInfo);        pConfig->SetPath(strBaseConfigLocation + liColumnInfo.GetText());        pConfig->Write(wxT("Width"), liColumnInfo.GetWidth());        #if (defined(__WXMAC__) &&  wxCHECK_VERSION(2,8,0))        pConfig->Write(wxT("Width"), GetColumnWidth(iIndex)); // Work around bug in wxMac-2.8.0 wxListCtrl::SetColumn()#endif    }    // Save sorting column and direction    pConfig->SetPath(strBaseConfigLocation);    pConfig->Write(wxT("SortColumn"), m_pParentView->m_iSortColumn);    pConfig->Write(wxT("ReverseSortOrder"), m_pParentView->m_bReverseSort);    return true;}
开发者ID:BME-IK,项目名称:gridbee-nacl-framework,代码行数:44,


示例5: GetColumn

void wxHeaderCtrlBase::OnSeparatorDClick(wxHeaderCtrlEvent& event){    const unsigned col = event.GetColumn();    const wxHeaderColumn& column = GetColumn(col);    if ( !column.IsResizeable() )    {        event.Skip();        return;    }    int w = wxWindowBase::GetTextExtent(column.GetTitle()).x;    w += 4*GetCharWidth(); // add some arbitrary margins around text    if ( !UpdateColumnWidthToFit(col, w) )        event.Skip();    else        UpdateColumn(col);}
开发者ID:mark711,项目名称:Cafu,代码行数:19,


示例6: wxASSERT_MSG

int wxHeaderCtrl::MSWFromNativeOrder(int order){    wxASSERT_MSG( order >= 0 && order < GetShownColumnsCount(),                  "native column position out of range" );    unsigned pos = order;    for ( unsigned n = 0; n < m_numColumns; n++ )    {        if ( n > pos )            break;        if ( GetColumn(m_colIndices[n]).IsHidden() )            pos++;    }    wxASSERT_MSG( MSWToNativeOrder(pos) == order, "logic error" );    return pos;}
开发者ID:mael15,项目名称:wxWidgets,代码行数:19,


示例7: DoSetColumnsOrder

void wxHeaderCtrl::DoSetColumnsOrder(const wxArrayInt& order){    wxArrayInt orderShown;    orderShown.reserve(m_numColumns);    for ( unsigned n = 0; n < m_numColumns; n++ )    {        const int idx = order[n];        if ( GetColumn(idx).IsShown() )            orderShown.push_back(MSWToNativeIdx(idx));    }    if ( !Header_SetOrderArray(GetHwnd(), orderShown.size(), &orderShown[0]) )    {        wxLogLastError(wxT("Header_GetOrderArray"));    }    m_colIndices = order;}
开发者ID:mael15,项目名称:wxWidgets,代码行数:19,


示例8: GetUninlinedColumnCount

// Compare two schemasbool Schema::operator==(const Schema &other) const {  if (other.GetColumnCount() != GetColumnCount() ||      other.GetUninlinedColumnCount() != GetUninlinedColumnCount() ||      other.IsInlined() != IsInlined()) {    return false;  }  for (oid_t column_itr = 0; column_itr < other.GetColumnCount();       column_itr++) {    const Column &column_info = other.GetColumn(column_itr);    const Column &other_column_info = GetColumn(column_itr);    if (column_info != other_column_info) {      return false;    }  }  return true;}
开发者ID:GeorgeErickson,项目名称:peloton,代码行数:20,


示例9: GET_X_LPARAM

LRESULT CDrawHeader::DoLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled){	POINT point;	point.x = GET_X_LPARAM(lParam);	point.y = GET_Y_LPARAM(lParam);	m_ptLastLButtonDown = point;		if (!m_bColumnResizing)	{		m_pAlmSum->SetCapture(TRUE, this);		if (MouseOverColumnResizeArea(point))		{			SetCursor(m_hColDivCursor); 			m_bColumnResizing = TRUE;		}		else		{			m_nColumnCatpture = GetColumn(point);			CDCHandle dcHandle = m_pAlmSum->GetDC();			DoDraw(dcHandle);			m_pAlmSum->ReleaseDC(dcHandle);		}	}	if (m_bColumnResizing)	{		if (!GetResizeColumn(point, m_nResizingColumn, m_nDragDivideOffset))			return 1;				CRect rect = m_pAlmSum->m_rect;		CRect invertedRect(point.x - 1 - m_nDragDivideOffset, rect.top, 			point.x - m_nDragDivideOffset, rect.bottom);				CDCHandle dcHandle = m_pAlmSum->GetDC();		dcHandle.InvertRect(&invertedRect);		m_pAlmSum->ReleaseDC(dcHandle);	}			return 0;}
开发者ID:JackWangCUMT,项目名称:SuperCxHMI,代码行数:42,


示例10: GetColumn

HRESULT CADsSearch::GetColumn( UINT nIndex, CStringList &sList ){	CString s;	if ( m_sColumnList.IsEmpty() )	{		return E_FAIL;	}	POSITION pos;	pos = m_sColumnList.FindIndex( nIndex );	if ( pos == NULL )	{		return E_FAIL;	}	s = m_sColumnList.GetAt(pos);	return GetColumn( s, sList );}
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:21,


示例11: SetCapture

void EGridCtrl::OnLButtonDown(UINT nFlags, CPoint point){	SetCapture();	m_MouseDownCP = point;	bool bOnHeaderRow = ( 0<=point.y && point.y<GetHeaderRowHeight() );	if( bOnHeaderRow )	{		m_pDragColumn = GetColumn(point.x,true);		if( m_pDragColumn!=NULL )		{			SetCursor( LoadCursor(NULL,IDC_SIZEWE) );		}	}	else	{		int nCol=-1;		int nRow=-1;		EProperty* pProperty = GetProperty( point , nCol , nRow );		m_SeletectPropertyIndex.x = nCol;		m_SeletectPropertyIndex.y = nRow;		SetActiveProperty(pProperty);		if( m_pActiveProperty != NULL )		{			if( m_pActiveProperty->OnLButtonDown( this , point ) )			{				NotifyPropertyChanged();				Invalidate();			}		}	}}
开发者ID:sosoayaen,项目名称:DescentBoardGameTools,代码行数:40,


示例12: if

// CTwoListCtrl 消息处理程序void CSkinListProgressCtrl::DrawItem(LPDRAWITEMSTRUCT lpDIS ){    // TODO: Add your message handler code here and/or call default    CDC   *pDC = CDC::FromHandle(lpDIS->hDC);      int   nRows = m_lstItemColor.GetCount();      COLORREF *clrCol = NULL;      if   (nRows && (int)lpDIS->itemID < nRows)      {          clrCol = m_lstItemColor.GetAt(m_lstItemColor.FindIndex(lpDIS->itemID));      }      CRect  rcItem(lpDIS->rcItem);      LVCOLUMN lvColumn;      ZeroMemory(&lvColumn, sizeof(LVCOLUMN));      lvColumn.mask = LVCF_FMT | LVCF_WIDTH;      for (int nCol = 0; nCol < GetHeaderCtrl()->GetItemCount(); nCol++)      {          if (clrCol)          {            pDC->SetBkColor(clrCol[nCol]);            pDC->SetTextColor(clrCol[nCol]);          }        GetColumn(nCol, &lvColumn);          UINT   uStyle = DT_SINGLELINE | DT_END_ELLIPSIS;          if   (lvColumn.fmt & LVCFMT_LEFT)              uStyle |= DT_LEFT;          if   (lvColumn.fmt   &   LVCFMT_RIGHT)              uStyle |= DT_RIGHT;          if   (lvColumn.fmt & LVCFMT_CENTER)              uStyle |= DT_CENTER;          rcItem.right = rcItem.left + lvColumn.cx;       //   COLORREF color;     //   GetSysColor(color);     //   pDC->FillSolidRect(rcItem, RGB(122,122,122));//::GetSysColor(COLOR_INACTIVECAPTION));     		 pDC->FillSolidRect(rcItem, m_listItemColor1);         pDC->DrawText(GetItemText(lpDIS->itemID, nCol), rcItem, uStyle);        rcItem.left += lvColumn.cx;      }   //     CListCtrl::OnDrawItem(nIDCtl, lpDIS);}
开发者ID:anyboo,项目名称:project,代码行数:41,


示例13: GetColumn

void SmartListCtrl::Init(DWORD dwStyle, INT nCols, INT nFormat, LPCWSTR *pHeaders, DOUBLE *pColWidth /* = NULL */) {	this->DeleteAllItems();	this->SetExtendedStyle(this->GetExtendedStyle() | dwStyle);		int nTotalWidth;	CRect rc;	this->GetWindowRect(&rc);	nTotalWidth = static_cast<int>(rc.Size().cx);	for(int i = 0; i < nCols; i++) {		this->InsertColumn(i, pHeaders[i], nFormat, (pColWidth) ? static_cast<int>(nTotalWidth * pColWidth[i]) : (nTotalWidth / nCols));	}	// 修改参数使得支持第一列标题居中显示	if(nFormat == LVCFMT_CENTER) {		LVCOLUMN lvc;		lvc.mask = LVCF_FMT;		GetColumn(0, &lvc);		lvc.fmt &= ~LVCFMT_JUSTIFYMASK;		lvc.fmt |= LVCFMT_CENTER;		SetColumn(0, &lvc);	}}
开发者ID:NeetSonic,项目名称:MFCUtils,代码行数:22,


示例14: return

CEdit* CPlayerListCtrl::ShowInPlaceEdit(int nItem, int nCol){	CRect rect;	if(!PrepareInPlaceControl(nItem, nCol, rect))		return(NULL);	DWORD dwStyle = /*WS_BORDER|*/WS_CHILD|WS_VISIBLE|ES_AUTOHSCROLL;	LV_COLUMN lvcol;	lvcol.mask = LVCF_FMT;	GetColumn(nCol, &lvcol);	dwStyle |= (lvcol.fmt&LVCFMT_JUSTIFYMASK) == LVCFMT_LEFT ? ES_LEFT		: (lvcol.fmt&LVCFMT_JUSTIFYMASK) == LVCFMT_RIGHT ? ES_RIGHT		: ES_CENTER;	CEdit* pEdit = new CInPlaceEdit(nItem, nCol, GetItemText(nItem, nCol));	pEdit->Create(dwStyle, rect, this, IDC_EDIT1);	m_fInPlaceDirty = false;	return pEdit;}
开发者ID:banduladh,项目名称:meplayer,代码行数:22,


示例15: sizeof

int CTreeList::QuerySubItemText(int item, CHAR *Data, int length){    LV_COLUMN lvc;    LV_ITEM lvi;    int     ncol;    CRect   rect;    ::ZeroMemory(&lvc, sizeof(lvc));    lvc.mask = LVCF_WIDTH |LVCF_FMT;    for (ncol=0; GetColumn(ncol, &lvc); ncol++) {        if (ncol > 0) {            GetSubItemRect(item, ncol,LVIR_BOUNDS, rect);        } else {            GetItemRect(item, rect, LVIR_BOUNDS);            rect.right = GetColumnWidth(0);            rect.left = 0;        }        if (rect.PtInRect(m_Point)) {            ::ZeroMemory(Data, length);            ::ZeroMemory(&lvi, sizeof(lvi));            lvi.iItem = item;            lvi.mask = LVIF_TEXT;            lvi.iSubItem = ncol;            lvi.pszText = Data;            lvi.cchTextMax = length;            return GetItem(&lvi);            break;        }    }    return FALSE;}
开发者ID:Axure,项目名称:Ext3Fsd,代码行数:38,


示例16: GetColumn

void wxHeaderCtrl::DoUpdate(unsigned int idx){    // the native control does provide Header_SetItem() but it's inconvenient    // to use it because it sends HDN_ITEMCHANGING messages and we'd have to    // arrange not to block setting the width from there and the logic would be    // more complicated as we'd have to reset the old values as well as setting    // the new ones -- so instead just recreate the column    const wxHeaderColumn& col = GetColumn(idx);    if ( col.IsHidden() )    {        // column is hidden now        if ( !m_isHidden[idx] )        {            // but it wasn't hidden before, so remove it            if ( !Header_DeleteItem(GetHwnd(), MSWToNativeIdx(idx)) )                wxLogLastError(wxS("Header_DeleteItem()"));            m_isHidden[idx] = true;        }        //else: nothing to do, updating hidden column doesn't have any effect    }    else // column is shown now    {        if ( m_isHidden[idx] )        {            m_isHidden[idx] = false;        }        else // and it was shown before as well        {            // we need to remove the old column            if ( !Header_DeleteItem(GetHwnd(), MSWToNativeIdx(idx)) )                wxLogLastError(wxS("Header_DeleteItem()"));        }        DoInsertItem(col, idx);    }}
开发者ID:Anti-Ultimate,项目名称:dolphin,代码行数:38,


示例17: while

// scan for the next block element of type, returns true if no error, , bEof will be set to true if eof is hitbool Elementizer::GetNextBlock(int type, bool& bEof){    bool bFound = false;    while(bFound == false)    {        if (GetNext(bEof) == false || bEof == true)        {            break;        }        if (GetType() == type_block && GetValue() == type)        {            if (GetColumn() != 1)            {                m_pCompilerData->error = true;                m_pCompilerData->error_msg = g_pErrorStrings[error_bdmbifc];                return false;            }            bFound = true;        }    }    // if we found the block or we hit eof, then we got no error so return true    return (bFound || bEof);}
开发者ID:BackupGGCode,项目名称:open-source-spin-compiler,代码行数:24,


示例18: GetColumnCount

unsigned int wxHeaderCtrl::FindColumnAtPoint(int x, bool *onSeparator) const{    int pos = 0;    const unsigned count = GetColumnCount();    for ( unsigned n = 0; n < count; n++ )    {        const unsigned idx = m_colIndices[n];        const wxHeaderColumn& col = GetColumn(idx);        if ( col.IsHidden() )            continue;        pos += col.GetWidth();        // if the column is resizable, check if we're approximatively over the        // line separating it from the next column        //        // TODO: don't hardcode sensitivity        if ( col.IsResizeable() && abs(x - pos) < 8 )        {            if ( onSeparator )                *onSeparator = true;            return idx;        }        // inside this column?        if ( x < pos )        {            if ( onSeparator )                *onSeparator = false;            return idx;        }    }    if ( onSeparator )        *onSeparator = false;    return COL_NONE;}
开发者ID:Toonerz,项目名称:project64,代码行数:37,


示例19: GetNewColumnData

CColumnData* CEnListCtrl::CreateColumnData(int nCol){	CColumnData* pData = NULL;	if (!m_mapColumnData.Lookup(nCol, pData)) // see if its already added	{		pData = GetNewColumnData();				if (pData)			m_mapColumnData.SetAt(nCol, pData);		// set the column format to the most appropriate		LV_COLUMN lvc = { 0 };		lvc.mask = LVCF_FMT;				if (GetColumn(nCol, &lvc))		{			if ((lvc.fmt & LVCFMT_JUSTIFYMASK) == LVCFMT_RIGHT)				pData->nFormat = ES_START;		}	}	return pData;}
开发者ID:jithuin,项目名称:infogeezer,代码行数:24,


示例20: GetColumnCount

// event handling:void wxDataViewCtrl::OnSize(wxSizeEvent& event){  unsigned int const noOfColumns = GetColumnCount(); // reset DC of all custom renderers because DC has changed:  for (unsigned int i=0; i<noOfColumns; ++i)  {    wxDataViewColumn* dataViewColumnPtr(GetColumn(i));    if (dataViewColumnPtr != NULL)    {      wxDataViewCustomRenderer* dataViewCustomRendererPtr(dynamic_cast<wxDataViewCustomRenderer*>(dataViewColumnPtr->GetRenderer()));      if (dataViewCustomRendererPtr != NULL)        dataViewCustomRendererPtr->SetDC(NULL);    }  } // update the layout of the native control after a size event:  GetDataViewPeer()->OnSize();  event.Skip();}
开发者ID:Annovae,项目名称:Dolphin-Core,代码行数:25,


示例21: Input

/*******************************************************************************  Function Name  : GetCellRect  Input(s)       : nIndex - Type of the entry                   rect - Boundary of the entry  Output         : BOOL - TRUE on Success  Functionality  : Gets the dimensions of the colour cell given by (row,col)  Member of      : CColourPopup  Author(s)      : Raja N  Date Created   : 09/12/2004  Modifications  : *******************************************************************************/BOOL CColourPopup::GetCellRect(int nIndex, const LPRECT& rect){    if (nIndex == CUSTOM_BOX_VALUE)    {        ::SetRect(rect,                   m_CustomTextRect.left,  m_CustomTextRect.top,                  m_CustomTextRect.right, m_CustomTextRect.bottom);        return TRUE;    }    else if (nIndex == DEFAULT_BOX_VALUE)    {        ::SetRect(rect,                   m_DefaultTextRect.left,  m_DefaultTextRect.top,                  m_DefaultTextRect.right, m_DefaultTextRect.bottom);        return TRUE;    }    if (nIndex < 0 || nIndex >= m_nNumColours )    {        return FALSE;    }    rect->left = GetColumn(nIndex) * m_nBoxSize + m_nMargin;    rect->top  = GetRow(nIndex) * m_nBoxSize + m_nMargin;    // Move everything down if we are displaying a default text area    if( m_strDefaultText.GetLength() > 0 )    {        rect->top += (m_nMargin + m_DefaultTextRect.Height());    }    rect->right = rect->left + m_nBoxSize;    rect->bottom = rect->top + m_nBoxSize;    return TRUE;}
开发者ID:Fetze,项目名称:busmaster,代码行数:47,


示例22: GetMoveSAN

std::string GetMoveSAN(Position &position, const Move move){	const Square from = GetFrom(move);	const Square to = GetTo(move);	const Move moveType = GetMoveType(move);	std::string result;	if (moveType == MoveTypeCastle)	{		if (GetColumn(to) > FILE_E)		{			result = "O-O";		}		else		{			result = "O-O-O";		}	}	else	{		// Piece that is moving		const PieceType fromPieceType = GetPieceType(position.Board[from]);		switch (fromPieceType)		{		case PAWN: break;		case KNIGHT: result += "N"; break;		case BISHOP: result += "B"; break;		case ROOK: result += "R"; break;		case QUEEN: result += "Q"; break;		case KING: result += "K"; break;		}		Move legalMoves[256];		int legalMoveCount = GenerateLegalMoves(position, legalMoves);		// Do we need to disambiguate?		bool dupe = false, rowDiff = true, columnDiff = true;		for (int i = 0; i < legalMoveCount; i++)		{			if (GetFrom(legalMoves[i]) != from &&				GetTo(legalMoves[i]) == to &&				GetPieceType(position.Board[GetFrom(legalMoves[i])]) == fromPieceType)			{				dupe = true;				if (GetRow(GetFrom(legalMoves[i])) == GetRow(from))				{					rowDiff = false;				}				if (GetColumn(GetFrom(legalMoves[i])) == GetColumn(from))				{					columnDiff = false;				}			}		}		if (dupe)		{			if (columnDiff)			{				result += GetSquareSAN(from)[0];			}			else if (rowDiff)			{				result += GetSquareSAN(from)[1];			}			else			{				result += GetSquareSAN(from);			}		}		else if (fromPieceType == PAWN && position.Board[to] != PIECE_NONE)		{			// Pawn captures need a row			result += GetSquareSAN(from)[0];		}				// Capture?		if (position.Board[to] != PIECE_NONE ||			moveType == MoveTypeEnPassent)		{			result += "x";		}		// Target square		result += GetSquareSAN(to);	}	if (moveType == MoveTypePromotion)	{		switch (GetPromotionMoveType(move))		{		case KNIGHT: result += "=N"; break;		case BISHOP: result += "=B"; break;		case ROOK: result += "=R"; break;		case QUEEN: result += "=Q"; break;		}	}	MoveUndo moveUndo;//.........这里部分代码省略.........
开发者ID:glinscott,项目名称:Garbochess-3,代码行数:101,


示例23: GetColumn

	bool Parser::GetToken(token& out)	{		// trim leading whitespace first:		for (; text.str < text.end; ++text.str)		{			char ch = *text.str;			if (ch == ' ' || ch == '/t')  continue;			if (ch == '/r' || ch == '/n') SkipNewLine(ch);			else break; // not ' ' or '/t', so finish trim		}		out.end = out.str = text.str; // mark down start and default end		column  = GetColumn();		for ( ; text.str < text.end; ++text.str)		{			char ch = *text.str;			if (ch == '/r' || ch == '/n') {				SkipNewLine(ch);				continue;			}			if (ch == '/') { // possible comment start?				char c2 = text.str[1];				if (c2 == '/' || c2 == '*') // line comment '//' or block comment '/*'					return ParseComment(out, c2 == '*'); // parse the comment			}			else if (ch == '"')				return ParseStringLiteral(out); // skip the literal			else if (ch == '/'')				return ParseCharLiteral(out);			if (BreakerIndex[ch] == 1) // token starts with a breaker char			{				line    = cur_line;				column  = GetColumn();				char c2 = *++text.str;				char c3 = text.str[1];				if (c3 == '=' && (					(ch == '<' && c2 == '<')|| // <<=					(ch == '>' && c2 == '>'))) // >>=				{					text.str += 2; // 3 char token parsed				}				else if ((c2 == '=' && (					 ch == '<' || // <=					 ch == '>' || // >=					 ch == '=' || // ==					 ch == '!' || // !=					 ch == '+' || // +=					 ch == '-' || // -=					 ch == '*' || // *=					 ch == '/' || // /=					 ch == '%' || // %=					 ch == '&' || // &=					 ch == '|' || // |=					 ch == '^'    // ^=					)) || 					(ch == '+' && c2 == '+') || // ++					(ch == '-' && c2 == '-') || // --					(ch == '-' && c2 == '>') || // ->					(ch == '?' && c2 == '?') || // ??					(ch == '&' && c2 == '&') || // &&					(ch == '|' && c2 == '|') || // ||					(ch == '<' && c2 == '<') || // <<					(ch == '>' && c2 == '>') || // >>					(ch == ':' && c2 == ':'))   // ::				{					++text.str;  // 2 char token parsed				}				out.end = text.str;				return true; // 1 char token parsed			}			// so this is a literal or a statement?			return ParseStatement(out);		}		return false; // end of buffer	}
开发者ID:RedFox20,项目名称:CC-Compiler,代码行数:81,


示例24: return

// **************************************************************************// EditSubLabel ()//// Description://	Edit the subitem value.  Creates a CEdit object sized and placed to cover//	list control cell.  This edit box is needed to receive user input, and//	will delete itself when its parent window is destroyed.//// Parameters://  int			nItem	Index of item//	int			nCol	Column of item//// Returns://  CEdit* - Pointer to a CEdit object to be used to edit cell.// **************************************************************************CEdit* CKListEditCtrl::EditSubLabel (int nItem, int nCol)	{	int cnColumns = 0;	int nColOffset = 0;	// Make sure that the item is visible:	if (!EnsureVisible (nItem, TRUE)) 		return (NULL);	// Get the number of columns:	CHeaderCtrl* pHeader = (CHeaderCtrl*) GetDlgItem (0);	cnColumns = pHeader->GetItemCount ();	// Make sure that column is valid:	if (nCol >= cnColumns || GetColumnWidth (nCol) < 5)		return (NULL);	// Get the column offset (from left boundary):	nColOffset = 0;	for (int i = 0; i < nCol; i++)		nColOffset += GetColumnWidth (i);	// Get selected item's rectangle:	CRect rect;	GetItemRect (nItem, &rect, LVIR_BOUNDS);	// Scroll if we need to expose the column:	CRect rcClient;	GetClientRect (&rcClient);		if (nColOffset + rect.left < 0 || nColOffset + rect.left > rcClient.right)		{		CSize size;		size.cx = nColOffset + rect.left;		size.cy = 0;		Scroll (size);		rect.left -= size.cx;		}	// Get column alignment:	LV_COLUMN lvcol;	lvcol.mask = LVCF_FMT;	GetColumn (nCol, &lvcol);	DWORD dwStyle;	switch (lvcol.fmt & LVCFMT_JUSTIFYMASK)		{		case LVCFMT_LEFT:			dwStyle = ES_LEFT;			break;		case LVCFMT_RIGHT:			dwStyle = ES_RIGHT;			break;		default:			dwStyle = ES_CENTER;			break;		}	rect.left += (nColOffset + 4);	rect.right = rect.left + GetColumnWidth (nCol) - 10;	if (rect.right > rcClient.right) 		rect.right = rcClient.right;	// Defile edit control (base class) style:	dwStyle |= WS_BORDER | WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL;	// Create a new CKListEdit box (not to be confused with CKListEditCtrl):	CEdit *pEdit = new CKListEdit (nItem, nCol, GetItemText (nItem, nCol));	// Set style, size and position using base class:	pEdit->Create (dwStyle, rect, this, IDC_LISTEDIT);	// Update currently selected item:	m_nSelItem = nItem;	// Return pointer to new CKListEdit control:	return (pEdit);	}
开发者ID:wfmdyh,项目名称:wecan,代码行数:96,


示例25: TEST_F

TEST_F(ProjectionTests, BasicTargetTest) {  MockExecutor child_executor;  EXPECT_CALL(child_executor, DInit()).WillOnce(Return(true));  EXPECT_CALL(child_executor, DExecute())      .WillOnce(Return(true))      .WillOnce(Return(false));  size_t tile_size = 5;  // Create a table and wrap it in logical tile  auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance();  auto txn = txn_manager.BeginTransaction();  std::unique_ptr<storage::DataTable> data_table(      TestingExecutorUtil::CreateTable(tile_size));  TestingExecutorUtil::PopulateTable(data_table.get(), tile_size, false, false,                                   false, txn);  txn_manager.CommitTransaction(txn);  std::unique_ptr<executor::LogicalTile> source_logical_tile1(      executor::LogicalTileFactory::WrapTileGroup(data_table->GetTileGroup(0)));  EXPECT_CALL(child_executor, GetOutput())      .WillOnce(Return(source_logical_tile1.release()));  // Create the plan node  TargetList target_list;  DirectMapList direct_map_list;  /////////////////////////////////////////////////////////  // PROJECTION 0, TARGET 0 + 20  /////////////////////////////////////////////////////////  // construct schema  std::vector<catalog::Column> columns;  auto orig_schema = data_table.get()->GetSchema();  columns.push_back(orig_schema->GetColumn(0));  columns.push_back(orig_schema->GetColumn(0));  std::shared_ptr<const catalog::Schema> schema(new catalog::Schema(columns));  // direct map  DirectMap direct_map = std::make_pair(0, std::make_pair(0, 0));  direct_map_list.push_back(direct_map);  // target list  auto const_val = new expression::ConstantValueExpression(      type::ValueFactory::GetIntegerValue(20));  auto tuple_value_expr =      expression::ExpressionUtil::TupleValueFactory(type::Type::INTEGER, 0, 0);  expression::AbstractExpression *expr =      expression::ExpressionUtil::OperatorFactory(ExpressionType::OPERATOR_PLUS,                                                  type::Type::INTEGER,                                                  tuple_value_expr, const_val);  Target target = std::make_pair(1, expr);  target_list.push_back(target);  std::unique_ptr<const planner::ProjectInfo> project_info(      new planner::ProjectInfo(std::move(target_list),                               std::move(direct_map_list)));  planner::ProjectionPlan node(std::move(project_info), schema);  // Create and set up executor  executor::ProjectionExecutor executor(&node, nullptr);  executor.AddChild(&child_executor);  RunTest(executor, 1);}
开发者ID:Michael-Tieying-Zhang,项目名称:peloton,代码行数:69,


示例26: sizeof

void CListCtrlCl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct){	// TODO:  添加您的代码以绘制指定项	TCHAR lpBuffer[256];	LV_ITEM lvi;	lvi.mask = LVIF_TEXT | LVIF_PARAM ;	lvi.iItem = lpDrawItemStruct->itemID ; 	lvi.iSubItem = 0;	lvi.pszText = lpBuffer ;	lvi.cchTextMax = sizeof(lpBuffer);	VERIFY(GetItem(&lvi));	LV_COLUMN lvc, lvcprev ;	::ZeroMemory(&lvc, sizeof(lvc));	::ZeroMemory(&lvcprev, sizeof(lvcprev));	lvc.mask = LVCF_WIDTH | LVCF_FMT;	lvcprev.mask = LVCF_WIDTH | LVCF_FMT;	CDC* pDC;	pDC = CDC::FromHandle(lpDrawItemStruct->hDC);	CRect rtClient;	GetClientRect(&rtClient);	for ( int nCol=0; GetColumn(nCol, &lvc); nCol++)	{		if ( nCol > 0 ) 		{			// Get Previous Column Width in order to move the next display item			GetColumn(nCol-1, &lvcprev) ;			lpDrawItemStruct->rcItem.left += lvcprev.cx ;			lpDrawItemStruct->rcItem.right += lpDrawItemStruct->rcItem.left; 		}		CRect rcItem;   		if (!GetSubItemRect(lpDrawItemStruct->itemID,nCol,LVIR_LABEL,rcItem))   			continue;   		::ZeroMemory(&lvi, sizeof(lvi));		lvi.iItem = lpDrawItemStruct->itemID;		lvi.mask = LVIF_TEXT | LVIF_PARAM;		lvi.iSubItem = nCol;		lvi.pszText = lpBuffer;		lvi.cchTextMax = sizeof(lpBuffer);		VERIFY(GetItem(&lvi));		CRect rcTemp;		rcTemp = rcItem;		if (nCol==0)		{			rcTemp.left -=2;		}		if ( lpDrawItemStruct->itemState & ODS_SELECTED )		{			pDC->FillSolidRect(&rcTemp, GetSysColor(COLOR_HIGHLIGHT)) ;			pDC->SetTextColor(GetSysColor(COLOR_HIGHLIGHTTEXT)) ;		}		else		{			COLORREF color;			color = GetBkColor();			pDC->FillSolidRect(rcTemp,color);			if (FindColColor(nCol,color))			{				pDC->FillSolidRect(rcTemp,color);			}			if (FindItemColor(nCol,lpDrawItemStruct->itemID,color))			{				pDC->FillSolidRect(rcTemp,color);			}						//pDC->SetTextColor(m_color);		}		pDC->SelectObject(GetStockObject(DEFAULT_GUI_FONT));		UINT   uFormat    = DT_CENTER ;		if (m_Header.m_Format[nCol]=='0')		{			uFormat = DT_LEFT;		}		else if (m_Header.m_Format[nCol]=='1')		{			uFormat = DT_CENTER;		}		else if (m_Header.m_Format[nCol]=='2')		{			uFormat = DT_RIGHT;		}		TEXTMETRIC metric;		pDC->GetTextMetrics(&metric);		int ofst;		ofst = rcItem.Height() - metric.tmHeight;		rcItem.OffsetRect(0,ofst/2);		pDC->SetTextColor(m_color);		COLORREF color;		if (FindColTextColor(nCol,color))//.........这里部分代码省略.........
开发者ID:marco-sun,项目名称:arbi6,代码行数:101,


示例27: CancelEdit

CEdit* CListCtrlEx::EditSubItem (int Item, int Column){    // The returned pointer should not be saved	CancelEdit(FALSE);    // Make sure that the item is visible    if (!EnsureVisible (Item, TRUE))     {		InsertItemEx (Item);		if (!EnsureVisible (Item, TRUE)) 			return NULL;    }    // Make sure that nCol is valid    CHeaderCtrl* pHeader = (CHeaderCtrl*) GetDlgItem(0);    int nColumnCount = pHeader->GetItemCount();    if (Column >= nColumnCount || GetColumnWidth (Column) < 5)		return NULL;    // Get the column offset    int Offset = 0;    for (int iColumn = 0; iColumn < Column; iColumn++)		Offset += GetColumnWidth (iColumn);    CRect Rect;    GetItemRect (Item, &Rect, LVIR_BOUNDS);    // Now scroll if we need to expose the column    CRect ClientRect;    GetClientRect (&ClientRect);    if (Offset + Rect.left < 0 || Offset + Rect.left > ClientRect.right)    {		CSize Size;		if (Offset + Rect.left > 0)			Size.cx = -(Offset - Rect.left);		else			Size.cx = Offset - Rect.left;		Size.cy = 0;		Scroll (Size);		Rect.left -= Size.cx;    }    // Get Column alignment    LV_COLUMN lvCol;    lvCol.mask = LVCF_FMT;    GetColumn (Column, &lvCol);    DWORD dwStyle;    if ((lvCol.fmt & LVCFMT_JUSTIFYMASK) == LVCFMT_LEFT)		dwStyle = ES_LEFT;    else if ((lvCol.fmt & LVCFMT_JUSTIFYMASK) == LVCFMT_RIGHT)		dwStyle = ES_RIGHT;    else dwStyle = ES_CENTER;    Rect.left += Offset+4;    Rect.right = Rect.left + GetColumnWidth (Column) - 3;    if (Rect.right > ClientRect.right)		Rect.right = ClientRect.right;    dwStyle |= WS_BORDER | WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL;    // Send Notification to parent of ListView ctrl    LV_DISPINFO dispinfo;    dispinfo.hdr.hwndFrom = m_hWnd;    dispinfo.hdr.idFrom = 0;    dispinfo.hdr.code = LVN_BEGINLABELEDIT;    dispinfo.item.mask = LVIF_TEXT;    dispinfo.item.iItem = Item;    dispinfo.item.iSubItem = Column;    dispinfo.item.pszText = NULL;    dispinfo.item.cchTextMax = 0;	// Return Values	// To allow the user to edit the label, return FALSE.	// To prevent the user from editing the label, return TRUE.    if (!GetParent()->SendMessage (WM_NOTIFY, GetDlgCtrlID(), (LPARAM) &dispinfo)) {		CEditCell *pEdit = new CEditCell (this, Item, Column, GetItemText(Item, Column), 			m_AutoComplete.GetCount() > 0 ? &m_AutoComplete : NULL);		pEdit->Create (dwStyle, Rect, this, IDC_EDITCELL);	    return pEdit;	} else {		return NULL;	}}
开发者ID:stievie,项目名称:bibedt,代码行数:86,



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


C++ GetCommLineStatus函数代码示例
C++ GetColour函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。