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


C++ CDialogBuilder类代码示例

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


在下文中一共展示了CDialogBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Declaration

void CALLBACK CUICommandHistory::UIAdd(TiXmlNode* pNode)
{
	TiXmlElement* pElement = pNode->ToElement();
	CStringA strParentName = pElement->Attribute("parentname");
	pElement->RemoveAttribute("parentname");
	if(strParentName.IsEmpty())
		return;

	CUIDesignerView* pUIView = g_pMainFrame->GetActiveUIView();
	CPaintManagerUI* pManager = pUIView->GetPaintManager();
	CControlUI* pParentControl = pManager->FindControl(StringConvertor::Utf8ToWide(strParentName));
	if(pParentControl == NULL)
		return;

	TiXmlDocument xmlDoc;
	TiXmlDeclaration Declaration("1.0","utf-8","yes");
	xmlDoc.InsertEndChild(Declaration);
	TiXmlElement* pRootElem = new TiXmlElement("UIAdd");
	pRootElem->InsertEndChild(*pElement);
	xmlDoc.InsertEndChild(*pRootElem);
	TiXmlPrinter printer;
	xmlDoc.Accept(&printer);
	delete pRootElem;

	CDialogBuilder builder;
	CControlUI* pRoot=builder.Create(StringConvertor::Utf8ToWide(printer.CStr()), (UINT)0, NULL, pManager);
 	if(pRoot)
		pUIView->RedoUI(pRoot, pParentControl);
}
开发者ID:DayDayUpCQ,项目名称:misc,代码行数:29,代码来源:UICommandHistory.cpp

示例2: GetSystemMenu

LRESULT CDuilib3dFrame::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
	styleValue &= ~WS_CAPTION;
	styleValue &= ~WS_THICKFRAME;
	::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);

	HMENU hMenu = GetSystemMenu(m_hWnd,FALSE);
	if (hMenu != NULL)
	{
		DeleteMenu(hMenu,SC_MAXIMIZE,MF_BYCOMMAND);
	}

	//根据skin.xml创建程序界面
	m_PaintManager.Init(m_hWnd);

	CDialogBuilder builder;
	CDialogBuilderCallbackEx cb;
	CControlUI* pRoot = builder.Create(_T("skin.xml"), (UINT)0,  &cb, &m_PaintManager);
	ASSERT(pRoot && "Failed to parse XML");

	m_PaintManager.AttachDialog(pRoot);
	m_PaintManager.AddNotifier(this);

	HICON hIcon = LoadIcon((HINSTANCE)GetWindowLong(m_hWnd,GWL_HINSTANCE),MAKEINTRESOURCE(IDI_ICON));
	m_tray.Create(m_hWnd,WM_USER+1021,_T("360安全卫士"),hIcon,NULL);

	return 0;
}
开发者ID:likebeta,项目名称:code-snippets,代码行数:29,代码来源:Duilib3dFrame.cpp

示例3: CLabelUI

void CHelloDuilibWnd::InitWindow()
{
	CLabelUI* helloTxUI = static_cast<CLabelUI*>(m_PaintManager.FindControl(_T("apptitle")));
	helloTxUI->SetText(_T("hehe"));
	CButtonUI* btnClose = static_cast<CButtonUI*>(m_PaintManager.FindControl(_T("closebtn")));
	CVerticalLayoutUI* layoutBody = static_cast<CVerticalLayoutUI*>(m_PaintManager.FindControl(_T("body")));

	CLabelUI* txtUI = new CLabelUI();
	layoutBody->Add(txtUI);
	txtUI->SetFloat(true);
	txtUI->SetPos({ 10, 300, 0, 0 });
	txtUI->SetFixedWidth(200);
	txtUI->SetFixedHeight(20);
	txtUI->SetText(_T("Hello Dynamic Text"));

	btnClose->OnEvent += MakeDelegate(this, &CHelloDuilibWnd::OnCloseClicked);

	CDialogBuilder builder;
	CVerticalLayoutUI* userControl = static_cast<CVerticalLayoutUI*>(builder.Create(_T("HelloControl.xml"),(LPCTSTR)0));
	CControlUI* testLabel = userControl->FindSubControl(_T("myLabel"));
	layoutBody->Add(userControl);

	layoutBody->NeedUpdate();
	
	CControlUI* myLabel = static_cast<CLabelUI*>(m_PaintManager.FindControl(_T("myLabel")));
	
	if (myLabel)
	{
	}

}
开发者ID:fmj1980,项目名称:duilib,代码行数:31,代码来源:CHelloWnd.cpp

