xtremetoolkitpro怎么用
Codejock软件公司的Xtreme浮动面板为Windows开发者提供了完善的Visual Studio.NET风格的浮动面板。Windows开发者能比较容易的创建分离的选项卡和自动隐藏的窗口,这样就能够获得一个更易于管理的应用工作空间。浮动面板及其附带的内建主题允许开发者从预定义主题(如Visio 和Visual Studio .NET)中选择,或者创建开发者自己的自定义主题。 此产品包含在产品集合 Xtreme Toolki!
如何在mfc中使用xttoolkitpro
XTToolkitPro使用… 1
开发环境… 2
添加SDI程序的CommandBar和MenuBar支持… 2
定制toolbars和menus的支持… 3
添加自定义的主题支持… 5
添加Docking Panes支持… 6
发现定义在XTPDeprecated.h中的符号,为废弃符号,修改为新符号即可… 9
添加智能菜单支持… 9
添加自定义特性的派生控件… 9
Visual Studio 2008 + XTToolkitPro v11.2
1、 创建MFC的SDI应用程序
2、 在stdafx.h添加
#include 《XTToolkitPro.h》 // Xtreme Toolkit Pro component library
3、 修改mainfrm.h的CMainFrame基类,MDI对应为
CXTPMDIFrameWnd
class CMainFrame : public CXTPFrameWnd
4、 修改CMainFrame::OnCreate函数
// 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 Office 2003 Theme
CXTPPaintManager::SetTheme(xtpThemeOffice2003);
注释掉以下几行
//if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE |
CBRS_TOP
// | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC)
||
// !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
//{
// TRACE0(“未能创建工具栏\n“);
// return -1; // 未能创建
//}
/*m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);*/
5、 如果需要重载CMainFrame::PreTranslateMessage和CMainFrame::OnCmdMsg,修改如下
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base
class
return CXTPMDIFrameWnd::PreTranslateMessage(pMsg);
}
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode,
void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
// TODO: Add your specialized code here and/or call the base
class
return CXTPMDIFrameWnd::OnCmdMsg(nID, nCode, pExtra,
pHandlerInfo);
}
6、 编译运行,出现Offiice 2003主题风格的应用程序
1、
在CMainFrm类增加响应ON_COMMAND的消息
XTP_ID_CUSTOMIZE
支持
在mainfrm.cpp中修改
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
ON_WM_CREATE()
//}}AFX_MSG_MAP
ON_COMMAND(XTP_ID_CUSTOMIZE, OnCustomize)
END_MESSAGE_MAP()
在mainfrm.h中修改
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
afx_msg void OnCustomize();
DECLARE_MESSAGE_MAP()
2、 在mainfrm.cpp中增加
void CMainFrame::OnCustomize()
{
// Get a pointer to the command bars object.
CXTPCommandBars* pCommandBars = GetCommandBars();
if(pCommandBars != NULL)
{
// Instanciate the customize dialog object.
CXTPCustomizeSheet dlg(pCommandBars);
// Add the options page to the customize dialog.
CXTPCustomizeOptionsPage pageOptions(&dlg);
dlg.AddPage(&pageOptions);
// Add the commands page to the customize dialog.
CXTPCustomizeCommandsPage* pCommands = dlg.GetCommandsPage();
pCommands-》AddCategories(IDR_MDISAMTYPE);
// Use the command bar manager to initialize the
// customize dialog.
pCommands-》InsertAllCommandsCategory();
pCommands-》InsertBuiltInMenus(IDR_MDISAMTYPE);
pCommands-》InsertNewMenuCategory();
// Dispaly the dialog.
dlg.DoModal();
}
}
3、 添加CMainFrm类的对commandbar和menubar的定制配置序列化支持
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
…
// Load the previous state for toolbars and menus.
LoadCommandBars(_T(“CommandBars“));
return 0;
}
void CMainFrame::OnClose()
{
// Save the current state for toolbars and menus.
SaveCommandBars(_T(“CommandBars“));
CMDIFrameWnd::OnClose();
}
4、 资源包含,查看rc2资源文件代码,添加xttoolkitpro.rc,在资源附加目录中添加xttoolkitpro.rc所在目录
5、
编译运行,发现定制化工具栏和菜单的资源没有加载进来,如图标、字符串等,解决方法是修改字符资源语言为英文(这里编译的是英文资源的lib库,根据自己需要也可以编译中文资源的lib库)
xtreme toolkit pro vs2013 补丁怎么用
1.打开一个C++项目。首先打开任意一个带有Visual Studio的C++项目(不用管它是否是一个Codejock),只需打开它然后找到View -》 Property Manager然后打开“Debug | Win32“ 和 “Debug | x64“ (或其中任意一个):
2.选择“Microsoft.Cpp.Win32.user“或“Microsofr.Cpp.x64.user“,右键单击并选择“Properties“, 点击“VC++ Directories“:
3.现在添加路径,下拉每个元素然后添加一个新的路径:
4.如果项目属性是x86或x64,路径可能会不同,但这种情况不多。下面这个表格表示添加什么样的路径与Codejock安装路径有关,比如C:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v15.3.1):
5.最后一步,我们需要找到“Common Properties -》 Resources -》 General“然后向“Additional Include Directories“添加Source和Win32/x64中同样的路径:
6.最后我们在关闭Visual Studio时记得保存所有的设置。
做完以上步骤之后,选项就被保存到一个XML文件中,路径为C:\Users\《username》\AppData\Local\Microsoft\MSBuild\v4.0,可以被任何C++项目调用。
xtreme.toolkit.pro怎样改变控件的颜色
Codejock软件公司的Xtreme浮动面板为Windows开发者提供了完善的VisualStudio.NET风格的浮动面板。Windows开发者能比较容易的创建分离的选项卡和自动隐藏的窗口,这样就能够获得一个更易于管理的应用工作空间。浮动面板及其附带的内建主题允许开发者从预定义主题(如Visio和VisualStudio.NET)中选择,或者创建开发者自己的自定义主题。此产品包含在产品集合XtremeToolki!