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


C++ CXTPToolBar::LoadToolBar方法代码示例

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


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

示例1: InitToolBar

void gkToolBarPaneBase::InitToolBar( const TCHAR* toolbarname, DWORD nId )
{
	//////////////////////////////////////////////////////////////////////////
	// ToolBar Initilizing
	VERIFY(InitCommandBars());

	CXTPCommandBars* pCommandBars = GetCommandBars();
	pCommandBars->GetImageManager()->SetIcons(nId);
	pCommandBars->SetTheme(xtpThemeWhidbey);
	//pCommandBars->SetQuickCustomizeMode(FALSE);

	//TCHAR toolbarname = 
	CXTPToolBar* pToolBar = pCommandBars->Add(toolbarname, xtpBarTop);
	pToolBar->SetDefaultButtonStyle(xtpButtonIcon);
	pToolBar->LoadToolBar(nId);

 	pToolBar->SetCloseable(FALSE);
 	pToolBar->EnableCustomization();

	pToolBar->GetControls()->CreateOriginalControls();
	pCommandBars->GetCommandBarsOptions()->ShowKeyboardCues(xtpKeyboardCuesShowWindowsDefault);
	pCommandBars->GetToolTipContext()->SetStyle(xtpToolTipOffice2007);

	RecalcLayout();
	//////////////////////////////////////////////////////////////////////////
}
开发者ID:CheryJazz,项目名称:gkEngine,代码行数:26,代码来源:gkToolBarPaneBase.cpp

示例2: OnActivate

void CAlphaIconsPage::OnActivate()
{
	CXTPFrameWnd* pFrame = (CXTPFrameWnd*)AfxGetMainWnd();
	CXTPCommandBars* pCommandBars = pFrame->GetCommandBars();

	ASSERT(pCommandBars);

	CXTPToolBar* pToolBar = pCommandBars->GetAt(1);
	ASSERT(pToolBar->GetTitle() == _T("Standard"));


	XTPImageManager()->RemoveAll();
	pToolBar->LoadToolBar(IDR_ICONS_MENU_32);

	XTP_COMMANDBARS_ICONSINFO* pIconsInfo = XTPPaintManager()->GetIconsInfo();
	pIconsInfo->bUseDisabledIcons = TRUE;

	CXTPCommandBarsOptions* pOptions = pCommandBars->GetCommandBarsOptions();
	pOptions->szIcons = CSize(16, 16);
	pOptions->szLargeIcons = CSize (42, 35);
	pOptions->bLargeIcons = FALSE;

	XTPImageManager()->SetIcons(IDR_ICONS_TOOLBAR_32);


	if (!XTPImageManager()->IsAlphaIconsSupported())
	{
		m_bResample = TRUE;
		GetDlgItem(IDC_CHECK_RESAMPLE)->EnableWindow(FALSE);
		UpdateData(FALSE);
	}

	ResampleImages();

	UpdateContent();
}
开发者ID:chenbk85,项目名称:job_mobile,代码行数:36,代码来源:AlphaIconsPage.cpp

