本文整理汇总了C++中CControlUI::GetClass方法的典型用法代码示例。如果您正苦于以下问题:C++ CControlUI::GetClass方法的具体用法?C++ CControlUI::GetClass怎么用?C++ CControlUI::GetClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControlUI
的用法示例。
在下文中一共展示了CControlUI::GetClass方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnNcHitTest
LRESULT CRightFrame::OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
POINT pt; pt.x = GET_X_LPARAM(lParam); pt.y = GET_Y_LPARAM(lParam);
::ScreenToClient(*this, &pt);
RECT rcClient;
::GetClientRect(*this, &rcClient);
RECT rcCaption = m_pm.GetCaptionRect();
if( pt.x >= rcClient.left + rcCaption.left && pt.x < rcClient.right - rcCaption.right \
&& pt.y >= rcCaption.top && pt.y < rcCaption.bottom )
{
CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(pt));
if( pControl && _tcscmp(pControl->GetClass(), _T("ButtonUI")) != 0 )
return HTCAPTION;
}
return HTCLIENT;
}
示例2: Notify
void CColorPicker::Notify(TNotifyUI& msg)
{
if (_tcsicmp(msg.sType, _T("windowinti")) == 0)
{
InitWindow();
}
else if (_tcsicmp(msg.sType, _T("click")) == 0)
{
CControlUI* pOne = static_cast<CControlUI*>(GetPaintMgr()->FindControl(msg.ptMouse));
if (_tcsicmp(pOne->GetClass(), _T("ButtonUI")) == 0)
{
DWORD nColor = pOne->GetBkColor();
CVerticalLayoutUI* pColorContiner = static_cast<CVerticalLayoutUI*>(GetPaintMgr()->FindControl(_T("color")));
pColorContiner->SetBkColor(nColor);
UpdateWindow();
Sleep(500);
chat_dialog_->SetTextColor(nColor);
}
}
}
示例3: Notify
void YSkinWindow::Notify(TNotifyUI& msg)
{
CControlUI* pUI = msg.pSender;
YTrace_(_T("YSkinWindow::Notify class:%s,event:%s,name:%s"),pUI ? pUI->GetClass():_T(""),msg.sType.GetData(),pUI?pUI->GetName().GetData():_T(""));
if (0 == msg.sType.Compare(kClick))
OnClick(msg);
else if(0 == msg.sType.Compare(kSelectChanged))
{
// if (pUI->IsName(_T("tab1")))
// {
// _pSkinLayout->SelectItem(0);
// }
// else if (pUI->IsName(_T("tab2")))
// {
// _pSkinLayout->SelectItem(1);
// }
_pSkinLayout->SelectItem(msg.pSender->GetTag());
}
}
示例4: Notify
void CColorPicker::Notify(TNotifyUI& msg)
{
if (_tcsicmp(msg.sType, _T("click")) == 0)
{
CControlUI* pOne = static_cast<CControlUI*>(paint_manager_.FindControl(msg.ptMouse));
if (_tcsicmp(pOne->GetClass(), _T("ButtonUI")) == 0)
{
DWORD nColor = pOne->GetBkColor();
CVerticalLayoutUI* pColorContiner = static_cast<CVerticalLayoutUI*>(paint_manager_.FindControl(_T("color")));
pColorContiner->SetBkColor(nColor);
UpdateWindow(m_hWnd);
Sleep(500);
if (chat_dialog_)
{
chat_dialog_->SetTextColor(nColor);
}
if (chat_group_dialog_)
{
chat_group_dialog_->SetTextColor(nColor);
}
}
}
}
示例5: SetChildVisible
void CGroupsUI::SetChildVisible(Node* node, bool visible)
{
if (!node || node == root_node_)
return;
if (node->data().child_visible_ == visible)
return;
node->data().child_visible_ = visible;
TCHAR szBuf[MAX_PATH] = {0};
tString html_text;
if (node->data().has_child_)
{
if (node->data().child_visible_)
html_text += level_expand_image_;
else
html_text += level_collapse_image_;
#if defined(UNDER_WINCE)
_stprintf(szBuf, _T("<x %d>"), level_text_start_pos_);
#else
_stprintf_s(szBuf, MAX_PATH - 1, _T("<x %d>"), level_text_start_pos_);
#endif
html_text += szBuf;
html_text += node->data().text_;
CLabelUI* nick_name = static_cast<CLabelUI*>(paint_manager_.FindSubControlByName(node->data().list_elment_, kNickNameControlName));
if (nick_name != NULL)
{
nick_name->SetShowHtml(true);
nick_name->SetText(html_text.c_str());
}
}
if (!node->data().list_elment_->IsVisible())
return;
if (!node->has_children())
return;
Node* begin = node->child(0);
Node* end = node->get_last_child();
for (int i = begin->data().list_elment_->GetIndex(); i <= end->data().list_elment_->GetIndex(); ++i)
{
CControlUI* control = GetItemAt(i);
if (_tcsicmp(control->GetClass(), _T("ListContainerElementUI")) == 0)
{
if (visible)
{
Node* local_parent = ((Node*)control->GetTag())->parent();
if (local_parent->data().child_visible_ && local_parent->data().list_elment_->IsVisible())
{
control->SetVisible(true);
}
}
else
{
control->SetVisible(false);
}
}
}
}
示例6: OnBnClickedButtonAttribAdd
void CDialogDefaultAttribList::OnBnClickedButtonAttribAdd()
{
// TODO: 在此添加控件通知处理程序代码
int nClass;
switch(m_btnAdd.m_nMenuResult)
{
case ID_UI_CONTROL_BUTTON:
nClass = classButton;
break;
case ID_UI_CONTROL_CONTROL:
nClass = classControl;
break;
case ID_UI_CONTROL_LABEL:
nClass = classLabel;
break;
case ID_UI_CONTROL_TEXT:
nClass = classText;
break;
case ID_UI_CONTROL_EDIT:
nClass = classEdit;
break;
case ID_UI_CONTROL_OPTION:
nClass = classOption;
break;
case ID_UI_CONTROL_COMBO:
nClass = classCombo;
break;
case ID_UI_CONTROL_PROGRESS:
nClass = classProgress;
break;
case ID_UI_CONTROL_SLIDER:
nClass = classSlider;
break;
case ID_UI_CONTROL_ACTIVEX:
nClass = classActiveX;
break;
case ID_UI_LAYOUT_VERTICAL:
nClass = classVerticalLayout;
break;
case ID_UI_LAYOUT_HORIZONTAL:
nClass = classHorizontalLayout;
break;
case ID_UI_LAYOUT_CONTAINER:
nClass = classContainer;
break;
case ID_UI_LAYOUT_TILE:
nClass = classTileLayout;
break;
case ID_UI_LAYOUT_TAB:
nClass = classTabLayout;
break;
default:
return;
}
CControlUI* pControl = CLayoutManager::NewUI(nClass, CRect(0,0,0,0), NULL, NULL);
CString strName = pControl->GetClass();
strName = strName.Left(strName.GetLength() - 2);
if(m_pManager->GetDefaultAttributeList(strName) != NULL)
{
MessageBox(_T("此控件的默认属性已经存在,无法创建!"), _T("提示"), MB_ICONINFORMATION);
CLayoutManager::DeleteUI(pControl);
return;
}
CDialogUIAttribEdit dlg(pControl);
if(dlg.DoModal() == IDOK)
{
CString strValue;
if(GetDefaultAttrib(pControl, strValue) == FALSE)
{
MessageBox(_T("创建默认属性失败!"), _T("提示"), MB_ICONINFORMATION);
CLayoutManager::DeleteUI(pControl);
return;
}
m_pManager->AddDefaultAttributeList(strName, strValue);
int nIndex = m_lstDefaultAttrib.AddString(strName);
m_lstDefaultAttrib.SetItemDataPtr(nIndex, pControl);
m_lstDefaultAttrib.SetCurSel(nIndex);
m_wndUIProperties.ShowProperty(pControl);
g_pMainFrame->GetActiveUIView()->SetModifiedFlag();
}
else
CLayoutManager::DeleteUI(pControl);
}
示例7: HandleMessage
LRESULT CComboWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if( uMsg == WM_CREATE ) {
m_pm.SetForceUseSharedRes(true);
m_pm.Init(m_hWnd);
// The trick is to add the items to the new container. Their owner gets
// reassigned by this operation - which is why it is important to reassign
// the items back to the righfull owner/manager when the window closes.
m_pLayout = new CVerticalLayoutUI;
m_pLayout->SetManager(&m_pm, NULL, true);
LPCTSTR pDefaultAttributes = m_pOwner->GetManager()->GetDefaultAttributeList(_T("VerticalLayout"));
if( pDefaultAttributes ) {
m_pLayout->ApplyAttributeList(pDefaultAttributes);
}
m_pLayout->SetInset(CDuiRect(1, 1, 1, 1));
m_pLayout->SetBkColor(0xFFFFFFFF);
m_pLayout->SetBorderColor(0xFFC6C7D2);
m_pLayout->SetBorderSize(1);
m_pLayout->SetAutoDestroy(false);
m_pLayout->EnableScrollBar();
m_pLayout->ApplyAttributeList(m_pOwner->GetDropBoxAttributeList());
for( int i = 0; i < m_pOwner->GetCount(); i++ ) {
m_pLayout->Add(static_cast<CControlUI*>(m_pOwner->GetItemAt(i)));
}
m_pm.AttachDialog(m_pLayout);
m_pm.AddNotifier(this);
return 0;
}
else if( uMsg == WM_CLOSE ) {
m_pOwner->SetManager(m_pOwner->GetManager(), m_pOwner->GetParent(), false);
RECT rcNull = { 0 };
for( int i = 0; i < m_pOwner->GetCount(); i++ ) static_cast<CControlUI*>(m_pOwner->GetItemAt(i))->SetPos(rcNull);
m_pOwner->SetFocus();
}
else if( uMsg == WM_LBUTTONUP ) {
POINT pt = { 0 };
::GetCursorPos(&pt);
::ScreenToClient(m_pm.GetPaintWindow(), &pt);
CControlUI* pControl = m_pm.FindControl(pt);
if( pControl && _tcsicmp(pControl->GetClass(), _T("ScrollBarUI")) != 0 ) PostMessage(WM_KILLFOCUS);
}
else if( uMsg == WM_KEYDOWN ) {
switch( wParam ) {
case VK_ESCAPE:
m_pOwner->SelectItem(m_iOldSel, true);
EnsureVisible(m_iOldSel);
case VK_RETURN:
PostMessage(WM_KILLFOCUS);
break;
default:
TEventUI event;
event.Type = UIEVENT_KEYDOWN;
event.chKey = (TCHAR)wParam;
m_pOwner->DoEvent(event);
EnsureVisible(m_pOwner->GetCurSel());
return 0;
}
}
else if( uMsg == WM_MOUSEWHEEL ) {
int zDelta = (int) (short) HIWORD(wParam);
TEventUI event = { 0 };
event.Type = UIEVENT_SCROLLWHEEL;
event.wParam = MAKELPARAM(zDelta < 0 ? SB_LINEDOWN : SB_LINEUP, 0);
event.lParam = lParam;
event.dwTimestamp = ::GetTickCount();
m_pOwner->DoEvent(event);
EnsureVisible(m_pOwner->GetCurSel());
return 0;
}
else if( uMsg == WM_KILLFOCUS ) {
if( m_hWnd != (HWND) wParam ) PostMessage(WM_CLOSE);
}
LRESULT lRes = 0;
if( m_pm.MessageHandler(uMsg, wParam, lParam, lRes) ) return lRes;
return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
}