当前位置: 首页>>代码示例>>C++>>正文


C++ GetCurSel函数代码示例

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


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

示例1: GetItemCount

BOOL CIETabBar::SetNextSel()
{
	int nCount = GetItemCount();
	int nCurSel = GetCurSel();

	if (nCount >= 2)
	{
		if ( nCurSel == nCount-1 )//如果选择的是最后一个
		{
			SetCurSel(0);
		}
		else
		{
			SetCurSel(nCurSel + 1);
		}
	}
	return TRUE;
}
开发者ID:gaozan198912,项目名称:myproject,代码行数:18,代码来源:IE8TabBar.cpp

示例2: GetCurSel

void CTabCtrlSSL::OnSelChanging (NMHDR* pNMHDR, LRESULT* pResult) {
	// Notify derived classes that the selection is changing.
	int nIndex = GetCurSel ();
	if (nIndex == -1)
		return;

	OnDeactivatePage (nIndex, m_nPageIDs[nIndex]);

	// Save the input focus and hide the old page.
    TabDelete tabDelete = m_tabs[nIndex];
    CTabPageSSL* pDialog = tabDelete.pTabPage;

	if (pDialog != NULL) {
		m_hFocusWnd[nIndex] = ::GetFocus ();
		pDialog->ShowWindow (SW_HIDE);
	}
	*pResult = 0;
}
开发者ID:autocaddesk,项目名称:NtripCaster,代码行数:18,代码来源:TabCtrlSSL.cpp

示例3: ASSERT

CString COdbcValueComboBox::GetSelectedValueKey() const
{
	ASSERT(GetSafeHwnd());

	int nSel = GetCurSel();

	if (nSel == -1)
		return _T("");

	// else
	int nKey = GetItemData(nSel);
	ASSERT(nKey >= 0 && nKey < m_aKeys.GetSize());

	if (nKey < 0 || nKey >= m_aKeys.GetSize())
		return _T("");

	return m_aKeys[nKey];
}
开发者ID:Fox-Heracles,项目名称:TodoList,代码行数:18,代码来源:odbcvaluecombobox.cpp

示例4: GetCurSel

FONTITEM_PPG* CFontComboBox::GetFontItem(int sel)
{
	if (sel == -1)
		sel = GetCurSel();

	if (sel == -1)
	{
		CString str;

		GetWindowText( str );
		sel = FindString( -1, str );
		if (sel == CB_ERR)
			sel = 0;
	}

	ASSERT( GetItemData(sel) );
	return (FONTITEM_PPG*) GetItemData(sel);
}
开发者ID:Rupan,项目名称:winscp,代码行数:18,代码来源:ppgfont.cpp

示例5: GetJobCount

void CJobControlDlg::UpdateUI(int JobIdx)
{
	int	jobs = GetJobCount();
	if (JobIdx < 0)
		JobIdx = GetCurSel();
	// update job positioning buttons
	m_MoveUpBtn.EnableWindow(JobIdx > 0);
	m_MoveDownBtn.EnableWindow(JobIdx >= 0 && JobIdx < jobs - 1);
	// update job status buttons; don't let user change status of running job
	bool	StatChgOK = JobIdx >= 0 && !IsRunning(JobIdx);
	m_PostponeBtn.EnableWindow(StatChgOK);
	m_DeleteBtn.EnableWindow(StatChgOK);
	// update job control buttons
	bool	BatchMode = m_Main->GetBatchMode();	// true if batch jobs are running
	m_StartBtn.EnableWindow(jobs && !BatchMode && FindWaiting() >= 0);
	m_AbortBtn.EnableWindow(jobs && BatchMode);
	m_SkipBtn.EnableWindow(JobIdx >= 0 && BatchMode);
}
开发者ID:victimofleisure,项目名称:FFRend,代码行数:18,代码来源:JobControlDlg.cpp

示例6: SetSel

int CDomainListBox::SelectItem( int nSel, BOOL bSelected )
{
	if( GetStyle( ) & LBS_MULTIPLESEL )
	{
		return SetSel( nSel, bSelected );
	}
	else
	{
		if( bSelected )
			return SetCurSel( nSel );
		else
		{
			if( GetCurSel() == nSel || -1 == nSel )
				return SetCurSel( -1 );
		}
		return -1;
	}
}
开发者ID:amikey,项目名称:tradingstrategyking,代码行数:18,代码来源:SetGroupDlg.cpp

示例7: GetCurSel

