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


C++ CTabLayoutUI::SelectItem方法代码示例

本文整理汇总了C++中CTabLayoutUI::SelectItem方法的典型用法代码示例。如果您正苦于以下问题:C++ CTabLayoutUI::SelectItem方法的具体用法?C++ CTabLayoutUI::SelectItem怎么用?C++ CTabLayoutUI::SelectItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CTabLayoutUI的用法示例。


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

示例1: DuiControl

void    CZiMainFrame::OnSelectTab(TNotifyUI & msg)
{
	CTabLayoutUI * pTabs = DuiControl(CTabLayoutUI, _T("Tabs"));
	if(!pTabs) return ;

	if(msg.pSender->GetName() == _T("FriendBtn"))
	{
		if(pTabs->GetCurSel() != 0)
		{
			pTabs->SelectItem(0);
			//UpdateFriendsList();
		}

		return;
	}

	if(msg.pSender->GetName() == _T("GroupBtn"))
	{
		if(pTabs->GetCurSel() != 1)
		{
			pTabs->SelectItem(1);
			//UpdateGroupsList();
		}

		return;
	}
}
开发者ID:yuechuanbingzhi163,项目名称:zimc,代码行数:27,代码来源:MainWindow.cpp

示例2: Notify

void CFrameWnd::Notify( TNotifyUI& msg )
{
    if( msg.sType == _T("click") ) 
    {
        if( msg.pSender->GetName() == _T("btnMenu") ) 
        {
            POINT pt = {msg.ptMouse.x, msg.ptMouse.y};
            CMenuWnd *pMenu = new CMenuWnd(_T("Menu/menu.xml"));

            pMenu->Init(*this, pt);
            pMenu->ShowWindow(TRUE);
        }
    }
    else if(msg.sType == _T("selectchanged"))
    {
        CDuiString    strName     = msg.pSender->GetName();
        CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(_T("tabTest")));

        if(strName == _T("OptionDemo1"))
            pControl->SelectItem(0);
        else if(strName == _T("OptionDemo2"))
            pControl->SelectItem(1);
        else if(strName == _T("OptionDemo3"))
            pControl->SelectItem(2);
    }

    __super::Notify(msg);
}
开发者ID:CodeBees,项目名称:duilib-Ex-Debug,代码行数:28,代码来源:FrameWnd.cpp

示例3: OnSelectChange

void MainFrame::OnSelectChange(TNotifyUI& msg)
{
	CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(kMainTabControlName));
	if (_tcsicmp(msg.pSender->GetName(), kFriendButtonControlName) == 0)
	{
		if (pTabControl && pTabControl->GetCurSel() != 0)
		{
			pTabControl->SelectItem(0);
			UpdateFriendsList();
		}
	}
	else if (_tcsicmp(msg.pSender->GetName(), kGroupButtonControlName) == 0)
	{
		if (pTabControl && pTabControl->GetCurSel() != 1)
		{
			pTabControl->SelectItem(1);
			UpdateGroupsList();
		}
	}
	else if (_tcsicmp(msg.pSender->GetName(), kMicroBlogButtonControlName) == 0)
	{
		if (pTabControl && pTabControl->GetCurSel() != 2)
		{
			pTabControl->SelectItem(2);
			UpdateRecentlyList();
		}
	}
}
开发者ID:hgl888,项目名称:TeamTalk,代码行数:28,代码来源:main_frame_event.cpp

示例4: Notify

	void Notify(TNotifyUI& msg)
	{
		if( msg.sType == _T("windowinit") ) OnPrepare();
		else if( msg.sType == _T("click") ) {
			if( msg.pSender == m_pCloseBtn ) {
				PostQuitMessage(0);
				return; 
			}
#if defined(UI_BUILD_FOR_WIN32) && !defined(UI_BUILD_FOR_WINCE)
			else if( msg.pSender == m_pMinBtn ) { 
				SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0); return; }
			else if( msg.pSender == m_pMaxBtn ) { 
				SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0); return; }
			else if( msg.pSender == m_pRestoreBtn ) { 
				SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0); return; }
