diff --git a/CommonProjDefinitions.props b/CommonProjDefinitions.props index d68254a..b835780 100644 --- a/CommonProjDefinitions.props +++ b/CommonProjDefinitions.props @@ -9,7 +9,7 @@ $(SolutionDir)out\$(Platform)-$(Configuration)\libs $(SolutionDir)out\$(Platform)-Debug\libs $(SolutionDir)out\$(Platform)-Release\libs - E:\include\boost_1_58_0 + E:\include\boost_1_62_0 <_ProjectFileVersion>11.0.51106.1 diff --git a/SetupApp/SetupApp.vcxproj b/SetupApp/SetupApp.vcxproj index 2744192..d3253bc 100644 --- a/SetupApp/SetupApp.vcxproj +++ b/SetupApp/SetupApp.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -25,26 +25,26 @@ Application - v140 + v141 false Unicode Application - v140 + v141 false Unicode true Application - v140 + v141 false Unicode Application - v140 + v141 false MultiByte true @@ -149,11 +149,11 @@ Create self-extracting setup... - cd "$(OutDir)" -del /Q setup.7z -echo 7z a setup.7z "$(TargetPath)" -7z a setup.7z "$(TargetPath)" -copy /B /Y setup.sfx + "setup.7z" 2.1.X-ExifPro-Setup.exe + cd "$(OutDir)" +del /Q setup.7z +echo 7z a setup.7z "$(TargetPath)" +7z a setup.7z "$(TargetPath)" +copy /B /Y setup.sfx + "setup.7z" 2.1.X-ExifPro-Setup.exe @@ -208,10 +208,10 @@ copy /B /Y setup.sfx + "setup.7z" 2.1.X-ExifPro-Setup.exe Create self-extracting setup... - cd "$(OutDir)" -del /Q setup.7z -7z a setup.7z "$(TargetFileName)" -copy /B /Y 7zS.sfx + "setup.7z" 2.0.1.alpha-ExifPro-Setup.exe + cd "$(OutDir)" +del /Q setup.7z +7z a setup.7z "$(TargetFileName)" +copy /B /Y 7zS.sfx + "setup.7z" 2.0.1.alpha-ExifPro-Setup.exe diff --git a/SetupApp/Sfx/Util/SfxSetup/SfxSetup.vcxproj b/SetupApp/Sfx/Util/SfxSetup/SfxSetup.vcxproj index fb8279e..967e01b 100644 --- a/SetupApp/Sfx/Util/SfxSetup/SfxSetup.vcxproj +++ b/SetupApp/Sfx/Util/SfxSetup/SfxSetup.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -17,13 +17,13 @@ Application - v140 + v141 false Unicode Application - v140 + v141 false Unicode diff --git a/SetupApp/UnInstall/UnInstall.vcxproj b/SetupApp/UnInstall/UnInstall.vcxproj index 754d04e..3b5f609 100644 --- a/SetupApp/UnInstall/UnInstall.vcxproj +++ b/SetupApp/UnInstall/UnInstall.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -25,25 +25,25 @@ Application - v140 + v141 false Unicode Application - v140 + v141 false Unicode Application - v140 + v141 false MultiByte Application - v140 + v141 false MultiByte diff --git a/SlideShowApp/SlideShowApp.vcxproj b/SlideShowApp/SlideShowApp.vcxproj index afdac57..956a1f9 100644 --- a/SlideShowApp/SlideShowApp.vcxproj +++ b/SlideShowApp/SlideShowApp.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -25,26 +25,26 @@ Application - v140 + v141 false MultiByte Application - v140 + v141 false MultiByte true Application - v140 + v141 false MultiByte Application - v140 + v141 false MultiByte true diff --git a/libs/coolsb/coolsb.vcxproj b/libs/coolsb/coolsb.vcxproj index cc4dc88..a172834 100644 --- a/libs/coolsb/coolsb.vcxproj +++ b/libs/coolsb/coolsb.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -25,25 +25,25 @@ StaticLibrary - v140 + v141 false MultiByte StaticLibrary - v140 + v141 false MultiByte StaticLibrary - v140 + v141 false MultiByte StaticLibrary - v140 + v141 false MultiByte diff --git a/libs/giflib/giflib.vcxproj b/libs/giflib/giflib.vcxproj index 10cb03a..4ef02dc 100644 --- a/libs/giflib/giflib.vcxproj +++ b/libs/giflib/giflib.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -26,22 +26,22 @@ StaticLibrary - v140 + v141 MultiByte StaticLibrary - v140 + v141 MultiByte StaticLibrary - v140 + v141 MultiByte StaticLibrary - v140 + v141 MultiByte diff --git a/libs/lcms/Projects/VC7/lcms111.vcxproj b/libs/lcms/Projects/VC7/lcms111.vcxproj index 04bc9d4..e375b35 100644 --- a/libs/lcms/Projects/VC7/lcms111.vcxproj +++ b/libs/lcms/Projects/VC7/lcms111.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -26,27 +26,27 @@ StaticLibrary - v140 + v141 false MultiByte false StaticLibrary - v140 + v141 false MultiByte StaticLibrary - v140 + v141 false MultiByte false StaticLibrary - v140 + v141 false MultiByte diff --git a/libs/pnglib/pnglib.vcxproj b/libs/pnglib/pnglib.vcxproj index 48f3abe..13e49bf 100644 --- a/libs/pnglib/pnglib.vcxproj +++ b/libs/pnglib/pnglib.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -25,25 +25,25 @@ StaticLibrary - v140 + v141 false MultiByte StaticLibrary - v140 + v141 false MultiByte StaticLibrary - v140 + v141 false MultiByte StaticLibrary - v140 + v141 false MultiByte diff --git a/libs/scintilla/Scintilla/Scintilla.vcxproj b/libs/scintilla/Scintilla/Scintilla.vcxproj index 3d3ecbe..2b4bb03 100644 --- a/libs/scintilla/Scintilla/Scintilla.vcxproj +++ b/libs/scintilla/Scintilla/Scintilla.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -26,25 +26,25 @@ StaticLibrary - v140 + v141 Unicode false StaticLibrary - v140 + v141 Unicode StaticLibrary - v140 + v141 false Unicode false StaticLibrary - v140 + v141 false Unicode diff --git a/libs/tifflib/tifflib.vcxproj b/libs/tifflib/tifflib.vcxproj index 19f8d37..b3575d4 100644 --- a/libs/tifflib/tifflib.vcxproj +++ b/libs/tifflib/tifflib.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -25,25 +25,25 @@ StaticLibrary - v140 + v141 false MultiByte StaticLibrary - v140 + v141 false MultiByte StaticLibrary - v140 + v141 false MultiByte StaticLibrary - v140 + v141 false MultiByte diff --git a/libs/zlib/zlib.vcxproj b/libs/zlib/zlib.vcxproj index c7d2341..d1ff415 100644 --- a/libs/zlib/zlib.vcxproj +++ b/libs/zlib/zlib.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -25,25 +25,25 @@ StaticLibrary - v140 + v141 false MultiByte StaticLibrary - v140 + v141 false MultiByte StaticLibrary - v140 + v141 false MultiByte StaticLibrary - v140 + v141 false MultiByte diff --git a/lua/luavc/luavc.vcxproj b/lua/luavc/luavc.vcxproj index 861dfbd..18e637f 100644 --- a/lua/luavc/luavc.vcxproj +++ b/lua/luavc/luavc.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -27,24 +27,24 @@ StaticLibrary - v140 + v141 Unicode false StaticLibrary - v140 + v141 Unicode StaticLibrary - v140 + v141 Unicode false StaticLibrary - v140 + v141 Unicode diff --git a/src/BrowserToolbar.cpp b/src/BrowserToolbar.cpp index ed077d5..8c4557c 100644 --- a/src/BrowserToolbar.cpp +++ b/src/BrowserToolbar.cpp @@ -101,6 +101,7 @@ bool BrowserToolbar::Create(CWnd* parent, UINT id1, UINT id2, UINT rebar_band_id ID_PANE_MENU, ID_FOLDERS, ID_PREVIEW, ID_INFO_BAR }; + main_bar_.SetOwnerDraw(true); main_bar_.SetPadding(10, 8); // small_icons_ = AfxGetApp()->GetProfileInt(REGISTRY_SECTION_TOOLBAR, REG_ICONS, 0) == 0; @@ -121,6 +122,7 @@ bool BrowserToolbar::Create(CWnd* parent, UINT id1, UINT id2, UINT rebar_band_id main_bar_.AutoResize(); main_bar_.SetOwner(parent); + panels_.SetOwnerDraw(true); panels_.SetPadding(10, 8); if (!panels_.Create(":.:.....vxxX", commands, bmp_id, IDS_BROWSER_TOOLBAR, this, id2)) diff --git a/src/Config.cpp b/src/Config.cpp index 1577675..ec18264 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -792,7 +792,7 @@ void Config::UpdateAppColors() colors.push_back(std::make_pair(AppColors::Separator, sep)); colors.push_back(std::make_pair(AppColors::SecondarySeparator, CalcNewColor(sep, bkgnd, 0.50f))); colors.push_back(std::make_pair(AppColors::EditBox, CalcShade(bkgnd, -13.0f))); - colors.push_back(std::make_pair(AppColors::Selection, RGB(0x33, 0x99, 0xff))); //::GetSysColor(COLOR_HIGHLIGHT) + colors.push_back(std::make_pair(AppColors::Selection, RGB(25, 125, 225))); //::GetSysColor(COLOR_HIGHLIGHT) colors.push_back(std::make_pair(AppColors::AccentBackground, CalcShade(bkgnd, +12.0f))); app_colors_.SetColors(colors); diff --git a/src/DialogBase.cpp b/src/DialogBase.cpp new file mode 100644 index 0000000..f45ad09 --- /dev/null +++ b/src/DialogBase.cpp @@ -0,0 +1,55 @@ +#include "stdafx.h" +#include "DialogBase.h" +#include "AppColors.h" + +DialogBase::DialogBase() +{} + +DialogBase::DialogBase(LPCTSTR lpszTemplateName, CWnd* pParentWnd) : CDialog(lpszTemplateName, pParentWnd) +{} + +DialogBase::DialogBase(UINT nIDTemplate, CWnd* pParentWnd) : CDialog(nIDTemplate, pParentWnd) +{} + + +BEGIN_MESSAGE_MAP(DialogBase, CDialog) + //ON_WM_SIZE() + ON_WM_ERASEBKGND() + ON_WM_CTLCOLOR() + //ON_COMMAND_RANGE(ADD_FILTER, UPDATE_FILTER, OnFilterCommand) + //ON_EN_CHANGE(IDC_FILTER_NAME, OnFilterNameChanged) +END_MESSAGE_MAP() + +BOOL DialogBase::OnEraseBkgnd(CDC* dc) +{ + CRect rect(0, 0, 0, 0); + GetClientRect(rect); + if (!rect.IsRectEmpty()) + { + COLORREF background = GetAppColors()[AppColors::Background]; + dc->FillSolidRect(rect, background); + } + + return true; +} + + +HBRUSH DialogBase::OnCtlColor(CDC* dc, CWnd* wnd, UINT ctl_color) +{ + HBRUSH hbr = CDialog::OnCtlColor(dc, wnd, ctl_color); + + COLORREF background = GetAppColors()[AppColors::Background]; + COLORREF text = GetAppColors()[AppColors::Text]; + + // if (wnd && wnd->GetDlgCtrlID() == IDC_EXAMPLE) + { + background_brush_.DeleteObject(); + background_brush_.CreateSolidBrush(background); + hbr = background_brush_; + dc->SetBkColor(background); + dc->SetTextColor(text); + // dc->SelectObject(&fnd_desc_); + } + + return hbr; +} diff --git a/src/DialogBase.h b/src/DialogBase.h new file mode 100644 index 0000000..ccfeda2 --- /dev/null +++ b/src/DialogBase.h @@ -0,0 +1,19 @@ +#pragma once + +class DialogBase : public CDialog +{ +public: + DialogBase(); + explicit DialogBase(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL); + explicit DialogBase(UINT nIDTemplate, CWnd* pParentWnd = NULL); + +protected: + DECLARE_MESSAGE_MAP() + +protected: + afx_msg BOOL OnEraseBkgnd(CDC* dc); + HBRUSH OnCtlColor(CDC* dc, CWnd* wnd, UINT ctl_color); + +private: + CBrush background_brush_; +}; diff --git a/src/ExifPro.vcxproj b/src/ExifPro.vcxproj index ad2cd59..9c9d267 100644 --- a/src/ExifPro.vcxproj +++ b/src/ExifPro.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -42,53 +42,53 @@ Application - v140 + v141 Static MultiByte true Application - v140 + v141 Dynamic MultiByte Application - v140 + v141 Static Unicode false Application - v140 + v141 Dynamic Unicode Application - v140 + v141 Static MultiByte true Application - v140 + v141 Dynamic MultiByte Application - v140 + v141 Static Unicode false Application - v140 + v141 Dynamic Unicode @@ -601,6 +601,7 @@ + @@ -1072,6 +1073,7 @@ + diff --git a/src/ExifPro.vcxproj.filters b/src/ExifPro.vcxproj.filters index 55e316a..79d9c60 100644 --- a/src/ExifPro.vcxproj.filters +++ b/src/ExifPro.vcxproj.filters @@ -1287,6 +1287,9 @@ CommonUI + + CommonUI + @@ -2503,6 +2506,9 @@ Header Files + + CommonUI + diff --git a/src/ExifViewReBar.cpp b/src/ExifViewReBar.cpp index 5bc6a82..a5918ad 100644 --- a/src/ExifViewReBar.cpp +++ b/src/ExifViewReBar.cpp @@ -74,6 +74,13 @@ tool_bar_thumb_wnd_.SetOnIdleUpdateState(false); tool_bar_group_wnd_.SetOnIdleUpdateState(false); tool_bar_sort_wnd_.SetOnIdleUpdateState(false);*/ + toolbar_first_.SetOwnerDraw(true); + tool_bar_view_wnd_.SetOwnerDraw(true); + tool_bar_thumb_wnd_.SetOwnerDraw(true); + tool_bar_group_wnd_.SetOwnerDraw(true); + tool_bar_sort_wnd_.SetOwnerDraw(true); + toolbar_filter_.SetOwnerDraw(true); + // if (!CHorzReBar::Create(parent, false, RBS_FIXEDORDER/*RBS_VARHEIGHT | RBS_AUTOSIZE | RBS_DBLCLKTOGGLE | RBS_BANDBORDERS*/, AFX_IDW_REBAR)) // return false; if (!CWnd::Create(AfxRegisterWndClass(0, ::LoadCursor(NULL, IDC_ARROW)), 0, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN, diff --git a/src/FilterDialogs.cpp b/src/FilterDialogs.cpp index a206c07..333d747 100644 --- a/src/FilterDialogs.cpp +++ b/src/FilterDialogs.cpp @@ -22,7 +22,7 @@ ____________________________________________________________________________*/ extern void ManageTagsCollection(CWnd* parent, PhotoTagsCollection& tag_collection); -FilterDialog::FilterDialog(int id, CWnd* parent) : CDialog(id, parent) +FilterDialog::FilterDialog(int id, CWnd* parent) : DialogBase(id, parent) { min_height_ = 0; } @@ -31,7 +31,7 @@ FilterDialog::~FilterDialog() {} -BEGIN_MESSAGE_MAP(FilterDialog, CDialog) +BEGIN_MESSAGE_MAP(FilterDialog, DialogBase) ON_WM_SIZE() ON_BN_CLICKED(IDC_CANCEL, &FilterDialog::OnClear) END_MESSAGE_MAP() @@ -39,7 +39,7 @@ END_MESSAGE_MAP() void FilterDialog::OnSize(UINT type, int cx, int cy) { - CDialog::OnSize(type, cx, cy); + DialogBase::OnSize(type, cx, cy); resize_map_.Resize(); } @@ -47,7 +47,7 @@ void FilterDialog::OnSize(UINT type, int cx, int cy) BOOL FilterDialog::OnInitDialog() { - CDialog::OnInitDialog(); + DialogBase::OnInitDialog(); resize_map_.BuildMap(this); @@ -657,7 +657,7 @@ bool CFilterDialog_2::IsFilterActive() const void CFilterDialog_2::OnTimer(UINT_PTR event) { - CDialog::OnTimer(event); + DialogBase::OnTimer(event); if (event == TIMER_ID) { diff --git a/src/FilterDialogs.h b/src/FilterDialogs.h index 208ce74..1b42783 100644 --- a/src/FilterDialogs.h +++ b/src/FilterDialogs.h @@ -7,6 +7,7 @@ ____________________________________________________________________________*/ #pragma once #include "resource.h" +#include "DialogBase.h" #include "DlgAutoResize.h" #include #include "FilterData.h" @@ -19,7 +20,7 @@ ____________________________________________________________________________*/ enum { DEFAULT_TB_PAD_DX= 8, DEFAULT_TB_PAD_DY= 10 }; -class FilterDialog : public CDialog, protected ResizeWnd +class FilterDialog : public DialogBase, protected ResizeWnd { public: FilterDialog(int id, CWnd* parent); diff --git a/src/FilterPanelDlg.cpp b/src/FilterPanelDlg.cpp index be68b91..efa72d6 100644 --- a/src/FilterPanelDlg.cpp +++ b/src/FilterPanelDlg.cpp @@ -36,11 +36,11 @@ struct FilterPanelDlg::Impl dialogs_[4] = 0; } - void InitDlg(CDialog* self); + void InitDlg(DialogBase* self); void SubFilterChanged(FilterDialog* dlg); void UpdateStoreButton(); - CDialog* self_; + DialogBase* self_; DlgAutoResize resize_map_; DlgListCtrl list_; CEdit filter_name_; @@ -56,7 +56,7 @@ struct FilterPanelDlg::Impl }; -FilterPanelDlg::FilterPanelDlg() : impl_(new Impl), CDialog(FilterPanelDlg::IDD, 0) +FilterPanelDlg::FilterPanelDlg() : impl_(new Impl), DialogBase(FilterPanelDlg::IDD, 0) { ::LoadPngImageList(impl_->funnel_, IDB_FUNNEL, ::GetSysColor(COLOR_3DFACE), true, 1); } @@ -69,13 +69,13 @@ FilterPanelDlg::~FilterPanelDlg() void FilterPanelDlg::DoDataExchange(CDataExchange* DX) { - CDialog::DoDataExchange(DX); + DialogBase::DoDataExchange(DX); } enum { ADD_FILTER= 1111, DELETE_FILTER, UPDATE_FILTER }; -BEGIN_MESSAGE_MAP(FilterPanelDlg, CDialog) +BEGIN_MESSAGE_MAP(FilterPanelDlg, DialogBase) ON_WM_SIZE() ON_WM_ERASEBKGND() ON_COMMAND_RANGE(ADD_FILTER, UPDATE_FILTER, OnFilterCommand) @@ -88,7 +88,7 @@ END_MESSAGE_MAP() bool FilterPanelDlg::Create(CWnd* parent, PhotoTagsCollection& tags, FilterOperations* operations) { - if (!CDialog::Create(IDD, parent)) + if (!DialogBase::Create(IDD, parent)) return false; impl_->dlg_1_.SetTags(tags); @@ -107,7 +107,7 @@ bool FilterPanelDlg::Create(CWnd* parent, PhotoTagsCollection& tags, FilterOpera BOOL FilterPanelDlg::OnInitDialog() { - CDialog::OnInitDialog(); + DialogBase::OnInitDialog(); impl_->InitDlg(this); @@ -116,7 +116,7 @@ BOOL FilterPanelDlg::OnInitDialog() } -void FilterPanelDlg::Impl::InitDlg(CDialog* self) +void FilterPanelDlg::Impl::InitDlg(DialogBase* self) { self_ = self; @@ -274,7 +274,8 @@ BOOL FilterPanelDlg::OnEraseBkgnd(CDC* dc) if (rect.IsRectEmpty()) return true; - dc->FillSolidRect(rect.left, rect.top, rect.Width() - 1, rect.Height(), ::GetSysColor(COLOR_3DFACE)); + DialogBase::OnEraseBkgnd(dc); + //dc->FillSolidRect(rect.left, rect.top, rect.Width() - 1, rect.Height(), ::GetSysColor(COLOR_3DFACE)); dc->FillSolidRect(rect.right - 1, rect.top, 1, rect.Height(), ::GetSysColor(COLOR_3DSHADOW)); return true; diff --git a/src/FilterPanelDlg.h b/src/FilterPanelDlg.h index fb545b1..483a031 100644 --- a/src/FilterPanelDlg.h +++ b/src/FilterPanelDlg.h @@ -8,6 +8,7 @@ ____________________________________________________________________________*/ #pragma once class PhotoTagsCollection; #include "FilterData.h" +#include "DialogBase.h" class FilterOperations @@ -23,7 +24,7 @@ class FilterOperations // FilterPanelDlg dialog -class FilterPanelDlg : public CDialog +class FilterPanelDlg : public DialogBase { public: FilterPanelDlg();//CWnd* parent); diff --git a/src/FolderPane.cpp b/src/FolderPane.cpp index 68eccb2..e464341 100644 --- a/src/FolderPane.cpp +++ b/src/FolderPane.cpp @@ -321,6 +321,7 @@ bool FolderPane::Create2(CWnd* parent, UINT id, FolderPathPtr path, bool root, i int cmds[]= { ID_RECENT_FOLDERS, ID_FOLDER_UP }; + tool_bar_wnd_.SetOwnerDraw(true); if (!tool_bar_wnd_.Create("vp", cmds, IDB_FOLDER_TB, 0, this, AFX_IDW_TOOLBAR)) return false; diff --git a/src/InfoPane.cpp b/src/InfoPane.cpp index 8413bc7..394dde7 100644 --- a/src/InfoPane.cpp +++ b/src/InfoPane.cpp @@ -102,6 +102,7 @@ bool InfoPane::Create(CWnd* parent) ID_COPY_INFO, ID_RAW_INFO, ID_TASK_EXPORT, ID_TOGGLE_PREVIEW }; + tool_bar_wnd_.SetOwnerDraw(true); tool_bar_wnd_.SetPadding(8, 10); if (!tool_bar_wnd_.Create("Pxpx", commands, IsCaptionBig() ? IDB_INFO_TOOLBAR_BIG : IDB_INFO_TOOLBAR, IDS_INFO_TOOLBAR, this, -1)) diff --git a/src/PreviewBar.cpp b/src/PreviewBar.cpp index 1c7d355..f135889 100644 --- a/src/PreviewBar.cpp +++ b/src/PreviewBar.cpp @@ -67,6 +67,7 @@ bool PreviewBar::Create(PreviewPane* parent, bool big) int bmp= IDB_ZOOMBAR; toolbar_top_wnd_.SetPadding(8, 8); + toolbar_top_wnd_.SetOwnerDraw(true); VERIFY(toolbar_top_wnd_.Create("XXp......", cmd, bmp, vertical_ ? 0 : IDS_ZOOMBAR, this, -1, vertical_)); toolbar_top_wnd_.CreateDisabledImageList(bmp); @@ -75,12 +76,12 @@ bool PreviewBar::Create(PreviewPane* parent, bool big) toolbar_top_wnd_.SetRows(3, false, 0); toolbar_btm_wnd_.SetPadding(10, 8); + toolbar_btm_wnd_.SetOwnerDraw(true); VERIFY(toolbar_btm_wnd_.Create("::.p|pPP|pp", cmd, bmp, vertical_ ? 0 : IDS_ZOOMBAR, this, -1, vertical_)); toolbar_btm_wnd_.CreateDisabledImageList(bmp); toolbar_btm_wnd_.DeleteButton(ID_PREVIEW_OPTIONS); - VERIFY(zoom_wnd_.Create(WS_CHILD | WS_VISIBLE | TBS_BOTH | TBS_NOTICKS /*TBS_AUTOTICKS*/ | (vertical_ ? TBS_VERT : TBS_HORZ), - CRect(0,0,0,0), this, -1)); + VERIFY(zoom_wnd_.Create(WS_CHILD | WS_VISIBLE | TBS_BOTH | TBS_NOTICKS /*TBS_AUTOTICKS*/ | (vertical_ ? TBS_VERT : TBS_HORZ), CRect(0,0,0,0), this, -1)); toolbar_top_wnd_.SetOwner(parent); toolbar_top_wnd_.CWnd::SetOwner(parent); diff --git a/src/TagsBarCommon.cpp b/src/TagsBarCommon.cpp index 8b73b42..309d039 100644 --- a/src/TagsBarCommon.cpp +++ b/src/TagsBarCommon.cpp @@ -367,6 +367,7 @@ int TagsBarCommon::OnCreate(LPCREATESTRUCT create_struct) VERIFY(separator_.SubclassDlgItem(IDC_SEPARATOR, &rating_wnd_)); stars_.SetClickCallback(boost::bind(&TagsBarCommon::StarClicked, this, _1)); + clear_rating_.SetOwnerDraw(true); VERIFY(clear_rating_.SubclassDlgItem(IDC_CANCEL, &rating_wnd_)); int cmd[]= { CLEAR_RATING }; enum { DEFAULT_TB_PAD_DX= 8, DEFAULT_TB_PAD_DY= 10 }; @@ -378,6 +379,7 @@ int TagsBarCommon::OnCreate(LPCREATESTRUCT create_struct) if (create_toolbar_) { + tool_bar_wnd_.SetOwnerDraw(true); static int cmds[]= { ID_TAGS_MANAGE, ID_TAGS_OPTIONS }; tool_bar_wnd_.SetOnIdleUpdateState(false); int bmp_id= create_big_toolbar_ ? IDB_TAGS_TOOLBAR_BIG : IDB_TAGS_TOOLBAR; diff --git a/src/TagsBarCommon.h b/src/TagsBarCommon.h index 7d1f205..1e925df 100644 --- a/src/TagsBarCommon.h +++ b/src/TagsBarCommon.h @@ -61,7 +61,7 @@ class TagsBarCommon : public CWnd, ListViewCtrlNotifications typedef boost::function ApplyTagsFn; typedef boost::function ApplyRatingFn; - // if true leave space for a toolbar at a top + // if true leave space for a toolbar at the top bool tool_bar_at_top_; ToolBarWnd& GetToolBar() { return tool_bar_wnd_; } diff --git a/src/TaskToolbar.cpp b/src/TaskToolbar.cpp index 2a329f9..6c2ca28 100644 --- a/src/TaskToolbar.cpp +++ b/src/TaskToolbar.cpp @@ -15,6 +15,7 @@ TaskToolbar::TaskToolbar() small_icons_ = true; rebar_band_id_ = 0; horizontal_ = false; + SetOwnerDraw(true); } TaskToolbar::~TaskToolbar() @@ -125,6 +126,8 @@ bool TaskToolbar::Create(CWnd* parent, UINT id, bool vertical) if (!CToolBarCtrl::Create(tb_style, CRect(0,0,0,0), parent, id)) return false; + ::SetWindowTheme(m_hWnd, L"", L""); + int w= 0; { CClientDC dc(parent); diff --git a/src/ToolBarWnd.cpp b/src/ToolBarWnd.cpp index eac2d11..e5e0435 100644 --- a/src/ToolBarWnd.cpp +++ b/src/ToolBarWnd.cpp @@ -14,6 +14,8 @@ ____________________________________________________________________________*/ #include "PNGImage.h" #include "WhistlerLook.h" #include "GetDefaultGuiFont.h" +#include "AppColors.h" +#include "Color.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -50,7 +52,7 @@ BEGIN_MESSAGE_MAP(ToolBarWnd, CToolBarCtrl) ON_NOTIFY_REFLECT_EX(TBN_GETINFOTIP, OnGetInfoTip) ON_NOTIFY_REFLECT(TBN_QUERYINSERT, OnQueryInsert) ON_NOTIFY_REFLECT(TBN_QUERYDELETE, OnQueryDelete) -// ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomDraw) + ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomDraw) // ON_NOTIFY_REFLECT(TBN_GETDISPINFO, OnGetDispInfo) ON_NOTIFY_REFLECT(TBN_GETBUTTONINFO, OnGetButtonInfo) ON_NOTIFY_REFLECT(TBN_BEGINADJUST, OnBeginAdjust) @@ -292,6 +294,8 @@ bool ToolBarWnd::Create(const char* a_template, const int commands[], int bmp_id if (!CToolBarCtrl::Create(tb_style, CRect(0,0,0,0), parent, id)) return false; + ::SetWindowTheme(m_hWnd, L"", L""); + return AddButtons(a_template, commands, bmp_id, str_id, vertical); } @@ -605,33 +609,54 @@ void ToolBarWnd::SetPadding(int cx, int cy) // set button pad (before creation) pad_size_ = CSize(cx, cy); } -/* + void ToolBarWnd::OnCustomDraw(NMHDR* nm_hdr, LRESULT* result) { NMTBCUSTOMDRAW* NM_custom_draw= reinterpret_cast(nm_hdr); *result = CDRF_DODEFAULT; + const ApplicationColors& colors = GetAppColors(); + static HBRUSH backgnd = 0; + if (!owner_draw_) return; + NM_custom_draw->clrText = colors[AppColors::Text];; +// NM_custom_draw->clrTextHighlight = RGB(240, 255, 0); +// NM_custom_draw->hbrMonoDither = (HBRUSH)::GetStockObject(WHITE_BRUSH); + NM_custom_draw->hbrMonoDither = backgnd; + //NM_custom_draw->hbrLines = (HBRUSH)::GetStockObject(GRAY_BRUSH); + //NM_custom_draw->hpenLines = (HPEN)::GetStockObject(WHITE_PEN); + //NM_custom_draw->clrBtnFace = RGB(0, 0, 255); + NM_custom_draw->clrBtnHighlight = colors[AppColors::Selection]; // checked button + //NM_custom_draw->clrMark = RGB(0, 255, 0); + NM_custom_draw->clrHighlightHotTrack = CalcNewColor(colors[AppColors::Background], colors[AppColors::Selection], 0.3f); switch (NM_custom_draw->nmcd.dwDrawStage) { case CDDS_PREPAINT: - *result = CDRF_NOTIFYITEMDRAW; + *result = CDRF_NOTIFYITEMDRAW | CDRF_NOTIFYPOSTPAINT;// | TBCDRF_NOEDGES | TBCDRF_HILITEHOTTRACK | TBCDRF_NOETCHEDEFFECT; + backgnd = ::CreateSolidBrush(colors[AppColors::Selection]); + NM_custom_draw->hbrMonoDither = backgnd; break; case CDDS_ITEMPREPAINT: - *result = CDRF_SKIPDEFAULT; //TBCDRF_NOETCHEDEFFECT | TBCDRF_NOOFFSET | TBCDRF_NOEDGES | TBCDRF_NOMARK; //| TBCDRF_NOBACKGROUND; - HIMAGELIST image_list= NM_custom_draw->nmcd.uItemState & CDIS_HOT ? image_list_hot_ : image_list_; - CPoint pos(NM_custom_draw->nmcd.rc.left, NM_custom_draw->nmcd.rc.top); -// if (NM_custom_draw->nmcd.uItemState & CDIS_SELECTED) -// ++pos.x; - ImageList_Draw(image_list, CommandToIndex(NM_custom_draw->nmcd.dwItemSpec), NM_custom_draw->nmcd.hdc, - pos.x + 1, pos.y + 1, ILD_TRANSPARENT); -//TRACE(L"spec %x\n", NM_custom_draw->nmcd.dwItemSpec); -//TRACE(L"state %x\n", NM_custom_draw->nmcd.uItemState); +// *result = CDRF_SKIPDEFAULT; //TBCDRF_NOETCHEDEFFECT | TBCDRF_NOOFFSET | TBCDRF_NOEDGES | TBCDRF_NOMARK; //| TBCDRF_NOBACKGROUND; +// HIMAGELIST image_list= NM_custom_draw->nmcd.uItemState & CDIS_HOT ? image_list_hot_ : image_list_; +// CPoint pos(NM_custom_draw->nmcd.rc.left, NM_custom_draw->nmcd.rc.top); +//// if (NM_custom_draw->nmcd.uItemState & CDIS_SELECTED) +//// ++pos.x; +// ImageList_Draw(image_list, CommandToIndex(NM_custom_draw->nmcd.dwItemSpec), NM_custom_draw->nmcd.hdc, +// pos.x + 1, pos.y + 1, ILD_TRANSPARENT); +////TRACE(L"spec %x\n", NM_custom_draw->nmcd.dwItemSpec); +////TRACE(L"state %x\n", NM_custom_draw->nmcd.uItemState); + *result = TBCDRF_NOEDGES | TBCDRF_HILITEHOTTRACK | TBCDRF_NOETCHEDEFFECT; + break; + + case CDDS_POSTPAINT: + ::DeleteObject(backgnd); + backgnd = nullptr; break; } -} */ +} void ToolBarWnd::SetHotImageList(int hot_bmp_id) diff --git a/src/ToolBarWnd.h b/src/ToolBarWnd.h index 5a8c81c..bf7ee9b 100644 --- a/src/ToolBarWnd.h +++ b/src/ToolBarWnd.h @@ -46,7 +46,7 @@ class ToolBarWnd : public CToolBarCtrl void SetDisabledImageList(int disabled_bmp_id); bool CreateDisabledImageList(int bmp_id, float saturation= -0.3f, float lightness= +0.15f, float alpha= 1.0f); -// void SetOwnerDraw(bool owner_draw) { owner_draw_ = owner_draw; } + void SetOwnerDraw(bool owner_draw) { owner_draw_ = owner_draw; } void SetScrollInfoReceiver(CWnd* wnd) { pass_scroll_info_ = wnd; }