本文整理汇总了C++中CButtonUI::GetFixedWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ CButtonUI::GetFixedWidth方法的具体用法?C++ CButtonUI::GetFixedWidth怎么用?C++ CButtonUI::GetFixedWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButtonUI
的用法示例。
在下文中一共展示了CButtonUI::GetFixedWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateButtonImage
void CToolbarBottom::UpdateButtonImage(void* pbutton, wchar_t* strImage, int& nImageRight, int nImageWidth)
{
CButtonUI* pButton = static_cast<CButtonUI*>(pbutton);
if (NULL == pButton || NULL == strImage) return;
int nWidth = max(pButton->GetFixedWidth(), pButton->GetMinWidth());
wchar_t strDest[128] = {0};
int nLeft = (nWidth - nImageWidth) / 2;
nImageRight = nLeft + nImageWidth;
wsprintf(strDest,_T("dest='%d,4,%d,34'"), nLeft, nImageRight);
wchar_t strImagePath[128] = {0};
wsprintf(strImagePath, L"res='%s' restype='ZPIMGRES' source='0,0,%d,30' %s", strImage, nImageWidth, strDest);
pButton->SetForeImage(strImagePath);
wsprintf(strImagePath, L"res='%s' restype='ZPIMGRES' source='%d,0,%d,30' %s", strImage, nImageWidth * 2, nImageWidth * 3, strDest);
pButton->SetHotForeImage(strImagePath);
wsprintf(strImagePath, L"res='%s' restype='ZPIMGRES' source='%d,0,%d,30' %s", strImage, nImageWidth, nImageWidth * 2, strDest);
pButton->SetPushedImage(strImagePath);
}
示例2: UpdateButton
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:
{
//.........这里部分代码省略.........