#else
			else if( msg.pSender == m_pMinBtn ) { 
				::ShowWindow(*this, SW_MINIMIZE); return;
			}
			else if( msg.pSender == m_pMaxBtn ) { 
				::ShowWindow(*this, SW_MAXIMIZE);
				CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(_T("maxbtn")));
				if( pControl ) pControl->SetVisible(false);
				pControl = static_cast<CControlUI*>(m_pm.FindControl(_T("restorebtn")));
				if( pControl ) pControl->SetVisible(true);
				return;
			}
			else if( msg.pSender == m_pRestoreBtn ) { 
				::ShowWindow(*this, SW_RESTORE);

				CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(_T("maxbtn")));
				if( pControl ) pControl->SetVisible(true);
				pControl = static_cast<CControlUI*>(m_pm.FindControl(_T("restorebtn")));
				if( pControl ) pControl->SetVisible(false);
				return;
			}
#endif
		}
		else if(msg.sType==_T("setfocus"))
		{
			CStdString name = msg.pSender->GetName();
			CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
			if(name==_T("examine"))
				 pControl->SelectItem(0);
			else if(name==_T("trojan"))
				 pControl->SelectItem(1);
			else if(name==_T("plugins"))
				pControl->SelectItem(2);
			else if(name==_T("vulnerability"))
				pControl->SelectItem(3);
			else if(name==_T("rubbish"))
				pControl->SelectItem(4);
			else if(name==_T("cleanup"))
				pControl->SelectItem(5);
			else if(name==_T("fix"))
				pControl->SelectItem(6);
			else if(name==_T("tool"))
				pControl->SelectItem(7);
		}
	}
开发者ID:achellies,项目名称:DUI_LIb,代码行数:60,代码来源:360Safe.cpp

示例5: OnSelectChanged

void CTradeCtrl::OnSelectChanged( TNotifyUI &msg )
{
    CDuiString name = msg.pSender->GetName();
    CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pThisWnd->m_PaintManager.FindControl(_T("MarketSwitch")));
    
    static COptionUI* pLastButton = NULL;
    static CAbstractUI* pLastTab = NULL;
    CAbstractUI* pUI = NULL;

    for (int idx=0; idx<m_pThisWnd->m_TabContainer.GetSize(); ++idx)
    {
        if (name == m_pThisWnd->m_TabContainer[idx])
        {
            pUI = (CAbstractUI*)m_pThisWnd->m_TabContainer.Find(name);
        }
    }
    if (pUI == NULL) return;

    if (pLastTab != NULL && pUI != pLastTab && !pLastTab->CanChange()) 
	{
        if (pLastButton) pLastButton->Selected(true);
		//::MessageBox(NULL, _T(""), _T(""), MB_OK);
		return;
    }
    
    if (pUI && pUI!=pLastTab) 
	{
        pUI->RefreshWnd();
        pControl->SelectItem(pUI->GetIndex());
        pLastTab = pUI;
        pLastButton = static_cast<COptionUI*>(m_pThisWnd->m_PaintManager.FindControl(msg.pSender->GetName()));
    }
}
开发者ID:goodgo,项目名称:TradeClient,代码行数:33,代码来源:TradeController.cpp

示例6: OnSelChanged

void CMainDialog::OnSelChanged( CControlUI* pSender )
{
	CTabLayoutUI* pTabTest = static_cast <CTabLayoutUI*>(m_pm.FindControl(_T ("tabTest")));
	if (pTabTest == NULL) {
		return;
	}

	CDuiString strSelName = pSender->GetName();
	if (strSelName == _T ("tabButton")) {
		pTabTest->SelectItem(0);
	}
	else if (strSelName == _T ("tabEdit")) {
		pTabTest->SelectItem(1);
	}
	else if (strSelName == _T ("tabTree")) {
		pTabTest->SelectItem(2);
	}
	else if (strSelName == _T ("tabList")) {
		pTabTest->SelectItem(3);
	}
	else if (strSelName == _T ("tabMenu")) {
		pTabTest->SelectItem(4);
	}
	else if (strSelName == _T ("tabActivex")) {
		pTabTest->SelectItem(5);
	}
	else if (strSelName == _T ("tabCombobox")) {
		pTabTest->SelectItem(6);
	}
}
开发者ID:yiminyangguang520,项目名称:duilib,代码行数:30,代码来源:MainDialog.cpp

