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


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

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


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

示例3: 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

示例4: OnItemClick

void MainFrame::OnItemClick(TNotifyUI& msg)
{
	CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(kMainTabControlName));
	if (pTabControl != NULL)
	{
		if (pTabControl->GetCurSel() == 0)
		{
			CFriendsUI* pFriendsList = static_cast<CFriendsUI*>(m_PaintManager.FindControl(kFriendsListControlName));
			if ((pFriendsList != NULL) && pFriendsList->GetItemIndex(msg.pSender) != -1)
			{
				if (_tcsicmp(msg.pSender->GetClass(), _T("ListContainerElementUI")) == 0)
				{
					Node* node = (Node*)msg.pSender->GetTag();

					if (pFriendsList->CanExpand(node))
					{
						pFriendsList->SetChildVisible(node, !node->data().child_visible_);
					}
				}
			}
		}
		else if (pTabControl->GetCurSel() == 1)
		{
			CGroupsUI* pGroupsList = static_cast<CGroupsUI*>(m_PaintManager.FindControl(kGroupsListControlName));
			if ((pGroupsList != NULL) && pGroupsList->GetItemIndex(msg.pSender) != -1)
			{
				if (_tcsicmp(msg.pSender->GetClass(), _T("ListContainerElementUI")) == 0)
				{
					Node* node = (Node*)msg.pSender->GetTag();

					if (pGroupsList->CanExpand(node))
					{
						pGroupsList->SetChildVisible(node, !node->data().child_visible_);
					}
				}
			}
		}
	}
}
开发者ID:hgl888,项目名称:TeamTalk,代码行数:39,代码来源:main_frame_event.cpp

示例5: OnItemActivate

void MainFrame::OnItemActivate(TNotifyUI& msg)
{
	CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(kMainTabControlName));
	if (pTabControl != NULL)
	{
		if (pTabControl->GetCurSel() == 0)
		{
			CFriendsUI* pFriendsList = static_cast<CFriendsUI*>(m_PaintManager.FindControl(kFriendsListControlName));
			if ((pFriendsList != NULL) && pFriendsList->GetItemIndex(msg.pSender) != -1)
			{
				if (_tcsicmp(msg.pSender->GetClass(), _T("ListContainerElementUI")) == 0)
				{
					Node* node = (Node*)msg.pSender->GetTag();

					CControlUI* background = m_PaintManager.FindControl(kBackgroundControlName);
					if (!pFriendsList->CanExpand(node) && (background != NULL))
					{
						FriendListItemInfo friend_info;

						for (std::vector<FriendListItemInfo>::const_iterator citer = friends_.begin(); citer != friends_.end(); ++citer)
						{
							if (_tcsicmp(citer->id, node->data().value) == 0)
							{
								friend_info = *citer;
								break;
							}
						}
						TCHAR szBuf[MAX_PATH] = { 0 };
						if (_tcslen(background->GetBkImage()) > 0)
						{
							_stprintf_s(szBuf, MAX_PATH - 1, _T("bg%d.png"), bk_image_index_);
						}

						ChatDialog* pChatDialog = new ChatDialog(szBuf, background->GetBkColor(), myself_info_, friend_info);
						if (pChatDialog == NULL)
							return;
						pChatDialog->Create(NULL, _T("ChatDialog"), UI_WNDSTYLE_FRAME | WS_POPUP, NULL, 0, 0, 0, 0);
						skin_changed_observer_.AddReceiver(pChatDialog);
						pChatDialog->CenterWindow();
						::ShowWindow(*pChatDialog, SW_SHOW);
					}
				}
			}
		}
	}
}
开发者ID:hgl888,项目名称:TeamTalk,代码行数:46,代码来源:main_frame_event.cpp

示例6: 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

示例7: 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

示例8: 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

示例9: Notify


//.........这里部分代码省略.........
				{
					param.bkcolor = background->GetBkColor();
					if (_tcslen(background->GetBkImage()) > 0)
					{
#if defined(UNDER_WINCE)
						_stprintf(szBuf, _T("bg%d.png"), bk_image_index_);
#else
						_stprintf_s(szBuf, MAX_PATH - 1, _T("bg%d.png"), bk_image_index_);
#endif
					}

					param.bgimage = szBuf;
				}
				skin_changed_observer_.Broadcast(param);
			}
		}
		else if (_tcsicmp(msg.pSender->GetName(), kChangeColorSkinControlName) == 0)
		{
			CDuiRect rcWindow;
			GetWindowRect(m_hWnd, &rcWindow);
			rcWindow.top = rcWindow.top + msg.pSender->GetPos().bottom;
			new ColorSkinWindow(this, rcWindow);
		}
	}
	else if (_tcsicmp(msg.sType, _T("timer")) == 0)
	{
		return OnTimer(msg);
	}
	else if (_tcsicmp(msg.sType, _T("selectchanged")) == 0)
	{
		CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(paint_manager_.FindControl(kTabControlName));
		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);
				UpdateMicroBlogList();
			}
		}
	}
	else if (_tcsicmp(msg.sType, _T("itemactivate")) == 0)
	{
		CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(paint_manager_.FindControl(kTabControlName));
		if (pTabControl != NULL)
		{
			if (pTabControl->GetCurSel() == 0)
			{
				CFriendsUI* pFriendsList = static_cast<CFriendsUI*>(paint_manager_.FindControl(kFriendsListControlName));
				if ((pFriendsList != NULL) &&  pFriendsList->GetItemIndex(msg.pSender) != -1)
				{
开发者ID:fftyjw,项目名称:cdui,代码行数:67,代码来源:main_frame.cpp


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