示例3: OnCreate

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	if (!InitCommandBars())
		return -1;

	CXTPPaintManager::SetTheme(xtpThemeOffice2003);

	CXTPCommandBars* pCommandBars = GetCommandBars();
	pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);

	CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("Standard"), xtpBarTop);
	if (!pCommandBar ||
		!pCommandBar->LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;
	}

	pCommandBars->GetImageManager()->SetIcons(IDR_MAINFRAME, IDR_TOOLBAR_ALPHA);
	pCommandBars->GetShortcutManager()->SetAccelerators(IDR_MAINFRAME);


	// Load the previous state for command bars.
	LoadCommandBars(_T("CommandBars"));

	EnableDocking(CBRS_ALIGN_ANY);
		
	SetOfficeTheme(xtpCalendarThemeOffice2007);
	

	// Initialize dialog bar
	if (!m_dlgDatePicker.Create(this, IDD_DATEPICKER,
		CBRS_LEFT|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_HIDE_INPLACE, ID_VIEW_DATEPICKER))
		return -1;		// fail to create

	// Initialize dialog bar
	if (!m_dlgOptions.Create(this, IDD_CALENDAR_DEMO_VIEW,
		CBRS_ALIGN_TOP|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_HIDE_INPLACE, ID_VIEW_PROPERTIES))
		return -1;		// fail to create

	//m_dlgOptions.EnableDocking(CBRS_ALIGN_ANY);
	m_dlgOptions.EnableDocking(0);
	m_dlgOptions.SetWindowText(_T("Options"));
	
	ShowControlBar(&m_dlgOptions, FALSE, FALSE);
	
	FloatControlBar(&m_dlgOptions, CPoint(100, 200));

	// docking for DatePicker
	m_dlgDatePicker.EnableDocking(CBRS_ALIGN_LEFT);
	m_dlgDatePicker.SetWindowText(_T("Date Picker"));
	
	ShowControlBar(&m_dlgDatePicker, TRUE, FALSE);
	//FloatControlBar(&m_dlgDatePicker, CPoint(100, GetSystemMetrics(SM_CYSCREEN) / 3));

	return 0;
}
开发者ID:chenbk85,项目名称:job_mobile,代码行数:68,代码来源:MainFrm.cpp

示例4: OnCreate

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    AfxGetApp()->m_nCmdShow = SW_HIDE;
    if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1;
    this->CenterWindow(CWnd::GetDesktopWindow());

    if (!m_wndStatusBar.Create(this) ||
            !m_wndStatusBar.SetIndicators(indicators,
                                          sizeof(indicators)/sizeof(UINT)))
    {
        TRACE0("Failed to create status bar\n");
        return -1;      // fail to create
    }

    if (!InitCommandBars())
        return -1;

    CXTPCommandBars* pCommandBars = GetCommandBars();
    if(pCommandBars == NULL)
    {
        TRACE0("Failed to create command bars object.\n");
        return -1;      // fail to create
    }

    //设置下面状态栏
    m_wndStatusBar.SetPaneInfo(0, m_wndStatusBar.GetItemID(0), SBPS_STRETCH, NULL);
    m_wndStatusBar.SetPaneInfo(1, m_wndStatusBar.GetItemID(1), SBPS_NORMAL, 250);
    m_wndStatusBar.SetPaneInfo(2, m_wndStatusBar.GetItemID(2), SBPS_NORMAL, 120);
    m_wndStatusBar.SetPaneInfo(3, m_wndStatusBar.GetItemID(3), SBPS_NORMAL, 120);
    /*
    	m_wndStatusBar.EnableCustomization();

    	if (!m_TrayIcon.Create(_T(""), // Toolktip text
    		this,                       // Parent window
    		IDR_MAINFRAME,               // Icon resource ID
    		IDR_MINIMIZE,             // Resource ID of popup menu
    		IDM_SHOW,                // Default menu item for popup menu
    		false))                     // True if default menu item is located by position
    	{
    		TRACE0("Failed to create tray icon\n");
    		return -1;
    	}
    	*/

    if (!InitCommandBars())
    {
        return -1;
    }