示例7: BindTriggerTabSel

	void CButtonUI::BindTriggerTabSel( int _SetSelectIndex /*= -1*/ )
	{
		LPCTSTR pstrName = GetBindTabLayoutName();
		if(pstrName == NULL || (GetBindTabLayoutIndex() < 0 && _SetSelectIndex < 0))
			return;

		CTabLayoutUI* pTabLayout = static_cast<CTabLayoutUI*>(GetManager()->FindControl(pstrName));
		if(!pTabLayout) return;
		pTabLayout->SelectItem(_SetSelectIndex >=0?_SetSelectIndex:GetBindTabLayoutIndex());
	}
开发者ID:anlev5,项目名称:DuiLib_Ultimate,代码行数:10,代码来源:UIButton.cpp

示例8: SwitchDialog

void CCloud::SwitchDialog(int nIndex)
{
	CTabLayoutUI* pTable = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(_T("tabPage")));
	ASSERT(pTable != NULL);

	if (nIndex != pTable->GetCurSel())
	{
		pTable->SelectItem(m_nIndex);
		m_nIndex = nIndex;
	}
}
开发者ID:zsjtoby,项目名称:iume,代码行数:11,代码来源:iCloud.cpp

示例9: BindTriggerTabSel

	void CButtonUI::BindTriggerTabSel( int _SetSelectIndex /*= -1*/ )
	{
		if(GetBindTabLayoutName().IsEmpty() || (GetBindTabLayoutIndex() < 0 && _SetSelectIndex < 0))
			return;

		CTabLayoutUI* pTabLayout = static_cast<CTabLayoutUI*>(GetManager()->FindControl(GetBindTabLayoutName()));
		if(!pTabLayout)
			return;

		pTabLayout->SelectItem(_SetSelectIndex >=0?_SetSelectIndex:GetBindTabLayoutIndex());
	}
开发者ID:hioscar,项目名称:DuiLib_Ultimate,代码行数:11,代码来源:UIButton.cpp

示例10: Notify

void CMainWnd::Notify( TNotifyUI &msg )
{
	if(msg.sType.CompareNoCase(DUI_MSGTYPE_SCROLL) == 0)
	{
		CVerticalLayoutUI* pTabPanel = (CVerticalLayoutUI*)msg.pSender;
		CString sName = msg.pSender->GetName();
		int nPage = (int)msg.wParam;
		CString sTabPanel = sName;
		int nIdx = sTabPanel.Find(_T("@"));
		if(nIdx == -1) return;
		CString sType = sTabPanel.Mid(nIdx + 1);
		if(nPage < 1) nPage = 1;
		if(nPage > 200) nPage = 200;

		int nScrollPos = (nPage - 1) * pTabPanel->GetVerticalScrollBar()->GetLineSize();
		SIZE szSize = {0, nScrollPos};
		pTabPanel->SetScrollPos(szSize, false);

		m_Data.LoadBizhi(sType, nPage, 10);
	}
	else if(msg.sType.CompareNoCase(DUI_MSGTYPE_SELECTCHANGED) == 0)
	{
		COptionUI* pTabBtn = (COptionUI*)msg.pSender;
		CTabLayoutUI* pTabLayout = (CTabLayoutUI*)m_PaintManager.FindControl(_T("wp_tablayout"));
		CString sName = pTabBtn->GetName();
		if(sName == _T("wp_tabbtn") && pTabLayout)
		{
			CString sType = pTabBtn->GetUserData();
			CString sTabPanel;
			sTabPanel.Format(_T("[email protected]%s"), sType);
			CVerticalLayoutUI* pTabPanel = (CVerticalLayoutUI*)m_PaintManager.FindControl(sTabPanel);
			if(pTabPanel == NULL)
			{
				m_Data.LoadBizhi(sType, 1, 10);
			}
			else
			{
				pTabLayout->SelectItem(pTabPanel);
			}
		}
	}
	else if(msg.sType.CompareNoCase(DUI_MSGTYPE_CLICK_WPFAV) == 0)
	{
		MessageBox(NULL, _T("收藏成功"), _T("百度壁纸 - 提示"), MB_OK);
	}
	else if(msg.sType.CompareNoCase(DUI_MSGTYPE_CLICK_WPSET) == 0)
	{
		CWPButton* pWPBtn = (CWPButton*)msg.pSender;
		pWPBtn->SetWP();
	}
	return WindowImplBase::Notify(msg);
}
开发者ID:Crawping,项目名称:DuiLib_Ultimate,代码行数:52,代码来源:MainWnd.cpp