示例4: HandleMessage

	LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) {
		if( uMsg == WM_CREATE ) {     
			paint_manager_.Init(m_hWnd);
			CDialogBuilder builder;
			CControlUI* pRoot = builder.Create(GetDialogResource(), (UINT)0, NULL, &paint_manager_);
			paint_manager_.AttachDialog(pRoot);
			paint_manager_.AddNotifier(this);

			CControlUI *pText = paint_manager_.FindControl(_T("content"));
			if( pText ) pText->SetText(m_sContent);
			CenterWindow();
			return 0;
		}
		else if( uMsg == WM_KEYDOWN ) {
			if( wParam == VK_RETURN ) {
				m_iRetCode = IDOK;
				Close();
				return 0;
			}
			else if( wParam == VK_ESCAPE ) {
				m_iRetCode = IDCANCEL;
				Close();
				return 0;
			}
		}
		LRESULT lRes = 0;
		if( paint_manager_.MessageHandler(uMsg, wParam, lParam, lRes) ) return lRes;
		return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
	}
开发者ID:achellies,项目名称:DimenBuilder,代码行数:29,代码来源:UIGDIWindow_Win.cpp

示例5: LOG__

void SessionLayout::_AddGroupMemberToList(IN const std::string& sID, IN const BOOL bCreator)
{
	module::UserInfoEntity userInfo;
	if (!module::getUserListModule()->getUserInfoBySId(sID, userInfo))
	{
		LOG__(ERR, _T("can't find the userInfo:%s,GroupId:%s"),util::stringToCString(sID),util::stringToCString(m_sId));
		return;
	}
	CDialogBuilder dlgBuilder;
	CListContainerElementUI* pListElement = (CListContainerElementUI*)dlgBuilder.Create(_T("SessionDialog\\groupMembersListItem.xml"), (UINT)0, NULL, &m_paint_manager);
	if (!pListElement)
	{
		LOG__(ERR, _T("群item创建失败"));
		return;
	}
	CButtonUI* pLogo = static_cast<CButtonUI*>(pListElement->FindSubControl(_T("AvatarInfo")));
	PTR_VOID(pLogo);
	pLogo->SetBkImage(util::stringToCString(userInfo.getAvatarPath()));

	if (bCreator)
	{
		CButtonUI* pCreator = static_cast<CButtonUI*>(pListElement->FindSubControl(_T("Creator")));
		PTR_VOID(pCreator);
		pCreator->SetVisible(true);
		pCreator->SetUserData(_T("Creator"));
	}

	CLabelUI* pNameLable = static_cast<CLabelUI*>(pListElement->FindSubControl(_T("nickname")));
	PTR_VOID(pNameLable);
	pNameLable->SetText(userInfo.getRealName());
	pListElement->SetUserData(util::stringToCString(userInfo.sId));

	m_pGroupMemberList->Add(pListElement);
}
开发者ID:hgl888,项目名称:TeamTalk,代码行数:34,代码来源:SessionLayout.cpp

示例6: OnCreate

    LRESULT CShadowWindow::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
    {
        // 使用xml字符串形式加载皮肤,内容很简单,一个Container控件就够了!Window要有bktrans属性
        CDuiString xml;
        xml.Append(_T("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>"));
        xml.Append(_T("<Window size=\"%d,%d\" bktrans=\"true\">"));
        xml.Append(_T(" <Container />"));
        xml.Append(_T("</Window>"));
        xml.Format(xml.GetData(), m_pShadowUI->GetFixedWidth(), m_pShadowUI->GetFixedHeight());

        m_pManager->Init(m_hWnd);

        CDialogBuilder builder;
        CControlUI* pRoot = builder.Create((LPCTSTR)xml, (UINT)0, NULL, m_pManager);
        if (pRoot == NULL)
        {
            MessageBox(m_hWnd, _T("加载资源文件失败"), _T("错误"), MB_OK | MB_ICONERROR);
            ExitProcess(1);
            return 0;
        }

        m_pManager->AttachDialog(pRoot);

        // 为主窗口设置一个属性,内容为阴影窗口的指针,然后子类化主窗口
        ::SetProp(m_hWndOwner, SHADOW_WINDOW_PROP, (HANDLE) this);
        m_pOldOwnerProc = (WNDPROC) ::SetWindowLongPtr(m_hWndOwner, GWL_WNDPROC, (LONG) OwnerProc);
        return 0;
    }
