예제 #1
0
//显示道具页
void CRightFrame::ShowPropPage(UINT uPage)
{
	if (uPage < 0)
	{
		return;
	}

	if (uPage >= m_uPropPageNums)
	{
		return;
	}

	//当前显示道具的页
	m_uCurrPropPage = uPage;

	int iMinPos = uPage * m_uPropPageSize;
	int iMaxPos = iMinPos + m_uPropPageSize - 1;

	for (int i = 0; i < MAX_PROP_NUMS; ++i)
	{
		if (m_pPropBtn[i])
		{
			m_pPropBtn[i]->SetVisible(i >= iMinPos && i <= iMaxPos);
		}
	}

	CButtonUI* pBtnPrev = static_cast<CButtonUI*>(m_pm.FindControl("Prop_Btn_Prev"));
	CButtonUI* pBtnNext = static_cast<CButtonUI*>(m_pm.FindControl("Prop_Btn_Next"));

	pBtnPrev->SetEnabled(uPage > 0);
	pBtnNext->SetEnabled(uPage < m_uPropPageNums - 1);

	return;
}
예제 #2
0
void CVisitor::SetPageBtn()
{
	CButtonUI* pLast = static_cast<CButtonUI*>(m_pManager->FindControl(_T("Visitor_LastPage")));
	CButtonUI* pNext = static_cast<CButtonUI*>(m_pManager->FindControl(_T("Visitor_NextPage")));
	if (m_iCurrentPage == 1)
	{
		pLast->SetEnabled(false);
	}
	else
	{
		pLast->SetEnabled(true);
	}
	if (m_iCurrentPage >= m_iPage)
	{
		pNext->SetEnabled(false);
	}
	else
	{
		pNext->SetEnabled(true);
	}
}
예제 #3
0
파일: Main.cpp 프로젝트: Fluray/duilib
    static DWORD WINAPI Search(LPVOID lpParameter)
    {
        try
        {
            struct Prama* prama = (struct Prama *)lpParameter;
            CListUI* pList = prama->pList;
            CButtonUI* pSearch = prama->pSearch;
            CStdString tDomain = prama->tDomain;
            //-------------------------------------
            /*
            * 添加数据循环
            */
            for(int i=0; i<100; i++)
            {
                std::stringstream ss;
                ss << "www." << i << ".com";
                domain.push_back(ss.str());
                ss.clear();
                ss << "it's " << i;
                desc.push_back(ss.str());
                CListTextElementUI* pListElement = new CListTextElementUI;
                pListElement->SetTag(i);
                if (pListElement != NULL)
                {
                    ::PostMessage(prama->hWnd, WM_ADDLISTITEM, 0L, (LPARAM)pListElement);
                }
                /*
                *	Sleep 为了展示添加的动态效果,故放慢了添加速度,同时可以看到添加过程中界面仍然可以响应
                */
                ::Sleep(100);
            }
            //------------------------------------------
            delete prama;

            pSearch->SetEnabled(true);
            return 0;
        }
        catch(...)
        {
            return 0;
        }
    }