示例11: TBCIAWindowProc

BOOL CALLBACK TBCIAWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	BOOL res = 0;
	std::map<HWND, WNDPROC>::iterator iter = g_windowInfoMap.find( hwnd );
	//DEBUG_INFO("hwnd 0x%x message 0x%x wparam 0x%x lparam 0x%x\n",hwnd,message,wParam,lParam);
	if( iter != g_windowInfoMap.end() )
	{

 		if (message == WM_PAINT)
 		{
 			ShowWindow( hwnd, SW_HIDE );
 		}
		else if( message == LVM_SETITEMTEXT ) // TODO  安装细节显示  等找到消息再写
		{
			;
		}
 		else if( message == PBM_SETPOS ) 
 		{
			CProgressUI* pProgress = static_cast<CProgressUI*>(g_pFrame->GetPaintManager().FindControl( g_tempParam ));
			pProgress->SetMaxValue( 30000 );
			if( pProgress == NULL )
				return 0;
			pProgress->SetValue( (int)wParam);

			if( pProgress->GetValue() == 30000 )
			{
				CTabLayoutUI* pTab = NULL;
				int currentIndex;
				pTab = static_cast<CTabLayoutUI*>(g_pFrame->GetPaintManager().FindControl( g_installPageTabName ));
				if( pTab == NULL )
					return -1;
				currentIndex = pTab->GetCurSel();
				pTab->SelectItem( currentIndex + 1 );
			}
 		}
 		else
 		{
			res = CallWindowProc( iter->second, hwnd, message, wParam, lParam);
		}
	}	
	return res;
}
开发者ID:liao0818,项目名称:nsduilib,代码行数:42,代码来源:nsduilib.cpp

示例12: Notify

	void Notify(TNotifyUI& msg)
	{
		if( msg.sType == _T("windowinit") ) OnPrepare();
		else if( msg.sType == _T("click") ) {
			if( msg.pSender == m_pCloseBtn ) {
				PostQuitMessage(0);
				return; 
			}
			else if( msg.pSender == m_pMinBtn ) { 
				SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0); return; }
			else if( msg.pSender == m_pMaxBtn ) { 
				SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0); return; }
			else if( msg.pSender == m_pRestoreBtn ) { 
				SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0); return; }
		}
		else if(msg.sType==_T("selectchanged"))
		{
			CDuiString name = msg.pSender->GetName();
			CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
			if(name==_T("examine"))
				 pControl->SelectItem(0);
			else if(name==_T("trojan"))
				 pControl->SelectItem(1);
			else if(name==_T("plugins"))
				pControl->SelectItem(2);
			else if(name==_T("vulnerability"))
				pControl->SelectItem(3);
			else if(name==_T("rubbish"))
				pControl->SelectItem(4);
			else if(name==_T("cleanup"))
				pControl->SelectItem(5);
			else if(name==_T("fix"))
				pControl->SelectItem(6);
			else if(name==_T("tool"))
				pControl->SelectItem(7);
		}
	}
开发者ID:yylwuwei,项目名称:HelloWorld,代码行数:37,代码来源:360Safe.cpp

示例13: if