开发者ID:zhuhuigong,项目名称:test,代码行数:28,代码来源:UIShadow.cpp

示例7: APP_LOG

void SessionLayout::_AddGroupMemberToList(IN const std::string& sID)
{
	module::UserInfoEntity userInfo;
	if (!module::getUserListModule()->getUserInfoBySId(sID, userInfo))
	{
		APP_LOG(LOG_ERROR, _T("SessionLayout::_updateGroupMembersList(),can't find the userInfo"));
		return;
	}
	CDialogBuilder dlgBuilder;
	CListContainerElementUI* pListElement = (CListContainerElementUI*)dlgBuilder.Create(_T("SessionDialog\\groupMembersListItem.xml"), (UINT)0, NULL, &m_paint_manager);
	if (!pListElement)
	{
		APP_LOG(LOG_ERROR, _T("群item创建失败"));
		return;
	}
	CButtonUI* pLogo = static_cast<CButtonUI*>(pListElement->FindSubControl(_T("AvatarInfo")));
	if (!pLogo)
	{
		return;
	}
	pLogo->SetBkImage(util::stringToCString(userInfo.getAvatarPath()));

	CLabelUI* pNameLable = static_cast<CLabelUI*>(pListElement->FindSubControl(_T("nickname")));
	if (!pNameLable)
	{
		return;
	}
	pNameLable->SetText(userInfo.getRealName());
	pListElement->SetUserData(util::stringToCString(userInfo.sId));

	m_pGroupMemberList->Add(pListElement);

}
开发者ID:3rdexp,项目名称:TTWinClient,代码行数:33,代码来源:SessionLayout.cpp

示例8: HandleMessage

LRESULT CToolbarBottom::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	LRESULT lRes = 0;
	BOOL bHandled = TRUE;

	if( uMsg == WM_CREATE ) 
	{
		m_PaintManager.Init(m_hWnd);

		CDialogBuilder builder;
		STRINGorID xml(GetSkinRes());
		CControlUI* pRoot = builder.Create(xml, _T("xml"), 0, &m_PaintManager);
		ASSERT(pRoot && "Failed to parse XML");

		m_PaintManager.AttachDialog(pRoot);
		m_PaintManager.AddNotifier(this);
		InitWindow(); 
		return lRes;
	}

	if( m_PaintManager.MessageHandler(uMsg, wParam, lParam, lRes) ) 
	{
		return lRes;
	}

	return __super::HandleMessage(uMsg, wParam, lParam);
}
开发者ID:zoomvideo,项目名称:Windows,代码行数:27,代码来源:toolbar_bottom_ui.cpp

示例9: HandleMessage

    LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
    {
		LRESULT lRes = 0;
		BOOL bHandled = FALSE;

        if( uMsg == WM_CREATE ) {
            m_pm.Init(m_hWnd);
            CDialogBuilder builder;
            CControlUI* pRoot = builder.Create(_T("test1.xml"), (UINT)0, NULL, &m_pm);
            ASSERT(pRoot && "Failed to parse XML");
            m_pm.AttachDialog(pRoot);
            m_pm.AddNotifier(this);
            Init();
            return 0;
        }
        else if( uMsg == WM_DESTROY ) {
            ::PostQuitMessage(0L);
        }
        else if( uMsg == WM_ERASEBKGND ) {
            return 1;
        }
		else if( uMsg == WM_CLOSE) {
			lRes = OnClose(uMsg, wParam, lParam, bHandled);
		}
		else if(uMsg == WM_SYSCOMMAND) {
			lRes = OnSysCommand(uMsg, wParam, lParam, bHandled); 
		}

		if( bHandled ) return lRes;
        if( m_pm.MessageHandler(uMsg, wParam, lParam, lRes) ) return lRes;
        return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
    }
