DitherBlt(lpDIS->hDC,rect.left+dx,rect.top+dy,m_iconX,m_iconY,
(HBITMAP)(bitmapstandard),0,0,transparentcol);
else
- DitherBlt2(pDC,rect.left+dx,rect.top+dy,m_iconX,m_iconY,
- bitmapstandard,0,0,transparentcol);
+ if(hicolor_bitmaps)
+ DitherBlt3(pDC,rect.left+dx,rect.top+dy,m_iconX,m_iconY,
+ bitmapstandard,transparentcol);
+ else
+ DitherBlt2(pDC,rect.left+dx,rect.top+dy,m_iconX,m_iconY,
+ bitmapstandard,0,0,transparentcol);
if(state&ODS_SELECTED)pDC->Draw3dRect (rect,crSelect,crSelect);
bitmapstandard.DeleteObject();
}
CBitmap bmp2;
ddc2.CreateCompatibleDC(NULL);
bmp2.CreateCompatibleBitmap(&ddc,BitMap.bmWidth,BitMap.bmHeight);
- col=RGB(192,192,192);
+ col=RGB(255,0,255); // Original was RGB(192,192,192)
brush.CreateSolidBrush(col);
CBitmap * pddcOldBmp2 = ddc2.SelectObject(&bmp2);
CRect rect(0,0,BitMap.bmWidth,BitMap.bmHeight);
extern CLogFile gLog;
static BOOL add_regexp PARAMS((struct regexp_list **, char const*, BOOL bShowError));
+
+static void LoadToolbarImageList(UINT nIDResource, CImageList& ImgList);
+
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
RebuildRegExpList(FALSE);
GetFontProperties();
- m_wndToolBar.SetBorders(1, 1, 1, 1);
- if (!m_wndToolBar.Create(this, WS_CHILD|WS_VISIBLE|CBRS_GRIPPER|CBRS_TOP|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_SIZE_DYNAMIC) ||
- !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
+ if (!CreateToobar())
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
- VERIFY(m_wndToolBar.ModifyStyle(0, TBSTYLE_FLAT));
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
if (m_options.GetBool(OPT_SHOW_STATUSBAR) == false)
CMDIFrameWnd::ShowControlBar(&m_wndStatusBar, false, 0);
- // TODO: Remove this if you don't want tool tips or a resizeable toolbar
- m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
- CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
-
- // TODO: 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);
- if (m_options.GetBool(OPT_SHOW_TOOLBAR) == false)
- CMDIFrameWnd::ShowControlBar(&m_wndToolBar, false, 0);
-
// CG: The following line was added by the Splash Screen component.
CSplashWnd::ShowSplashScreen(this);
}
}
}
+
+BOOL CMainFrame::CreateToobar()
+{
+ if (!m_wndToolBar.Create(this, WS_CHILD|WS_VISIBLE|CBRS_GRIPPER|CBRS_TOP|CBRS_TOOLTIPS|CBRS_FLYBY|CBRS_SIZE_DYNAMIC) ||
+ !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
+ {
+ return FALSE;
+ }
+
+ m_wndToolBar.SetBorders(1, 1, 1, 1);
+ VERIFY(m_wndToolBar.ModifyStyle(0, TBSTYLE_FLAT));
+
+ // 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);
+
+ LoadToolbarImageList(IDB_TOOLBAR_ENABLED, m_ToolbarImages[TOOLBAR_IMAGES_ENABLED]);
+ LoadToolbarImageList(IDB_TOOLBAR_DISABLED, m_ToolbarImages[TOOLBAR_IMAGES_DISABLED]);
+
+ CToolBarCtrl& BarCtrl = m_wndToolBar.GetToolBarCtrl();
+ BarCtrl.SetImageList(&m_ToolbarImages[TOOLBAR_IMAGES_ENABLED]);
+ BarCtrl.SetDisabledImageList(&m_ToolbarImages[TOOLBAR_IMAGES_DISABLED]);
+
+ if (m_options.GetBool(OPT_SHOW_TOOLBAR) == false)
+ {
+ CMDIFrameWnd::ShowControlBar(&m_wndToolBar, false, 0);
+ }
+
+ return TRUE;
+}
+
+/**
+ * @brief Load a transparent 24-bit color image list.
+ */
+static void LoadHiColImageList(UINT nIDResource, int nWidth, int nHeight, int nCount, CImageList& ImgList, COLORREF crMask = RGB(255,0,255))
+{
+ CBitmap bm;
+ VERIFY(bm.LoadBitmap(nIDResource));
+ VERIFY(ImgList.Create(nWidth, nHeight, ILC_COLORDDB|ILC_MASK, nCount, 0));
+ int nIndex = ImgList.Add(&bm, crMask);
+ ASSERT(-1 != nIndex);
+}
+
+/**
+ * @brief Load toolbar image list.
+ */
+static void LoadToolbarImageList(UINT nIDResource, CImageList& ImgList)
+{
+ static const int ImageWidth = 16;
+ static const int ImageHeight = 15;
+ static const int ImageCount = 19;
+
+ LoadHiColImageList(nIDResource, ImageWidth, ImageHeight, ImageHeight, ImgList);
+}