void CDuilib3dFrame::Notify(TNotifyUI& msg)
{
	CStdString strName = msg.pSender->GetName();
	if(msg.sType == _T("windowinit"))
	{
		
	}
	else if (msg.sType == _T("click"))
	{
		if (strName == _T("closebtn"))
		{
			//Close();
			m_cls.Create(m_hWnd,230,false,SW_MINIMIZE,CCloseAnimation::STYLE_CLOSE_ICON);
		}

		else if (strName == _T("scanbtn"))
		{
			CControlUI* pControl = m_PaintManager.FindControl(_T("testanibtn"));
			RECT rc = pControl->GetPos();
			rc.right = rc.left+64;
			rc.bottom = rc.top+64;
			POINT ptCenter = {rc.left+32,rc.top+32};
			POINT ptTrans = {-120,100};
			CAnimJobUI anim(0,500,ptCenter,ptTrans,1.0f,1.0f);
			anim.SetTextureFromFile(_T("../bin/skin/texture.png"));
			m_PaintManager.AddAnimJob(anim);
		}
		else if (strName == _T("common") || strName == _T("mumaoption")
			 || strName == _T("shaduoption") || strName == _T("wangdunoption")
			  || strName == _T("fdhoption") || strName == _T("rjgjoption"))
		{
			RECT rc = msg.pSender->GetPos();
			POINT ptStartCenter = {rc.left+(rc.right-rc.left)/2,rc.top+(rc.bottom-rc.top)/2};
			POINT ptTrans = {200,0};
			CAnimJobUI anim(0,500,ptStartCenter,ptTrans,1.0f,1.0f,false,false,rc,rc);
			anim.SetSpeedType(SPEED_LINEAR);
			m_PaintManager.AddAnimJob(anim);
		}
		else if (strName == _T("testanibtn"))
		{
		}
	}
	else if(msg.sType==_T("selectchanged"))
	{
		CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(_T("switch")));			
		RECT rcSrc = pControl->GetPos();
		RECT rcClip = {rcSrc.left+1,rcSrc.top+1,rcSrc.right-1,rcSrc.bottom};;
		long rcWidth = rcClip.right - rcClip.left;
		long rcHeight = rcClip.bottom - rcClip.top;
		CStdString stdString[8] = {_T("examine"),_T("trojan"),_T("plugins"),_T("vulnerability"),_T("rubbish"),_T("cleanup"),_T("fix"),_T("tool")};
		POINT ptStartCenter = {rcClip.left+rcWidth/2,rcClip.top+rcHeight/2};
		POINT ptTrans = {-rcWidth,0};

		for (int i=0;i<8;++i)
		{
			if (strName == stdString[i])
			{
				CAnimJobUI anim(0,500,ptStartCenter,ptTrans,1.0f,1.0f,true,true,rcClip,rcClip);
				m_PaintManager.AddAnimJob(anim);
				pControl->SelectItem(i);
				ptStartCenter.x += rcWidth;
				CAnimJobUI animTmp(0,500,ptStartCenter,ptTrans,1.0f,1.0f,true,true,rcClip,rcClip,WM_USER+1,pControl);				
				if (m_PaintManager.AddAnimJob(animTmp))
				{
					pControl->SetVisible(false);
				}
			}
		}
	}
	else if (msg.sType == _T("tabselect"))
	{
	}
}
开发者ID:likebeta,项目名称:code-snippets,代码行数:73,代码来源:Duilib3dFrame.cpp

示例14: Notify