void CXTabCtrl::OnSelchange(NMHDR* pNMHDR, LRESULT* pResult) 
{
	// TODO: Add your control notification handler code here
	int iNewTab = GetCurSel();

	if (!IsTabEnabled(iNewTab))
	{
		SetCurSel(m_iSelectedTab);
	}
	else
	{
		TCITEM item;
		CWnd* pWnd;

		item.mask = TCIF_PARAM;
		
		//** hide the current tab ---------
		GetItem(m_iSelectedTab, &item);
		pWnd = reinterpret_cast<CWnd*> (item.lParam);
		ASSERT_VALID(pWnd);
		pWnd->ShowWindow(SW_HIDE);

		//** show the selected tab --------
		GetItem(iNewTab, &item);
		pWnd = reinterpret_cast<CWnd*> (item.lParam);
		ASSERT_VALID(pWnd);

		// 改变属性页的大小位置
		CRect rc;
		GetClientRect(rc);
		rc.top		+= 20;
		rc.bottom	-= 3;
		rc.left		+= 2;
		rc.right	-= 3;
		pWnd->MoveWindow(&rc);

		pWnd->ShowWindow(SW_SHOW);

		// 发送到父窗口Tab项改变
		GetParent()->SendMessage(WM_TAB_SEL_CHANGED,0,iNewTab);
	}

	*pResult = 0;
}
开发者ID:corefan,项目名称:nativetaskmanager,代码行数:44,代码来源:XTabCtrl.cpp

示例8: GetCurSel

void CListImpl::OnMouseMove(UINT wParam, WTL::CPoint pt)
{
  if (m_last_pt == pt) // not moving
    return;
  m_last_pt = pt;
  int index = GetCurSel();
  WTL::CRect mainrc = GetHittestDivideRect(2 * index);
  WTL::CRect seconrc = GetHittestDivideRect(2 * index + 1);

  if (PtInRect(&mainrc, pt))
  {
    if (m_highlightstat == 1)
      return;

    SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_HAND));
    ::SetCursor(LoadCursor(NULL, IDC_HAND));
    m_highlightstat = 1;
    Invalidate(FALSE);
    return;
  }

  if (PtInRect(&seconrc, pt))
  {
    if (m_highlightstat == 2)
      return;

    SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_HAND));
    SetCursor(LoadCursor(NULL, IDC_HAND));
    m_highlightstat = 2;
    Invalidate(FALSE);
    return;
  }

  int bhightlightorg = m_highlightstat;
  m_highlightstat = 0;

  SetClassLong(m_hWnd, GCL_HCURSOR, (LONG)LoadCursor(NULL, IDC_ARROW));
  SetCursor(LoadCursor(NULL, IDC_ARROW));

  if (bhightlightorg != m_highlightstat)
    Invalidate(FALSE);

}
开发者ID:Strongc,项目名称:playasa,代码行数:43,代码来源:ListImpl.cpp

示例9: GetCurSel

BOOL CTDLFindTaskExpressionListCtrl::DeleteSelectedRule()
{
	int nRow = GetCurSel();

	if (nRow != -1 && CanDeleteSelectedCell())
	{
		DeleteItem(nRow);
		m_aSearchParams.RemoveAt(nRow);

		ValidateListData();

		SetCurSel(nRow);
		EnsureVisible(nRow, FALSE);

		return TRUE;
	}

	return FALSE;
}
开发者ID:jithuin,项目名称:infogeezer,代码行数:19,代码来源:TDLFindTaskExpressionListCtrl.cpp

示例10: GetSelectedClass