예제 #4
0
void CToolbarBottom::UpdateButton(ToolbarButtonType btnNeedUpdate, buttonStatusType btnStatus)
{
	CButtonUI* button = GetButton(btnNeedUpdate);
	if(NULL == button)
		return;

	switch(btnNeedUpdate)
	{
	case Toolbar_Button_Audio:
		{
			if(Button_UnMuted==btnStatus)
			{
				wchar_t* strText = L"Mute Audio";
				button->SetText(strText);
				int nWidth = max(button->GetFixedWidth(), button->GetMinWidth());
				button->SetFixedWidth(nWidth);
				int nImageRight = 0;
				UpdateButtonImage((void*)button, _T("toolbar_btn_mute.png"), nImageRight);
			}
			else if(Button_Muted == btnStatus)
			{
				wchar_t* strText = L"Unmute Audio";
				button->SetText(strText);
				int nWidth = max(button->GetFixedWidth(), button->GetMinWidth());
				button->SetFixedWidth(nWidth);
				int nImageRight = 0;
				UpdateButtonImage((void*)button, _T("toolbar_btn_unmute.png"), nImageRight);				
			}
			else if(Button_Enabled == btnStatus)
			{
				button->SetEnabled(true);
			}
			else if(Button_Disabled == btnStatus)
			{
				button->SetEnabled(false);
			}
		}
		break;
	case Toolbar_Button_Video:
		{
			if(Button_UnMuted == btnStatus)
			{
				wchar_t* strText = L"Hide Video";
				button->SetText(strText);
				int nWidth = max(button->GetFixedWidth(), button->GetMinWidth());
				button->SetFixedWidth(nWidth);
				int nImageRight = 0;
				UpdateButtonImage((void*)button, _T("toolbar_btn_stopVideo.png"), nImageRight);
			}
			else if(Button_Muted == btnStatus)
			{
				wchar_t* strText = L"Start Video";
				button->SetText(strText);
				int nWidth = max(button->GetFixedWidth(), button->GetMinWidth());
				button->SetFixedWidth(nWidth);
				int nImageRight = 0;
				UpdateButtonImage((void*)button, _T("toolbar_btn_startVideo.png"), nImageRight);				
			}
			else if(Button_Enabled == btnStatus)
			{
				button->SetEnabled(true);
			}
			else if(Button_Disabled == btnStatus)
			{
				button->SetEnabled(false);
			}
		}
		break;
	case Toolbar_Button_Invite:
		break;
	case Toolbar_Button_Chat:
		{
			if(Button_UnMuted == btnStatus)
			{
				wchar_t* strText = L"Show Chat";
				button->SetText(strText);
			}
			else if(Button_Muted == btnStatus)
			{
				wchar_t* strText = L"Hide Chat";
				button->SetText(strText);
			}
		}
		break;
	case Toolbar_Button_Participant:
		{
			if(Button_UnMuted == btnStatus)
			{
				wchar_t* strText = L"Show Participant";
				button->SetText(strText);
			}
			else if(Button_Muted == btnStatus)
			{
				wchar_t* strText = L"Hide Participant";
				button->SetText(strText);
			}
		}
		break;
	case Toolbar_Button_ThumbnailVideo:
		{
			if(Button_UnMuted == btnStatus)
			{
				wchar_t* strText = L"Show Gallery";
				button->SetText(strText);
			}
			else if(Button_Muted == btnStatus)
			{
				wchar_t* strText = L"Hide Gallery";
				button->SetText(strText);
			}
		}
		break;
	case Toolbar_Button_Share:
		{
			if(Button_UnMuted == btnStatus)
			{
				wchar_t* strText = L"Share";
				button->SetText(strText);
			}
			else if(Button_Muted == btnStatus)
			{
				wchar_t* strText = L"Stop Share";
				button->SetText(strText);
			}
		}
		break;
	case Toolbar_Button_Leave:
		break;
	default:
		break;
	}
}
예제 #5
0
void CRightFrame::Init() 
{
	CLoveSendClassInExe* pGameFrame = static_cast<CLoveSendClassInExe*>(m_pRoom);

	CString sPath = CBcfFile::GetAppPath();

	//获取窗口的最大宽度与最小宽度
	CBcfFile fGSkin(sPath + "GameOption.bcf");
	m_uMaxWidth = fGSkin.GetKeyVal(_T("RightFrame"),"max_width",324);
	m_uMinWidth = fGSkin.GetKeyVal(_T("RightFrame"),"min_width",248);
	m_uOldWidth = fGSkin.GetKeyVal("RightFrame","old_width",0);
	//是否能隐藏该窗口
	m_bCanHide  = fGSkin.GetKeyVal(_T("RightFrame"),"can_hide",1);

	//判断是否百家乐游戏
	TCHAR szKey[10];
	
	CBcfFile fsr(sPath + "..\\SpecialRule.bcf");
	wsprintf(szKey, "%d", pGameFrame->m_pGameInfo->uNameID);
	m_bBJLGame = (fsr.GetKeyVal(_T("BJLType"),szKey,0) == 1);

	//玩家是否用踢人道具
	CBcfFile fOr(sPath + "..\\Order.bcf");
	m_bUseKickUserProp = (fOr.GetKeyVal(_T("ClassInExe"),_T("UseKickUserProp"),0) == 1);

	//如果是百人游戏,显示与隐藏窗口按钮无效
	CButtonUI* pBtnCtrl = static_cast<CButtonUI*>(m_pm.FindControl("Btn_Show_Wnd"));
	if (pBtnCtrl)
	{
		pBtnCtrl->SetEnabled(m_bCanHide && (!m_bBJLGame));
	}

	//用户列表指针
	CListUI* pListCtrl = static_cast<CListUI*>(m_pm.FindControl("Lst_List_Users"));
	pListCtrl->SetTextCallback(this);
	pListCtrl->SetContextMenuUsed(true);

	m_pUsersList = new CGameUserListCtrlDu(pListCtrl);

	//加载常用控件的样式
	LoadNormalCtrlSkin();

	//初始化道具栏
	InitProp();

	CFont f;
	f.CreateFont(
		12,                        // nHeight
		0,                         // nWidth
		0,						   // nEscapement
		0,                         // nOrientation
		FW_NORMAL,                 // nWeight
		FALSE,                     // bItalic
		FALSE,                     // bUnderline下划线标记,需要下划线把这里设置成TRUE
		0,                         // cStrikeOut
		ANSI_CHARSET,			   // nCharSet
		OUT_DEFAULT_PRECIS,        // nOutPrecision
		CLIP_DEFAULT_PRECIS,       // nClipPrecision
		DEFAULT_QUALITY,           // nQuality
		DEFAULT_PITCH | FF_SWISS,  // nPitchAndFamily
		_T("宋体"));               // lpszFacename

	//聊天框
	m_pTalkBoxList = static_cast<CListUI*>(m_pm.FindControl("Talk_Lst_Main"));

	//开聊天框缓冲文本
	m_pTalkTempText = static_cast<CTextUI*>(m_pm.FindControl("Talk_Text_Temp"));

	OnReLoadTalkINI();

}