void ColorSkinWindow::Notify(TNotifyUI& msg)
{
	if (_tcsicmp(msg.sType, _T("click")) == 0)
	{
		CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(kTabControlName));
		if (pTabControl != NULL)
		{
			if (pTabControl->GetCurSel() == 0)
			{
				if (_tcsstr(msg.pSender->GetName(), _T("colour_")) != 0)
				{
					CSliderUI* AdjustColorSliderR = static_cast<CSliderUI*>(m_PaintManager.FindControl(kAdjustColorSliderRControlName));
					CSliderUI* AdjustColorSliderG = static_cast<CSliderUI*>(m_PaintManager.FindControl(kAdjustColorSliderGControlName));
					CSliderUI* AdjustColorSliderB = static_cast<CSliderUI*>(m_PaintManager.FindControl(kAdjustColorSliderBControlName));
					if ((AdjustColorSliderR != NULL) && (AdjustColorSliderG != NULL) && (AdjustColorSliderB != NULL))
					{
						DWORD dwColor = msg.pSender->GetBkColor();
						AdjustColorSliderR->SetValue(static_cast<BYTE>(GetRValue(dwColor)));
						AdjustColorSliderG->SetValue(static_cast<BYTE>(GetGValue(dwColor)));
						AdjustColorSliderB->SetValue(static_cast<BYTE>(GetBValue(dwColor)));

						main_frame_->SetBkColor(dwColor);
					}
				}
			}
			else if (pTabControl->GetCurSel() == 1)
			{}
		}
	}
	else if (_tcsicmp(msg.sType, _T("valuechanged")) == 0)
	{
		CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(kTabControlName));
		if (pTabControl != NULL)
		{
			if (pTabControl->GetCurSel() == 0)
			{
				CSliderUI* AdjustColorSliderR = static_cast<CSliderUI*>(m_PaintManager.FindControl(kAdjustColorSliderRControlName));
				CSliderUI* AdjustColorSliderG = static_cast<CSliderUI*>(m_PaintManager.FindControl(kAdjustColorSliderGControlName));
				CSliderUI* AdjustColorSliderB = static_cast<CSliderUI*>(m_PaintManager.FindControl(kAdjustColorSliderBControlName));
				if ((AdjustColorSliderR != NULL) && (AdjustColorSliderG != NULL) && (AdjustColorSliderB != NULL))
				{
					if ((_tcsicmp(msg.pSender->GetName(), kAdjustColorSliderRControlName) == 0) ||
						(_tcsicmp(msg.pSender->GetName(), kAdjustColorSliderGControlName) == 0) ||
						(_tcsicmp(msg.pSender->GetName(), kAdjustColorSliderBControlName) == 0))
					{
						BYTE red = AdjustColorSliderR->GetValue();
						BYTE green = AdjustColorSliderG->GetValue();
						BYTE blue = AdjustColorSliderB->GetValue();
						COLORREF crColor = RGB(red, green, blue);
						TCHAR szBuf[MAX_PATH] = {0};
#if defined(UNDER_CE)
						_stprintf(szBuf, _T("FF%02X%02X%02X"), GetRValue(crColor), GetGValue(crColor), GetBValue(crColor));
#else
						_stprintf_s(szBuf, MAX_PATH - 1, _T("FF%02X%02X%02X"), GetRValue(crColor), GetGValue(crColor), GetBValue(crColor));
#endif
						LPTSTR pstr = NULL;
						DWORD dwColor = _tcstoul(szBuf, &pstr, 16);
						main_frame_->SetBkColor(dwColor);
					}
				}
			}
			else if (pTabControl->GetCurSel() == 1)
			{}
		}
	}
	else if (_tcsicmp(msg.sType, _T("selectchanged")) == 0)
	{
		CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(kTabControlName));
		if (_tcsicmp(msg.pSender->GetName(), kAdjustColorControlName) == 0)
		{
			if (pTabControl && pTabControl->GetCurSel() != 0)
			{
				pTabControl->SelectItem(0);
			}
		}
		else if (_tcsicmp(msg.pSender->GetName(), kAdjustBkControlName) == 0)
		{
			if (pTabControl && pTabControl->GetCurSel() != 1)
			{
				pTabControl->SelectItem(1);
			}
		}
	}
}
开发者ID:ECNU-ZR,项目名称:physwf-c-lab,代码行数:84,代码来源:color_skin.cpp

示例15: Notify

