enh_flatbar_sample
所属分类:工具条
开发工具:Visual C++
文件大小:56KB
下载次数:754
上传日期:2001-01-01 00:00:00
上 传 者:
管理员
说明: 在工具条上使用类似IE的带文字的扁平按钮并且可以像VC5那样使用鼠标组织排列
(Using flat button with text on toolbar as IE and it can organize the buttons with mouse as VC5)
文件列表:
ChildFrm.cpp (2411, 1998-01-24)
ChildFrm.h (1479, 1998-01-24)
Debug (0, 1998-03-25)
FlatBar.bak (10469, 1997-10-13)
FlatBar.clw (4180, 1998-05-10)
FlatBar.cpp (4330, 1998-03-23)
FlatBar.dsp (5149, 1998-05-10)
FlatBar.dsw (789, 1998-01-27)
FlatBar.h (1377, 1997-10-08)
FlatBar.mak (12750, 1998-03-03)
FlatBar.mdp (42496, 1998-03-08)
FlatBar.rc (17463, 1998-05-10)
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 (9551, 1998-05-10)
MainFrm.h (2998, 1998-05-10)
MemDC.h (2135, 1997-10-17)
res (0, 1998-03-25)
resource.h (1712, 1998-02-19)
res\childbar.bmp (1014, 1998-01-24)
res\cursor1.cur (326, 1997-12-12)
res\FlatBar.ico (1078, 1997-10-08)
res\FlatBar.rc2 (399, 1997-10-08)
res\FlatBarDoc.ico (1078, 1997-10-08)
res\SearchBar.bmp (478, 1997-12-04)
res\Toolbar.bmp (1198, 1997-11-23)
res\toolbar1.bmp (1078, 1998-01-26)
StdAfx.cpp (205, 1997-10-13)
StdAfx.h (1026, 1998-02-15)
ToolBarEx.cpp (71100, 1998-05-10)
ToolBarEx.h (11998, 1998-05-10)
Start values for TBMgrRes.h
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 500
#define _APS_NEXT_COMMAND_VALUE 34000
#define _APS_NEXT_CONTROL_VALUE 3000
#define _APS_NEXT_SYMED_VALUE 250
#endif
#endif
/////////////////////////////////////////////////////////////////////////////
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
近期下载者:
相关文件:
收藏者: