XP介面

来源:互联网 发布:英文网络流行语 编辑:程序博客网 时间:2024/05/02 01:43

XP介面


作者:Kelvin



是本人在2005-09-11刚完成的,由于时间有限,功能还不够全面。

文件列表
Kpxssalc.H 头文件
XPlib.Lib 发行版库文件
XPlibD.lib 调试版库文件
CoolMenu 目录包含一个XP的菜单
MDI和SDI介面必需与CoolMenu配合使用, CoolMenu则可以单独使用。

已经实现的XP类
Menu 是带阴影的菜单
Combobox 隐藏了滚动条,只能使用鼠标中键滚动
Dialog
Mdi 必需与CoolMenu配全使用
Sdi 必需与CoolMenu配全使用
Button
Checkbox
Radiobox
Groupbox
TabPage
Listbox
ListCtrl
TreeCtrl
Editbox
Staticbox
DATETIMEPICKER

需要源代码可以与我联系。
电邮: KelvinSpace@citiz.net
网址:ebug.ys168.com







一、加入XpLib库
////////////Step1
#include "Kpxssalc.H"
BOOL CKDlgApp::InitInstance()
{
.....
Kpxssalc();
.....
}
////////////Step2
Kpxssalc.H文件根据实际情况指定库文件位置
//##################### 加载库 ###########################
#ifdef _DEBUG
//#pragma comment(lib,"..//Kpxssalc//XPLibD.lib")
#pragma message("Automatically linking with XPLibD.LIB")
#else
//#pragma comment(lib,"..//Kpxssalc//XPLib.lib")
#pragma message("Automatically linking with XPLib.LIB")
#endif



二、菜单CoolBar的使用例程:
/****************************************第 1 步**********************/
#include "CoolMenu/CoolBar.H"
class CMainFrame : public CFrameWnd
{
...
CCoolBar m_wndReBar;
...
}
/****************************************第 2 步**********************/
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
//Step2 ################禁 用 原 工 具 条 ###################
// 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("Failed to create toolbar/n");
// return -1; // fail to create
// }
//
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
}

// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
//Step2 ###########
// m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
// EnableDocking(CBRS_ALIGN_ANY);
// DockControlBar(&m_wndToolBar);

////Step 3############### 新建 工具条 和 菜单 ################
COLORREF cl = RGB(175,175,175);
COLORREF bk = RGB(230,230,230);
if(!m_wndReBar.CreateEx(this,IDR_MAINFRAME,
IDR_MAINFRAME, cl, bk))
{
TRACE0("Failed to create rebar/n");
return -1; // fail to create
}

return 0;
}
/****************************************第 3 步**********************/
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
////Setp4 ######### 重载 菜单 信息 ###############
if(!m_wndReBar.PreMenuMessage(pMsg))
return 0;

return CFrameWnd::PreTranslateMessage(pMsg);
}

三、图像


图一



图二

四、结束语

原创粉丝点击