开发者ID:wyrover,项目名称:GDES,代码行数:32,代码来源:App.cpp

示例10: AddMenuItem

bool PopupMenu::AddMenuItem(std::wstring menu_item_title, int menu_item_tag, bool enable, bool checked, bool add_seperate, const std::wstring& icon)
{
	CListUI* menu_list = static_cast<CListUI*>(paint_manager_.FindControl(kMenuList));
	if (menu_list != NULL)
	{
		CDialogBuilder builder;
		CListContainerElementUI* menu_item = static_cast<CListContainerElementUI*>(builder.Create(kMenuItemSkin, (UINT)0, NULL, &paint_manager_));
		if (menu_item != NULL)
		{
			menu_item_tags_.push_back(menu_item_tag);

			CLabelUI* item_title = static_cast<CLabelUI*>(paint_manager_.FindSubControlByName(menu_item, kMenuItemTitleName));
			CControlUI* item_image = paint_manager_.FindSubControlByName(menu_item, kMenuItemImageName);
			CControlUI* underline = paint_manager_.FindSubControlByName(menu_item, kMenuItemUnderlineName);
			if ((item_title != NULL) && (item_image != NULL) && (underline != NULL))
			{
				if (checked)
					item_image->SetBkImage(kMenuCheckPngName);
				else if (!icon.empty())
					item_image->SetBkImage(icon.c_str());

				underline->SetVisible(add_seperate);

				item_title->SetText(menu_item_title.c_str());
				item_title->SetEnabled(enable);
			}

			menu_item->SetVisible(true);
			menu_list->Add(menu_item);

			return true;
		}
	}
	return false;
}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:35,代码来源:popup_menu.cpp

示例11: cb

CProjectInfoPage::CProjectInfoPage(DuiLib::CPaintManagerUI* ppm)
:m_pListProjs(NULL)
,m_pProjProcessor(NULL)
//,m_pAddGroupMemWnd(NULL)
,m_pBtnPrevPage(NULL)
,m_pBtnNextPage(NULL)
,m_pBtnEndPage(NULL)
,m_nCurrentPageIndex(-1)
,m_nEndPageIndex(-1)
{
	m_PaintManager = ppm;

	CDialogBuilder DlgBuilder;
	CVerticalLayoutUI *pProjectPage = NULL;
	CDialogBuilderCallbackEx cb(m_PaintManager);
	if (!DlgBuilder.GetMarkup()->IsValid())
	{
		pProjectPage = static_cast<CVerticalLayoutUI*>(DlgBuilder.Create(_T("tab_project_page.xml"),
			(UINT)0, &cb, m_PaintManager));
	}
	else
	{
		pProjectPage = static_cast<CVerticalLayoutUI*>(DlgBuilder.Create((UINT)0, m_PaintManager));
	}
	static_cast<CTabLayoutUI*>(ppm->FindControl("SidebarTabContainer"))->Add(pProjectPage);	

	m_PaintManager->AddNotifier(this);
}
开发者ID:Hopedream,项目名称:mm-win,代码行数:28,代码来源:ProjectsListPage.cpp

示例12: HandleMessage

	LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
	{
		switch(uMsg)
		{
		case WM_KEYDOWN:
			{
				int nVirtKey = (int) wParam;
				if(VK_ESCAPE == nVirtKey)
				{
					::PostQuitMessage(0);
				}
			} 
			break;
		case WM_CREATE:
			{
				m_PaintMgr.Init(m_hWnd); 
				//从xml中加载界面
				CDialogBuilder builder;
				m_pRoot = builder.Create(L"tutorial3.xml",(UINT)0,NULL,&m_PaintMgr);

				m_PaintMgr.AttachDialog(m_pRoot); 
				m_PaintMgr.AddNotifier(this);
			}
			break;  
		case WM_DESTROY:
			::PostQuitMessage(0);
			break;
		} 
		LRESULT lRes=0;
		if(m_PaintMgr.MessageHandler(uMsg,wParam,lParam,lRes)) return lRes;
		return CWindowWnd::HandleMessage(uMsg,wParam,lParam);
	}
开发者ID:sonicsunsky,项目名称:duilib-tutorial,代码行数:32,代码来源:tutorial3.cpp

示例13: OnCreate

LRESULT WindowImplBase::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
	styleValue &= ~WS_CAPTION;
	::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);

	RECT rcClient;
	::GetClientRect(*this, &rcClient);
	::SetWindowPos(*this, NULL, rcClient.left, rcClient.top, rcClient.right - rcClient.left, \
		rcClient.bottom - rcClient.top, SWP_FRAMECHANGED);

	m_PaintManager.Init(m_hWnd);
	m_PaintManager.AddPreMessageFilter(this);

	CDialogBuilder builder;

	CControlUI* pRoot=NULL;
	pRoot = builder.Create(GetSkinFile().GetData(), (UINT)0, this, &m_PaintManager);
	ASSERT(pRoot);
	if (pRoot==NULL)
	{
		MessageBox(NULL,_T("加载资源文件失败"),_T("Duilib"),MB_OK|MB_ICONERROR);
		ExitProcess(1);
		return 0;
	}
	m_PaintManager.AttachDialog(pRoot);
	m_PaintManager.AddNotifier(this);

	InitWindow();
	return 0;
}
开发者ID:baijiazhao,项目名称:DuiLib_Redrain,代码行数:31,代码来源:WinImplBase.cpp

示例14: OnCreate

	LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
	{
		LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
		styleValue &= ~WS_CAPTION;
		::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
		RECT rcClient;
		::GetClientRect(*this, &rcClient);
		::SetWindowPos(*this, NULL, rcClient.left, rcClient.top, rcClient.right - rcClient.left, \
			rcClient.bottom - rcClient.top, SWP_FRAMECHANGED);

		m_pm.Init(m_hWnd);
		CDialogBuilder builder;

		tString tstrSkin = CPaintManagerUI::GetInstancePath() + _T("skins\\TestSkin\\");
		m_pm.SetResourcePath(tstrSkin.c_str());

		tstrSkin = m_pm.GetResourcePath() + _T("test1.xml");
		CControlUI* pRoot = builder.Create(tstrSkin.c_str(), (UINT)0, this, &m_pm);		
		ASSERT(pRoot && _T("Failed to parse XML"));
		m_pm.AttachDialog(pRoot);
		m_pm.AddNotifier(this);

		Init();
		return 0;
	}
开发者ID:achellies,项目名称:DUI_LIb,代码行数:25,代码来源:Test.cpp

示例15: _T

LRESULT CMainFrame::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled){
	m_pm.Init(m_hWnd);//主窗口类与窗口句柄关联
	CDialogBuilder builder;
#ifdef _DEBUG
	CControlUI* pRoot = builder.Create(_T("UISkin.xml"), (UINT)0, NULL, &m_pm);//加载XML并动态创建界面无素,与布局界面元素,核心函数单独分析
#else
	CControlUI* pRoot = builder.Create((STRINGorID)MAKEINTRESOURCE(IDR_SKIN_XML), _T("DATA"), NULL, &m_pm);//加载XML并动态创建界面无素,与布局界面元素,核心函数单独分析
#endif
	//注意:CDialogBuilder 并不是一个对话框类
	ASSERT(pRoot && "Failed to parse XML");
	if (NULL==pRoot)//如果找不到皮肤文件则退出
	{
		MessageBox(NULL,TEXT("Cant not find the skin!"),NULL,MB_ICONHAND);
		return 0;
	}
	m_pm.AttachDialog(pRoot);//附加控件数据到HASH表中……为pRoot作为对话框结点,为其创建控件树	
	m_pm.AddNotifier(this);//增加通知处理

 	LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
 	styleValue &= ~WS_CAPTION;
 	styleValue &= ~WS_THICKFRAME; 
 	::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
	
	if(m_pBackWnd){
		m_pBackWnd->AttachWindow(m_hWnd);//必须要让背景与当前要作为背景的窗口绑定起来
		DWORD oldLong = ::GetWindowLong(m_pBackWnd->GetHandle(), GWL_STYLE);
		::SetWindowLong(m_pBackWnd->GetHandle(), GWL_STYLE, oldLong | WS_MINIMIZEBOX);
	}

	m_gaThread.Resume();	//开始统计线程
	return 0;
}
开发者ID:deathmemory,项目名称:blog_try,代码行数:32,代码来源:blog_try.cpp


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