//	CXTPCommandBars* pCommandBars = GetCommandBars();

    CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);
    pMenuBar->SetFlags(xtpFlagAddMDISysPopup);
    /*
    	CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("Standard"), xtpBarTop);
    	if (!pCommandBar ||
    		!pCommandBar->LoadToolBar(IDR_TOOLBAR3))
    	{
    		TRACE0("Failed to create toolbar\n");
    		return -1;
    	};
    	*/
    CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("工具栏(T)"), xtpBarTop);
    if (!pCommandBar ||
            !pCommandBar->LoadToolBar(IDR_TOOLBAR3)) //
    {
        TRACE0("Failed to create toolbar\n");
        return -1;
    }



    pCommandBars->GetCommandBarsOptions()->bShowTextBelowIcons = TRUE;
    pCommandBars->GetCommandBarsOptions()->ShowKeyboardCues(xtpKeyboardCuesShowWindowsDefault);




    /*

    	// Create ToolBar
    	CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("工具栏(T)"), xtpBarTop);
    	if (!pCommandBar ||
    		!pCommandBar->LoadToolBar(IDR_TOOLBAR3)) //
    	{
    		TRACE0("Failed to create toolbar\n");
    		return -1;
    	}


    //    LoadIcons();

    	CXTPCommandBarsOptions* pOptions = pCommandBars->GetCommandBarsOptions();


    	pOptions->bShowExpandButtonAlways= FALSE;

    	pOptions->bShowTextBelowIcons = true;
    	pOptions->bLargeIcons = TRUE;
    	pCommandBar->GetImageManager()->SetIcons(IDR_TOOLBAR3,IDB_BITMAP1);
//.........这里部分代码省略.........
开发者ID:Ramerzhang,项目名称:remotectrl,代码行数:101,代码来源:MainFrm.cpp

示例5: OnCreate

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	AfxGetApp()->m_nCmdShow = SW_HIDE;
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	//界面居中显示
   this ->CenterWindow(CWnd::GetDesktopWindow());

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	m_wndStatusBar.SetPaneInfo(0, m_wndStatusBar.GetItemID(0), SBPS_STRETCH, NULL);
	m_wndStatusBar.SetPaneInfo(1, m_wndStatusBar.GetItemID(1), SBPS_NORMAL, 180);
	m_wndStatusBar.SetPaneInfo(2, m_wndStatusBar.GetItemID(2), SBPS_NORMAL, 100);
	m_wndStatusBar.SetPaneInfo(3, m_wndStatusBar.GetItemID(3), SBPS_NORMAL, 100);
	m_wndStatusBar.SetPaneInfo(4, m_wndStatusBar.GetItemID(4), SBPS_NORMAL, NULL);
	m_wndStatusBar.SetPaneInfo(5, m_wndStatusBar.GetItemID(5), SBPS_NORMAL, NULL);
	m_wndStatusBar.SetPaneInfo(6, m_wndStatusBar.GetItemID(6), SBPS_NORMAL, NULL);
	
	///////////////////////////////////////////////////////////////////////////////////////

	m_wndStatusBar.EnableCustomization();
	
	if (!m_TrayIcon.Create(_T(""), // Toolktip text
		this,                       // Parent window
		IDR_MAINFRAME,               // Icon resource ID
		IDR_MINIMIZE,             // Resource ID of popup menu
		IDM_SHOW,                // Default menu item for popup menu
		false))                     // True if default menu item is located by position
	{
		TRACE0("Failed to create tray icon\n");
		return -1;
	}	
	
	if (!InitCommandBars())
	{
		return -1;
	}
	

	CXTPCommandBars* pCommandBars = GetCommandBars();
	
	CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);
	pMenuBar->SetFlags(xtpFlagAddMDISysPopup);
	
	CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("Standard"), xtpBarTop);
	if (!pCommandBar ||
		!pCommandBar->LoadToolBar(IDR_TOOLBAR3))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;
	};
	
	pCommandBars->GetCommandBarsOptions()->bShowTextBelowIcons = TRUE;
	pCommandBars->GetCommandBarsOptions()->ShowKeyboardCues(xtpKeyboardCuesShowWindowsDefault);

	
	m_paneManager.InstallDockingPanes(this);
	m_paneManager.SetTheme(xtpPaneThemeWinExplorer);
	CXTPDockingPane* pwndPaneLog = CreatePane(300, 141, RUNTIME_CLASS(CLogView), _T("日志信息"), xtpPaneDockBottom);
	CXTPDockingPane* pwndPaneShortcuts = CreatePane(200, 145, RUNTIME_CLASS(CShortcuts), _T("快捷功能"), xtpPaneDockRight,pwndPaneLog);
	CXTPDockingPane* pwndPaneIPUP = CreatePane(200, 145, RUNTIME_CLASS(CIPUpdate), _T("域名更新"), xtpPaneDockRight,pwndPaneLog);
	
	pwndPaneIPUP->Select();
	m_paneManager.AttachPane( pwndPaneIPUP ,pwndPaneShortcuts );

	pwndPaneShortcuts->SetOptions(xtpPaneNoCaption);
	pwndPaneIPUP->SetOptions(xtpPaneNoCaption);
	
	XTPColorManager()->DisableLunaColors(TRUE);
	CXTPPaintManager::SetTheme(xtpThemeOffice2003);
	LoadCommandBars(_T("CommandBars"));
	
	SetTimer(1,1000,NULL); 
	
	return 0;
}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:82,代码来源:MainFrm.cpp

示例6: OnCreate

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;


	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	// Initialize the command bars
	if (!InitCommandBars())
		return -1;

	// Get a pointer to the command bars object.
	CXTPCommandBars* pCommandBars = GetCommandBars();
	if(pCommandBars == NULL)
	{
		TRACE0("Failed to create command bars object.\n");
		return -1;      // fail to create
	}

	// Add the menu bar
	CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(
		_T("Menu Bar"), IDR_MAINFRAME);
	if(pMenuBar == NULL)
	{
		TRACE0("Failed to create menu bar.\n");
		return -1;      // fail to create
	}

	// Create ToolBar
	CXTPToolBar* pToolBar = (CXTPToolBar*)
		pCommandBars->Add(_T("Standard"), xtpBarTop);
	if (!pToolBar || !pToolBar->LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;
	}

	// Set Windows XP Theme
	CXTPPaintManager::SetTheme(xtpThemeNativeWinXP);

	// Hide array of commands
	pCommandBars->HideCommands(uHideCmds, _countof(uHideCmds));

	// Set "Always Show Full Menus" option to the FALSE
	pCommandBars->GetCommandBarsOptions()->bAlwaysShowFullMenus = FALSE;

	pCommandBars->GetShortcutManager()->SetAccelerators(IDR_MAINFRAME);

	// Load the previous state for toolbars and menus.
	LoadCommandBars(_T("CommandBars"));

	// Initialize the docking pane manager and set the
	// initial them for the docking panes.  Do this only after all
	// control bars objects have been created and docked.
	m_paneManager.InstallDockingPanes(this);
	// Set Windows XP Theme
	m_paneManager.SetTheme(xtpPaneThemeWinNative);

	// Create docking panes.
	CXTPDockingPane* pwndPane1 = m_paneManager.CreatePane(
		IDR_PANE_OPTIONS, CRect(0, 0,200, 120), xtpPaneDockLeft);
	CXTPDockingPane* pwndPane2 = m_paneManager.CreatePane(
		IDR_PANE_PROPERTIES, CRect(0, 0,200, 120), xtpPaneDockBottom, pwndPane1);

	// Set the icons for the docking pane tabs.
	int nIDIcons[] = {IDR_PANE_OPTIONS, IDR_PANE_PROPERTIES};
		m_paneManager.SetIcons(IDB_BITMAP_ICONS, nIDIcons,
		_countof(nIDIcons), RGB(0, 255, 0));

	// Load the previous state for docking panes.
	CXTPDockingPaneLayout layoutNormal(&m_paneManager);
	if (layoutNormal.Load(_T("NormalLayout")))
	{
		m_paneManager.SetLayout(&layoutNormal);
	}

	return 0;
}
开发者ID:0xbda2d2f8,项目名称:CodeToolKit,代码行数:85,代码来源:MainFrm.cpp


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