-
大小: 6.2MB文件類型: .rar金幣: 2下載: 0 次發布日期: 2023-11-01
- 語言: C/C++
- 標簽: CMFCToolBar??VS2010??
資源簡介
vs2010 mfc
CMFCToolBarVS2010實現真彩大圖標

代碼片段和文件信息
#include?“stdafx.h“
#include?“MainFrm.h“
#include?“ClassView.h“
#include?“Resource.h“
#include?“ShoepadAnalyse.h“
class?CClassViewMenuButton?:?public?CMFCToolBarMenuButton
{
friend?class?CClassView;
DECLARE_SERIAL(CClassViewMenuButton)
public:
CClassViewMenuButton(HMENU?hMenu?=?NULL)?:?CMFCToolBarMenuButton((UINT)-1?hMenu?-1)
{
}
virtual?void?OnDraw(CDC*?pDC?const?CRect&?rect?CMFCToolBarImages*?pImages?BOOL?bHorz?=?TRUE
BOOL?bCustomizeMode?=?FALSE?BOOL?bHighlight?=?FALSE?BOOL?bDrawBorder?=?TRUE?BOOL?bGrayDisabledButtons?=?TRUE)
{
pImages?=?CMFCToolBar::GetImages();
CAfxDrawState?ds;
pImages->PrepareDrawImage(ds);
CMFCToolBarMenuButton::OnDraw(pDC?rect?pImages?bHorz?bCustomizeMode?bHighlight?bDrawBorder?bGrayDisabledButtons);
pImages->EndDrawImage(ds);
}
};
IMPLEMENT_SERIAL(CClassViewMenuButton?CMFCToolBarMenuButton?1)
//////////////////////////////////////////////////////////////////////
//?構造/析構
//////////////////////////////////////////////////////////////////////
CClassView::CClassView()
{
m_nCurrSort?=?ID_SORTING_GROUPBYTYPE;
}
CClassView::~CClassView()
{
}
BEGIN_MESSAGE_MAP(CClassView?CDockablePane)
ON_WM_CREATE()
ON_WM_SIZE()
ON_WM_CONTEXTMENU()
ON_COMMAND(ID_CLASS_ADD_MEMBER_FUNCTION?OnClassAddMemberFunction)
ON_COMMAND(ID_CLASS_ADD_MEMBER_VARIABLE?OnClassAddMemberVariable)
ON_COMMAND(ID_CLASS_DEFINITION?OnClassDefinition)
ON_COMMAND(ID_CLASS_PROPERTIES?OnClassProperties)
ON_COMMAND(ID_NEW_FOLDER?OnNewFolder)
ON_WM_PAINT()
ON_WM_SETFOCUS()
ON_COMMAND_RANGE(ID_SORTING_GROUPBYTYPE?ID_SORTING_SORTBYACCESS?OnSort)
ON_UPDATE_COMMAND_UI_RANGE(ID_SORTING_GROUPBYTYPE?ID_SORTING_SORTBYACCESS?OnUpdateSort)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CClassView?消息處理程序
int?CClassView::OnCreate(LPCREATESTRUCT?lpCreateStruct)
{
if?(CDockablePane::OnCreate(lpCreateStruct)?==?-1)
return?-1;
CRect?rectDummy;
rectDummy.SetRectEmpty();
//?創建視圖:
const?DWORD?dwViewstyle?=?WS_CHILD?|?WS_VISIBLE?|?TVS_HASLINES?|?TVS_LINESATROOT?|?TVS_HASBUTTONS?|?WS_CLIPSIBLINGS?|?WS_CLIPCHILDREN;
if?(!m_wndClassView.Create(dwViewstyle?rectDummy?this?2))
{
TRACE0(“未能創建類視圖\n“);
return?-1;??????//?未能創建
}
//?加載圖像:
m_wndToolBar.Create(this?AFX_DEFAULT_TOOLBAR_style?IDR_SORT);
m_wndToolBar.LoadToolBar(IDR_SORT?0?0?TRUE?/*?已鎖定*/);
onchangeVisualstyle();
m_wndToolBar.SetPanestyle(m_wndToolBar.GetPanestyle()?|?CBRS_TOOLTIPS?|?CBRS_FLYBY);
m_wndToolBar.SetPanestyle(m_wndToolBar.GetPanestyle()?&?~(CBRS_GRIPPER?|?CBRS_SIZE_DYNAMIC?|?CBRS_BORDER_TOP?|?CBRS_BORDER_BOTTOM?|?CBRS_BORDER_LEFT?|?CBRS_BORDER_RIGHT));
m_wndToolBar.SetOwner(this);
//?所有命令將通過此控件路由,而不是通過主框架路由:
m_wndToolBar.SetRouteCommandsViaframe(FALSE);
CMenu?menuSort;
menuSort.LoadMenu(IDR_POPUP_SORT);
m_wndToolBar.ReplaceButton(ID_SORT_MENU?CClassViewMenuButto
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????2803028??2011-05-04?16:04??Debug\ShoepadAnalyse.ilk
?????文件???????9036??2011-04-24?20:26??ShoepadAnalyse\ClassView.cpp
?????文件???????1275??2011-04-24?20:26??ShoepadAnalyse\ClassView.h
?????文件??????13216??2011-05-04?16:04??ShoepadAnalyse\Debug\BuildLog.htm
?????文件???????6678??2011-04-24?20:26??ShoepadAnalyse\FileView.cpp
?????文件???????1135??2011-04-24?20:26??ShoepadAnalyse\FileView.h
?????文件??????13918??2011-05-04?16:02??ShoepadAnalyse\MainFrm.cpp
?????文件???????1527??2011-05-04?13:44??ShoepadAnalyse\MainFrm.h
?????文件???????4884??2011-04-24?20:26??ShoepadAnalyse\OutputWnd.cpp
?????文件???????1011??2011-04-24?20:26??ShoepadAnalyse\OutputWnd.h
?????文件???????8695??2011-04-24?20:26??ShoepadAnalyse\PropertiesWnd.cpp
?????文件???????1421??2011-04-24?20:26??ShoepadAnalyse\PropertiesWnd.h
?????文件???????3608??2011-04-24?20:26??ShoepadAnalyse\ReadMe.txt
?????文件??????10486??2011-05-04?14:09??ShoepadAnalyse\res\bitmap1.bmp
?????文件???????6198??2011-05-04?15:15??ShoepadAnalyse\res\bmp00001.bmp
????.......???????958??2007-08-30?17:14??ShoepadAnalyse\res\classview.bmp
????.......??????5096??2007-08-30?17:14??ShoepadAnalyse\res\classview_hc.bmp
????.......??????1078??2007-08-30?17:14??ShoepadAnalyse\res\class_view.ico
????.......??????2478??2007-08-30?17:14??ShoepadAnalyse\res\class_view_hc.ico
????.......???????246??2007-08-30?17:14??ShoepadAnalyse\res\explorer.bmp
????.......???????824??2007-08-30?17:14??ShoepadAnalyse\res\explorer_hc.bmp
????.......???????478??2007-08-30?17:14??ShoepadAnalyse\res\fileview.bmp
????.......??????2216??2007-08-30?17:14??ShoepadAnalyse\res\fileview_hc.bmp
????.......??????1078??2007-08-30?17:14??ShoepadAnalyse\res\file_view.ico
????.......??????2166??2007-08-30?17:14??ShoepadAnalyse\res\file_view_hc.ico
?????文件??????62264??2011-03-29?13:55??ShoepadAnalyse\res\mainfram.bmp
?????文件???????6198??2011-05-04?15:15??ShoepadAnalyse\res\mainfram_16.bmp
?????文件??????31158??2011-05-04?14:38??ShoepadAnalyse\res\mainfram_24.bmp
?????文件??????62264??2011-03-29?13:55??ShoepadAnalyse\res\mainfram_ok.bmp
????.......??????3830??2007-11-01?09:00??ShoepadAnalyse\res\menuimages.bmp
............此處省略44個文件信息
評論
共有 條評論