flatbar_sample_project

所属分类:工具条
开发工具:Visual C++
文件大小:185KB
下载次数:749
上传日期:2001-01-01 00:00:00
上 传 者管理员
说明:  在工具条上使用类似IE的带文字的扁平按钮
(Using flat button with text on toolbar as IE)

文件列表:
ChildFrm.cpp (1497, 1997-10-08)
ChildFrm.h (1403, 1997-10-08)
FlatBar.bak (10469, 1997-10-13)
FlatBar.cpp (4357, 1997-10-08)
FlatBar.dsp (4691, 1997-10-21)
FlatBar.dsw (537, 1997-10-13)
FlatBar.h (1377, 1997-10-08)
FlatBar.mak (10398, 1997-10-30)
FlatBar.mdp (41984, 1997-11-25)
FlatBar.rc (14924, 1997-11-24)
FlatBarDoc.cpp (1762, 1997-10-08)
FlatBarDoc.h (1494, 1997-10-08)
FlatBarView.cpp (2611, 1997-10-08)
FlatBarView.h (1913, 1997-10-08)
MainFrm.cpp (6777, 1997-11-23)
MainFrm.h (1860, 1997-11-23)
Release\FlatBar.exe (324608, 1997-11-25)
resource.h (782, 1997-11-23)
res\FlatBar.ico (1078, 1997-10-08)
res\FlatBar.rc2 (399, 1997-10-08)
res\FlatBarDoc.ico (1078, 1997-10-08)
res\Toolbar.bmp (1198, 1997-11-24)
StdAfx.cpp (205, 1997-10-13)
StdAfx.h (928, 1997-10-08)
ToolBarEx.cpp (24102, 1997-11-25)
ToolBarEx.h (7371, 1997-11-25)

Some time ago, I saw Roger Onslow's flat toolbar implementation on www.codeguru.com. The fact, that I need a special product (MSIE) (or even DLL ->commctrl.dll) was somewhat inconvenient to me. So I started to develop my own version of a flat looking toolbar without such requirements. The result is a class called CToolBarEx. With CToolBarEx one can toggle between flat- and "classic"-mode. The appropriate look will be shown immediataly (have a look at the sample to see how easy it is). Don't wonder if some parts of the code seem to be well known to you. The drawing of separators and the gripper was (more or less) stolen from Roger's toolbar (why should I do all of the hard bits again ;-) In flat-mode CToolBarEx makes all of the drawings by itself. In classic-mode, MFC does the work. Since VC++ >= 4.2 provides custom-draw abilities, this feature will be emulated in flat mode by a local helper class, so one can use this feature regardless of the current mode (flat or classic). To get some further informations on owner-drawing, have a look at the implementation file ToolBarEx.cpp. The MainFrm.cpp in the sample application may provide even more informations, if you're not familiar with owner-drawing on toolbars. CToolBarEx consists of two files: ToolBarEx.h ToolBarEx.cpp To use CToolBarEx in an MFC application, you have to perform the following steps (I assume you use App-/Class-Wizard): 1. #include "ToolBarEx.h" in either StdAfx.h or MainFrm.h 2. Change the type of CMainFrame::m_wndToolBar from CToolBar to CToolBarEx That's it. Have fun J鰎g

近期下载者

相关文件


收藏者