From a64ebfa474753e761e4e236868f17196d68258cb Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Sun, 20 May 2007 15:23:58 +0000 Subject: [PATCH] PATCH: [ 1717774 ] Gradient toolbar --- Src/Changes.txt | 4 ++++ Src/MainFrm.cpp | 29 +++++++++++++++++++---------- Src/MainFrm.h | 1 + 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Src/Changes.txt b/Src/Changes.txt index 1a69346fe..2ab847976 100644 --- a/Src/Changes.txt +++ b/Src/Changes.txt @@ -2,6 +2,10 @@ Src\Changes.txt Add new items to top. (This summarizes all changes to all files under Src, including Src\Languages.) +2007-05-20 Takashi + PATCH: [ 1717774 ] Gradient toolbar + Src: MainFrm.cpp MainFrm.h + 2007-05-19 Tim Fix white space indenting in ASP and C# highlighter (included with PATCH #1556685). Src/editlib: asp.cpp csharp.cpp diff --git a/Src/MainFrm.cpp b/Src/MainFrm.cpp index 8807519e9..b355bf14d 100644 --- a/Src/MainFrm.cpp +++ b/Src/MainFrm.cpp @@ -3060,24 +3060,24 @@ void CMainFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) BOOL CMainFrame::CreateToobar() { - if (!m_wndToolBar.Create(this, WS_CHILD|WS_VISIBLE|CBRS_GRIPPER|CBRS_TOP|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_SIZE_DYNAMIC) || + if (!m_wndToolBar.CreateEx(this) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) { return FALSE; } - m_wndToolBar.SetBorders(1, 1, 1, 1); - VERIFY(m_wndToolBar.ModifyStyle(0, TBSTYLE_FLAT)); + if (!m_wndReBar.Create(this)) + { + return FALSE; + } + + VERIFY(m_wndToolBar.ModifyStyle(0, TBSTYLE_FLAT|TBSTYLE_TRANSPARENT)); // Remove this if you don't want tool tips or a resizable toolbar m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); - // Delete these three lines if you don't want the toolbar to - // be dockable - m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); - EnableDocking(CBRS_ALIGN_ANY); - DockControlBar(&m_wndToolBar); + m_wndReBar.AddBar(&m_wndToolBar); LoadToolbarImages(); @@ -3097,6 +3097,7 @@ void CMainFrame::LoadToolbarImages() m_ToolbarImages[TOOLBAR_IMAGES_ENABLED].DeleteImageList(); m_ToolbarImages[TOOLBAR_IMAGES_DISABLED].DeleteImageList(); + CSize sizeButton(0, 0); if (toolbarSize == 0) { @@ -3104,7 +3105,7 @@ void CMainFrame::LoadToolbarImages() m_ToolbarImages[TOOLBAR_IMAGES_ENABLED]); LoadToolbarImageList(TOOLBAR_SIZE_16x16, IDB_TOOLBAR_DISABLED, m_ToolbarImages[TOOLBAR_IMAGES_DISABLED]); - BarCtrl.SetButtonSize(CSize(23,22)); + sizeButton = CSize(24, 24); } else if (toolbarSize == 1) { @@ -3112,11 +3113,19 @@ void CMainFrame::LoadToolbarImages() m_ToolbarImages[TOOLBAR_IMAGES_ENABLED]); LoadToolbarImageList(TOOLBAR_SIZE_32x32, IDB_TOOLBAR_DISABLED32, m_ToolbarImages[TOOLBAR_IMAGES_DISABLED]); - BarCtrl.SetButtonSize(CSize(39,39)); + sizeButton = CSize(40, 40); } + BarCtrl.SetButtonSize(sizeButton); BarCtrl.SetImageList(&m_ToolbarImages[TOOLBAR_IMAGES_ENABLED]); BarCtrl.SetDisabledImageList(&m_ToolbarImages[TOOLBAR_IMAGES_DISABLED]); + + // resize the rebar. + REBARBANDINFO rbbi; + rbbi.cbSize = sizeof(rbbi); + rbbi.fMask = RBBIM_CHILDSIZE; + rbbi.cyMinChild = sizeButton.cy; + m_wndReBar.GetReBarCtrl().SetBandInfo(0, &rbbi); } diff --git a/Src/MainFrm.h b/Src/MainFrm.h index d2702f36c..e270a9075 100644 --- a/Src/MainFrm.h +++ b/Src/MainFrm.h @@ -202,6 +202,7 @@ protected: // control bar embedded members CStatusBar m_wndStatusBar; + CReBar m_wndReBar; ToolBarXPThemes m_wndToolBar; CMDITabBar m_wndTabBar; -- 2.11.0