Пример #1
0
void CUIDialog::_UpdateButtons()
{
#ifdef _WIN32_WCE
	// Recuperar o style do botao 'voltar'
	UINT nStyle = m_dlgCommandBar.GetButtonStyle(0);

	// Se estamos no root, desabilitar o botao...
	if(IsFirstPage())
		nStyle |= TBBS_DISABLED; 
	else
		nStyle &= ~TBBS_DISABLED; 

	// Setar o style novamente...
	m_dlgCommandBar.SetButtonStyle(0, nStyle);

	// Recuperar o style do botao 'proximo'
	nStyle = m_dlgCommandBar.GetButtonStyle(1);

	// Se estamos no root, desabilitar o botao...
	if(IsLastPage())
		nStyle |= TBBS_DISABLED; 
	else
		nStyle &= ~TBBS_DISABLED; 

	// Setar o style novamente...
	m_dlgCommandBar.SetButtonStyle(1, nStyle);
#endif
}
Пример #2
0
void CProjectInfoPage::Notify( TNotifyUI& msg )
{
	if (0 == _tcsicmp(DUI_MSGTYPE_WINDOWINIT, msg.sType))
	{
		HandleWindowInitEvent(msg);
	}

	if (msg.sType != DUI_MSGTYPE_CLICK )
	{
		return;
	}

	DuiLib::CDuiString strName = msg.pSender->GetName();

	//"第一页"
	if (_tcsicmp(strName.GetData(), "btn_page_first") == 0)
	{
		if (!IsCacheEmpty()&& !IsFirstPage())
		{
			GotoPage(1);
		}	
	}
	//"上一页"
	else if (_tcsicmp(strName.GetData(), "btn_page_prev") == 0)
	{
		if (!IsCacheEmpty() && !IsFirstPage())
		{
			if (m_nCurrentPageIndex>1)
			{
				GotoPage(m_nCurrentPageIndex-1);
			}
		}
	}
	//"下一页"
	else if (_tcsicmp(strName.GetData(), "btn_page_next") == 0)
	{
		if (!IsCacheEmpty() && !IsEndPage())
		{
			if (m_nCurrentPageIndex<m_nEndPageIndex)
			{
				GotoPage(m_nCurrentPageIndex+1);
			}
		}
	}
	//"最后一页"
	else if (_tcsicmp(strName.GetData(), "btn_page_end") == 0)
	{
		if (!IsCacheEmpty()&& !IsEndPage())
		{
			if (m_nEndPageIndex>0)
			{
				GotoPage(m_nEndPageIndex);
			}	
		}
	}
	//1--10页按钮
	else if (strName.Find("btn_page_")>=0)
	{
		//tstring strSearch = "btn_page_";
		//tstring strBtnIndex = strName.Right(strName.GetLength()-strSearch.length());
		//int nIndex = atoi(strBtnIndex.c_str());

		int nIndex = atoi(msg.pSender->GetText());
		GotoPage(nIndex);
		return;
	}

	if (_tcsicmp(strName.GetData(), "OptionToday") == 0)
	{
		time_t tToday = time(0);
		FetchProjects(GetYMDTimeString(tToday));
	}
	else if (_tcsicmp(strName.GetData(), "OptionWeek") == 0)
	{
		time_t tToday = time(0);
		time_t tOneWeekAgo = tToday - const_one_week_seconds;
		FetchProjects(GetYMDTimeString(tOneWeekAgo));
	}
	else if (_tcsicmp(strName.GetData(), "OptionMonth") == 0)
	{
		time_t tToday = time(0);
		time_t tOneMonthAgo = tToday - const_one_month_seconds;
		FetchProjects(GetYMDTimeString(tOneMonthAgo));
	}
	else if (_tcsicmp(strName.GetData(), "OptionAll") == 0)
	{
		FetchProjects(tstring(_T("")));
	}
	else if (msg.pSender->GetName() == "btn_get_project_info")
	{
		sProjectItem* pData = (sProjectItem*)msg.pSender->GetParent()->GetParent()->GetParent()->GetTag();
		if (NULL != pData)
		{
			CFrameBusinessData::Instance()->ShowWindow(true);
			CFrameBusinessData::Instance()->setProjectItem(pData);
		}
	}
	else if (msg.pSender->GetName() == "btn_bussiness_chat")
	{
		sProjectItem* pData = (sProjectItem*)msg.pSender->GetParent()->GetParent()->GetParent()->GetTag();
		if (NULL != pData)
		{
			//没有创建房间,就需要重新选人。
			if (pData->strRoomID.empty())
			{
				
				CAddNewGroupMember* pAddGroupMemWnd = new CAddNewGroupMember(m_PaintManager);
				if (NULL != pAddGroupMemWnd)
				{
					pAddGroupMemWnd->SetShowMode(true);
					pAddGroupMemWnd->CreateWnd();
					pAddGroupMemWnd->Initialize();//初始化一次。
				}
				
				//bool bWithProperty = m_pComboResProperty->GetCurSel() == 1;
				pAddGroupMemWnd->SetResProperty(false, pData->strProjID, pData->strProjName);
				pAddGroupMemWnd->ShowWindow(true);
			}
			else
			{
				//我有可能不是这个群里面的成员,就需要判断下。如果我不是这个群里面的人,就不能进去。
				tstring strMyPhone = CController::Instance()->GetXmppClient()->jid().username();
				tstring strMyAccount = strMyPhone+MMPC_ACCOUNT;
				if(CController::Instance()->GetRoomManager()->IsInThisRoom(pData->strRoomID, strMyAccount ))
				{
					CController::Instance()->GetRoomManager()->EnterRoom(pData->strRoomID, strMyPhone);
					if (pData->strDestOrgID.empty() && pData->strDestOrgName.empty())
					{
						if (pData->vecDestParticipants.size()>0)
						{
							mainDlg::getInstance()->OnShowGroupChatWnd_Personal(pData->vecDestParticipants[0], pData->strRoomID);
						}
					}
					else
					{
						mainDlg::getInstance()->OnShowGroupChatWnd(pData->strDestOrgID, pData->strDestOrgName, pData->strRoomID);
					}
				}
				else
				{
					CMsgBox* pMsgBox = new CMsgBox("错误","您不是该群组成员!");
					pMsgBox->ShowModal();
				}
			}
			
		}		
	}	
	//增加搜索功能 by HQ 20160519
	else if (msg.pSender->GetName() == "btn_Search")
	{	
		COptionUI* OptionToday = static_cast<COptionUI*>(m_PaintManager->FindControl("OptionToday"));
		COptionUI* OptionWeek = static_cast<COptionUI*>(m_PaintManager->FindControl("OptionWeek"));
		COptionUI* OptionMonth = static_cast<COptionUI*>(m_PaintManager->FindControl("OptionMonth"));
		COptionUI* OptionAll = static_cast<COptionUI*>(m_PaintManager->FindControl("OptionAll"));

		tstring sSelectedTime=(_T(""));
		if (OptionToday->IsSelected())
		{
			time_t tToday = time(0);
			sSelectedTime = GetYMDTimeString(tToday);
		}
		else if (OptionWeek->IsSelected())
		{
			time_t tToday = time(0);
			time_t tOneWeekAgo = tToday - const_one_week_seconds;
			sSelectedTime = GetYMDTimeString(tOneWeekAgo);
		}
		else if (OptionMonth->IsSelected())
		{
			time_t tToday = time(0);
			time_t tOneMonthAgo = tToday - const_one_month_seconds;
			sSelectedTime = GetYMDTimeString(tOneMonthAgo);
		}
		else if (OptionAll->IsSelected())
		{
			//do nothing...
		}

		CEditUI* edtSearchString = static_cast<CEditUI*>(m_PaintManager->FindControl("edt_SearchString"));
		tstring sSearchString = edtSearchString->GetText();

		//允许空字符串查询 by HQ 20160519
		//if(sSearchString == "")
		//{
		//	CMsgBox* pMsgBox = new CMsgBox("错误","请输入查找条件!");
		//	pMsgBox->ShowModal();
		//	edtSearchString->SetFocus();
		//}
		//else
		//{
			FetchProjects(sSelectedTime,sSearchString);
		//}
	}	
}