void imsdkDemoLogin::Notify(TNotifyUI& msg) {
    if (msg.sType == _T("click")) {
        if (msg.pSender == m_pCloseBtn) {
            PostQuitMessage(0);
            return;
        }
        if (msg.pSender == m_pLoginBtn) {
            CEditUI* pEditServer = static_cast<CEditUI*>(m_pm.FindControl(_T("editServer")));
            CEditUI* pEditAccount = static_cast<CEditUI*>(m_pm.FindControl(_T("editAccount")));
            CEditUI* pEditPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("editPassword")));
            std::string server = getString(pEditServer->GetText().GetData());
            std::string account = getString(pEditAccount->GetText().GetData());
            std::string password = getString(pEditPassword->GetText().GetData());
            gClientDemo.login(server, account, password, std::bind(&imsdkDemoLogin::onLoginCb, this, std::placeholders::_1));
            //Close(7);
        }
        if (msg.pSender == m_pSignCodeBtn) {
            CEditUI* pEditServer = static_cast<CEditUI*>(m_pm.FindControl(_T("signServer")));
            CEditUI* pEditPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("signPhone")));
            std::string server = getString(pEditServer->GetText().GetData());
            std::string phone = getString(pEditPhone->GetText().GetData());

            gClientDemo.getRegCode(server, phone);
            m_secGetSignCode = 30;
            m_pSignCodeBtn->SetEnabled(false);
            std::string strText = std::to_string(m_secGetSignCode) + "s后重试";
            auto strT = getWString(strText.c_str());
            m_pSignCodeBtn->SetText(strT.c_str());
            ::SetTimer(GetHWND(), 7, 1000, NULL);
        }
        if (msg.pSender == m_pSignUpBtn) {
            CEditUI* pEditAccount = static_cast<CEditUI*>(m_pm.FindControl(_T("signAccount")));
            CEditUI* pEditPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("signPassword")));
            CEditUI* pEditSignCode = static_cast<CEditUI*>(m_pm.FindControl(_T("signCode")));
            std::string account = getString(pEditAccount->GetText().GetData());
            std::string password = getString(pEditPassword->GetText().GetData());
            std::string signcode = getString(pEditSignCode->GetText().GetData());
            gClientDemo.reg(account, password, signcode);
        }
    }
    else if (msg.sType == _T("selectchanged")) {
        CDuiString name = msg.pSender->GetName();
        CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("login")));
        if (name == _T("optLogin")){
            CEditUI* pEditAccount = static_cast<CEditUI*>(m_pm.FindControl(_T("editAccount")));
            CEditUI* pEditPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("editPassword")));
            pEditAccount->SetText(_T("手机号"));
            pEditPassword->SetText(_T("密码"));
            pControl->SelectItem(0);
        }
        else if (name == _T("optSignUp")) {
            CEditUI* pEditPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("signPhone")));
            CEditUI* pEditAccount = static_cast<CEditUI*>(m_pm.FindControl(_T("signAccount")));
            CEditUI* pEditPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("signPassword")));
            CEditUI* pEditSignCode = static_cast<CEditUI*>(m_pm.FindControl(_T("signCode")));
            pEditPhone->SetText(_T("手机号"));
            pEditAccount->SetText(_T("用户名"));
            pEditPassword->SetText(_T("密码"));
            pEditSignCode->SetText(_T("验证码"));

            pControl->SelectItem(1);
        }
    }
    else if (msg.sType == _T("return"))
    {
        // Enter键注册、登录
        CTabLayoutUI* pTab = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("login")));
        if (0 == pTab->GetCurSel()){
            //
            CEditUI* pEditServer = static_cast<CEditUI*>(m_pm.FindControl(_T("editServer")));
            CEditUI* pEditAccount = static_cast<CEditUI*>(m_pm.FindControl(_T("editAccount")));
            CEditUI* pEditPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("editPassword")));
            if (pEditPassword->IsFocused())
            {
                std::string server = getString(pEditServer->GetText().GetData());
                std::string account = getString(pEditAccount->GetText().GetData());
                std::string password = getString(pEditPassword->GetText().GetData());
                gClientDemo.login(server, account, password, std::bind(&imsdkDemoLogin::onLoginCb, this, std::placeholders::_1));
            }
            if (pEditAccount->IsFocused())
            {
                pEditPassword->SetFocus();
            }
        }
        else
        {
            CEditUI* pEditAccount = static_cast<CEditUI*>(m_pm.FindControl(_T("signAccount")));
            CEditUI* pEditPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("signPassword")));
            CEditUI* pEditSignCode = static_cast<CEditUI*>(m_pm.FindControl(_T("signCode")));
            std::string account = getString(pEditAccount->GetText().GetData());
            std::string password = getString(pEditPassword->GetText().GetData());
            std::string signcode = getString(pEditSignCode->GetText().GetData());
            gClientDemo.reg(account, password, signcode);
        }
    }
}
开发者ID:VRVIM,项目名称:VIM_PC_SDK,代码行数:96,代码来源:DemoLogin.cpp


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