// Gets the selected class from the listbox
CString CClassList::GetSelectedClass()
{
	// Get the current selection
	int nSelString=GetCurSel();
	if (nSelString != LB_ERR)
	{
		// Get the string for the current selection
		CString sString;
		GetText(nSelString, sString);

		// Return the string
		return sString;
	}
	else
	{
		// Return an empty string
		return "";
	}
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:20,代码来源:ClassList.cpp

示例11: GetWindowText

void CUnitComboBox::Tran(CWnd *pWnd)
{
	CString strText;
	CString strUnit;
	double dOut = 0;
	double dOut1 = 0;
	pWnd->GetWindowText(strText);
	GetWindowText(strUnit);
	double dIn = _tcstod(strText, '\0');
	TransformToStd(dOut,strUnit,dIn);

	int nIndex = GetCurSel();
	if(CB_ERR != nIndex)
	{
		GetLBText(nIndex,strUnit);
	}
	TransformFromStd(dOut1,strUnit,dOut);
	pWnd->SetWindowText(GetValue(dOut1));
}
开发者ID:uesoft,项目名称:AutoPFA,代码行数:19,代码来源:UnitComboBox.cpp

示例12: GetCurSel

void CListBoxEx::CreateComboControl()
{
    if(IsWindow(ComboCtrl.m_hWnd))
        return;

    // create edit control
    int iItem = GetCurSel();
    if(iItem == LB_ERR)
        return;

    LBEXTITEMSTRUCT& lbis = Items[iItem];

    if(lbis.iEditType != lbeChoices)
        return;

    CRect r;
    GetItemRect(iItem, r);
    r.left += iCaptionWidthPixels;
    r.bottom += 80;

    // create combo ctrl
    ComboCtrl.Create(WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST |
                     WS_TABSTOP, r, this, IDC_EDITPARAMETER);
    // set font
    HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
    if (hFont == NULL)
        hFont = (HFONT)GetStockObject(ANSI_VAR_FONT);
    ComboCtrl.SendMessage(WM_SETFONT, (WPARAM)hFont);

    // add strings to combo ctrl
    CStringArray * pChoices = lbis.pChoices;
    Assert(pChoices);

    for(int i = 0; i < pChoices->GetSize(); i++)
        ComboCtrl.AddString(pChoices->GetAt(i));

    // set current selection in combo ctrl
    ComboCtrl.SetCurSel(lbis.iDataValue);
    ComboCtrl.SetForegroundWindow();

    bControlActive = TRUE;
    iControlItem = iItem;
}
开发者ID:steadyfield,项目名称:SourceEngine2007,代码行数:43,代码来源:listboxex.cpp

示例13: GetCurSel

TZNotePage *
TZNoteBook::GetActivePage( )
{
   zSHORT nCurrIdx = GetCurSel( );
#ifdef DEBUG_ALL
   TraceLineI( "TZNoteBook::GetActivePage: ", nCurrIdx );
#endif

   TZNotePage *pCurrNotePage = m_pZNotePage;
   while ( pCurrNotePage )
   {
      if ( pCurrNotePage->m_nTabIdx == nCurrIdx )
         break;

      pCurrNotePage = pCurrNotePage->m_pNext;
   }

   return( pCurrNotePage );
}
开发者ID:DeegC,项目名称:10d,代码行数:19,代码来源:TzCtlTAB.cpp

示例14: GetCurSel

bool CShaderListBox::DeleteCurrentShader()
{
    bool ret = false;
    int sel = GetCurSel();
    if (sel != LB_ERR) {
        if (DeleteShader(sel) != LB_ERR) {
            ret = true;
            if (GetCount() == sel) {
                sel--;
            }
            if (sel >= 0) {
                VERIFY(SetCurSel(sel) != LB_ERR);
            }
        } else {
            ASSERT(FALSE);
        }
    }
    return ret;
}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:19,代码来源:PPageShaders.cpp

示例15: Input

/******************************************************************************
 Function Name  :   OnRButtonDown

 Description    :   The framework calls this member function when the user
                    right clicks on the list box
 Input(s)       :    nFlags -
                    point -
 Output         :   -
 Functionality  :   Shows a popup menu to clear the contents of the listbox
 Member of      :   CNotificListbox

 Author(s)      :   Ravikumar Patil
 Date Created   :   27-03-2003
******************************************************************************/
void CNotificListbox::OnRButtonDown(UINT nFlags, CPoint point)
{
    if (GetCount() > 0)
    {
        CMenu* pomContextMenu = new CMenu;

        if (pomContextMenu != NULL)
        {
            // Load the Menu from the resource
            pomContextMenu->DestroyMenu();
            pomContextMenu->LoadMenu(IDM_OPERATION_LIST);
            CMenu* pomSubMenu = pomContextMenu->GetSubMenu(0);

            if (pomSubMenu != NULL)
            {
                CPoint omSrcPt = point;
                ClientToScreen(&omSrcPt);
                UINT unEnable;

                /* If no item is selected, make "Clear" and "Delete" menu
                items disabled */
                if (GetCurSel() == -1)
                {
                    unEnable = MF_BYCOMMAND | MF_DISABLED | MF_GRAYED;
                }
                else
                {
                    unEnable = MF_BYCOMMAND | MF_ENABLED;
                }

                pomSubMenu->EnableMenuItem(IDM_OPRTN_CLEAR, unEnable);
                pomSubMenu->EnableMenuItem(IDM_OPRTN_DELETE, unEnable);
                pomSubMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
                                           omSrcPt.x, omSrcPt.y, this, NULL);
            }

            delete pomContextMenu;
            pomContextMenu = NULL;
        }
    }

    CListBox::OnRButtonDown(nFlags, point);
}
开发者ID:Ferrere,项目名称:busmaster,代码行数:57,代码来源:NotificListbox.cpp


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