diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3618bdc --- /dev/null +++ b/.gitignore @@ -0,0 +1,66 @@ +/UIShop/Debug Unicode +/UIShop/Release Unicode Static +/LibUIDK/*.ncb +/LibUIDK/*.opt +/LibUIDK/*.plg +*.sdf +*.suo +/LibUIDK/LibUIDK_VC140.VC.db +/LibUIDK/LibUIDK_VC100.vcxproj.user +*.aps +/UIShop/UIShop_vs2010.opensdf +/UIShop/UIShop_vs2010.vcxproj.user +/UIShop/ipch/libuidk_vc100-bbcd57c9/libuidk100ud-c1e9d220.ipch +/UIShop/ipch/uishop_vs2010-b27a1585/uishop_vs2010-4f852af6.ipch +/LibUIDK/Debug100u +/LibUIDK/Lib +/UIShop/*.user +/UIShop/ipch +/UIShop/*.ncb +/UIShop.1.0 +/LibUIDK/Debug2019u +/LibUIDK/Debugu_vs2017 +/LibUIDK/Release2019su +/UIShop/Debug +/UIShop/Release +/LibUIDK/.vs +/UIShop/.vs +/LibUIDK/Releasesu_vs2017 +/LibUIDK/Debug_vs2017 +/LibUIDK/Debugs_vs2017 +/LibUIDK/Debugsud_vs2017 +/LibUIDK/Release_vs2017 +/LibUIDK/Releases_vs2017 +/LibUIDK/Releaseu_vs2017 +/LibUIDK/x64 +/LibUIDK/ipch +/UIShop/x64/Debug Unicode +/UIShop/x64/Release Unicode Static +/LibUIDK/LibUIDK_vs2017.vcxproj.user +/LibUIDK/LibUIDK_vs2019.vcxproj.user +/CombineImage +/DirectHWND +/Document +/EnterpriseRegistryTool +/Help/Images +/Help/LibUIDK_CHS +/Help/PreBuild +/Help/UIShop Video Help +/Help/UIShop_Help +/Install +/RegistryTool +/Test +/外包合作流程.txt +/美工加皮肤编辑项目外包合同.doc +/设置环境变量.bat +/软件项目外包合同.doc +/LibUIDK/Render回收代码.txt +/LibUIDK/编译问题.txt +/LibUIDK价格历史.txt +/LibUIDK升级合同.doc +/LibUIDK软件使用许可合同.doc +/NT119Admin.exe +/NT119用户使用参考手册.pdf +/Help/Develop/UIWNDPROPERTIES内存布局.bmp +/Help/LibUIDK函数改名.txt +/LibUIDK/*.user diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/BtnLoginClose.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/BtnLoginClose.png new file mode 100644 index 0000000..977d9d8 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/BtnLoginClose.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/BtnLoginMin.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/BtnLoginMin.png new file mode 100644 index 0000000..9bef739 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/BtnLoginMin.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/Edit.bmp b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/Edit.bmp new file mode 100644 index 0000000..0504a68 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/Edit.bmp differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/IDW_DSMAIN.bmp b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/IDW_DSMAIN.bmp new file mode 100644 index 0000000..712ae7a Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/IDW_DSMAIN.bmp differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/IDW_EXAMINE.bmp b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/IDW_EXAMINE.bmp new file mode 100644 index 0000000..e3d1fd5 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/IDW_EXAMINE.bmp differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/IDW_EXAMINING.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/IDW_EXAMINING.png new file mode 100644 index 0000000..ad87c50 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/IDW_EXAMINING.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/IDW_LOGIN.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/IDW_LOGIN.png new file mode 100644 index 0000000..d9f62a0 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/IDW_LOGIN.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/Resource.h b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/Resource.h new file mode 100644 index 0000000..d55f6d4 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/Resource.h @@ -0,0 +1,42 @@ +//WARNING: DO NOT EDIT OR DELETE THIS HEADER FILE! + +#pragma once + +#define IDW_LOGIN 1000 +#define IDC_BTN_MIN 1001 +#define IDC_BTN_CLOSE 1002 +#define IDC_WL_TXT_PASSWORD 1003 +#define IDC_EDT_NAME 1004 +#define IDC_WL_TXT_NAME 1005 +#define IDC_EDT_PASSWORD 1006 +#define IDC_BTN_LOGIN 1007 +#define IDW_MAIN 1008 +#define IDC_WL_TXT_TITLE 1009 +#define IDC_BTN_SKIN 1010 +#define IDC_BTN_MENU 1011 +#define IDC_CHK_MAX 1012 +#define IDC_RAD_EXAMINE 1013 +#define IDC_RAD_DSMAIN 1014 +#define IDC_RAD_VUL_REPAIR 1015 +#define IDC_RAD_SYS_REPAIR 1016 +#define IDC_RAD_TRACE_CLEANER 1017 +#define IDC_RAD_SPEEDUP 1018 +#define IDC_RAD_DNMZ 1019 +#define IDC_RAD_SOFT_MGR 1020 +#define IDC_RAD_ADV_TOOLS 1021 +#define IDC_WL_TXT_VER 1022 +#define IDC_BTN_CHECK_UPDATE 1023 +#define IDC_WL_TXT_CLOUD 1024 +#define IDC_BTN_LOGO 1025 +#define IDC_TWMGR_MAIN 1026 +#define IDW_EXAMINE_FRM 1027 +#define IDC_TWMGR_EXAMINE 1028 +#define IDW_EXAMINE 1029 +#define IDC_BTN_SCAN 1030 +#define IDW_EXAMINING 1031 +#define IDC_BTN_CANCEL 1032 +#define IDW_DSMAIN 1033 +#define IDC_BTN_1 1034 +#define IDC_BTN_2 1035 +#define IDW_WEB 1036 +#define IDC_HTMLCTRL_1 1037 diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/SkinButtom.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/SkinButtom.png new file mode 100644 index 0000000..479c399 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/SkinButtom.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/WEB.bmp b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/WEB.bmp new file mode 100644 index 0000000..8f68a29 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/WEB.bmp differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/button_middle.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/button_middle.png new file mode 100644 index 0000000..afc1b2b Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/button_middle.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/diagbtn_new.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/diagbtn_new.png new file mode 100644 index 0000000..915cc95 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/diagbtn_new.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/framemod_sim.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/framemod_sim.png new file mode 100644 index 0000000..9fe9316 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/framemod_sim.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_AdvTools.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_AdvTools.png new file mode 100644 index 0000000..cb2ebb9 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_AdvTools.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_Examine.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_Examine.png new file mode 100644 index 0000000..4f9ebed Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_Examine.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_SpeedupOpt.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_SpeedupOpt.png new file mode 100644 index 0000000..8ee92e8 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_SpeedupOpt.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_SysRepair.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_SysRepair.png new file mode 100644 index 0000000..f1d1789 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_SysRepair.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_TraceCleaner.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_TraceCleaner.png new file mode 100644 index 0000000..29cd2da Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_TraceCleaner.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_VulRepair.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_VulRepair.png new file mode 100644 index 0000000..a88cf10 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_VulRepair.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_diannaomenzhen.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_diannaomenzhen.png new file mode 100644 index 0000000..b5e6b8f Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_diannaomenzhen.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_dsmain.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_dsmain.png new file mode 100644 index 0000000..7b3a7df Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_dsmain.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_softmgr.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_softmgr.png new file mode 100644 index 0000000..59da846 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/ico_softmgr.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/logo.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/logo.png new file mode 100644 index 0000000..8afa00e Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/logo.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/netstateok2.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/netstateok2.png new file mode 100644 index 0000000..c74ce49 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/netstateok2.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/scanbutton.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/scanbutton.png new file mode 100644 index 0000000..f0271cd Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/scanbutton.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/scanbuttonS_new.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/scanbuttonS_new.png new file mode 100644 index 0000000..5173ca9 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/scanbuttonS_new.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/sys_button_close.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/sys_button_close.png new file mode 100644 index 0000000..0a0795f Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/sys_button_close.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/sys_button_max.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/sys_button_max.png new file mode 100644 index 0000000..02d4565 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/sys_button_max.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/sys_button_min.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/sys_button_min.png new file mode 100644 index 0000000..3a39ab5 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/sys_button_min.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/the.xui b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/the.xui new file mode 100644 index 0000000..f54826a --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/the.xui @@ -0,0 +1,587 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/title_bar_menu.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/title_bar_menu.png new file mode 100644 index 0000000..bf5eb91 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/title_bar_menu.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/toolbar_hover.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/toolbar_hover.png new file mode 100644 index 0000000..2ba99c8 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/toolbar_hover.png differ diff --git a/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/toolbar_pushed.png b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/toolbar_pushed.png new file mode 100644 index 0000000..aa23719 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/Bin/skins/SafeMgr/toolbar_pushed.png differ diff --git a/Demo/360 Demo/V8.9/Source/ExamineFrame.cpp b/Demo/360 Demo/V8.9/Source/ExamineFrame.cpp new file mode 100644 index 0000000..40cbf6b --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/ExamineFrame.cpp @@ -0,0 +1,79 @@ +// ExamineFrame.cpp : implementation of the CExamineFrame class +// + +#include "stdafx.h" +#include "ExamineFrame.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CExamineFrame + +BEGIN_MESSAGE_MAP(CExamineFrame, CUIWnd) + //{{AFX_MSG_MAP(CExamineFrame) + ON_WM_CREATE() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CExamineFrame construction/destruction + +CExamineFrame::CExamineFrame() +{ + m_pTWMgrExamine = NULL; + +} + +CExamineFrame::~CExamineFrame() +{ +} + +void CExamineFrame::DoDataExchange(CDataExchange* pDX) +{ + CUIWnd::DoDataExchange(pDX); + + //{{AFX_DATA_MAP(CExamineFrame) + //}}AFX_DATA_MAP +} + + +////////////////////////////////////////////////////////////////////////// +// protected + +int CExamineFrame::InitControls() +{ + m_pTWMgrExamine = (CTaskWndMgr *)GetDlgWLItem(IDC_TWMGR_EXAMINE); + ASSERT(m_pTWMgrExamine != NULL); + + return 0; +} + +////////////////////////////////////////////////////////////////////////// +// public + +int CExamineFrame::SwitchTaskWnd(int nWndID) +{ + return m_TaskWndMgr.SwitchToTaskWindow(nWndID); +} + +///////////////////////////////////////////////////////////////////////////// +// CExamineFrame message handlers + +int CExamineFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CUIWnd::OnCreate(lpCreateStruct) == -1) + return -1; + + if (InitControls() != 0) + return -1; + + m_pTWMgrExamine->AddTaskWindow(IDW_EXAMINE, FALSE, &m_wndExamine, IDW_EXAMINE, _T("Examine")); + m_pTWMgrExamine->AddTaskWindow(IDW_EXAMINING, FALSE, &m_wndExamining, IDW_EXAMINING, _T("Examining")); + m_pTWMgrExamine->SwitchToTaskWindow(IDW_EXAMINE); + + return 0; +} diff --git a/Demo/360 Demo/V8.9/Source/ExamineFrame.h b/Demo/360 Demo/V8.9/Source/ExamineFrame.h new file mode 100644 index 0000000..6ebacce --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/ExamineFrame.h @@ -0,0 +1,58 @@ +// ExamineFrame.h : interface of the CExamineFrame class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_EXAMINEFRAME_H__72DCAC07_34D6_48EA_A26F_E2B3B0E87446__INCLUDED_) +#define AFX_EXAMINEFRAME_H__72DCAC07_34D6_48EA_A26F_E2B3B0E87446__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + +#include "TaskExamineWnd.h" +#include "TaskExaminingWnd.h" + + +class CExamineFrame : public CUIWnd +{ +public: + CExamineFrame(); + virtual ~CExamineFrame(); + void WindowID() { IDD = IDW_EXAMINE_FRM; } + +protected: + int InitControls(); + +public: + int SwitchTaskWnd(int nWndID); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CExamineFrame) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Generated message map functions +protected: + //{{AFX_MSG(CExamineFrame) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +protected: + CTaskWndMgr *m_pTWMgrExamine; + +protected: + CTaskWndMgr m_TaskWndMgr; + CTaskExamineWnd m_wndExamine; + CTaskExaminingWnd m_wndExamining; +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// + +#endif // !defined(AFX_EXAMINEFRAME_H__72DCAC07_34D6_48EA_A26F_E2B3B0E87446__INCLUDED_) diff --git a/Demo/360 Demo/V8.9/Source/LibUIDKSkin.rc b/Demo/360 Demo/V8.9/Source/LibUIDKSkin.rc new file mode 100644 index 0000000..4eb881a --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/LibUIDKSkin.rc @@ -0,0 +1,107 @@ +//Microsoft Developer Studio generated resource script. +// + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "LibUIDKSkinRc.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// LIBUIDKSKIN +// + +THE.XUI LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\the.xui" +RESOURCE.H LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\Resource.h" +I62746E6C6F67696E636C6F7365.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\BtnLoginClose.png" +I62746E6C6F67696E6D696E.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\BtnLoginMin.png" +I627574746F6E5F6D6964646C65.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\button_middle.png" +I6469616762746E5F6E6577.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\diagbtn_new.png" +I6672616D656D6F645F73696D.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\framemod_sim.png" +I69636F5F616476746F6F6C73.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\ico_AdvTools.png" +I69636F5F6469616E6E616F6D656E7A68656E.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\ico_diannaomenzhen.png" +I69636F5F64736D61696E.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\ico_dsmain.png" +I69636F5F6578616D696E65.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\ico_Examine.png" +I69636F5F736F66746D6772.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\ico_softmgr.png" +I69636F5F737065656475706F7074.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\ico_SpeedupOpt.png" +I69636F5F737973726570616972.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\ico_SysRepair.png" +I69636F5F7472616365636C65616E6572.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\ico_TraceCleaner.png" +I69636F5F76756C726570616972.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\ico_VulRepair.png" +I6964775F6578616D696E696E67.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\IDW_EXAMINING.png" +I6964775F6C6F67696E.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\IDW_LOGIN.png" +I6C6F676F.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\logo.png" +I6E657473746174656F6B32.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\netstateok2.png" +I7363616E627574746F6E.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\scanbutton.png" +I7363616E627574746F6E735F6E6577.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\scanbuttonS_new.png" +I736B696E627574746F6D.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\SkinButtom.png" +I7379735F627574746F6E5F636C6F7365.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\sys_button_close.png" +I7379735F627574746F6E5F6D6178.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\sys_button_max.png" +I7379735F627574746F6E5F6D696E.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\sys_button_min.png" +I7469746C655F6261725F6D656E75.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\title_bar_menu.png" +I746F6F6C6261725F686F766572.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\toolbar_hover.png" +I746F6F6C6261725F707573686564.PNG LIBUIDKSKIN DISCARDABLE ".\\Bin\\skins\\SafeMgr\\toolbar_pushed.png" + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +I65646974.BMP BITMAP DISCARDABLE ".\\Bin\\skins\\SafeMgr\\Edit.bmp" +I6964775F64736D61696E.BMP BITMAP DISCARDABLE ".\\Bin\\skins\\SafeMgr\\IDW_DSMAIN.bmp" +I6964775F6578616D696E65.BMP BITMAP DISCARDABLE ".\\Bin\\skins\\SafeMgr\\IDW_EXAMINE.bmp" +I776562.BMP BITMAP DISCARDABLE ".\\Bin\\skins\\SafeMgr\\WEB.bmp" +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Demo/360 Demo/V8.9/Source/LoginDlg.cpp b/Demo/360 Demo/V8.9/Source/LoginDlg.cpp new file mode 100644 index 0000000..3c633af --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/LoginDlg.cpp @@ -0,0 +1,96 @@ +// LoginDlg.cpp : implementation of the CLoginDlg class +// + +#include "stdafx.h" +#include "LoginDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CLoginDlg + +BEGIN_MESSAGE_MAP(CLoginDlg, CUIWnd) + //{{AFX_MSG_MAP(CLoginDlg) + ON_WM_CREATE() + ON_BN_CLICKED(IDC_BTN_LOGIN, OnBtnLogin) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CLoginDlg construction/destruction + +CLoginDlg::CLoginDlg() +{ + m_pBtnMin = NULL; + m_pBtnClose = NULL; + m_pWLTxtPassword = NULL; + m_pEdtName = NULL; + m_pWLTxtName = NULL; + m_pEdtPassword = NULL; + m_pBtnLogin = NULL; + + m_strName = _T(""); + m_strPassword = _T(""); +} + +CLoginDlg::~CLoginDlg() +{ +} + +void CLoginDlg::DoDataExchange(CDataExchange* pDX) +{ + CUIWnd::DoDataExchange(pDX); + + //{{AFX_DATA_MAP(CLoginDlg) + DDX_Text(pDX, IDC_EDT_NAME, m_strName); + DDX_Text(pDX, IDC_EDT_PASSWORD, m_strPassword); + //}}AFX_DATA_MAP +} + + +////////////////////////////////////////////////////////////////////////// +// protected + +int CLoginDlg::InitControls() +{ + m_pBtnMin = (CSkinButton *)GetDlgItem(IDC_BTN_MIN); + ASSERT(m_pBtnMin->GetSafeHwnd() != NULL); + m_pBtnClose = (CSkinButton *)GetDlgItem(IDC_BTN_CLOSE); + ASSERT(m_pBtnClose->GetSafeHwnd() != NULL); + m_pWLTxtPassword = (CWLText *)GetDlgWLItem(IDC_WL_TXT_PASSWORD); + ASSERT(m_pWLTxtPassword != NULL); + m_pEdtName = (CSkinEdit *)GetDlgItem(IDC_EDT_NAME); + ASSERT(m_pEdtName->GetSafeHwnd() != NULL); + m_pWLTxtName = (CWLText *)GetDlgWLItem(IDC_WL_TXT_NAME); + ASSERT(m_pWLTxtName != NULL); + m_pEdtPassword = (CSkinEdit *)GetDlgItem(IDC_EDT_PASSWORD); + ASSERT(m_pEdtPassword->GetSafeHwnd() != NULL); + m_pBtnLogin = (CSkinButton *)GetDlgItem(IDC_BTN_LOGIN); + ASSERT(m_pBtnLogin->GetSafeHwnd() != NULL); + + return 0; +} + +///////////////////////////////////////////////////////////////////////////// +// CLoginDlg message handlers + +int CLoginDlg::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CUIWnd::OnCreate(lpCreateStruct) == -1) + return -1; + + if (InitControls() != 0) + return -1; + + + return 0; +} + +void CLoginDlg::OnBtnLogin() +{ + EndDialog(IDC_BTN_LOGIN); +} diff --git a/Demo/360 Demo/V8.9/Source/LoginDlg.h b/Demo/360 Demo/V8.9/Source/LoginDlg.h new file mode 100644 index 0000000..0c1bb95 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/LoginDlg.h @@ -0,0 +1,58 @@ +// LoginDlg.h : interface of the CLoginDlg class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_LOGINDLG_H__8B1F6E08_367F_4005_9EEF_D8BD7C9D0452__INCLUDED_) +#define AFX_LOGINDLG_H__8B1F6E08_367F_4005_9EEF_D8BD7C9D0452__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +class CLoginDlg : public CUIWnd +{ +public: + CLoginDlg(); + virtual ~CLoginDlg(); + void WindowID() { IDD = IDW_LOGIN; } + +protected: + int InitControls(); + +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CLoginDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Generated message map functions +protected: + //{{AFX_MSG(CLoginDlg) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnBtnLogin(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +protected: + CSkinButton *m_pBtnMin; + CSkinButton *m_pBtnClose; + CWLText *m_pWLTxtPassword; + CSkinEdit *m_pEdtName; + CWLText *m_pWLTxtName; + CSkinEdit *m_pEdtPassword; + CSkinButton *m_pBtnLogin; + +public: + CString m_strName; + CString m_strPassword; +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// + +#endif // !defined(AFX_LOGINDLG_H__8B1F6E08_367F_4005_9EEF_D8BD7C9D0452__INCLUDED_) diff --git a/Demo/360 Demo/V8.9/Source/MainFrm.cpp b/Demo/360 Demo/V8.9/Source/MainFrm.cpp new file mode 100644 index 0000000..6296a85 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/MainFrm.cpp @@ -0,0 +1,172 @@ +// MainFrm.cpp : implementation of the CMainFrame class +// + +#include "stdafx.h" +#include "SafeMgr.h" +#include "MainFrm.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CMainFrame + +BEGIN_MESSAGE_MAP(CMainFrame, CUIWnd) + //{{AFX_MSG_MAP(CMainFrame) + ON_WM_CREATE() + ON_BN_CLICKED(IDC_BTN_SKIN, OnBtnSkin) + ON_BN_CLICKED(IDC_BTN_MENU, OnBtnMenu) + ON_BN_CLICKED(IDC_BTN_CHECK_UPDATE, OnBtnCheckUpdate) + ON_BN_CLICKED(IDC_BTN_LOGO, OnBtnLogo) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CMainFrame construction/destruction + +CMainFrame::CMainFrame() +{ + m_pWLTxtTitle = NULL; + m_pBtnSkin = NULL; + m_pBtnMenu = NULL; + m_pBtnMin = NULL; + m_pChkMax = NULL; + m_pBtnClose = NULL; + m_pRadExamine = NULL; + m_pRadDsmain = NULL; + m_pRadVulRepair = NULL; + m_pRadSysRepair = NULL; + m_pRadTraceCleaner = NULL; + m_pRadSpeedup = NULL; + m_pRadDnmz = NULL; + m_pRadSoftMgr = NULL; + m_pRadAdvTools = NULL; + m_pWLTxtVer = NULL; + m_pBtnCheckUpdate = NULL; + m_pWLTxtCloud = NULL; + m_pBtnLogo = NULL; + m_pTWMgrMain = NULL; + + m_bMax = FALSE; + // TODO: add member initialization code here + +} + +CMainFrame::~CMainFrame() +{ +} + +void CMainFrame::DoDataExchange(CDataExchange* pDX) +{ + CUIWnd::DoDataExchange(pDX); + + //{{AFX_DATA_MAP(CMainFrame) + DDX_Check(pDX, IDC_CHK_MAX, m_bMax); + //}}AFX_DATA_MAP +} + + +////////////////////////////////////////////////////////////////////////// +// protected + +int CMainFrame::InitControls() +{ + m_pWLTxtTitle = (CWLText *)GetDlgWLItem(IDC_WL_TXT_TITLE); + ASSERT(m_pWLTxtTitle != NULL); + m_pBtnSkin = (CSkinButton *)GetDlgItem(IDC_BTN_SKIN); + ASSERT(m_pBtnSkin->GetSafeHwnd() != NULL); + m_pBtnMenu = (CSkinButton *)GetDlgItem(IDC_BTN_MENU); + ASSERT(m_pBtnMenu->GetSafeHwnd() != NULL); + m_pBtnMin = (CSkinButton *)GetDlgItem(IDC_BTN_MIN); + ASSERT(m_pBtnMin->GetSafeHwnd() != NULL); + m_pChkMax = (CSkinButton *)GetDlgItem(IDC_CHK_MAX); + ASSERT(m_pChkMax->GetSafeHwnd() != NULL); + m_pBtnClose = (CSkinButton *)GetDlgItem(IDC_BTN_CLOSE); + ASSERT(m_pBtnClose->GetSafeHwnd() != NULL); + m_pRadExamine = (CSkinButton *)GetDlgItem(IDC_RAD_EXAMINE); + ASSERT(m_pRadExamine->GetSafeHwnd() != NULL); + m_pRadDsmain = (CSkinButton *)GetDlgItem(IDC_RAD_DSMAIN); + ASSERT(m_pRadDsmain->GetSafeHwnd() != NULL); + m_pRadVulRepair = (CSkinButton *)GetDlgItem(IDC_RAD_VUL_REPAIR); + ASSERT(m_pRadVulRepair->GetSafeHwnd() != NULL); + m_pRadSysRepair = (CSkinButton *)GetDlgItem(IDC_RAD_SYS_REPAIR); + ASSERT(m_pRadSysRepair->GetSafeHwnd() != NULL); + m_pRadTraceCleaner = (CSkinButton *)GetDlgItem(IDC_RAD_TRACE_CLEANER); + ASSERT(m_pRadTraceCleaner->GetSafeHwnd() != NULL); + m_pRadSpeedup = (CSkinButton *)GetDlgItem(IDC_RAD_SPEEDUP); + ASSERT(m_pRadSpeedup->GetSafeHwnd() != NULL); + m_pRadDnmz = (CSkinButton *)GetDlgItem(IDC_RAD_DNMZ); + ASSERT(m_pRadDnmz->GetSafeHwnd() != NULL); + m_pRadSoftMgr = (CSkinButton *)GetDlgItem(IDC_RAD_SOFT_MGR); + ASSERT(m_pRadSoftMgr->GetSafeHwnd() != NULL); + m_pRadAdvTools = (CSkinButton *)GetDlgItem(IDC_RAD_ADV_TOOLS); + ASSERT(m_pRadAdvTools->GetSafeHwnd() != NULL); + m_pWLTxtVer = (CWLText *)GetDlgWLItem(IDC_WL_TXT_VER); + ASSERT(m_pWLTxtVer != NULL); + m_pBtnCheckUpdate = (CSkinButton *)GetDlgItem(IDC_BTN_CHECK_UPDATE); + ASSERT(m_pBtnCheckUpdate->GetSafeHwnd() != NULL); + m_pWLTxtCloud = (CWLText *)GetDlgWLItem(IDC_WL_TXT_CLOUD); + ASSERT(m_pWLTxtCloud != NULL); + m_pBtnLogo = (CSkinButton *)GetDlgItem(IDC_BTN_LOGO); + ASSERT(m_pBtnLogo->GetSafeHwnd() != NULL); + m_pTWMgrMain = (CTaskWndMgr *)GetDlgWLItem(IDC_TWMGR_MAIN); + ASSERT(m_pTWMgrMain != NULL); + + return 0; +} + +///////////////////////////////////////////////////////////////////////////// +// CMainFrame message handlers + +int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CUIWnd::OnCreate(lpCreateStruct) == -1) + return -1; + + if (InitControls() != 0) + return -1; + + CenterWindow(); + + // TODO: Add your message handler code here + + m_pTWMgrMain->AddTaskWindow(IDC_RAD_EXAMINE, TRUE, &m_wndExamineFrame, IDW_EXAMINE_FRM); + m_pTWMgrMain->AddTaskWindow(IDC_RAD_DSMAIN, TRUE, &m_wndDSMain, IDW_DSMAIN); + m_pTWMgrMain->AddTaskWindow(IDC_RAD_VUL_REPAIR, TRUE, &m_wndWeb, IDW_WEB); + m_pTWMgrMain->SwitchToTaskWindow(IDC_RAD_EXAMINE); + + return 0; +} + +void CMainFrame::OnBtnSkin() +{ + static BOOL bFlag = TRUE; + if (bFlag) + { + SetBkColor(RGB(18, 94, 22)); + bFlag = FALSE; + } + else + { + SetBkColor(RGB(15, 86, 150)); + bFlag = TRUE; + } +} + +void CMainFrame::OnBtnMenu() +{ + AfxMessageBox(_T("IDC_BTN_MENU")); +} + +void CMainFrame::OnBtnCheckUpdate() +{ + ShellExecute(NULL, _T("Open"), _T("http://www.iuishop.com"), NULL, NULL, SW_SHOW); +} + +void CMainFrame::OnBtnLogo() +{ + ShellExecute(NULL, _T("Open"), _T("http://www.iuishop.com"), NULL, NULL, SW_SHOW); +} diff --git a/Demo/360 Demo/V8.9/Source/MainFrm.h b/Demo/360 Demo/V8.9/Source/MainFrm.h new file mode 100644 index 0000000..cc8caf3 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/MainFrm.h @@ -0,0 +1,85 @@ +// MainFrm.h : interface of the CMainFrame class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_MAINFRM_H__69BBC78E_4403_4464_90C1_0F728E1441D4__INCLUDED_) +#define AFX_MAINFRM_H__69BBC78E_4403_4464_90C1_0F728E1441D4__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + +#include "ExamineFrame.h" +#include "TaskDSMainWnd.h" +#include "TaskWebWnd.h" + + +class CMainFrame : public CUIWnd +{ +public: + CMainFrame(); + virtual ~CMainFrame(); + void WindowID() { IDD = IDW_MAIN; } + +protected: + int InitControls(); + +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CMainFrame) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Generated message map functions +protected: + //{{AFX_MSG(CMainFrame) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnBtnSkin(); + afx_msg void OnBtnMenu(); + afx_msg void OnBtnCheckUpdate(); + afx_msg void OnBtnLogo(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +protected: + CWLText *m_pWLTxtTitle; + CSkinButton *m_pBtnSkin; + CSkinButton *m_pBtnMenu; + CSkinButton *m_pBtnMin; + CSkinButton *m_pChkMax; + CSkinButton *m_pBtnClose; + CSkinButton *m_pRadExamine; + CSkinButton *m_pRadDsmain; + CSkinButton *m_pRadVulRepair; + CSkinButton *m_pRadSysRepair; + CSkinButton *m_pRadTraceCleaner; + CSkinButton *m_pRadSpeedup; + CSkinButton *m_pRadDnmz; + CSkinButton *m_pRadSoftMgr; + CSkinButton *m_pRadAdvTools; + CWLText *m_pWLTxtVer; + CSkinButton *m_pBtnCheckUpdate; + CWLText *m_pWLTxtCloud; + CSkinButton *m_pBtnLogo; + CTaskWndMgr *m_pTWMgrMain; + +public: + BOOL m_bMax; + +protected: + CTaskWndMgr m_TaskWndMgr; + CExamineFrame m_wndExamineFrame; + CTaskDSMainWnd m_wndDSMain; + CTaskWebWnd m_wndWeb; +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_MAINFRM_H__69BBC78E_4403_4464_90C1_0F728E1441D4__INCLUDED_) diff --git a/Demo/360 Demo/V8.9/Source/Resource.h b/Demo/360 Demo/V8.9/Source/Resource.h new file mode 100644 index 0000000..658d7b4 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/Resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by SafeMgr.rc +// +#define IDR_MAINFRAME 128 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 130 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/Demo/360 Demo/V8.9/Source/SafeMgr.cpp b/Demo/360 Demo/V8.9/Source/SafeMgr.cpp new file mode 100644 index 0000000..a8af9a0 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/SafeMgr.cpp @@ -0,0 +1,135 @@ +// SafeMgr.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "SafeMgr.h" +#include "MainFrm.h" +#include "LoginDlg.h" + + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CSafeMgrApp + +BEGIN_MESSAGE_MAP(CSafeMgrApp, CWinApp) + //{{AFX_MSG_MAP(CSafeMgrApp) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CSafeMgrApp construction + +CSafeMgrApp::CSafeMgrApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance + m_pFrame = NULL; +} + +///////////////////////////////////////////////////////////////////////////// +// The one and only CSafeMgrApp object + +CSafeMgrApp theApp; + +///////////////////////////////////////////////////////////////////////////// +// CSafeMgrApp initialization + +BOOL CSafeMgrApp::InitInstance() +{ + // Standard initialization + // If you are not using these features and wish to reduce the size + // of your final executable, you should remove from the following + // the specific initialization routines you do not need. + + // Change the registry key under which our settings are stored. + // TODO: You should modify this string to be something appropriate + // such as the name of your company or organization. + SetRegistryKey(_T("Local AppWizard-Generated Applications")); + + // Change the path under which your skin files are stored. + if (CUIMgr::SetUIPath(_T("the.xui"), _T("RESOURCE.H"), _T("LIBUIDKSKIN")) != 0) +// if (CUIMgr::SetUIPath(_T("Skins\\SafeMgr\\the.xui")) != 0) + { + AfxMessageBox(_T("Failed to set the ui path or the ui path isn't exist!")); + return FALSE; + } + + CLoginDlg dlg; + int nRet = dlg.DoModal(); + if (nRet != IDC_BTN_LOGIN) + return FALSE; + + // To create the main window, this code creates a new frame window + // object and then sets it as the application's main window object. + + m_pFrame = new CMainFrame; + m_pMainWnd = m_pFrame; + + // create and load the frame with its resources + + BOOL bRet = m_pFrame->LoadFrame(IDR_MAINFRAME, + WS_POPUP|WS_CLIPCHILDREN|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX, NULL); + + if (!bRet) + { + DWORD dwLastError = m_pFrame->GetLastCreateError(); + switch (dwLastError) + { + case E_LOADBMPB: // 1 failed to load the base image + case E_LOADBMPN: // 2 failed to load the background image of normal status(end by _N.bmp) + case E_LOADBMPH: // 3 failed to laod the background image of highlight status(end by _H.bmp) + case E_LOADBMPD: // 4 failed to load the background image of disable status(end by _D.bmp) + case E_LOADBMPS: // 5 failed to load the background image of selected status(end by _S.bmp) + case E_LOADBMPC: // 6 failed to load the background image of checked status(end by _C.bmp) + TRACE(_T("Failed to load background image")); + break; + case E_ATTACHBMPB: // 50 failed to attach the HBITMAP of base image to CBitmap object + case E_ATTACHBMPN: // 51 failed to attach the HBITMAP of normal image to CBitmap object + case E_ATTACHBMPH: // 52 failed to attach the HBITMAP of highlight image to CBitmap object + case E_ATTACHBMPD: // 53 failed to attach the HBITMAP of disable image to CBitmap object + case E_ATTACHBMPS: // 54 failed to attach the HBITMAP of selected image to CBitmap object + case E_ATTACHBMPC: // 55 failed to attach the HBITMAP of checked image to CBitmap object + case E_ADJUSTCHILD:// 56 failed to adjust the child controls while change the skin + TRACE(_T("Failed to attach bitmap to CBitmao object")); + break; + case E_CREATECHILD:// 110 failed to create the child window + TRACE(_T("Failed to create child windows")); + break; + default: + break; + } + return FALSE; + } + + // The one and only window has been initialized, so show and update it. + m_pFrame->ShowWindow(SW_SHOW); + m_pFrame->UpdateWindow(); + + return TRUE; +} + +int CSafeMgrApp::ExitInstance() +{ + if (m_pFrame != NULL) + { + delete m_pFrame; + m_pFrame = NULL; + } + + CUIMgr::ReleaseSkin(); + + // TODO: Add your specialized code here and/or call the base class + + return CWinApp::ExitInstance(); +} + +///////////////////////////////////////////////////////////////////////////// +// CSafeMgrApp message handlers + diff --git a/Demo/360 Demo/V8.9/Source/SafeMgr.h b/Demo/360 Demo/V8.9/Source/SafeMgr.h new file mode 100644 index 0000000..4507bbe --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/SafeMgr.h @@ -0,0 +1,56 @@ +// SafeMgr.h : main header file for the SAFEMGR application +// + +#if !defined(AFX_SAFEMGR_H__479B3322_A02E_4FE1_810A_BBD6AFC5DD72__INCLUDED_) +#define AFX_SAFEMGR_H__479B3322_A02E_4FE1_810A_BBD6AFC5DD72__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#ifndef __AFXWIN_H__ + #error include 'stdafx.h' before including this file for PCH +#endif + +#include "resource.h" // main symbols + +class CMainFrame; + +///////////////////////////////////////////////////////////////////////////// +// CSafeMgrApp: +// See SafeMgr.cpp for the implementation of this class +// + +class CSafeMgrApp : public CWinApp +{ +public: + CSafeMgrApp(); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CSafeMgrApp) + public: + virtual BOOL InitInstance(); + virtual int ExitInstance(); + //}}AFX_VIRTUAL + +// Implementation + +public: + //{{AFX_MSG(CSafeMgrApp) + // NOTE - the ClassWizard will add and remove member functions here. + // DO NOT EDIT what you see in these blocks of generated code ! + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +private: + CMainFrame *m_pFrame; +}; + + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_SAFEMGR_H__479B3322_A02E_4FE1_810A_BBD6AFC5DD72__INCLUDED_) diff --git a/Demo/360 Demo/V8.9/Source/SafeMgr.rc b/Demo/360 Demo/V8.9/Source/SafeMgr.rc new file mode 100644 index 0000000..15becdd --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/SafeMgr.rc @@ -0,0 +1,157 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "#ifdef _WIN32\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#endif //_WIN32\r\n" + "#include ""res\\SafeMgr.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#include ""LibUIDKSkin.rc""\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON DISCARDABLE "res\\SafeMgr.ico" + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "\0" + VALUE "FileDescription", "SafeMgr MFC Application\0" + VALUE "FileVersion", "1, 0, 0, 1\0" + VALUE "InternalName", "SafeMgr\0" + VALUE "LegalCopyright", "Copyright (C) 2008\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "SafeMgr.EXE\0" + VALUE "ProductName", "SafeMgr Application\0" + VALUE "ProductVersion", "1, 0, 0, 1\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE PRELOAD DISCARDABLE +BEGIN + IDR_MAINFRAME "SafeMgr" +END + +STRINGTABLE PRELOAD DISCARDABLE +BEGIN + AFX_IDS_APP_TITLE "SafeMgr" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE 9, 1 +#pragma code_page(1252) +#endif //_WIN32 +#include "res\SafeMgr.rc2" // non-Microsoft Visual C++ edited resources +#include "afxres.rc" // Standard components +#include "LibUIDKSkin.rc" +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Demo/360 Demo/V8.9/Source/SafeMgr.sln b/Demo/360 Demo/V8.9/Source/SafeMgr.sln new file mode 100644 index 0000000..e9d3db5 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/SafeMgr.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{007CA833-E319-4E26-A29E-260C0572101C}") = "SafeMgr", "SafeMgr.vcproj", "{98261698-4758-474C-BA65-79238B467E52}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {98261698-4758-474C-BA65-79238B467E52}.Debug|Win32.ActiveCfg = Debug|Win32 + {98261698-4758-474C-BA65-79238B467E52}.Debug|Win32.Build.0 = Debug|Win32 + {98261698-4758-474C-BA65-79238B467E52}.Release|Win32.ActiveCfg = Release|Win32 + {98261698-4758-474C-BA65-79238B467E52}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Demo/360 Demo/V8.9/Source/SafeMgr.vcproj b/Demo/360 Demo/V8.9/Source/SafeMgr.vcproj new file mode 100644 index 0000000..6ca5165 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/SafeMgr.vcproj @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Demo/360 Demo/V8.9/Source/SafeMgr_VC10.sln b/Demo/360 Demo/V8.9/Source/SafeMgr_VC10.sln new file mode 100644 index 0000000..d9ae6e6 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/SafeMgr_VC10.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{A30A9037-1598-49B2-91A0-901E94FB8AE1}") = "SafeMgr", "SafeMgr_VC10.vcxproj", "{79851765-15FC-4F2B-A622-477AC2C436FA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {79851765-15FC-4F2B-A622-477AC2C436FA}.Debug|Win32.ActiveCfg = Debug|Win32 + {79851765-15FC-4F2B-A622-477AC2C436FA}.Debug|Win32.Build.0 = Debug|Win32 + {79851765-15FC-4F2B-A622-477AC2C436FA}.Release|Win32.ActiveCfg = Release|Win32 + {79851765-15FC-4F2B-A622-477AC2C436FA}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Demo/360 Demo/V8.9/Source/SafeMgr_VC10.vcxproj b/Demo/360 Demo/V8.9/Source/SafeMgr_VC10.vcxproj new file mode 100644 index 0000000..2fb7aa4 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/SafeMgr_VC10.vcxproj @@ -0,0 +1,139 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {79851765-15FC-4F2B-A622-477AC2C436FA} + SafeMgr + MFCProj + + + + Application + true + Unicode + Dynamic + + + Application + false + true + Unicode + Static + + + + + + + + + + + + + true + $(ProjectName)_D + $(SolutionDir)Bin\ + $(LIBUIDKINCLUDE);$(IncludePath) + $(LIBUIDKLIB);$(LibraryPath) + + + false + $(SolutionDir)Bin\ + $(LIBUIDKINCLUDE);$(IncludePath) + $(LIBUIDKLIB);$(LibraryPath) + + + + Use + Level3 + Disabled + WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) + + + Windows + true + + + false + true + _DEBUG;%(PreprocessorDefinitions) + + + 0x0409 + _DEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + false + true + NDEBUG;%(PreprocessorDefinitions) + + + 0x0409 + NDEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Demo/360 Demo/V8.9/Source/StdAfx.cpp b/Demo/360 Demo/V8.9/Source/StdAfx.cpp new file mode 100644 index 0000000..fc36920 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/StdAfx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// SafeMgr.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + + + diff --git a/Demo/360 Demo/V8.9/Source/StdAfx.h b/Demo/360 Demo/V8.9/Source/StdAfx.h new file mode 100644 index 0000000..57d5e78 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/StdAfx.h @@ -0,0 +1,230 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#if !defined(AFX_STDAFX_H__B6AB0D5D_8102_464F_8B25_12DB1345C9DA__INCLUDED_) +#define AFX_STDAFX_H__B6AB0D5D_8102_464F_8B25_12DB1345C9DA__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers + +#include // MFC core and standard components +#include // MFC extensions +#include // MFC support for Internet Explorer 4 Common Controls +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + +#ifdef _UNICODE + #if defined _M_IX86 + #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") + #elif defined _M_IA64 + #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") + #elif defined _M_X64 + #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") + #else + #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") + #endif +#endif + + +#include "Bin/Skins/SafeMgr/Resource.h" +#include +using namespace LibUIDK; + +#if(_MSC_VER == 1200) // VC6.0 + #ifdef _DEBUG + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK60ud.lib") + #else // Static + #pragma comment (lib, "LibUIDKs60ud.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK60d.lib") + #else // Static + #pragma comment (lib, "LibUIDKs60d.lib") + #endif + #endif // end _UNICODE + #else // Release + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK60u.lib") + #else // Static + #pragma comment (lib, "LibUIDKs60u.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK60.lib") + #else // Static + #pragma comment (lib, "LibUIDKs60.lib") + #endif + #endif // end _UNICODE + #endif +#endif +#if (_MSC_VER == 1310) // VC2003 + #ifdef _DEBUG + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK71ud.lib") + #else // Static + #pragma comment (lib, "LibUIDKs71ud.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK71d.lib") + #else // Static + #pragma comment (lib, "LibUIDKs71d.lib") + #endif + #endif // end _UNICODE + #else // Release + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK71u.lib") + #else // Static + #pragma comment (lib, "LibUIDKs71u.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK71.lib") + #else // Static + #pragma comment (lib, "LibUIDKs71.lib") + #endif + #endif // end _UNICODE + #endif +#endif +#if (_MSC_VER == 1400) // VC2005 + #ifdef _DEBUG + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK80ud.lib") + #else // Static + #pragma comment (lib, "LibUIDKs80ud.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK80d.lib") + #else // Static + #pragma comment (lib, "LibUIDKs80d.lib") + #endif + #endif // end _UNICODE + #else // Release + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK80u.lib") + #else // Static + #pragma comment (lib, "LibUIDKs80u.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK80.lib") + #else // Static + #pragma comment (lib, "LibUIDKs80.lib") + #endif + #endif // end _UNICODE + #endif +#endif +#if (_MSC_VER == 1500) // VC2008 + #ifdef _DEBUG + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK90ud.lib") + #else // Static + #pragma comment (lib, "LibUIDKs90ud.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK90d.lib") + #else // Static + #pragma comment (lib, "LibUIDKs90d.lib") + #endif + #endif // end _UNICODE + #else // Release + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK90u.lib") + #else // Static + #pragma comment (lib, "LibUIDKs90u.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK90.lib") + #else // Static + #pragma comment (lib, "LibUIDKs90.lib") + #endif + #endif // end _UNICODE + #endif +#endif +#if (_MSC_VER == 1600) // VC2010 + #ifdef _DEBUG + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK100ud.lib") + #else // Static + #pragma comment (lib, "LibUIDKs100ud.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK100d.lib") + #else // Static + #pragma comment (lib, "LibUIDKs100d.lib") + #endif + #endif // end _UNICODE + #else // Release + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK100u.lib") + #else // Static + #pragma comment (lib, "LibUIDKs100u.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK100.lib") + #else // Static + #pragma comment (lib, "LibUIDKs100.lib") + #endif + #endif // end _UNICODE + #endif +#endif +#if (_MSC_VER == 1700) // VC2012 + #ifdef _DEBUG + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK110ud.lib") + #else // Static + #pragma comment (lib, "LibUIDKs110ud.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK110d.lib") + #else // Static + #pragma comment (lib, "LibUIDKs110d.lib") + #endif + #endif // end _UNICODE + #else // Release + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK110u.lib") + #else // Static + #pragma comment (lib, "LibUIDKs110u.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK110.lib") + #else // Static + #pragma comment (lib, "LibUIDKs110.lib") + #endif + #endif // end _UNICODE + #endif +#endif + + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__B6AB0D5D_8102_464F_8B25_12DB1345C9DA__INCLUDED_) diff --git a/Demo/360 Demo/V8.9/Source/TaskDSMainWnd.cpp b/Demo/360 Demo/V8.9/Source/TaskDSMainWnd.cpp new file mode 100644 index 0000000..73805f6 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/TaskDSMainWnd.cpp @@ -0,0 +1,83 @@ +// TaskDSMainWnd.cpp : implementation of the CTaskDSMainWnd class +// + +#include "stdafx.h" +#include "TaskDSMainWnd.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CTaskDSMainWnd + +BEGIN_MESSAGE_MAP(CTaskDSMainWnd, CUIWnd) + //{{AFX_MSG_MAP(CTaskDSMainWnd) + ON_WM_CREATE() + ON_BN_CLICKED(IDC_BTN_1, OnBtn1) + ON_BN_CLICKED(IDC_BTN_2, OnBtn2) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CTaskDSMainWnd construction/destruction + +CTaskDSMainWnd::CTaskDSMainWnd() +{ + m_pBtn1 = NULL; + m_pBtn2 = NULL; + +} + +CTaskDSMainWnd::~CTaskDSMainWnd() +{ +} + +void CTaskDSMainWnd::DoDataExchange(CDataExchange* pDX) +{ + CUIWnd::DoDataExchange(pDX); + + //{{AFX_DATA_MAP(CTaskDSMainWnd) + //}}AFX_DATA_MAP +} + + +////////////////////////////////////////////////////////////////////////// +// protected + +int CTaskDSMainWnd::InitControls() +{ + m_pBtn1 = (CSkinButton *)GetDlgItem(IDC_BTN_1); + ASSERT(m_pBtn1->GetSafeHwnd() != NULL); + m_pBtn2 = (CSkinButton *)GetDlgItem(IDC_BTN_2); + ASSERT(m_pBtn2->GetSafeHwnd() != NULL); + + return 0; +} + +///////////////////////////////////////////////////////////////////////////// +// CTaskDSMainWnd message handlers + +int CTaskDSMainWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CUIWnd::OnCreate(lpCreateStruct) == -1) + return -1; + + if (InitControls() != 0) + return -1; + + + return 0; +} + +void CTaskDSMainWnd::OnBtn1() +{ + AfxMessageBox(_T("IDC_BTN_1")); +} + +void CTaskDSMainWnd::OnBtn2() +{ + AfxMessageBox(_T("IDC_BTN_2")); +} diff --git a/Demo/360 Demo/V8.9/Source/TaskDSMainWnd.h b/Demo/360 Demo/V8.9/Source/TaskDSMainWnd.h new file mode 100644 index 0000000..7619d71 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/TaskDSMainWnd.h @@ -0,0 +1,52 @@ +// TaskDSMainWnd.h : interface of the CTaskDSMainWnd class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_TASKDSMAINWND_H__5E1A2AF6_0462_4874_98B6_D2574778D5EA__INCLUDED_) +#define AFX_TASKDSMAINWND_H__5E1A2AF6_0462_4874_98B6_D2574778D5EA__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +class CTaskDSMainWnd : public CUIWnd +{ +public: + CTaskDSMainWnd(); + virtual ~CTaskDSMainWnd(); + void WindowID() { IDD = IDW_DSMAIN; } + +protected: + int InitControls(); + +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CTaskDSMainWnd) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Generated message map functions +protected: + //{{AFX_MSG(CTaskDSMainWnd) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnBtn1(); + afx_msg void OnBtn2(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +protected: + CSkinButton *m_pBtn1; + CSkinButton *m_pBtn2; + +public: +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// + +#endif // !defined(AFX_TASKDSMAINWND_H__5E1A2AF6_0462_4874_98B6_D2574778D5EA__INCLUDED_) diff --git a/Demo/360 Demo/V8.9/Source/TaskExamineWnd.cpp b/Demo/360 Demo/V8.9/Source/TaskExamineWnd.cpp new file mode 100644 index 0000000..02163cc --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/TaskExamineWnd.cpp @@ -0,0 +1,76 @@ +// TaskExamineWnd.cpp : implementation of the CTaskExamineWnd class +// + +#include "stdafx.h" +#include "TaskExamineWnd.h" +#include "ExamineFrame.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CTaskExamineWnd + +BEGIN_MESSAGE_MAP(CTaskExamineWnd, CUIWnd) + //{{AFX_MSG_MAP(CTaskExamineWnd) + ON_WM_CREATE() + ON_BN_CLICKED(IDC_BTN_SCAN, OnBtnScan) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CTaskExamineWnd construction/destruction + +CTaskExamineWnd::CTaskExamineWnd() +{ + m_pBtnScan = NULL; + +} + +CTaskExamineWnd::~CTaskExamineWnd() +{ +} + +void CTaskExamineWnd::DoDataExchange(CDataExchange* pDX) +{ + CUIWnd::DoDataExchange(pDX); + + //{{AFX_DATA_MAP(CTaskExamineWnd) + //}}AFX_DATA_MAP +} + + +////////////////////////////////////////////////////////////////////////// +// protected + +int CTaskExamineWnd::InitControls() +{ + m_pBtnScan = (CSkinButton *)GetDlgItem(IDC_BTN_SCAN); + ASSERT(m_pBtnScan->GetSafeHwnd() != NULL); + + return 0; +} + +///////////////////////////////////////////////////////////////////////////// +// CTaskExamineWnd message handlers + +int CTaskExamineWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CUIWnd::OnCreate(lpCreateStruct) == -1) + return -1; + + if (InitControls() != 0) + return -1; + + + return 0; +} + +void CTaskExamineWnd::OnBtnScan() +{ + CExamineFrame *pParent = (CExamineFrame *)GetParent(); + pParent->SwitchTaskWnd(IDW_EXAMINING); +} diff --git a/Demo/360 Demo/V8.9/Source/TaskExamineWnd.h b/Demo/360 Demo/V8.9/Source/TaskExamineWnd.h new file mode 100644 index 0000000..1463b30 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/TaskExamineWnd.h @@ -0,0 +1,50 @@ +// TaskExamineWnd.h : interface of the CTaskExamineWnd class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_TASKEXAMINEWND_H__6326E908_827B_4AC3_B184_FFF0A9996D6A__INCLUDED_) +#define AFX_TASKEXAMINEWND_H__6326E908_827B_4AC3_B184_FFF0A9996D6A__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +class CTaskExamineWnd : public CUIWnd +{ +public: + CTaskExamineWnd(); + virtual ~CTaskExamineWnd(); + void WindowID() { IDD = IDW_EXAMINE; } + +protected: + int InitControls(); + +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CTaskExamineWnd) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Generated message map functions +protected: + //{{AFX_MSG(CTaskExamineWnd) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnBtnScan(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +protected: + CSkinButton *m_pBtnScan; + +public: +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// + +#endif // !defined(AFX_TASKEXAMINEWND_H__6326E908_827B_4AC3_B184_FFF0A9996D6A__INCLUDED_) diff --git a/Demo/360 Demo/V8.9/Source/TaskExaminingWnd.cpp b/Demo/360 Demo/V8.9/Source/TaskExaminingWnd.cpp new file mode 100644 index 0000000..0c29674 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/TaskExaminingWnd.cpp @@ -0,0 +1,76 @@ +// TaskExaminingWnd.cpp : implementation of the CTaskExaminingWnd class +// + +#include "stdafx.h" +#include "TaskExaminingWnd.h" +#include "ExamineFrame.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CTaskExaminingWnd + +BEGIN_MESSAGE_MAP(CTaskExaminingWnd, CUIWnd) + //{{AFX_MSG_MAP(CTaskExaminingWnd) + ON_WM_CREATE() + ON_BN_CLICKED(IDC_BTN_CANCEL, OnBtnCancel) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CTaskExaminingWnd construction/destruction + +CTaskExaminingWnd::CTaskExaminingWnd() +{ + m_pBtnCancel = NULL; + +} + +CTaskExaminingWnd::~CTaskExaminingWnd() +{ +} + +void CTaskExaminingWnd::DoDataExchange(CDataExchange* pDX) +{ + CUIWnd::DoDataExchange(pDX); + + //{{AFX_DATA_MAP(CTaskExaminingWnd) + //}}AFX_DATA_MAP +} + + +////////////////////////////////////////////////////////////////////////// +// protected + +int CTaskExaminingWnd::InitControls() +{ + m_pBtnCancel = (CSkinButton *)GetDlgItem(IDC_BTN_CANCEL); + ASSERT(m_pBtnCancel->GetSafeHwnd() != NULL); + + return 0; +} + +///////////////////////////////////////////////////////////////////////////// +// CTaskExaminingWnd message handlers + +int CTaskExaminingWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CUIWnd::OnCreate(lpCreateStruct) == -1) + return -1; + + if (InitControls() != 0) + return -1; + + + return 0; +} + +void CTaskExaminingWnd::OnBtnCancel() +{ + CExamineFrame *pParent = (CExamineFrame *)GetParent(); + pParent->SwitchTaskWnd(IDW_EXAMINE); +} diff --git a/Demo/360 Demo/V8.9/Source/TaskExaminingWnd.h b/Demo/360 Demo/V8.9/Source/TaskExaminingWnd.h new file mode 100644 index 0000000..35c67c4 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/TaskExaminingWnd.h @@ -0,0 +1,50 @@ +// TaskExaminingWnd.h : interface of the CTaskExaminingWnd class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_TASKEXAMININGWND_H__39894983_41BF_47F0_8C88_AFBE1E6278F9__INCLUDED_) +#define AFX_TASKEXAMININGWND_H__39894983_41BF_47F0_8C88_AFBE1E6278F9__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +class CTaskExaminingWnd : public CUIWnd +{ +public: + CTaskExaminingWnd(); + virtual ~CTaskExaminingWnd(); + void WindowID() { IDD = IDW_EXAMINING; } + +protected: + int InitControls(); + +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CTaskExaminingWnd) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Generated message map functions +protected: + //{{AFX_MSG(CTaskExaminingWnd) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnBtnCancel(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +protected: + CSkinButton *m_pBtnCancel; + +public: +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// + +#endif // !defined(AFX_TASKEXAMININGWND_H__39894983_41BF_47F0_8C88_AFBE1E6278F9__INCLUDED_) diff --git a/Demo/360 Demo/V8.9/Source/TaskWebWnd.cpp b/Demo/360 Demo/V8.9/Source/TaskWebWnd.cpp new file mode 100644 index 0000000..709289c --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/TaskWebWnd.cpp @@ -0,0 +1,74 @@ +// TaskWebWnd.cpp : implementation of the CTaskWebWnd class +// + +#include "stdafx.h" +#include "TaskWebWnd.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CTaskWebWnd + +BEGIN_MESSAGE_MAP(CTaskWebWnd, CUIWnd) + //{{AFX_MSG_MAP(CTaskWebWnd) + ON_WM_CREATE() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CTaskWebWnd construction/destruction + +CTaskWebWnd::CTaskWebWnd() +{ + m_pHtml1 = NULL; + +} + +CTaskWebWnd::~CTaskWebWnd() +{ +} + +void CTaskWebWnd::DoDataExchange(CDataExchange* pDX) +{ + CUIWnd::DoDataExchange(pDX); + + //{{AFX_DATA_MAP(CTaskWebWnd) + //}}AFX_DATA_MAP +} + + +////////////////////////////////////////////////////////////////////////// +// protected + +int CTaskWebWnd::InitControls() +{ + m_pHtml1 = (CHtmlCtrl *)GetDlgItem(IDC_HTMLCTRL_1); + ASSERT(m_pHtml1->GetSafeHwnd() != NULL); + + return 0; +} + +int CTaskWebWnd::InitHtml1() +{ + return 0; +} + +///////////////////////////////////////////////////////////////////////////// +// CTaskWebWnd message handlers + +int CTaskWebWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CUIWnd::OnCreate(lpCreateStruct) == -1) + return -1; + + if (InitControls() != 0) + return -1; + + InitHtml1(); + + return 0; +} diff --git a/Demo/360 Demo/V8.9/Source/TaskWebWnd.h b/Demo/360 Demo/V8.9/Source/TaskWebWnd.h new file mode 100644 index 0000000..b45ba88 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/TaskWebWnd.h @@ -0,0 +1,50 @@ +// TaskWebWnd.h : interface of the CTaskWebWnd class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_TASKWEBWND_H__AA865F75_7FE7_48F6_A2ED_AB7244EC4784__INCLUDED_) +#define AFX_TASKWEBWND_H__AA865F75_7FE7_48F6_A2ED_AB7244EC4784__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +class CTaskWebWnd : public CUIWnd +{ +public: + CTaskWebWnd(); + virtual ~CTaskWebWnd(); + void WindowID() { IDD = IDW_WEB; } + +protected: + int InitControls(); + int InitHtml1(); + +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CTaskWebWnd) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Generated message map functions +protected: + //{{AFX_MSG(CTaskWebWnd) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +protected: + CHtmlCtrl *m_pHtml1; + +public: +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// + +#endif // !defined(AFX_TASKWEBWND_H__AA865F75_7FE7_48F6_A2ED_AB7244EC4784__INCLUDED_) diff --git a/Demo/360 Demo/V8.9/Source/res/SafeMgr.ico b/Demo/360 Demo/V8.9/Source/res/SafeMgr.ico new file mode 100644 index 0000000..8b1d992 Binary files /dev/null and b/Demo/360 Demo/V8.9/Source/res/SafeMgr.ico differ diff --git a/Demo/360 Demo/V8.9/Source/res/SafeMgr.rc2 b/Demo/360 Demo/V8.9/Source/res/SafeMgr.rc2 new file mode 100644 index 0000000..cddfc04 --- /dev/null +++ b/Demo/360 Demo/V8.9/Source/res/SafeMgr.rc2 @@ -0,0 +1,13 @@ +// +// SAFEMGR.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// diff --git "a/Help/CSkinListCtrl\346\266\210\346\201\257\346\230\240\345\260\204.txt" "b/Help/CSkinListCtrl\346\266\210\346\201\257\346\230\240\345\260\204.txt" new file mode 100644 index 0000000..4fe5744 --- /dev/null +++ "b/Help/CSkinListCtrl\346\266\210\346\201\257\346\230\240\345\260\204.txt" @@ -0,0 +1,307 @@ + ON_NOTIFY(NM_CLICK, IDC_LIST1, OnClickList1) + ON_NOTIFY(NM_DBLCLK, IDC_LIST1, OnDblclkList1) + ON_NOTIFY(NM_KILLFOCUS, IDC_LIST1, OnKillfocusList1) + ON_NOTIFY(NM_OUTOFMEMORY, IDC_LIST1, OnOutofmemoryList1) + ON_NOTIFY(NM_RCLICK, IDC_LIST1, OnRclickList1) + ON_NOTIFY(NM_RDBLCLK, IDC_LIST1, OnRdblclkList1) + ON_NOTIFY(NM_RETURN, IDC_LIST1, OnReturnList1) + ON_NOTIFY(NM_SETFOCUS, IDC_LIST1, OnSetfocusList1) + ON_NOTIFY(LVN_BEGINDRAG, IDC_LIST1, OnBegindragList1) + ON_NOTIFY(LVN_BEGINLABELEDIT, IDC_LIST1, OnBeginlabeleditList1) + ON_NOTIFY(LVN_BEGINRDRAG, IDC_LIST1, OnBeginrdragList1) + ON_NOTIFY(LVN_COLUMNCLICK, IDC_LIST1, OnColumnclickList1) + ON_NOTIFY(LVN_DELETEALLITEMS, IDC_LIST1, OnDeleteallitemsList1) + ON_NOTIFY(LVN_DELETEITEM, IDC_LIST1, OnDeleteitemList1) + ON_NOTIFY(LVN_ENDLABELEDIT, IDC_LIST1, OnEndlabeleditList1) + ON_NOTIFY(LVN_GETDISPINFO, IDC_LIST1, OnGetdispinfoList1) + ON_NOTIFY(LVN_INSERTITEM, IDC_LIST1, OnInsertitemList1) + ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST1, OnItemchangedList1) + ON_NOTIFY(LVN_ITEMCHANGING, IDC_LIST1, OnItemchangingList1) + ON_NOTIFY(LVN_KEYDOWN, IDC_LIST1, OnKeydownList1) + ON_NOTIFY(LVN_SETDISPINFO, IDC_LIST1, OnSetdispinfoList1) + ON_NOTIFY(LVN_ODCACHEHINT, IDC_LIST1, OnOdcachehintList1) + ON_NOTIFY(LVN_ODFINDITEM, IDC_LIST1, OnOdfinditemList1) + ON_NOTIFY(LVN_ODSTATECHANGED, IDC_LIST1, OnOdstatechangedList1) + ON_NOTIFY(HDN_ITEMCHANGED, IDC_LIST1, OnItemchangedList1) + ON_NOTIFY(HDN_ITEMCHANGING, IDC_LIST1, OnItemchangingList1) + ON_NOTIFY(HDN_TRACK, IDC_LIST1, OnTrackList1) + ON_NOTIFY(HDN_ITEMCLICK, IDC_LIST1, OnItemclickList1) + ON_NOTIFY(HDN_ITEMDBLCLICK, IDC_LIST1, OnItemdblclickList1) + ON_NOTIFY(HDN_BEGINTRACK, IDC_LIST1, OnBegintrackList1) + ON_NOTIFY(HDN_ENDTRACK, IDC_LIST1, OnEndtrackList1) + ON_NOTIFY(HDN_DIVIDERDBLCLICK, IDC_LIST1, OnDividerdblclickList1) + ON_NOTIFY(HDN_BEGINDRAG, IDC_LIST1, OnBegindragList1) + ON_NOTIFY(HDN_ENDDRAG, IDC_LIST1, OnEnddragList1) + ON_NOTIFY(HDN_GETDISPINFO, IDC_LIST1, OnGetdispinfoList1) + + afx_msg void OnClickList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDblclkList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnKillfocusList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnOutofmemoryList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnRclickList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnRdblclkList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnReturnList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnSetfocusList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBegindragList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBeginlabeleditList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBeginrdragList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnColumnclickList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDeleteallitemsList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDeleteitemList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnEndlabeleditList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnGetdispinfoList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnInsertitemList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnItemchangedList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnItemchangingList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnKeydownList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnSetdispinfoList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnOdcachehintList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnOdfinditemList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnOdstatechangedList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnTrackList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnItemclickList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnItemdblclickList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBegintrackList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnEndtrackList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDividerdblclickList1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnEnddragList1(NMHDR* pNMHDR, LRESULT* pResult); + + void CDDlg::OnClickList1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnDblclkList1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnKillfocusList1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnOutofmemoryList1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnRclickList1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnRdblclkList1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnReturnList1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnSetfocusList1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnBegindragList1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnBeginlabeleditList1(NMHDR* pNMHDR, LRESULT* pResult) + { + LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnBeginrdragList1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnColumnclickList1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnDeleteallitemsList1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnDeleteitemList1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnEndlabeleditList1(NMHDR* pNMHDR, LRESULT* pResult) + { + LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnGetdispinfoList1(NMHDR* pNMHDR, LRESULT* pResult) + { + LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnInsertitemList1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnItemchangedList1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnItemchangingList1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnKeydownList1(NMHDR* pNMHDR, LRESULT* pResult) + { + LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnSetdispinfoList1(NMHDR* pNMHDR, LRESULT* pResult) + { + LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnOdcachehintList1(NMHDR* pNMHDR, LRESULT* pResult) + { + NMLVCACHEHINT* pCacheHint = (NMLVCACHEHINT*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnOdfinditemList1(NMHDR* pNMHDR, LRESULT* pResult) + { + NMLVFINDITEM* pFindInfo = (NMLVFINDITEM*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnOdstatechangedList1(NMHDR* pNMHDR, LRESULT* pResult) + { + NMLVODSTATECHANGE* pStateChanged = (NMLVODSTATECHANGE*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnTrackList1(NMHDR* pNMHDR, LRESULT* pResult) + { + HD_NOTIFY *phdn = (HD_NOTIFY *) pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnItemclickList1(NMHDR* pNMHDR, LRESULT* pResult) + { + HD_NOTIFY *phdn = (HD_NOTIFY *) pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnItemdblclickList1(NMHDR* pNMHDR, LRESULT* pResult) + { + HD_NOTIFY *phdn = (HD_NOTIFY *) pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnBegintrackList1(NMHDR* pNMHDR, LRESULT* pResult) + { + HD_NOTIFY *phdn = (HD_NOTIFY *) pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnEndtrackList1(NMHDR* pNMHDR, LRESULT* pResult) + { + HD_NOTIFY *phdn = (HD_NOTIFY *) pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnDividerdblclickList1(NMHDR* pNMHDR, LRESULT* pResult) + { + HD_NOTIFY *phdn = (HD_NOTIFY *) pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnEnddragList1(NMHDR* pNMHDR, LRESULT* pResult) + { + HD_NOTIFY * phdn = (HD_NOTIFY *) pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } diff --git "a/Help/CSkinTreeCtrl\346\266\210\346\201\257\346\230\240\345\260\204.txt" "b/Help/CSkinTreeCtrl\346\266\210\346\201\257\346\230\240\345\260\204.txt" new file mode 100644 index 0000000..4b7a102 --- /dev/null +++ "b/Help/CSkinTreeCtrl\346\266\210\346\201\257\346\230\240\345\260\204.txt" @@ -0,0 +1,197 @@ +CSkinTreeCtrl + // Ϣӳ + ON_NOTIFY(NM_CLICK, IDC_TREE1, OnClickTree1) + ON_NOTIFY(NM_DBLCLK, IDC_TREE1, OnDblclkTree1) + ON_NOTIFY(NM_KILLFOCUS, IDC_TREE1, OnKillfocusTree1) + ON_NOTIFY(NM_OUTOFMEMORY, IDC_TREE1, OnOutofmemoryTree1) + ON_NOTIFY(NM_RCLICK, IDC_TREE1, OnRclickTree1) + ON_NOTIFY(NM_RDBLCLK, IDC_TREE1, OnRdblclkTree1) + ON_NOTIFY(NM_RETURN, IDC_TREE1, OnReturnTree1) + ON_NOTIFY(NM_SETFOCUS, IDC_TREE1, OnSetfocusTree1) + ON_NOTIFY(TVN_BEGINDRAG, IDC_TREE1, OnBegindragTree1) + ON_NOTIFY(TVN_BEGINLABELEDIT, IDC_TREE1, OnBeginlabeleditTree1) + ON_NOTIFY(TVN_BEGINRDRAG, IDC_TREE1, OnBeginrdragTree1) + ON_NOTIFY(TVN_DELETEITEM, IDC_TREE1, OnDeleteitemTree1) + ON_NOTIFY(TVN_ENDLABELEDIT, IDC_TREE1, OnEndlabeleditTree1) + ON_NOTIFY(TVN_GETDISPINFO, IDC_TREE1, OnGetdispinfoTree1) + ON_NOTIFY(TVN_ITEMEXPANDED, IDC_TREE1, OnItemexpandedTree1) + ON_NOTIFY(TVN_ITEMEXPANDING, IDC_TREE1, OnItemexpandingTree1) + ON_NOTIFY(TVN_KEYDOWN, IDC_TREE1, OnKeydownTree1) + ON_NOTIFY(TVN_SELCHANGED, IDC_TREE1, OnSelchangedTree1) + ON_NOTIFY(TVN_SELCHANGING, IDC_TREE1, OnSelchangingTree1) + ON_NOTIFY(TVN_SETDISPINFO, IDC_TREE1, OnSetdispinfoTree1) + + // ͷļ + afx_msg void OnClickTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDblclkTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnKillfocusTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnOutofmemoryTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnRclickTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnRdblclkTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnReturnTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnSetfocusTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBegindragTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBeginlabeleditTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBeginrdragTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDeleteitemTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnEndlabeleditTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnGetdispinfoTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnItemexpandedTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnItemexpandingTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnKeydownTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnSelchangedTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnSelchangingTree1(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnSetdispinfoTree1(NMHDR* pNMHDR, LRESULT* pResult); + + // ʵ + void CDDlg::OnClickTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnDblclkTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnKillfocusTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnOutofmemoryTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnRclickTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnRdblclkTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnReturnTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnSetfocusTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnBegindragTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnBeginlabeleditTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnBeginrdragTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnDeleteitemTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnEndlabeleditTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnGetdispinfoTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnItemexpandedTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnItemexpandingTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnKeydownTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + TV_KEYDOWN* pTVKeyDown = (TV_KEYDOWN*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnSelchangedTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnSelchangingTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } + + void CDDlg::OnSetdispinfoTree1(NMHDR* pNMHDR, LRESULT* pResult) + { + TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR; + // TODO: Add your control notification handler code here + + *pResult = 0; + } diff --git "a/Help/LibUIDK\345\210\207\345\233\276\346\214\207\345\215\227.doc" "b/Help/LibUIDK\345\210\207\345\233\276\346\214\207\345\215\227.doc" new file mode 100644 index 0000000..c279c3a Binary files /dev/null and "b/Help/LibUIDK\345\210\207\345\233\276\346\214\207\345\215\227.doc" differ diff --git "a/Help/\344\275\277\347\224\250\350\217\234\345\215\225.txt" "b/Help/\344\275\277\347\224\250\350\217\234\345\215\225.txt" new file mode 100644 index 0000000..49e468d --- /dev/null +++ "b/Help/\344\275\277\347\224\250\350\217\234\345\215\225.txt" @@ -0,0 +1,18 @@ +1. ںͿؼͬLibUIDKUIShop༭д˵ֱʹVCԴдIJ˵ԴͨCSkinMenuBindStyleVCԴдIJ˵Դ󶨵UIShop༭IJ˵Styleϣﵽ˵Ŀġ +2. VCԴд˵ +3. UIShop༭д˵Style +4. AppInitInstanceУAfxInitSkinMenu + if (!AfxInitSkinMenu()) + return FALSE; +5. ˵ + CSkinMenu menuSkin; + menuSkin.BindStyle(_T("IDR_MENU_DEFAULT")); + menuSkin.LoadMenu(IDR_MAINFRAME); + + // Get sub skin menu + CSkinMenu *pSkinMenu = (CSkinMenu *)menuSkin.GetSubMenu(2); + + // Pop-up skin menu + CRect rcButton; + m_pBtnPopupResourceMenu->GetWindowRect(rcButton); + pSkinMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_TOPALIGN, rcButton.right, rcButton.bottom, this); diff --git "a/Help/\345\212\237\350\203\275\345\222\214\347\225\214\351\235\242\345\210\206\347\246\273.exe" "b/Help/\345\212\237\350\203\275\345\222\214\347\225\214\351\235\242\345\210\206\347\246\273.exe" deleted file mode 100644 index 2aaccc6..0000000 Binary files "a/Help/\345\212\237\350\203\275\345\222\214\347\225\214\351\235\242\345\210\206\347\246\273.exe" and /dev/null differ diff --git a/LICENSE b/LICENSE deleted file mode 100644 index bbe365b..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 iUIShop - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..ff11b4b --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,7 @@ +版权所有(c)2005-2024 iUIShop + +特此授予个人和教育机构获得此软件和相关文件副本免费使用权,但不可应用于商业或盈利用途。 +如需应用于商业或盈利用途,需要付费使用LibUIDK,联系QQ: 1584793892 + +禁止使用本软件制作违反“成品发布所在国”法律的软件。 +我们不对使用本软件造成的任何损失负责。 diff --git a/LibUIDK/ButtonBase.cpp b/LibUIDK/ButtonBase.cpp index 21b2f89..cfa5c21 100644 --- a/LibUIDK/ButtonBase.cpp +++ b/LibUIDK/ButtonBase.cpp @@ -140,11 +140,6 @@ int CButtonBase::BindPushButtonStyle(const BTNPROPERTIES *pCtrlProp) SetBkImageRepeatX(pCtrlProp->m_uXRepeatPixel); SetBkImageRepeatY(pCtrlProp->m_uYRepeatPixel); - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } - SetBkImageTransparent(pCtrlProp->m_lBkImgTransparent); // Set foreground bitmaps for control @@ -281,11 +276,6 @@ int BindToggleButtonStyle(T *pButtonCtrl, const TOGGLEBTNPROPERTIES *pCtrlProp) pButtonCtrl->SetBkImageRepeatX(pCtrlProp->m_uXRepeatPixel); pButtonCtrl->SetBkImageRepeatY(pCtrlProp->m_uYRepeatPixel); - for (int i = 0; i < 1 + COMBINEIMAGESIZE8; ++i) - { - ReleaseIUIImage(strImageName[i]); - } - pButtonCtrl->SetBkImageTransparent(pCtrlProp->m_lBkImgTransparent); // Set foreground diff --git a/LibUIDK/CUSTSITE.CPP b/LibUIDK/CUSTSITE.CPP index ae7ae9d..8f3e8de 100644 --- a/LibUIDK/CUSTSITE.CPP +++ b/LibUIDK/CUSTSITE.CPP @@ -50,7 +50,52 @@ void CCustomOleControlSite::SetXDocHostUI_Flag(DWORD dwSet) m_dwXDocHostUI_Flag = dwSet; } - +#undef BEGIN_INTERFACE_MAP + +#ifdef _AFXDLL + // shared link to mfc + #define BEGIN_INTERFACE_MAP(theClass, theBase) \ + const AFX_INTERFACEMAP* PASCAL theClass::_GetBaseInterfaceMap() \ + { return &theBase::interfaceMap; } \ + const AFX_INTERFACEMAP* theClass::GetInterfaceMap() const \ + { return &theClass::interfaceMap; } \ + AFX_COMDAT const AFX_DATADEF AFX_INTERFACEMAP theClass::interfaceMap = \ + { &theClass::_GetBaseInterfaceMap, &theClass::_interfaceEntries[0], }; \ + AFX_COMDAT const AFX_DATADEF AFX_INTERFACEMAP_ENTRY theClass::_interfaceEntries[] = \ + { \ + +#else + // static link to mfc + #define BEGIN_INTERFACE_MAP(theClass, theBase) \ + const AFX_INTERFACEMAP* theClass::GetInterfaceMap() const \ + { return &theClass::interfaceMap; } \ + const AFX_DATADEF AFX_INTERFACEMAP theClass::interfaceMap = \ + { &theBase::interfaceMap, &theClass::_interfaceEntries[0], }; \ + AFX_COMDAT const AFX_DATADEF AFX_INTERFACEMAP_ENTRY theClass::_interfaceEntries[] = \ + { \ + +#endif +#define BEGIN_INTERFACE_MAP(theClass, theBase) \ + const AFX_INTERFACEMAP* PASCAL theClass::_GetBaseInterfaceMap() \ +{ return &theBase::interfaceMap; } \ + const AFX_INTERFACEMAP* theClass::GetInterfaceMap() const \ +{ return &theClass::interfaceMap; } \ + AFX_COMDAT const AFX_DATADEF AFX_INTERFACEMAP theClass::interfaceMap = \ +{ &theClass::_GetBaseInterfaceMap, &theClass::_interfaceEntries[0], }; \ + AFX_COMDAT const AFX_DATADEF AFX_INTERFACEMAP_ENTRY theClass::_interfaceEntries[] = \ +{ \ + +#else +// static +#define BEGIN_INTERFACE_MAP(theClass, theBase) \ + const AFX_INTERFACEMAP* theClass::GetInterfaceMap() const \ +{ return &theClass::interfaceMap; } \ + const AFX_DATADEF AFX_INTERFACEMAP theClass::interfaceMap = \ +{ &theBase::interfaceMap, &theClass::_interfaceEntries[0], }; \ + AFX_COMDAT const AFX_DATADEF AFX_INTERFACEMAP_ENTRY theClass::_interfaceEntries[] = \ +{ \ + +#endif BEGIN_INTERFACE_MAP(CCustomOleControlSite, COleControlSite) INTERFACE_PART(CCustomOleControlSite, IID_IDocHostUIHandler, DocHostUIHandler) diff --git a/LibUIDK/ControlBase.cpp b/LibUIDK/ControlBase.cpp index 4b71b01..b43f30b 100644 --- a/LibUIDK/ControlBase.cpp +++ b/LibUIDK/ControlBase.cpp @@ -75,10 +75,16 @@ int CControlBase::BindStyle(const CTRLPROPERTIES *pCtrlProp) int CControlBase::ReleaseObject() { - ReleaseIUIImage(m_himgCombineBk); - m_himgCombineBk = NULL; - ReleaseIUIImage(m_himgCombineFg); - m_himgCombineFg = NULL; + if (NULL != m_himgCombineBk) + { + ReleaseIUIImage(m_himgCombineBk); + m_himgCombineBk = NULL; + } + if (NULL != m_himgCombineFg) + { + ReleaseIUIImage(m_himgCombineFg); + m_himgCombineFg = NULL; + } return 0; } diff --git a/LibUIDK/CreateControls.cpp b/LibUIDK/CreateControls.cpp index e357b48..92fd303 100644 --- a/LibUIDK/CreateControls.cpp +++ b/LibUIDK/CreateControls.cpp @@ -110,7 +110,7 @@ CSkinButton *LibUIDK::CreateButton(BTNPROPERTIES *pBtn, CWnd *pParent, if (nHas == DC_HASDEFID && pPreviousBtn->GetSafeHwnd() != NULL) { - LONG lStyle = GetWindowLong(pChild->GetSafeHwnd(), GWL_STYLE); + LONG_PTR lStyle = GetWindowLongPtr(pChild->GetSafeHwnd(), GWL_STYLE); lStyle &= ~BS_DEFPUSHBUTTON; pPreviousBtn->SendMessage(BM_SETSTYLE, lStyle, MAKELPARAM(FALSE, 0)); } diff --git a/LibUIDK/CtrlProperties.cpp b/LibUIDK/CtrlProperties.cpp index c21bf4f..e274f94 100644 --- a/LibUIDK/CtrlProperties.cpp +++ b/LibUIDK/CtrlProperties.cpp @@ -1446,7 +1446,7 @@ int _InitOtherStateColor(COLORREF *pColor, bool bSameNColor, COLORREF crNormal, RESCOLORPROPERTIES *pColorProp = (RESCOLORPROPERTIES *)CUIMgr::GetColorResourceItem( lpszColorID); - *pColor = (pColorProp == NULL) ? crNormal : pColorProp->m_crColor; + *pColor = (pColorProp == NULL) ? crNormal : (long)pColorProp->m_crColor; } return 0; @@ -1464,7 +1464,7 @@ int CTRLPROPERTIES::IUIGetControlColor4(const CTRLPROPERTIES *pCtrlProp, if (pcrN != NULL) { - *pcrN = (pColorPropN == NULL) ? crDefault : pColorPropN->m_crColor; + *pcrN = (pColorPropN == NULL) ? crDefault : (long)pColorPropN->m_crColor; } if (pcrH != NULL) @@ -1478,7 +1478,7 @@ int CTRLPROPERTIES::IUIGetControlColor4(const CTRLPROPERTIES *pCtrlProp, RESCOLORPROPERTIES *pColorPropH = (RESCOLORPROPERTIES *)CUIMgr::GetColorResourceItem( (LPCTSTR)pCtrlProp->m_strResColorIDH); - *pcrH = (pColorPropH == NULL) ? crDefault : pColorPropH->m_crColor; + *pcrH = (pColorPropH == NULL) ? crDefault : (long)pColorPropH->m_crColor; } } @@ -1493,7 +1493,7 @@ int CTRLPROPERTIES::IUIGetControlColor4(const CTRLPROPERTIES *pCtrlProp, RESCOLORPROPERTIES *pColorPropS = (RESCOLORPROPERTIES *)CUIMgr::GetColorResourceItem( (LPCTSTR)pCtrlProp->m_strResColorIDS); - *pcrS = (pColorPropS == NULL) ? crDefault : pColorPropS->m_crColor; + *pcrS = (pColorPropS == NULL) ? crDefault : (long)pColorPropS->m_crColor; } } @@ -1508,7 +1508,7 @@ int CTRLPROPERTIES::IUIGetControlColor4(const CTRLPROPERTIES *pCtrlProp, RESCOLORPROPERTIES *pColorPropD = (RESCOLORPROPERTIES *)CUIMgr::GetColorResourceItem( (LPCTSTR)pCtrlProp->m_strResColorIDD); - *pcrD = (pColorPropD == NULL) ? crDefault : pColorPropD->m_crColor; + *pcrD = (pColorPropD == NULL) ? crDefault : (long)pColorPropD->m_crColor; } } @@ -1529,7 +1529,7 @@ int CTRLPROPERTIES::IUIGetControlColor8(const TOGGLEBTNPROPERTIES *pCtrlProp, COLORREF crNormal = RGB(255, 255, 255); if (pcrN != NULL) { - *pcrN = (pColorPropN == NULL) ? crDefault : pColorPropN->m_crColor; + *pcrN = (pColorPropN == NULL) ? crDefault : (long)pColorPropN->m_crColor; crNormal = *pcrN; } @@ -1558,18 +1558,12 @@ int CTRLPROPERTIES::IUIGetBackground2(const CTRLPROPERTIES *pCtrlProp, if (bCombineImage) { *pstrImageName = (LPCTSTR)pCtrlProp->m_strBKCombine; - - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKCombine); } else { int nIndex = 1; *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKN; - - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKN); - - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKD); *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKD; } @@ -1590,24 +1584,15 @@ int CTRLPROPERTIES::IUIGetBackground4(const CTRLPROPERTIES *pCtrlProp, if (bCombineImage) { *pstrImageName = (LPCTSTR)pCtrlProp->m_strBKCombine; - - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKCombine); } else { int nIndex = 1; *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKN; - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKN); - *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKH; - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKH); - *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKS; - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKS); - *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKD; - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKD); } return 0; @@ -1633,36 +1618,19 @@ int CTRLPROPERTIES::IUIGetToggleButtonBackground8(const TOGGLEBTNPROPERTIES *pCt if (bCombineImage) { *pstrImageName = (LPCTSTR)pCtrlProp->m_strBKCombine; - - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKCombine); } else { int nIndex = 1; *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKN; - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKN); - *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKH; - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKH); - *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKS; - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKS); - *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKD; - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKD); - *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKCN; - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKCN); - *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKCH; - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKCH); - *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKCS; - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKCS); - *(pstrImageName + (nIndex++)) = (LPCTSTR)pCtrlProp->m_strBKCD; - CreateEmptyIUIImage((LPCTSTR)pCtrlProp->m_strBKCD); } return 0; @@ -4000,10 +3968,6 @@ LSTCTRLPROPERTIES::LSTCTRLPROPERTIES() m_bTwoClickActivate.strXUIElementName = _T("IsTwoClickActivate"); m_bTwoClickActivate.strPropWndName = _T("Two Click Activate"); - m_bEnableOwnerDraw.varDefaultValue = m_bEnableOwnerDraw = false; - m_bEnableOwnerDraw.strXUIElementName = _T("IsEnableOwnerDraw"); - m_bEnableOwnerDraw.strPropWndName = _T("Enable Owner Draw"); - m_strTag.varDefaultValue = m_strTag = _T(""); m_strTag.strUIKeyName = m_strTag.strXUIElementName = _T("Tag"); m_strTag.strPropWndName = _T("Tag"); @@ -4054,6 +4018,11 @@ LSTCTRLPROPERTIES::LSTCTRLPROPERTIES() m_bDraw0Row.strXUIAttributeName = _T("Draw0Row"); m_bDraw0Row.strPropWndName = _T("Draw First Row"); + m_bVerLineTo0Row.varDefaultValue = m_bVerLineTo0Row = false; + m_bVerLineTo0Row.strXUIElementName = m_bShowGridLine.strXUIElementName; + m_bVerLineTo0Row.strXUIAttributeName = _T("VerDrawTo0Row"); + m_bVerLineTo0Row.strPropWndName = _T("Vert Draw To First Row"); + m_lXOffset.varDefaultValue = m_lXOffset = (LONG)0; m_lXOffset.strXUIElementName = m_bShowGridLine.strXUIElementName; m_lXOffset.strXUIAttributeName = _T("XOffset"); diff --git a/LibUIDK/DockPanel.cpp b/LibUIDK/DockPanel.cpp index eb3e2db..d35a498 100644 --- a/LibUIDK/DockPanel.cpp +++ b/LibUIDK/DockPanel.cpp @@ -147,7 +147,7 @@ int CDockPanel::RelayoutElements(BOOL bRedraw/* = FALSE*/) { CWnd *pWnd = (CWnd *)pItem->m_pElement; - // Skip the invisible element. The IsWindowVisible can't get the visible state at WM_CREATE message of parent, so use IsWindowVisibleEx(GetWindowLong) instead. + // Skip the invisible element. The IsWindowVisible can't get the visible state at WM_CREATE message of parent, so use IsWindowVisibleEx(GetWindowLongPtr) instead. if (!IsWindowVisibleEx(pWnd->GetSafeHwnd())) { continue; diff --git a/LibUIDK/Global.cpp b/LibUIDK/Global.cpp index a46557b..6fadc2e 100644 --- a/LibUIDK/Global.cpp +++ b/LibUIDK/Global.cpp @@ -323,7 +323,7 @@ BOOL LibUIDK::IsWindowVisibleEx(HWND hWnd) { BOOL bRet = FALSE; - LONG lStyle = GetWindowLong(hWnd, GWL_STYLE); + LONG_PTR lStyle = GetWindowLongPtr(hWnd, GWL_STYLE); if ((lStyle & WS_VISIBLE) == WS_VISIBLE) { bRet = TRUE; @@ -1924,14 +1924,16 @@ HFONT LibUIDK::CreateControlFont(__in FONTRESOURCEITEM *pResFontAs, if (CUIMgr::IsEnableDPI()) { LOGFONT lfDPI; - memcpy(&lfDPI, &(LOGFONT)pConditionFont->m_logFont, sizeof(LOGFONT)); + LOGFONT logFont = (LOGFONT)pConditionFont->m_logFont; + memcpy(&lfDPI, &logFont, sizeof(LOGFONT)); GetDPILogFont(&lfDPI); hFont = CreateFontIndirect(&lfDPI); } else { - hFont = CreateFontIndirect(&(LOGFONT)pConditionFont->m_logFont); + LOGFONT logFont = (LOGFONT)pConditionFont->m_logFont; + hFont = CreateFontIndirect(&logFont); } } else @@ -1941,14 +1943,16 @@ HFONT LibUIDK::CreateControlFont(__in FONTRESOURCEITEM *pResFontAs, if (CUIMgr::IsEnableDPI()) { LOGFONT lfDPI; - memcpy(&lfDPI, &(LOGFONT)pResFontAs->m_pFontResProp->m_logFont, sizeof(LOGFONT)); + LOGFONT logFont = (LOGFONT)pResFontAs->m_pFontResProp->m_logFont; + memcpy(&lfDPI, &logFont, sizeof(LOGFONT)); GetDPILogFont(&lfDPI); hFont = CreateFontIndirect(&lfDPI); } else { - hFont = CreateFontIndirect(&(LOGFONT)pResFontAs->m_pFontResProp->m_logFont); + LOGFONT logFont = (LOGFONT)pResFontAs->m_pFontResProp->m_logFont; + hFont = CreateFontIndirect(&logFont); } } } diff --git a/LibUIDK/HtmlCtrl.cpp b/LibUIDK/HtmlCtrl.cpp index 40c7637..d3e91bd 100644 --- a/LibUIDK/HtmlCtrl.cpp +++ b/LibUIDK/HtmlCtrl.cpp @@ -647,7 +647,7 @@ BOOL CHtmlCtrl::CallJScript(const CString strFunc, const CStringArray ¶mArra for (int i = 0; i < arraySize; i++) { - CComBSTR bstr = paramArray.GetAt(arraySize - 1 - i); // back reading + CComBSTR bstr = (LPCTSTR)paramArray.GetAt(arraySize - 1 - i); // back reading bstr.CopyTo(&dispparams.rgvarg[i].bstrVal); dispparams.rgvarg[i].vt = VT_BSTR; } diff --git a/LibUIDK/IMRichEditCtrl.cpp b/LibUIDK/IMRichEditCtrl.cpp index fd43753..7b20c6a 100644 --- a/LibUIDK/IMRichEditCtrl.cpp +++ b/LibUIDK/IMRichEditCtrl.cpp @@ -63,7 +63,7 @@ LRESULT CIMRichEditCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) } else if (message == WM_SIZE) { - DoIMSize(wParam, LOWORD(lParam), HIWORD(lParam)); + DoIMSize((UINT)wParam, LOWORD(lParam), HIWORD(lParam)); } else if (message == WM_DESTROY) { diff --git a/LibUIDK/IMRichEditCtrlBase.cpp b/LibUIDK/IMRichEditCtrlBase.cpp index 3572bcc..e10da34 100644 --- a/LibUIDK/IMRichEditCtrlBase.cpp +++ b/LibUIDK/IMRichEditCtrlBase.cpp @@ -280,8 +280,8 @@ void CIMMsg::Copy(const CIMMsg &rSrc) m_nMsgEndCp = rSrc.m_nMsgEndCp; m_nMsgParagraphCount = rSrc.m_nMsgParagraphCount; - int nCount = rSrc.m_vpStrRichMsg.size(); - for (int i = 0; i < nCount ; i++) + size_t nCount = rSrc.m_vpStrRichMsg.size(); + for (size_t i = 0; i < nCount ; i++) { const CRichMsgItem *p = rSrc.m_vpStrRichMsg[i]; @@ -353,8 +353,8 @@ int CIMRichEditCtrlBase::ReleaseObject() } // ͷϢ - int nMsgCount = m_vMsg.size(); - for (i = 0; i < nMsgCount; ++i) + size_t nMsgCount = m_vMsg.size(); + for (size_t i = 0; i < nMsgCount; ++i) { const CIMMsg *pMsg = m_vMsg[i]; delete pMsg; @@ -462,10 +462,6 @@ int CIMRichEditCtrlBase::BindStyle(const CTRLPROPERTIES *pCtrlProp) IMRE_CALL_FUN(SetImages(CONTROL_STATE_UNCHECKED_ALL, strImageName[1], strImageName[2], strImageName[3], strImageName[4])); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } } return 0; @@ -1420,7 +1416,7 @@ int CIMRichEditCtrlBase::OnDrawFace(CDC *pMemDCParent, int nMsgIndex, LPCRECT lp GraphicsPath gp; //gp.AddEllipse(0, 0, 40, 40); - gp.AddEllipse(rcNew.left, rcNew.top, + gp.AddEllipse((int)rcNew.left, rcNew.top, rcNew.right - rcNew.left, rcNew.bottom - rcNew.top); g.FillPath(&tBrush, &gp); @@ -1442,8 +1438,8 @@ int CIMRichEditCtrlBase::GetMsgPosInGroup(int nMsgIndex) const CIMMsg *pMsg = m_vMsg[nMsgIndex]; #ifdef _DEBUG - int nc = pMsg->m_vpStrRichMsg.size(); - for (int j = 0; j < nc ; j++) + size_t nc = pMsg->m_vpStrRichMsg.size(); + for (size_t j = 0; j < nc ; j++) { CRichMsgItem *pitem = pMsg->m_vpStrRichMsg[j]; if (pitem->m_strMsgContent.Find(_T("˵")) >= 0) diff --git a/LibUIDK/IUIImage.cpp b/LibUIDK/IUIImage.cpp index 7abe275..fbb357c 100644 --- a/LibUIDK/IUIImage.cpp +++ b/LibUIDK/IUIImage.cpp @@ -40,7 +40,7 @@ CImageMgr::~CImageMgr() // Release image if (!m_mapImages.empty()) { - int nCount = m_mapImages.size(); + size_t nCount = m_mapImages.size(); ATLASSERT(FALSE); @@ -284,17 +284,7 @@ int LibUIDK::ImageManager::ReleaseIUIImage(HIUIIMAGE hIUIImage) CString strFileName = hIUIImage->GetSafeImageName(); - return ReleaseIUIImage(strFileName); -} - -int LibUIDK::ImageManager::ReleaseIUIImage(LPCTSTR lpszImageFile) -{ - if (lpszImageFile == NULL || CString(lpszImageFile).IsEmpty() || g_ImageMgr.m_mapImages.empty()) - { - return -1; - } - - std::map::iterator it = g_ImageMgr.m_mapImages.find(lpszImageFile); + std::map::iterator it = g_ImageMgr.m_mapImages.find(strFileName); // Not found the Image if (it == g_ImageMgr.m_mapImages.end()) @@ -1143,11 +1133,11 @@ int CIUIImage::PartNineGridBitmapG(HBITMAP hSrcBmp, POINT pt9GridResize, LONG l9GridRepeatX, LONG l9GridRepeatY, LPCRECT lprcSrcPart, HBITMAP *phDstBmp, int nDestWidth, int nDestHeight) { - if (NULL != hSrcBmp) + if (NULL == hSrcBmp) { return -1; } - if (NULL != phDstBmp) + if (NULL == phDstBmp) { return -2; } diff --git a/LibUIDK/LibUIDK.h b/LibUIDK/LibUIDK.h index f1cce5d..576d9ea 100644 --- a/LibUIDK/LibUIDK.h +++ b/LibUIDK/LibUIDK.h @@ -8,6 +8,7 @@ #pragma warning (disable : 4786) #include +#include #include #include #include @@ -593,10 +594,6 @@ namespace LibUIDK #define BNN_DRAWTEXT (NM_FIRST-40) #define TVN_HIGHLIGHTCHANGING (NM_FIRST-50) // Parameter same as CSkinTreeCtrl::TVN_SELCHANGING #define TVN_HIGHLIGHTCHANGED (NM_FIRST-51) // Parameter same as CSkinTreeCtrl::TVN_SELCHANGED -#define TVN_ANIMATE_INSERT_ITEM (NM_FIRST-52) -#define TVN_ANIMATION_END (NM_FIRST-53) // The animation of show list item of CSkinTreeCtrl finished. -#define TVN_ANIMATION_INSERT_ITEM_END (NM_FIRST-54) // The animation of insert item of CSkinTreeCtrl finished. -#define TVN_ANIMATION_REMOVE_ITEM_END (NM_FIRST-55) #define TVN_INSTANTIATE_ITEM_TEMPLATE (NM_FIRST-56) // Instantiate tree item template. LPARAM: NMTREEVIEW * #define LVN_INSTANTIATE_ITEM_TEMPLATE (NM_FIRST-57) // Instantiate list view item template. LPARAM: NMLISTVIEW * #define WVN_SCROLLED (NM_FIRST-60) @@ -1493,7 +1490,6 @@ namespace LibUIDK // No Add ref, Needn't release. If the image not exist, no create. HIUIIMAGE GetIUIImage(LPCTSTR lpszImageFile); int ReleaseIUIImage(HIUIIMAGE hIUIImage); - int ReleaseIUIImage(LPCTSTR lpszImageFile); } // namespace ImageManager namespace FontManager @@ -2641,7 +2637,6 @@ return _messageEntries;\ IUI_VARIANT m_bInfoTooltip; IUI_VARIANT m_bTrackSelect; IUI_VARIANT m_bTwoClickActivate; - IUI_VARIANT m_bEnableOwnerDraw; IUI_VARIANT m_strTag; // Only for report style @@ -2657,6 +2652,7 @@ return _messageEntries;\ // Grid line IUI_VARIANT m_bShowGridLine; IUI_VARIANT m_bDraw0Row; // Draw 0 row or not. Only valid while bEnableOwnerDraw is true. + IUI_VARIANT m_bVerLineTo0Row; // TRUE: grid ver line draw to first item top. otherwise to header's bottom. IUI_VARIANT m_lXOffset; // The horizontal offset of the line. Only valid while bEnableOwnerDraw is true. IUI_VARIANT m_crGridLine; // Only valid while bEnableOwnerDraw is true. @@ -5780,9 +5776,6 @@ return _messageEntries;\ CString *pstrCombineImageName, CString *pstrImageNameBkN, CString *pstrImageNameBkD) const; - int EnableOwnerDraw(BOOL bEnable); - BOOL IsEnableOwnerDraw() const; - // For grid line ; int ShowGridLine(BOOL bShow); @@ -5791,6 +5784,9 @@ return _messageEntries;\ int DrawFirstRow(BOOL bDraw0Row); BOOL IsDrawFirstRow() const; + int GridVerLineToFirstRow(BOOL bTo0Row); + BOOL IsGridVerLineToFirstRow() const; + int SetGridLineOffset(const LPPOINT lpPtOffset); int GetGridLineOffset(LPPOINT lpPtOffset) const; @@ -5955,6 +5951,7 @@ return _messageEntries;\ protected: virtual int OnDrawBackground(CDC *pDC); + virtual int OnDrawItemInterlacedHighlight(CDC *pDC); virtual int OnDrawGridLine(CDC *pDC); virtual int OnDrawItemEx(CDC *pDC, int nItem, int nLeftMargin = 0); virtual int OnDrawReportItem(CDC *pDC, int nItem, const CRect &rcItem, int nLeftMargin = 0); @@ -5999,12 +5996,6 @@ return _messageEntries;\ int UpdateImageListCache(); public: - int SmoothScroll(BOOL bSmooth); - BOOL IsSmoothScroll() const; - // ֹһεĽ - int SetVScrollMouseWhellStep(int nStep); - int GetVScrollMouseWhellStep() const; - int SetImages(UINT uMask, LPCTSTR lpszImageNameBkN, LPCTSTR lpszImageNameBkD); int GetImages(UINT uMask, BOOL *pbCombineImage, @@ -6194,13 +6185,6 @@ return _messageEntries;\ // for drag & drop int RegisterDropTarget(); - // Animation mode - int AnimateContent(std::vector &vAnimationData, int nElapse/*ms*/, BOOL bTogetherAnimate); - HTREEITEM AnimateInsertItem(LPCTSTR lpszItem, int nItemHeight, DWORD dwItemData, std::vector &vAnimationData, int nElapse/*ms*/, HTREEITEM hParent = TVI_ROOT, HTREEITEM hInsertAfter = TVI_LAST); - int AnimateRemoveItem(HTREEITEM hItem, std::vector &vAnimationData, int nElapse/*ms*/); // Not delete item. - int AnimateDeleteItem(HTREEITEM hItem, std::vector &vAnimationData, int nElapse/*ms*/); - int AnimateVerticalScroll(std::vector &vAnimationData, int nElapse/*ms*/); - // Operations public: @@ -9068,7 +9052,7 @@ return _messageEntries;\ int GetClientAreaRect(LPRECT lpRect); int ResizeRect(LPCRECT lpRectSrc, LPRECT lpRectResized); CRectCtrl *GetRectChild(int nRectID); - CWLWnd *CUIWnd::GetDlgWLItem(int nItemID); // WL means windowless + CWLWnd *GetDlgWLItem(int nItemID); // WL means windowless int SetWindowResizePoint(const LPPOINT lpPt); int GetWindowResizePoint(LPPOINT lpPt) const; @@ -10557,10 +10541,10 @@ return _messageEntries;\ protected: friend class CNWUIOverItemWnd; friend LRESULT NWUIElementWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); - friend VOID CALLBACK CNewWindowsUIPanel_OnTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime); afx_msg virtual int OnDeletedItem(int nRow, int nColumn, CWnd *pWndDeleted); // Only LibUIDK call. + static VOID CALLBACK CNewWindowsUIPanel_OnTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime); afx_msg void OnTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime); virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT *pResult); diff --git a/LibUIDK/LibUIDK_vs2017.vcxproj b/LibUIDK/LibUIDK_vs2017.vcxproj index b2dbc85..c4d2b1d 100644 --- a/LibUIDK/LibUIDK_vs2017.vcxproj +++ b/LibUIDK/LibUIDK_vs2017.vcxproj @@ -138,35 +138,35 @@ StaticLibrary true - v141 + v141_xp Unicode Dynamic StaticLibrary true - v141 + v141_xp Unicode Dynamic StaticLibrary true - v141 + v141_xp Unicode Dynamic StaticLibrary true - v141 + v141_xp Unicode Dynamic StaticLibrary false - v141 + v141_xp true Unicode Dynamic @@ -174,7 +174,7 @@ StaticLibrary false - v141 + v141_xp true Unicode Dynamic @@ -182,7 +182,7 @@ StaticLibrary false - v141 + v141_xp true Unicode Dynamic @@ -190,7 +190,7 @@ StaticLibrary false - v141 + v141_xp true Unicode Dynamic @@ -250,45 +250,85 @@ - Lib\ + $(VCToolsInstallDir)atlmfc\lib\x86 Debug_vs2017\ $(ProjectName)d_vs2017 - Lib\ + $(VCToolsInstallDir)atlmfc\lib\x86 Debugs_vs2017\ $(ProjectName)sd_vs2017 - Lib\ + $(VCToolsInstallDir)atlmfc\lib\x86 Debugu_vs2017 $(ProjectName)ud_vs2017 - Lib\ + $(VCToolsInstallDir)atlmfc\lib\x86 Debugsud_vs2017 $(ProjectName)sud_vs2017 - Lib\ + $(VCToolsInstallDir)atlmfc\lib\x86 Release_vs2017 $(ProjectName)_vs2017 - Lib\ + $(VCToolsInstallDir)atlmfc\lib\x86 Releases_vs2017 $(ProjectName)s_vs2017 - Lib\ + $(VCToolsInstallDir)atlmfc\lib\x86 Releaseu_vs2017 $(ProjectName)u_vs2017 - Lib\ + $(VCToolsInstallDir)atlmfc\lib\x86 Releasesu_vs2017 $(ProjectName)su_vs2017 + + $(VCToolsInstallDir)atlmfc\lib\x64 + $(Platform)\Debug_vs2017\ + $(ProjectName)d_vs2017 + + + $(VCToolsInstallDir)atlmfc\lib\x64 + $(ProjectName)sd_vs2017 + $(Platform)\Debugs_vs2017\ + + + $(VCToolsInstallDir)atlmfc\lib\x64 + $(ProjectName)ud_vs2017 + $(Platform)\Debugu_vs2017 + + + $(VCToolsInstallDir)atlmfc\lib\x64 + $(ProjectName)sud_vs2017 + $(Platform)\Debugsud_vs2017 + + + $(VCToolsInstallDir)atlmfc\lib\x64 + $(ProjectName)_vs2017 + $(Platform)\Release_vs2017 + + + $(VCToolsInstallDir)atlmfc\lib\x64 + $(ProjectName)s_vs2017 + $(Platform)\Releases_vs2017 + + + $(VCToolsInstallDir)atlmfc\lib\x64 + $(ProjectName)u_vs2017 + $(Platform)\Releaseu_vs2017 + + + $(VCToolsInstallDir)atlmfc\lib\x64 + $(ProjectName)su_vs2017 + $(Platform)\Releasesu_vs2017 + Use @@ -610,6 +650,14 @@ Create Create Create + Create + Create + Create + Create + Create + Create + Create + Create diff --git a/LibUIDK/LibUIDK_vs2019.sln b/LibUIDK/LibUIDK_vs2019.sln new file mode 100644 index 0000000..e0860a9 --- /dev/null +++ b/LibUIDK/LibUIDK_vs2019.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30517.126 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibUIDK_vs2019", "LibUIDK_vs2019.vcxproj", "{DC979C4F-ECB2-47FE-9721-EA973F964C4E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug Unicode|x64 = Debug Unicode|x64 + Debug Unicode|x86 = Debug Unicode|x86 + Release Unicdoe Static|x64 = Release Unicdoe Static|x64 + Release Unicdoe Static|x86 = Release Unicdoe Static|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Debug Unicode|x86.ActiveCfg = Debug Unicode|Win32 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Debug Unicode|x86.Build.0 = Debug Unicode|Win32 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Release Unicdoe Static|x64.ActiveCfg = Release Unicode Static|x64 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Release Unicdoe Static|x64.Build.0 = Release Unicode Static|x64 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Release Unicdoe Static|x86.ActiveCfg = Release Unicode Static|Win32 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Release Unicdoe Static|x86.Build.0 = Release Unicode Static|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0AB296CC-7D3C-4CDA-B856-6FFA1CC05344} + EndGlobalSection +EndGlobal diff --git a/LibUIDK/LibUIDK_vs2019.vcxproj b/LibUIDK/LibUIDK_vs2019.vcxproj new file mode 100644 index 0000000..e038cb6 --- /dev/null +++ b/LibUIDK/LibUIDK_vs2019.vcxproj @@ -0,0 +1,276 @@ + + + + + Debug Unicode + Win32 + + + Release Unicode Static + Win32 + + + Debug Unicode + x64 + + + Release Unicode Static + x64 + + + + 16.0 + Win32Proj + {dc979c4f-ecb2-47fe-9721-ea973f964c4e} + LibUIDK + 10.0 + + + + StaticLibrary + true + v142 + Unicode + Dynamic + + + StaticLibrary + false + v142 + true + Unicode + Static + + + StaticLibrary + true + v142 + Unicode + Dynamic + + + StaticLibrary + false + v142 + true + Unicode + Static + + + + + + + + + + + + + + + + + + + + + true + $(VCToolsInstallDir)atlmfc\lib\x86\ + Debug2019u\ + $(ProjectName)ud + + + false + $(VCToolsInstallDir)atlmfc\lib\x86\ + Release2019su\ + $(ProjectName)su + + + true + $(ProjectName)ud + $(Platform)\Debug2019u\ + $(VCToolsInstallDir)atlmfc\lib\x64\ + + + false + $(VCToolsInstallDir)atlmfc\lib\x64 + $(Platform)\Release2019su\ + $(ProjectName)su + + + + Level3 + true + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + Use + StdAfx.h + $(OutDir)$(TargetName).pdb + + + + + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + Use + StdAfx.h + $(OutDir)$(TargetName).pdb + + + + + true + true + true + + + + + Level3 + true + _DEBUG;_LIB;%(PreprocessorDefinitions) + true + Use + StdAfx.h + + + + + true + + + + + Level3 + true + true + true + NDEBUG;_LIB;%(PreprocessorDefinitions) + true + Use + StdAfx.h + + + + + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + StdAfx.h + Create + StdAfx.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LibUIDK/LibUIDK_vs2019.vcxproj.filters b/LibUIDK/LibUIDK_vs2019.vcxproj.filters new file mode 100644 index 0000000..5aca3f8 --- /dev/null +++ b/LibUIDK/LibUIDK_vs2019.vcxproj.filters @@ -0,0 +1,285 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {c3978a3c-37a5-4574-9ccb-f1389717a16b} + + + {b6dd3ee7-e346-4d63-b446-9dbe411c616e} + + + {bb5e07ca-a0ee-403c-9aea-02d1e7c9899c} + + + + + ControlBase + + + RichEdit + + + RichEdit + + + RichEdit + + + RichEdit + + + RichEdit + + + RichEdit + + + RichEdit + + + RichEdit + + + treeview + + + treeview + + + treeview + + + treeview + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + + + ControlBase + + + RichEdit + + + treeview + + + + + + + + \ No newline at end of file diff --git a/LibUIDK/MenuBar.cpp b/LibUIDK/MenuBar.cpp index f5eaeb7..eb8f9fb 100644 --- a/LibUIDK/MenuBar.cpp +++ b/LibUIDK/MenuBar.cpp @@ -872,7 +872,8 @@ int CMenuBar::GetNormalMenuItemFont(LOGFONT *plf) const return -1; } - memcpy(plf, &((LOGFONT)pMember->m_MenuStyleProp.m_lfNormalItemText), sizeof(LOGFONT)); + LOGFONT logFont = (LOGFONT)pMember->m_MenuStyleProp.m_lfNormalItemText; + memcpy(plf, &logFont, sizeof(LOGFONT)); return 0; } @@ -954,7 +955,8 @@ int CMenuBar::GetHighlightMenuItemFont(LOGFONT *plf) const return -1; } - memcpy(plf, &((LOGFONT)pMember->m_MenuStyleProp.m_lfHighlightItemText), sizeof(LOGFONT)); + LOGFONT logFont = (LOGFONT)pMember->m_MenuStyleProp.m_lfHighlightItemText; + memcpy(plf, &logFont, sizeof(LOGFONT)); return 0; } @@ -1036,7 +1038,8 @@ int CMenuBar::GetDisabledMenuItemFont(LOGFONT *plf) const return -1; } - memcpy(plf, &((LOGFONT)pMember->m_MenuStyleProp.m_lfDisabledItemText), sizeof(LOGFONT)); + LOGFONT logFont = (LOGFONT)pMember->m_MenuStyleProp.m_lfDisabledItemText; + memcpy(plf, &logFont, sizeof(LOGFONT)); return 0; } diff --git a/LibUIDK/NewWindowsUIPanel.cpp b/LibUIDK/NewWindowsUIPanel.cpp index 0005dc7..9538c01 100644 --- a/LibUIDK/NewWindowsUIPanel.cpp +++ b/LibUIDK/NewWindowsUIPanel.cpp @@ -162,7 +162,7 @@ class LibUIDK::CNWUIOverItemWnd : public CUIWndBase return CWnd::PreCreateWindow(cs); } - virtual LRESULT CNWUIOverItemWnd::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { if (message == WM_EXITSIZEMOVE) { @@ -270,7 +270,7 @@ int CNewWindowsUIPanel::HitTestItem(HWND hWndSender, const CRect &rcSender) return DoCNewWindowsUIPanel_HitTestItem(&m_Data, nItemCount, GetColumnCount(), hWndSender, rcSender); } -VOID CALLBACK LibUIDK::CNewWindowsUIPanel_OnTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) +VOID CALLBACK CNewWindowsUIPanel::CNewWindowsUIPanel_OnTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) { ASSERT(uMsg == WM_TIMER); diff --git a/LibUIDK/PictureCtrl.cpp b/LibUIDK/PictureCtrl.cpp index 3a49bb2..2c00faf 100644 --- a/LibUIDK/PictureCtrl.cpp +++ b/LibUIDK/PictureCtrl.cpp @@ -511,7 +511,7 @@ LRESULT LibUIDK::CPictureCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lP AddCustomImage((LPCTSTR)_bstr_t(wszName), hBmp); pMember->m_hBackground = CreateIUIImage((LPCTSTR)_bstr_t(wszName)); - ReleaseIUIImage((LPCTSTR)_bstr_t(wszName)); + ReleaseIUIImage(pMember->m_hBackground); if (bRedraw) { diff --git a/LibUIDK/Render.cpp b/LibUIDK/Render.cpp index 5f072ff..2bd7379 100644 --- a/LibUIDK/Render.cpp +++ b/LibUIDK/Render.cpp @@ -371,7 +371,7 @@ int LibUIDK::Render::DrawControlText( CRect rcTest(rcText); if (bMultiLine) { - int nHeight = ::DrawText(hDstDC, lpszText, TSTRLEN(lpszText), + int nHeight = ::DrawText(hDstDC, lpszText, (int)TSTRLEN(lpszText), rcTest, uFormat | DT_CALCRECT); int nAdjustHeight = (rcText.Height() - nHeight) / 2; rcText.DeflateRect(0, nAdjustHeight, 0, 0); @@ -390,7 +390,7 @@ int LibUIDK::Render::DrawControlText( CRect rcTest(rcText); if (bMultiLine) { - int nHeight = ::DrawText(hDstDC, lpszText, TSTRLEN(lpszText), + int nHeight = ::DrawText(hDstDC, lpszText, (int)TSTRLEN(lpszText), rcTest, uFormat | DT_CALCRECT); rcText.top += (rcText.Height() - nHeight); } @@ -402,7 +402,7 @@ int LibUIDK::Render::DrawControlText( ::SetBkMode(hDstDC, TRANSPARENT); - ::DrawText(hDstDC, lpszText, TSTRLEN(lpszText), rcText, uFormat); + ::DrawText(hDstDC, lpszText, (int)TSTRLEN(lpszText), rcText, uFormat); if (hOldFont != NULL) { diff --git a/LibUIDK/ScrollBarEx.cpp b/LibUIDK/ScrollBarEx.cpp index bc77d07..db2a7a5 100644 --- a/LibUIDK/ScrollBarEx.cpp +++ b/LibUIDK/ScrollBarEx.cpp @@ -222,10 +222,7 @@ int CScrollBarEx::BindHorzScrollbarStyle(const HORSBPROPERTIES *pHorzScrollbarPr SetBkBitmaps(CONTROL_STATE_UNCHECKED_ALL, strImageName[1], strImageName[2], strImageName[3], strImageName[4]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } + SetBkImageResizeMode(pHorzScrollbarProp->m_eBkImageResizeMode); SetBkImageResizePoint(pHorzScrollbarProp->m_ptImageResize); SetBkImageRepeatX(pHorzScrollbarProp->m_uXRepeatPixel); @@ -296,10 +293,7 @@ int CScrollBarEx::BindVertScrollbarStyle(const VERSBPROPERTIES *pVertScrollbarPr SetBkBitmaps(CONTROL_STATE_UNCHECKED_ALL, strImageName[1], strImageName[2], strImageName[3], strImageName[4]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } + SetBkImageResizeMode(pVertScrollbarProp->m_eBkImageResizeMode); SetBkImageResizePoint(pVertScrollbarProp->m_ptImageResize); SetBkImageRepeatX(pVertScrollbarProp->m_uXRepeatPixel); diff --git a/LibUIDK/SkinButton.cpp b/LibUIDK/SkinButton.cpp index 0869865..b415b43 100644 --- a/LibUIDK/SkinButton.cpp +++ b/LibUIDK/SkinButton.cpp @@ -815,7 +815,7 @@ LRESULT CSkinButton::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) AddCustomImage((LPCTSTR)_bstr_t(wszName), hBmp); pMember->m_himgBk[0] = CreateIUIImage((LPCTSTR)_bstr_t(wszName)); - ReleaseIUIImage((LPCTSTR)_bstr_t(wszName)); + ReleaseIUIImage(pMember->m_himgBk[0]); if (bRedraw) { @@ -836,7 +836,7 @@ LRESULT CSkinButton::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) AddCustomImage((LPCTSTR)_bstr_t(wszName), hBmp); pMember->m_himgBk[1] = CreateIUIImage((LPCTSTR)_bstr_t(wszName)); - ReleaseIUIImage((LPCTSTR)_bstr_t(wszName)); + ReleaseIUIImage(pMember->m_himgBk[1]); if (bRedraw) { @@ -857,7 +857,7 @@ LRESULT CSkinButton::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) AddCustomImage((LPCTSTR)_bstr_t(wszName), hBmp); pMember->m_himgBk[2] = CreateIUIImage((LPCTSTR)_bstr_t(wszName)); - ReleaseIUIImage((LPCTSTR)_bstr_t(wszName)); + ReleaseIUIImage(pMember->m_himgBk[2]); if (bRedraw) { @@ -878,7 +878,7 @@ LRESULT CSkinButton::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) AddCustomImage((LPCTSTR)_bstr_t(wszName), hBmp); pMember->m_himgBk[3] = CreateIUIImage((LPCTSTR)_bstr_t(wszName)); - ReleaseIUIImage((LPCTSTR)_bstr_t(wszName)); + ReleaseIUIImage(pMember->m_himgBk[3]); if (bRedraw) { diff --git a/LibUIDK/SkinComboBox.cpp b/LibUIDK/SkinComboBox.cpp index 1dddf40..a95bb3a 100644 --- a/LibUIDK/SkinComboBox.cpp +++ b/LibUIDK/SkinComboBox.cpp @@ -184,10 +184,6 @@ int CSkinComboBox::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetBitmap(CONTROL_STATE_UNCHECKED_ALL, strImageName[1], strImageName[2], strImageName[3], strImageName[4]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } } // Text color diff --git a/LibUIDK/SkinDateTimeCtrl.cpp b/LibUIDK/SkinDateTimeCtrl.cpp index 2462e43..252daff 100644 --- a/LibUIDK/SkinDateTimeCtrl.cpp +++ b/LibUIDK/SkinDateTimeCtrl.cpp @@ -157,10 +157,6 @@ int CSkinDateTimeCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetBkImages(CONTROL_STATE_UNCHECKED_ALL, strImageName[1], strImageName[2], strImageName[3], strImageName[4]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } } SetBkImageResizeMode(pCtrlProp->m_eBkImageResizeMode); SetBkImageResizePoint(pCtrlProp->m_ptImageResize); diff --git a/LibUIDK/SkinEdit.cpp b/LibUIDK/SkinEdit.cpp index 7f5f814..b310c21 100644 --- a/LibUIDK/SkinEdit.cpp +++ b/LibUIDK/SkinEdit.cpp @@ -26,7 +26,6 @@ struct EDITMEMBER m_himgBk[i] = NULL; } - m_bFirstInitBrush = true; m_brush = NULL; m_nDeflateRight = 0; m_bHasBorder = FALSE; @@ -49,7 +48,6 @@ struct EDITMEMBER m_himgBk[i] = NULL; } - m_bFirstInitBrush = true; ::DeleteObject(m_brush); m_brush = NULL; @@ -68,7 +66,6 @@ struct EDITMEMBER BOOL m_bSingleLineTopBottomMargin; HIUIIMAGE m_himgBk[4]; // The Highlight state is for Combo Box, the Selected state is not used. - bool m_bFirstInitBrush; HBRUSH m_brush; // For child of CCombobBox @@ -160,7 +157,8 @@ int CSkinEdit::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetTextFont(strResFontID); // Alignment - SetTextMargin(&((RECT)pEdtProp->m_rcPadding)); + RECT rect = (RECT)pEdtProp->m_rcPadding; + SetTextMargin(&rect); // Set bitmaps for background bool bSpecifyBackgroundImages = pEdtProp->m_bSpecifyBackgroundImages; @@ -178,10 +176,7 @@ int CSkinEdit::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetImages(CONTROL_STATE_UNCHECKED_ALL, strImageName[1], strImageName[2], strImageName[3], strImageName[4]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } + SetBkImageResizePoint(pEdtProp->m_ptImageResize); UpdateBackgroundBrush(); @@ -711,11 +706,13 @@ HBRUSH CSkinEdit::CtlColor(CDC *pDC, UINT nCtlColor) { EDITMEMBER *pMember = (EDITMEMBER *)m_pMember; - // EditĸûָͼڵһεCtlColor֮ǰɵbrushǺɫġ - if (pMember->m_bFirstInitBrush) + // ԣWin11ϣ + // EditCtlColorڸCUIWndWM_PAINTϢCUIWndWM_PAINTϢEditWM_PAINTϢ + // ԣEditڵһCtlColorʱ򣬵UpdateBackgroundBrushڲʹøڱ + // ʵʱ򣬸ڱδ׼á + if (NULL == pMember->m_brush) { - UpdateBackgroundBrush(); - pMember->m_bFirstInitBrush = false; + int nRet = UpdateBackgroundBrush(); } // TODO: Change any attributes of the DC here @@ -1203,7 +1200,11 @@ int CSkinEdit::UpdateBackgroundBrush() pBackgroundParent->ScreenToClient(rcClientNon00); } - DrawParentPart(this, &dcMem, rcClientNon00, NULL, pBackgroundParent); + int nRet = DrawParentPart(this, &dcMem, rcClientNon00, NULL, pBackgroundParent); + if (0 != nRet) + { + return -2; + } } // diff --git a/LibUIDK/SkinHeaderCtrl.cpp b/LibUIDK/SkinHeaderCtrl.cpp index f5ce46f..6a3da68 100644 --- a/LibUIDK/SkinHeaderCtrl.cpp +++ b/LibUIDK/SkinHeaderCtrl.cpp @@ -183,10 +183,6 @@ int CSkinHeaderCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetButtonImages(CONTROL_STATE_UNCHECKED_ALL, strHeaderButton[1], strHeaderButton[2], strHeaderButton[3], strHeaderButton[4]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strHeaderButton[i]); - } SetButtonBkImageResizePoint(pCtrlProp->m_ptImageResize); SetButtonBkImageRepeatX(pCtrlProp->m_uXRepeatPixel); diff --git a/LibUIDK/SkinHotKeyCtrl.cpp b/LibUIDK/SkinHotKeyCtrl.cpp index 8ca5d1c..3893e0d 100644 --- a/LibUIDK/SkinHotKeyCtrl.cpp +++ b/LibUIDK/SkinHotKeyCtrl.cpp @@ -18,7 +18,7 @@ static char THIS_FILE[] = __FILE__; #define GWU_HFONT 4*sizeof(UINT) #define GWU_YFONT 5*sizeof(UINT) #define NUM_WND_EXTRA (GWU_YFONT+sizeof(UINT)) -#define GetWindowInt GetWindowLong +#define GetWindowInt GetWindowLongPtr struct HOTKEYMEMBER @@ -129,10 +129,6 @@ int CSkinHotKeyCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetImages(CONTROL_STATE_UNCHECKED_ALL, strImageName[1], strImageName[2], strImageName[3], strImageName[4]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } } return 0; @@ -194,8 +190,8 @@ void NEAR PASCAL PaintHotKey(register HWND hwnd) TSTRCPY(szPlus, ARRAYSIZE(szPlus), _T(" + ")); //LoadString(HINST_THISDLL, IDS_PLUS, szPlus, ARRAYSIZE(szPlus)); - wVirtKey = GetWindowInt(hwnd, GWU_VIRTKEY); - wMods = GetWindowInt(hwnd, GWU_MODS); + wVirtKey = (UINT)GetWindowInt(hwnd, GWU_VIRTKEY); + wMods = (UINT)GetWindowInt(hwnd, GWU_MODS); if (wVirtKey || wMods) { sz[0] = 0; @@ -245,7 +241,7 @@ void NEAR PASCAL PaintHotKey(register HWND hwnd) } else { - GrayString(hdc, NULL, NULL, (DWORD)(LPTSTR)sz, cch, x, y, 0, 0); + GrayString(hdc, NULL, NULL, (LPARAM)sz, cch, x, y, 0, 0); } MGetTextExtent(hdc, sz, cch, &x, NULL); diff --git a/LibUIDK/SkinIPAddressCtrl.cpp b/LibUIDK/SkinIPAddressCtrl.cpp index 3deb287..e3f1258 100644 --- a/LibUIDK/SkinIPAddressCtrl.cpp +++ b/LibUIDK/SkinIPAddressCtrl.cpp @@ -156,10 +156,6 @@ int CSkinIPAddressCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetImages(CONTROL_STATE_UNCHECKED_ALL, strImageName[1], strImageName[2], strImageName[3], strImageName[4]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } } // Background color diff --git a/LibUIDK/SkinListCtrl.cpp b/LibUIDK/SkinListCtrl.cpp index 5c8b999..0f9023a 100644 --- a/LibUIDK/SkinListCtrl.cpp +++ b/LibUIDK/SkinListCtrl.cpp @@ -47,6 +47,12 @@ struct LV_ITEMPROPERTIES { ReleaseIUIImage(m_hItemBkBmp); m_hItemBkBmp = NULL; + + if (NULL != m_hIUIFont) + { + ReleaseIUIFontInternal(m_hIUIFont); + m_hIUIFont = NULL; + } } // Background @@ -87,7 +93,6 @@ struct LISTCTRLMEMBER m_nEditingItem = -1; // Background - m_bEnableOwnerDraw = FALSE; m_bUseBitmap = TRUE; int i = 0; for (i = 0; i < 2; ++i) @@ -99,6 +104,7 @@ struct LISTCTRLMEMBER // Grid line m_bDraw0Row = FALSE; + m_bVerLineTo0Row = FALSE; m_ptLineOffset = CPoint(0, 0); m_crGridLine = RGB(212, 208, 200); @@ -175,7 +181,6 @@ struct LISTCTRLMEMBER m_nEditingItem = -1; // Background - m_bEnableOwnerDraw = FALSE; m_bUseBitmap = TRUE; int i = 0; for (i = 0; i < 2; ++i) @@ -188,6 +193,7 @@ struct LISTCTRLMEMBER // Grid line m_bDraw0Row = FALSE; + m_bVerLineTo0Row = FALSE; m_ptLineOffset = CPoint(0, 0); m_crGridLine = RGB(212, 208, 200); @@ -277,7 +283,6 @@ struct LISTCTRLMEMBER LV_SORTDATA m_LibUIDKSortData; // Background - BOOL m_bEnableOwnerDraw; BOOL m_bUseBitmap; HIUIIMAGE m_himgBk[2]; // 0: Enabled; 1: Disabled. @@ -286,15 +291,16 @@ struct LISTCTRLMEMBER // for grid line BOOL m_bDraw0Row; + BOOL m_bVerLineTo0Row; // TRUE: to 0 row; FALSE: to header bottom. CPoint m_ptLineOffset; COLORREF m_crGridLine; // for normal item - BOOL m_bEnableNormalItemEffect; // valid when m_bEnableOwnerDraw is set to TRUE + BOOL m_bEnableNormalItemEffect; LV_ITEMPROPERTIES m_lvpItemN; // for highlight item - BOOL m_bEnableHighlightItemEffect; // valid when m_bEnableOwnerDraw is set to TRUE + BOOL m_bEnableHighlightItemEffect; int m_nCurHighlightItem; LV_ITEMPROPERTIES m_lvpItemH; @@ -303,11 +309,11 @@ struct LISTCTRLMEMBER LV_ITEMPROPERTIES m_lvpItemS; // for normal disabled item - BOOL m_bEnableNormalDisabledItemEffect; // valid when m_bEnableOwnerDraw is set to TRUE + BOOL m_bEnableNormalDisabledItemEffect; LV_ITEMPROPERTIES m_lvpItemND; // for select disabled item - BOOL m_bEnableSelectedDisabledItemEffect; // valid when m_bEnableOwnerDraw is set to TRUE + BOOL m_bEnableSelectedDisabledItemEffect; LV_ITEMPROPERTIES m_lvpItemSD; // for thumbnail view @@ -437,45 +443,24 @@ int _LibUIDK_CSkinListCtrl_UpdateLevel2(CSkinListCtrl *pListCtrl, BOOL bListFirs // // Draw content // - if (pListCtrl->IsEnableOwnerDraw()) - { - // Draw grid line of list with report style. - pListCtrl->SendMessage(LVM_DRAW_GRIDLINE, (WPARAM)&memBkDC, 0); - - // draw all of the items that are completely visible - int nItem = pListCtrl->GetTopIndex(); - int nLast = nItem + pListCtrl->GetCountPerPage() + 1; - int nCount = pListCtrl->GetItemCount(); - if (nLast > nCount) - { - nLast = nCount; - } - memBkDC.SetBkMode(TRANSPARENT); + // Draw grid line of list with report style. + pListCtrl->SendMessage(LVM_DRAW_GRIDLINE, (WPARAM)&memBkDC, 0); - for (; nItem < nLast; nItem++) - { - pListCtrl->SendMessage(LVM_DRAW_ITEM, (WPARAM)&memBkDC, nItem); - } - } - else + // draw all of the items that are completely visible + int nItem = pListCtrl->GetTopIndex(); + int nLast = nItem + pListCtrl->GetCountPerPage() + 1; + int nCount = pListCtrl->GetItemCount(); + if (nLast > nCount) { - // Draw the default content to the dcText - CDC dcText; - dcText.CreateCompatibleDC(&dc); - CBitmap bmpText; - bmpText.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height()); - ASSERT(bmpText.GetSafeHandle() != NULL); - CBitmap *pbmpTextOld = dcText.SelectObject(&bmpText); - COLORREF crTextBk = pListCtrl->GetTextBkColor(); - dcText.FillSolidRect(rcClient, crTextBk); - HFONT hFontOld = (HFONT)::GetCurrentObject(dcText.GetSafeHdc(), OBJ_FONT); // store the Font object before call DefWindowProc - pListCtrl->SendMessage(LVM_DRAW_DEFAULT, (WPARAM)dcText.m_hDC, 0); + nLast = nCount; + } + + memBkDC.SetBkMode(TRANSPARENT); - // draw the text to memBkDC by erase background text color - TransparentBlt2(memBkDC.m_hDC, 0, 0, rcClient.Width(), rcClient.Height(), dcText.m_hDC, 0, 0, rcClient.Width(), rcClient.Height(), crTextBk); - dcText.SelectObject(pbmpTextOld); - dcText.SelectObject(hFontOld); + for (; nItem < nLast; nItem++) + { + pListCtrl->SendMessage(LVM_DRAW_ITEM, (WPARAM)&memBkDC, nItem); } // @@ -514,12 +499,6 @@ int _LibUIDK_CSkinListCtrl_UpdateLevel3(CSkinListCtrl *pListCtrl, BOOL bListFirs BitBltG(memBkDC.GetSafeHdc(), 0, 0, rcClient.Width(), rcClient.Height(), hLevel2BlendBkTextImage, 0, 0, SRCCOPY); - if (!pListCtrl->IsEnableOwnerDraw()) - { - memBkDC.SelectObject(hOldBmpBk); - return 1; - } - // // Draw changed content(highlight item) // @@ -680,8 +659,6 @@ int CSkinListCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetExtendedStyle(dwExStyle); - EnableOwnerDraw(pLstProp->m_bEnableOwnerDraw); - // Set background images if (pLstProp->m_bSpecifyBackgroundImages) { @@ -696,10 +673,6 @@ int CSkinListCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) { SetImages(CONTROL_STATE_UNCHECKED_ND, strImageName[1], strImageName[2]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE2; ++i) - { - ReleaseIUIImage(strImageName[i]); - } SetBkImageResizeMode(pCtrlProp->m_eBkImageResizeMode); SetBkImageResizePoint(pCtrlProp->m_ptImageResize); @@ -786,7 +759,7 @@ int CSkinListCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) else { RESCOLORPROPERTIES *pColorPropSD = (RESCOLORPROPERTIES *)CUIMgr::GetColorResourceItem((LPCTSTR)pLstProp->m_strResColorIDSD); - crSD = (pColorPropSD == NULL) ? cr[0] : pColorPropSD->m_crColor; + crSD = (pColorPropSD == NULL) ? cr[0] : (long)pColorPropSD->m_crColor; } SetSelectedDisabledItemTextColor(crSD); @@ -875,6 +848,7 @@ int CSkinListCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) { ShowGridLine(TRUE); DrawFirstRow(pLstProp->m_bDraw0Row); + GridVerLineToFirstRow(pLstProp->m_bVerLineTo0Row); POINT ptOffset; ptOffset.x = (LONG)pLstProp->m_lXOffset; ptOffset.y = 0; @@ -1073,6 +1047,63 @@ int CSkinListCtrl::OnDrawBackground(CDC *pDC) return 0; } +// żвͬɫ +int CSkinListCtrl::OnDrawItemInterlacedHighlight(CDC *pDC) +{ + LISTCTRLMEMBER *pMember = (LISTCTRLMEMBER *)m_pMember; + + CRect rcClient; + GetClientRect(rcClient); + + LONG lStyle = GetWindowLong(m_hWnd, GWL_STYLE); + if ((lStyle & LVS_REPORT) != LVS_REPORT) + { + return 1; + } + + int nIndex = 0; + while (true) + { + CPoint pt; + BOOL bOK = GetItemPosition(nIndex, &pt); + if (!bOK) + { + break; + } + + int nY = pt.y - 1; + if (nY >= rcClient.Height()) + { + break; + } + + CPoint pt2; + BOOL bOK2 = GetItemPosition(nIndex + 1, &pt2); + if (!bOK2) + { + break; + } + + CRect rcItem; + rcItem.left = 0; + rcItem.top = nY; + rcItem.right = rcClient.right; + rcItem.bottom = rcItem.top + (pt2.y - pt.y); + + pDC->FillSolidRect(rcItem, (nIndex % 2 == 0) ? RGB(255, 0, 0) : RGB(255, 255, 0)); + + // Fixed bug: scroll the vertical scroll bot to bottom, the while loop can't break. + if (nIndex > 0 && pt.y == 0) + { + break; + } + + ++nIndex; + } + + return 0; +} + int CSkinListCtrl::OnDrawGridLine(CDC *pDC) { LISTCTRLMEMBER *pMember = (LISTCTRLMEMBER *)m_pMember; @@ -1112,7 +1143,6 @@ int CSkinListCtrl::OnDrawGridLine(CDC *pDC) CPen *pPenOld = pDC->SelectObject(pPen); int nIndex = pMember->m_bDraw0Row ? 0 : 1; - int nItemCount = GetItemCount(); while (true) { CPoint pt; @@ -1163,6 +1193,9 @@ int CSkinListCtrl::OnDrawGridLine(CDC *pDC) } CPen *pPenOld = pDC->SelectObject(pPen); + CPoint pt; + BOOL bOK = GetItemPosition(0, &pt); + int nHeaderItemCount = pMember->m_wndHeader.GetItemCount(); for (int nCloumn = 0; nCloumn < nHeaderItemCount; ++nCloumn) { @@ -1171,7 +1204,7 @@ int CSkinListCtrl::OnDrawGridLine(CDC *pDC) pMember->m_wndHeader.ClientToScreen(rcHeaderItem); ScreenToClient(rcHeaderItem); - pDC->MoveTo(rcHeaderItem.right + pMember->m_ptLineOffset.x, rcHeaderItem.Height()); + pDC->MoveTo(rcHeaderItem.right + pMember->m_ptLineOffset.x, pMember->m_bVerLineTo0Row ? pt.y : rcHeaderItem.Height()); pDC->LineTo(rcHeaderItem.right + pMember->m_ptLineOffset.x, rcClient.bottom); } @@ -1666,82 +1699,85 @@ int CSkinListCtrl::OnDrawReportItem(CDC *pDC, int nItem, const CRect &rcItem, in SelectObject(pDC->GetSafeHdc(), hFontOld); } - // Draw windowless sub item. - std::map::iterator it = pData->mapSubItemObject.find(nColumn); - if (it != pData->mapSubItemObject.end()) + // Draw windowless sub item. owner data list not set item data. + if (nullptr != pData) { - SItemBindObject *pSubItemObject = it->second; - - if (pSubItemObject->uBindWndID > 0) + std::map::iterator it = pData->mapSubItemObject.find(nColumn); + if (it != pData->mapSubItemObject.end()) { - if (!pSubItemObject->bAlreadyCreateChildren) - { - _InstantiateItemBindTemplate(pSubItemObject, this); - - // Do something on instantiating item template. - NMHDR nmhdr; - nmhdr.hwndFrom = m_hWnd; - nmhdr.idFrom = GetDlgCtrlID(); - nmhdr.code = LVN_INSTANTIATE_ITEM_TEMPLATE; - NMLISTVIEW lvhdr; - lvhdr.hdr = nmhdr; - lvhdr.iItem = nItem; - lvhdr.iSubItem = nColumn; - GetParent()->SendMessage(WM_NOTIFY, nmhdr.idFrom, LPARAM(&lvhdr)); - } + SItemBindObject* pSubItemObject = it->second; - if (pSubItemObject->bAlreadyCreateChildren) + if (pSubItemObject->uBindWndID > 0) { - if (!pSubItemObject->vSubWLWnd.empty()) + if (!pSubItemObject->bAlreadyCreateChildren) { - CRect rcSubItem = rcItem; - rcSubItem.left = rcHeaderItem.left; - rcSubItem.right = rcHeaderItem.right; + _InstantiateItemBindTemplate(pSubItemObject, this); + + // Do something on instantiating item template. + NMHDR nmhdr; + nmhdr.hwndFrom = m_hWnd; + nmhdr.idFrom = GetDlgCtrlID(); + nmhdr.code = LVN_INSTANTIATE_ITEM_TEMPLATE; + NMLISTVIEW lvhdr; + lvhdr.hdr = nmhdr; + lvhdr.iItem = nItem; + lvhdr.iSubItem = nColumn; + GetParent()->SendMessage(WM_NOTIFY, nmhdr.idFrom, LPARAM(&lvhdr)); + } - // Relayout the children. - if (rcSubItem != pSubItemObject->rcLastParentLayout) + if (pSubItemObject->bAlreadyCreateChildren) + { + if (!pSubItemObject->vSubWLWnd.empty()) { - _RelayoutItemBindObject(this, rcSubItem, pSubItemObject); - } + CRect rcSubItem = rcItem; + rcSubItem.left = rcHeaderItem.left; + rcSubItem.right = rcHeaderItem.right; - // Draw windowless children. - std::vector::iterator itChild = pSubItemObject->vSubWLWnd.begin(); - std::vector::iterator itChildEnd = pSubItemObject->vSubWLWnd.end(); - for (; itChild != itChildEnd; ++itChild) - { - CONTROL_TYPE eControlType = itChild->m_eControlType; - if (eControlType == CT_WL_RECTCTRL - || eControlType == CT_WL_SPLITTER - || eControlType == CT_WL_LINE - || eControlType == CT_WL_TEXT - || eControlType == CT_WL_PICTURE - || eControlType == CT_WL_BUTTON - || eControlType == CT_WL_CHECK - || eControlType == CT_WL_RADIO - || eControlType == CT_WL_SLIDER - || eControlType == CT_WL_RICHEDIT - || eControlType == CT_WL_RICHEDIT_IM - || eControlType == CT_TASK_WND_MGR - || eControlType == CT_PNL_DOCK - || eControlType == CT_UNIFORM_GRID - || eControlType == CT_PNL_STACK) + // Relayout the children. + if (rcSubItem != pSubItemObject->rcLastParentLayout) { - CWLWnd *pWLWnd = (CWLWnd *)itChild->m_pChildCtrl; + _RelayoutItemBindObject(this, rcSubItem, pSubItemObject); + } - if (!pWLWnd->IsCreated()) + // Draw windowless children. + std::vector::iterator itChild = pSubItemObject->vSubWLWnd.begin(); + std::vector::iterator itChildEnd = pSubItemObject->vSubWLWnd.end(); + for (; itChild != itChildEnd; ++itChild) + { + CONTROL_TYPE eControlType = itChild->m_eControlType; + if (eControlType == CT_WL_RECTCTRL + || eControlType == CT_WL_SPLITTER + || eControlType == CT_WL_LINE + || eControlType == CT_WL_TEXT + || eControlType == CT_WL_PICTURE + || eControlType == CT_WL_BUTTON + || eControlType == CT_WL_CHECK + || eControlType == CT_WL_RADIO + || eControlType == CT_WL_SLIDER + || eControlType == CT_WL_RICHEDIT + || eControlType == CT_WL_RICHEDIT_IM + || eControlType == CT_TASK_WND_MGR + || eControlType == CT_PNL_DOCK + || eControlType == CT_UNIFORM_GRID + || eControlType == CT_PNL_STACK) { - continue; - } + CWLWnd* pWLWnd = (CWLWnd*)itChild->m_pChildCtrl; - if (pWLWnd->IsWindowVisible()) - { - // Apply child's region. - HRGN hOldRgn = ApplyWLRgn(this, pDC, pWLWnd); + if (!pWLWnd->IsCreated()) + { + continue; + } - DrawWLWindow(pDC->GetSafeHdc(), pWLWnd); + if (pWLWnd->IsWindowVisible()) + { + // Apply child's region. + HRGN hOldRgn = ApplyWLRgn(this, pDC, pWLWnd); - ::SelectClipRgn(pDC->GetSafeHdc(), hOldRgn); - DeleteObject(hOldRgn); + DrawWLWindow(pDC->GetSafeHdc(), pWLWnd); + + ::SelectClipRgn(pDC->GetSafeHdc(), hOldRgn); + DeleteObject(hOldRgn); + } } } } @@ -2413,99 +2449,75 @@ LRESULT CSkinListCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) OnDrawBackground(&memBkDC); // Draw content - if (pMember->m_bEnableOwnerDraw) + + // Draw + OnDrawItemInterlacedHighlight(&memBkDC); + // Draw grid line of list with report style. + OnDrawGridLine(&memBkDC); + + // draw all of the items that are completely visible + int nItem = GetTopIndex(); + int nLast = nItem + GetCountPerPage() + 1; + int nCount = GetItemCount(); + if (nLast > nCount) { - // Draw grid line of list with report style. - OnDrawGridLine(&memBkDC); - - // draw all of the items that are completely visible - int nItem = GetTopIndex(); - int nLast = nItem + GetCountPerPage() + 1; - int nCount = GetItemCount(); - if (nLast > nCount) - { - nLast = nCount; - } + nLast = nCount; + } - memBkDC.SetBkMode(TRANSPARENT); + memBkDC.SetBkMode(TRANSPARENT); - for (; nItem < nLast; nItem++) + for (; nItem < nLast; nItem++) + { + if (pMember->m_bAnimationMode) { - if (pMember->m_bAnimationMode) + // Each item's left margin is different. + int nIndex = 0; + if (pMember->m_bTogetherAnimation) + { + nIndex = pMember->m_nCurTimerTick; + } + else { - // Each item's left margin is different. - int nIndex = 0; - if (pMember->m_bTogetherAnimation) + if (pMember->m_nCurTimerTick - nItem >= 0) { - nIndex = pMember->m_nCurTimerTick; + nIndex = pMember->m_nCurTimerTick - nItem; } else { - if (pMember->m_nCurTimerTick - nItem >= 0) - { - nIndex = pMember->m_nCurTimerTick - nItem; - } - else - { - nIndex = 0; - } - if (nIndex >= (int)pMember->m_vAnimationData.size()) - { - nIndex = (int)pMember->m_vAnimationData.size() - 1; - } + nIndex = 0; } - - OnDrawItemEx(&memBkDC, nItem, pMember->m_vAnimationData[nIndex]); - - // After the last item animation finish, kill the timer. - if (nItem == nLast - 1 && nIndex == pMember->m_vAnimationData.size() - 1) + if (nIndex >= (int)pMember->m_vAnimationData.size()) { - KillTimer(IDT_WIN8); - pMember->m_bAnimationMode = false; - pMember->m_nCurTimerTick = 0; - pMember->m_vAnimationData.clear(); - - NMHDR nmhdr; - nmhdr.hwndFrom = m_hWnd; - nmhdr.idFrom = GetDlgCtrlID(); - nmhdr.code = LVN_ANIMATION_END; - GetParent()->SendMessage(WM_NOTIFY, nmhdr.idFrom, LPARAM(&nmhdr)); + nIndex = (int)pMember->m_vAnimationData.size() - 1; } } - else + + OnDrawItemEx(&memBkDC, nItem, pMember->m_vAnimationData[nIndex]); + + // After the last item animation finish, kill the timer. + if (nItem == nLast - 1 && nIndex == pMember->m_vAnimationData.size() - 1) { - OnDrawItemEx(&memBkDC, nItem, 0); + KillTimer(IDT_WIN8); + pMember->m_bAnimationMode = false; + pMember->m_nCurTimerTick = 0; + pMember->m_vAnimationData.clear(); + + NMHDR nmhdr; + nmhdr.hwndFrom = m_hWnd; + nmhdr.idFrom = GetDlgCtrlID(); + nmhdr.code = LVN_ANIMATION_END; + GetParent()->SendMessage(WM_NOTIFY, nmhdr.idFrom, LPARAM(&nmhdr)); } } - - dc.BitBlt(0, 0, rcClient.Width(), rcClient.Height(), &memBkDC, 0, 0, SRCCOPY); - memBkDC.SelectObject(pbmpBkOld); - } - else - { - // Draw the default content to the dcText - CDC dcText; - dcText.CreateCompatibleDC(&dc); - CBitmap bmpText; - bmpText.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height()); - ASSERT(bmpText.GetSafeHandle() != NULL); - CBitmap *pbmpTextOld = dcText.SelectObject(&bmpText); - COLORREF crTextBk = GetTextBkColor(); // RGB(0, 0, 0) - dcText.FillSolidRect(rcClient, crTextBk); - HFONT hFontOld = (HFONT)::GetCurrentObject(dcText.GetSafeHdc(), OBJ_FONT); // store the Font object before call DefWindowProc - CWnd::DefWindowProc(WM_PAINT, (WPARAM)dcText.m_hDC, 0); - - // draw the text to memBkDC by erase background text color - TransparentBlt2(memBkDC.m_hDC, 0, 0, rcClient.Width(), rcClient.Height(), dcText.m_hDC, 0, 0, rcClient.Width(), rcClient.Height(), crTextBk); - - // draw the memBkDC to dc. - dc.BitBlt(0, 0, rcClient.Width(), rcClient.Height(), &memBkDC, 0, 0, SRCCOPY); - memBkDC.SelectObject(pbmpBkOld); - - dcText.SelectObject(pbmpTextOld); - dcText.SelectObject(hFontOld); + else + { + OnDrawItemEx(&memBkDC, nItem, 0); + } } + dc.BitBlt(0, 0, rcClient.Width(), rcClient.Height(), &memBkDC, 0, 0, SRCCOPY); + memBkDC.SelectObject(pbmpBkOld); + UpdateCustomScrollBar(); } } @@ -3705,55 +3717,55 @@ int CSkinListCtrl::GetImages( return 0; } -int CSkinListCtrl::EnableOwnerDraw(BOOL bEnable) +int CSkinListCtrl::ShowGridLine(BOOL bShow) { LISTCTRLMEMBER *pMember = (LISTCTRLMEMBER *)m_pMember; - pMember->m_bEnableOwnerDraw = bEnable; + DWORD dwStyle = GetExtendedStyle(); + SetExtendedStyle(dwStyle | LVS_EX_GRIDLINES); return 0; } -BOOL CSkinListCtrl::IsEnableOwnerDraw() const +BOOL CSkinListCtrl::IsGridLineVisible() { LISTCTRLMEMBER *pMember = (LISTCTRLMEMBER *)m_pMember; - return pMember->m_bEnableOwnerDraw; + DWORD dwStyle = GetExtendedStyle(); + BOOL bShowGridLine = ((dwStyle & LVS_EX_GRIDLINES) == LVS_EX_GRIDLINES); + return bShowGridLine; } -int CSkinListCtrl::ShowGridLine(BOOL bShow) +int CSkinListCtrl::DrawFirstRow(BOOL bDraw0Row) { LISTCTRLMEMBER *pMember = (LISTCTRLMEMBER *)m_pMember; - DWORD dwStyle = GetExtendedStyle(); - SetExtendedStyle(dwStyle | LVS_EX_GRIDLINES); + pMember->m_bDraw0Row = bDraw0Row; return 0; } -BOOL CSkinListCtrl::IsGridLineVisible() +BOOL CSkinListCtrl::IsDrawFirstRow() const { LISTCTRLMEMBER *pMember = (LISTCTRLMEMBER *)m_pMember; - DWORD dwStyle = GetExtendedStyle(); - BOOL bShowGridLine = ((dwStyle & LVS_EX_GRIDLINES) == LVS_EX_GRIDLINES); - return bShowGridLine; + return pMember->m_bDraw0Row; } -int CSkinListCtrl::DrawFirstRow(BOOL bDraw0Row) +int CSkinListCtrl::GridVerLineToFirstRow(BOOL bTo0Row) { LISTCTRLMEMBER *pMember = (LISTCTRLMEMBER *)m_pMember; - pMember->m_bDraw0Row = bDraw0Row; + pMember->m_bVerLineTo0Row = bTo0Row; return 0; } -BOOL CSkinListCtrl::IsDrawFirstRow() const +BOOL CSkinListCtrl::IsGridVerLineToFirstRow() const { LISTCTRLMEMBER *pMember = (LISTCTRLMEMBER *)m_pMember; - return pMember->m_bDraw0Row; + return pMember->m_bVerLineTo0Row; } int CSkinListCtrl::SetGridLineOffset(const LPPOINT lpPtOffset) diff --git a/LibUIDK/SkinMenu.cpp b/LibUIDK/SkinMenu.cpp index d3c9b0d..c2373e0 100644 --- a/LibUIDK/SkinMenu.cpp +++ b/LibUIDK/SkinMenu.cpp @@ -169,7 +169,8 @@ int CSkinMenu::BindStyle(const CTRLPROPERTIES *pCtrlProp) // Set normal menu item SetNormalItemTextColor(pMenuProp->m_crNormalItemText); - SetNormalItemFont(&(LOGFONT)pMenuProp->m_lfNormalItemText); + LOGFONT logFont = (LOGFONT)pMenuProp->m_lfNormalItemText; + SetNormalItemFont(&logFont); SetNormalItemBkType(pMenuProp->m_eNormalItemBkType); SetNormalItemBkColor(pMenuProp->m_crNormalItemBkColor); if (m_MenuMember.m_NormalItemProp.m_eBackgroundType == BKT_IMAGE) @@ -181,7 +182,8 @@ int CSkinMenu::BindStyle(const CTRLPROPERTIES *pCtrlProp) // Set highlight menu item SetHighlightItemTextColor(pMenuProp->m_crHighlightItemText); - SetHighlightItemFont(&(LOGFONT)pMenuProp->m_lfHighlightItemText); + logFont = (LOGFONT)pMenuProp->m_lfHighlightItemText; + SetHighlightItemFont(&logFont); SetHighlightItemBkType(pMenuProp->m_eHighlightItemBkType); SetHighlightItemBkColor(pMenuProp->m_crHighlightItemBkColor); if (m_MenuMember.m_HighlightItemProp.m_eBackgroundType == BKT_IMAGE) @@ -193,7 +195,8 @@ int CSkinMenu::BindStyle(const CTRLPROPERTIES *pCtrlProp) // Set disabled menu item SetDisabledItemTextColor(pMenuProp->m_crDisabledItemText); - SetDisabledItemFont(&(LOGFONT)pMenuProp->m_lfDisabledItemText); + logFont = (LOGFONT)pMenuProp->m_lfDisabledItemText; + SetDisabledItemFont(&logFont); SetDisabledItemBkType(pMenuProp->m_eDisabledItemBkType); SetDisabledItemBkColor(pMenuProp->m_crDisabledItemBkColor); if (m_MenuMember.m_DisabledItemProp.m_eBackgroundType == BKT_IMAGE) diff --git a/LibUIDK/SkinProgressCtrl.cpp b/LibUIDK/SkinProgressCtrl.cpp index c061322..0510d9a 100644 --- a/LibUIDK/SkinProgressCtrl.cpp +++ b/LibUIDK/SkinProgressCtrl.cpp @@ -148,10 +148,7 @@ int CSkinProgressCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) { SetImages(CONTROL_STATE_UNCHECKED_ND, strImageName[1], strImageName[2]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE2; ++i) - { - ReleaseIUIImage(strImageName[i]); - } + SetBkImageResizeMode(pCtrlProp->m_eBkImageResizeMode); SetBkImageResizePoint(pCtrlProp->m_ptImageResize); diff --git a/LibUIDK/SkinRichEditCtrlBase.cpp b/LibUIDK/SkinRichEditCtrlBase.cpp index 106b716..0f11323 100644 --- a/LibUIDK/SkinRichEditCtrlBase.cpp +++ b/LibUIDK/SkinRichEditCtrlBase.cpp @@ -527,10 +527,6 @@ int CRichEditCtrlBase::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetImages(CONTROL_STATE_UNCHECKED_ALL, strImageName[1], strImageName[2], strImageName[3], strImageName[4]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } } return 0; diff --git a/LibUIDK/SkinSliderCtrl.cpp b/LibUIDK/SkinSliderCtrl.cpp index 0cf6bdc..9b8ef55 100644 --- a/LibUIDK/SkinSliderCtrl.cpp +++ b/LibUIDK/SkinSliderCtrl.cpp @@ -134,10 +134,6 @@ int CSkinSliderCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) { SetImages(CONTROL_STATE_UNCHECKED_ND, strImageName[1], strImageName[2]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE2; ++i) - { - ReleaseIUIImage(strImageName[i]); - } SetBkImageResizeMode(pCtrlProp->m_eBkImageResizeMode); SetBkImageResizePoint(pCtrlProp->m_ptImageResize); diff --git a/LibUIDK/SkinSpinButtonCtrl.cpp b/LibUIDK/SkinSpinButtonCtrl.cpp index 97dd864..7061b56 100644 --- a/LibUIDK/SkinSpinButtonCtrl.cpp +++ b/LibUIDK/SkinSpinButtonCtrl.cpp @@ -129,10 +129,6 @@ int CSkinSpinButtonCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetImages(CONTROL_STATE_UNCHECKED_ALL, strImageName[1], strImageName[2], strImageName[3], strImageName[4]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } } return 0; diff --git a/LibUIDK/SkinStatic.cpp b/LibUIDK/SkinStatic.cpp index 62993dc..e256f7d 100644 --- a/LibUIDK/SkinStatic.cpp +++ b/LibUIDK/SkinStatic.cpp @@ -213,11 +213,6 @@ int CSkinStatic::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetBitmap(CONTROL_STATE_UNCHECKED_ND, strImageName[1], strImageName[2]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE2; ++i) - { - ReleaseIUIImage(strImageName[i]); - } - SetBkImageResizeMode(pCtrlProp->m_eBkImageResizeMode); SetBkImageResizePoint(pCtrlProp->m_ptImageResize); } diff --git a/LibUIDK/SkinTreeCtrl.cpp b/LibUIDK/SkinTreeCtrl.cpp index cf3d9db..bd3dd60 100644 --- a/LibUIDK/SkinTreeCtrl.cpp +++ b/LibUIDK/SkinTreeCtrl.cpp @@ -12,12 +12,6 @@ static char THIS_FILE[] = __FILE__; #endif -#define IDTT_ANIMATION_CONTENT 123 -#define IDTT_INSERT_ITEM 124 -#define IDTT_REMOVE_ITEM 125 -#define IDTT_DELETE_ITEM 126 -#define IDTT_VER_SCROLL 127 - #define TVM_GETITEMDATAINTERNAL WM_TREECTRL + 6 #define TVM_SETITEMDATAINTERNAL WM_TREECTRL + 7 @@ -31,8 +25,6 @@ struct TV_ITEMDATA { lParam = 0; pBindObject = NULL; - nItemHeight = 0; - nBranchHeight = 0; } ~TV_ITEMDATA() @@ -41,18 +33,7 @@ struct TV_ITEMDATA } LPARAM lParam; // The user Item Data. - SItemBindObject *pBindObject; // the bind object of the item. - - // иߣΪ0ʹtreeĬϸ߶ - int nItemHeight; - - // Itemչ״̬ʱʾпɼչģһڿӷΧڣItemĸ߶֮ͣԼ - // Item۵״̬ʱʾչʱܶչĸ߶ȡ - // itemitemʱnBranchHeightΪ㡣 - // Ŀǵչ۵ijItemʱܿٸtreeݵܸ߶ȣҪtree - // ڴֱTreeʱܿõһɼItem m_hTop - // ӡɾչ۵޸item߶ʱӦøItemֵ - int nBranchHeight; + SItemBindObject *pBindObject; // the bind object of the item. }; struct TREEMEMBER @@ -61,19 +42,6 @@ struct TREEMEMBER { m_bCacheMode = FALSE; - m_bSmoothScroll = FALSE; - m_nVScrollMouseWhellStep = 20; - m_hTop = NULL; - m_nTopItemYOffset = 0; - m_nTopItemYScrollPos = 0; - m_bRedraw = TRUE; - m_cxState = 0; - m_cyState = 0; - m_cxImage = 0; - m_cyImage = 0; - m_cxMax = 0; - m_ptCapture.x = m_ptCapture.y = 0; - m_bTreeFirstShowed = FALSE; m_hLevel1ResizedBkImage = NULL; m_hLevel2BlendBkTextImage = NULL; @@ -166,24 +134,6 @@ struct TREEMEMBER m_dwHoverTime = HOVER_DEFAULT; m_bHoverRepeat = FALSE; - // Animation - m_bAnimationMode = false; - m_bTogetherAnimation = FALSE; - m_nCurTimerTick = 0; - - m_bAnimateRemoveMode = false; - m_hRemoveItem = NULL; - m_nCurRemoveItemTimerTick = 0; - - m_hDeletedItem = NULL; - m_nCurDeleteItemTimerTick = 0; - - m_nCurVerScrollTimerTick = 0; - - m_bAnimationInsertItem = false; - m_hInsertItem = NULL; - m_nCurInsertItemTimerTick = 0; - m_bWindowlessNotCreateAsChild = false; } @@ -191,19 +141,6 @@ struct TREEMEMBER { m_bCacheMode = FALSE; - m_bSmoothScroll = FALSE; - m_nVScrollMouseWhellStep = 20; - m_hTop = NULL; - m_nTopItemYOffset = 0; - m_nTopItemYScrollPos = 0; - m_bRedraw = TRUE; - m_cxState = 0; - m_cyState = 0; - m_cxImage = 0; - m_cyImage = 0; - m_cxMax = 0; - m_ptCapture.x = m_ptCapture.y = 0; - m_bTreeFirstShowed = FALSE; ReleaseIUIImage(m_hLevel1ResizedBkImage); m_hLevel1ResizedBkImage = NULL; @@ -307,24 +244,6 @@ struct TREEMEMBER m_dwHoverTime = HOVER_DEFAULT; m_bHoverRepeat = FALSE; - // Animation - m_bAnimationMode = false; - m_bTogetherAnimation = FALSE; - m_nCurTimerTick = 0; - - m_bAnimateRemoveMode = false; - m_hRemoveItem = NULL; - m_nCurRemoveItemTimerTick = 0; - - m_hDeletedItem = NULL; - m_nCurDeleteItemTimerTick = 0; - - m_nCurVerScrollTimerTick = 0; - - m_bAnimationInsertItem = false; - m_hInsertItem = NULL; - m_nCurInsertItemTimerTick = 0; - m_bWindowlessNotCreateAsChild = false; return 0; @@ -332,21 +251,6 @@ struct TREEMEMBER BOOL m_bCacheMode; // True: use cache mode to draw tree - BOOL m_bSmoothScroll; - int m_nVScrollMouseWhellStep; // ֹһεIJ - HTREEITEM m_hTop; // TREE::hTop. һɼItem - int m_nTopItemYOffset; // ¼m_hTopԸڵYƫ - int m_nTopItemYScrollPos; // ¼m_hTopĴֱλ - BOOL m_bRedraw; - int m_cxState; // ״̬ImagelistͼȣTREE::cxStateΪTREE::cxState޷ֱӵõ - int m_cyState; // ״̬Imagelistͼ߶ȣTREE::cyState - int m_cxImage; // ImagelistͼȣTREE::cxImage - int m_cyImage; // Imagelistͼ߶ȣTREE::cyImage - POINT m_ptCapture; // TREE::ptCapture. Point where the mouse was capture - - // hittestʱõ - WORD m_cxMax; // ItemĿȣTREE::cxMax - // For cache draw BOOL m_bTreeFirstShowed; // Set to TRUE after the control first call WM_PAINT. HIUIIMAGE m_hLevel1ResizedBkImage; // Level-1 cache, Generate by resizing m_himgBk with 9 grid method. the size is equal to non-client size @@ -425,35 +329,10 @@ struct TREEMEMBER DWORD m_dwHoverTime; BOOL m_bHoverRepeat; - // The following variable for animating content. like windows 8. - bool m_bAnimationMode; - BOOL m_bTogetherAnimation; // The items together move or not. - int m_nCurTimerTick; // Times that timer implement. same as Frame. - std::vector m_vAnimationData; - - // For animate remove item. - bool m_bAnimateRemoveMode; - HTREEITEM m_hRemoveItem; - CBitmap m_bmpCachedRemovedItem; - int m_nCurRemoveItemTimerTick; - std::vector m_vRemoveItemAnimationData; - - // For animate delete item. - HTREEITEM m_hDeletedItem; - int m_nCurDeleteItemTimerTick; - std::vector m_vDeletedItemAnimationData; - // int m_nCurVerScrollTimerTick; std::vector m_vVerScrollAnimationData; - // - bool m_bAnimationInsertItem; - HTREEITEM m_hInsertItem; - CBitmap m_bmpCachedInsertItem; - int m_nCurInsertItemTimerTick; - std::vector m_vInsertItemAnimationData; - // Item󶨵windowlessؼtreeԼάҪ뵽WLMgr::vpWLChildren // ʱm_bWindowlessNotCreateAsChildΪtrue bool m_bWindowlessNotCreateAsChild; @@ -463,7 +342,6 @@ struct TREEMEMBER }; TV_ITEMDATA *TreeView_GetItemData(HWND hwnd, TREEMEMBER *pMember, HTREEITEM hItem); -BOOL NEAR _LibUIDK_TV_SmoothSetTopItem(HWND hTreeCtrl, TREEMEMBER *pMember, UINT wNewTop); int UpdateCustomScrollInfo(CSkinTreeCtrl *pTree) { @@ -895,10 +773,6 @@ int CSkinTreeCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) { SetImages(CONTROL_STATE_UNCHECKED_ALL, strImageName[1], strImageName[2]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE2; ++i) - { - ReleaseIUIImage(strImageName[i]); - } SetBkImageResizeMode(pCtrlProp->m_eBkImageResizeMode); SetBkImageResizePoint(pCtrlProp->m_ptImageResize); @@ -997,7 +871,7 @@ int CSkinTreeCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) } // Highlight Item - EnableHighlightItemEffect(pTreeProp->m_bEnableHighlightItemEffect); + EnableHighlightItemEffect((bool)pTreeProp->m_bEnableHighlightItemEffect); if (BKT_COLOR == (BACKGROUND_TYPE)pTreeProp->m_eHighlightItemBkType) { COLORREF cr = RGB(241, 241, 241); @@ -1152,1799 +1026,192 @@ BOOL CSkinTreeCtrl::OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LR return CTreeCtrl::OnChildNotify(message, wParam, lParam, pLResult); } -BOOL _LibUIDK_TV_CalcScrollBars(HWND hTreeCtrl, TREEMEMBER *pMember) +BOOL TreeView_IsRedraw(HWND hTreeCtrl) { - // UINT wMaxPos; - BOOL fChange = FALSE; - SCROLLINFO si; - - DWORD dwStyle = (DWORD)IUIGetWindowLong(hTreeCtrl, GWL_STYLE); - - if (dwStyle & TVS_NOSCROLL) - { - return FALSE; - } - - si.cbSize = sizeof(SCROLLINFO); - - int nTotalShowHeight = (int)SendMessage(hTreeCtrl, TVM_GET_TOTAL_SHOW_HEIGHT, 0, 0); - CRect rcClient; - GetClientRect(hTreeCtrl, rcClient); - - if (nTotalShowHeight > rcClient.Height()) - { - si.fMask = SIF_PAGE | SIF_RANGE; - si.nMin = 0; - si.nMax = nTotalShowHeight - 1; - si.nPage = rcClient.Height(); - - _LibUIDK_TV_SmoothSetTopItem(hTreeCtrl, pMember, (UINT)SetScrollInfo(hTreeCtrl, SB_VERT, &si, TRUE)); - } - else - { - _LibUIDK_TV_SmoothSetTopItem(hTreeCtrl, pMember, 0); - SetScrollRange(hTreeCtrl, SB_VERT, 0, 0, TRUE); - } - - return (TRUE); + return (BOOL)SendMessage(hTreeCtrl, WM_ISREDRAW, 0, 0); } -// ---------------------------------------------------------------------------- -// -// Returns the first visible item below the given item in the tree. -// -// ---------------------------------------------------------------------------- - -HTREEITEM _LibUIDK_TV_GetNextVisItem(HWND hTreeCtrl, HTREEITEM FAR hItem) +TV_ITEMDATA *TreeView_GetItemData(HWND hwnd, TREEMEMBER *pMember, HTREEITEM hItem) { - if (hItem == NULL) - { - ASSERT(FALSE); - return NULL; - } - - HTREEITEM hKids = TreeView_GetChild(hTreeCtrl, hItem); - int nState = TreeView_GetItemState(hTreeCtrl, hItem, TVIS_EXPANDED); - if (hKids != NULL && (nState & TVIS_EXPANDED)) - { - return hKids; - } + TVITEM item; + item.hItem = hItem; + item.mask = TVIF_PARAM; + pMember->m_bSetItemDataInternal = TRUE; + ::SendMessage(hwnd, TVM_GETITEM, 0, (LPARAM)&item); + pMember->m_bSetItemDataInternal = FALSE; -checkNext: - HTREEITEM hNext = TreeView_GetNextItem(hTreeCtrl, hItem, TVGN_NEXT); - if (hNext != NULL) + TV_ITEMDATA *pItemData = (TV_ITEMDATA *)item.lParam; + if (pItemData == NULL) { - return hNext; - } + pItemData = new TV_ITEMDATA; + item.lParam = (LPARAM)pItemData; - hItem = TreeView_GetParent(hTreeCtrl, hItem); - if (hItem) - { - goto checkNext; + pMember->m_bSetItemDataInternal = TRUE; + ::SendMessage(hwnd, TVM_SETITEM, 0, (LPARAM)&item); + pMember->m_bSetItemDataInternal = FALSE; } - return NULL; + return pItemData; } -// ---------------------------------------------------------------------------- -// -// ݵǰֱϢõһɼItemľitemtreeؼĴֱƫ -// -// ---------------------------------------------------------------------------- - -HTREEITEM NEAR _LibUIDK_TV_GetShownIndexItem(TREEMEMBER *pMember, HTREEITEM hItem, HWND hTreeCtrl, int wNewScrollPos) +LRESULT CSkinTreeCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { - HTREEITEM hRoot = (HTREEITEM)::SendMessage(hTreeCtrl, TVM_GETNEXTITEM, TVGN_ROOT, 0); - if (hRoot == NULL) - { - return NULL; - } - - int nBranchHeight = (int)SendMessage(hTreeCtrl, TVM_GET_TOTAL_SHOW_HEIGHT, 0, 0); - CRect rcClient; - GetClientRect(hTreeCtrl, rcClient); - - HTREEITEM hTop = NULL; + // TODO: Add your specialized code here and/or call the base class + TREEMEMBER *pMember = (TREEMEMBER *)m_pMember; - if (nBranchHeight <= rcClient.Height()) - { - // һʾ - pMember->m_hTop = hRoot; - hTop = hRoot; - pMember->m_nTopItemYOffset = 0; - pMember->m_nTopItemYScrollPos = 0; - } - else + switch (message) { - // ѯĸItemtopСtreebottombottomtreetop - int nCountHeight = 0; // ͳƹĸ߶ - HTREEITEM hCurItem = hRoot; - int nDefaultItemHeight = (SHORT)::SendMessage(hTreeCtrl, TVM_GETITEMHEIGHT, 0, 0L); + case WM_WINDOWPOSCHANGED: + Ctrl_OnWindowPosChanged(this, wParam, lParam); + break; - while (hCurItem != NULL) + case WM_GETBACKGROUND: + { + LRESULT lr = CTreeCtrl::WindowProc(message, wParam, lParam); // Give derived class a chance. + if (lr != 0) // The derived class has handle. { - if (nCountHeight > wNewScrollPos) - { - break; - } - - // - // 鲻ҰΧڣ - // - TV_ITEMDATA *pTvItemData = TreeView_GetItemData(hTreeCtrl, pMember, hCurItem); - + return lr; + } - // ֻչItemͳbranch߶ȡ - int nBranchHeight = 0; - int nState = TreeView_GetItemState(hTreeCtrl, hCurItem, TVIS_EXPANDED); - if (IsIncludeFlag(nState, TVIS_EXPANDED)) - { - nBranchHeight = pTvItemData->nBranchHeight; - } + BOOL *pbCompatibleBitmap = (BOOL *)lParam; - int nItemHeight = (pTvItemData->nItemHeight == 0 ? nDefaultItemHeight : pTvItemData->nItemHeight); - if (nCountHeight + nItemHeight + nBranchHeight <= wNewScrollPos) + if (m_bmpCompatible.GetSafeHandle() == NULL) + { + if (pbCompatibleBitmap != NULL) { - hCurItem = (HTREEITEM)::SendMessage(hTreeCtrl, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hCurItem); - nCountHeight += nItemHeight + nBranchHeight; - continue; + *pbCompatibleBitmap = FALSE; } - // - // - // - if (nCountHeight <= wNewScrollPos && nCountHeight + nItemHeight > wNewScrollPos) + return NULL; + } + else + { + if (pbCompatibleBitmap != NULL) { - pMember->m_hTop = hCurItem; - hTop = hCurItem; - pMember->m_nTopItemYOffset = nCountHeight - wNewScrollPos; - pMember->m_nTopItemYScrollPos = wNewScrollPos; - - break; + *pbCompatibleBitmap = TRUE; } - // - // һItem - // - hCurItem = _LibUIDK_TV_GetNextVisItem(hTreeCtrl, hCurItem); - nCountHeight += nItemHeight; + return (LRESULT)m_bmpCompatible.GetSafeHandle(); } } - - return hTop; -} - -// ---------------------------------------------------------------------------- -// -// _LibUIDK_TV_GetShownIndexItem෴ݵǰһɼItemλ -// -// ---------------------------------------------------------------------------- - -int NEAR _LibUIDK_TV_GetTopItemScrollPos(TREEMEMBER *pMember, HTREEITEM hTopItem, HWND hTreeCtrl) -{ - HTREEITEM hRoot = (HTREEITEM)::SendMessage(hTreeCtrl, TVM_GETNEXTITEM, TVGN_ROOT, 0); - if (hRoot == NULL) - { - return 0; } - int nBranchHeight = (int)SendMessage(hTreeCtrl, TVM_GET_TOTAL_SHOW_HEIGHT, 0, 0); - CRect rcClient; - GetClientRect(hTreeCtrl, rcClient); + PTREE pTree = (PTREE)GetWindowPtr(m_hWnd, 0); - if (nBranchHeight <= rcClient.Height()) - { - // һʾ - return 0; - } - else +#define TVMP_CALCSCROLLBARS (TV_FIRST + 0x1000) + + // the CTreeCtrl can't response SB_THUMBTRACK and SB_THUMBPOSITION message send by custom in Vista, + // but can response in XP. + // So, when CTreeCtrl receive these two message, use CTreeCtrl::SetScrollInfo to scroll content. + // if the XP, SetScrollInfo call cause flash. + if ((message == WM_VSCROLL || message == WM_HSCROLL) && pMember->m_bUseCustomScrollBar) { - int nCountHeight = 0; - int nItemDefaultHeight = TreeView_GetItemHeight(hTreeCtrl); - HTREEITEM hItem = TreeView_GetRoot(hTreeCtrl); - while (hItem != NULL) + WORD sbCode = LOWORD(wParam); + if ((sbCode == SB_THUMBTRACK || sbCode == SB_THUMBPOSITION) + && IUIIsWindowsVistaOrGreater()/*Vista or later*/) { - if (hItem == hTopItem) - { - pMember->m_nTopItemYScrollPos = nCountHeight - pMember->m_nTopItemYOffset; - break; - } - - TV_ITEMDATA *pData = TreeView_GetItemData(hTreeCtrl, pMember, hItem); + int nPos = HIWORD(wParam); - if (pData->nItemHeight == 0) + if (message == WM_VSCROLL) { - nCountHeight += nItemDefaultHeight; + SCROLLINFO siv = {0}; + siv.cbSize = sizeof(SCROLLINFO); + siv.fMask = SIF_ALL; + GetScrollInfo(SB_VERT, &siv); + siv.nPos = nPos; + SetRedraw(FALSE); + SetScrollInfo(SB_VERT, &siv); + SetRedraw(TRUE); + ReDrawControl(FALSE, TRUE, NULL); + UpdateWindow(); } - else + else if (message == WM_HSCROLL) { - nCountHeight += pData->nItemHeight; + SCROLLINFO sih = {0}; + sih.cbSize = sizeof(SCROLLINFO); + sih.fMask = SIF_ALL; + GetScrollInfo(SB_HORZ, &sih); + sih.nPos = nPos; + SetScrollInfo(SB_HORZ, &sih); } - - hItem = _LibUIDK_TV_GetNextVisItem(hTreeCtrl, hItem); } - return pMember->m_nTopItemYScrollPos; - } - - return 0; -} - -BOOL TreeView_IsRedraw(HWND hTreeCtrl) -{ - return (BOOL)SendMessage(hTreeCtrl, WM_ISREDRAW, 0, 0); -} - -// ---------------------------------------------------------------------------- -// -// Sets position of vertical scroll bar and scrolls window to match that -// position -// -// ÿؼڲһhTop¼һۿɼItem. -// ¼hTop -// -// ---------------------------------------------------------------------------- - -BOOL NEAR _LibUIDK_TV_SmoothSetTopItem(HWND hTreeCtrl, TREEMEMBER *pMember, UINT wNewTop) -{ - HTREEITEM hItem = TreeView_GetRoot(hTreeCtrl); - - if (!hItem) - { - return FALSE; + // If in XP, call Invalidate must before WindowProc to avoid flash + if (IUIIsWindowsVersion(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 0, VER_LESS)) + { + ReDrawControl(FALSE, TRUE, NULL); + } + LRESULT lr = CTreeCtrl::WindowProc(message, wParam, lParam); + UpdateCustomScrollInfo(this); + // if in vista or later, call Invalidate must after WindowProc + if (IUIIsWindowsVistaOrGreater()) + { + ReDrawControl(FALSE, TRUE, NULL); + } + return lr; } - SCROLLINFO si; - si.cbSize = sizeof(SCROLLINFO); - si.fMask = SIF_ALL; - if (!GetScrollInfo(hTreeCtrl, SB_VERT, &si)) + switch (message) { - return FALSE; + case WM_HSCROLL: + case WM_MOUSEWHEEL: + ReDrawControl(FALSE, TRUE, NULL); + break; + // If the bottom item is part visible, click it will start a timer with + // id 43(IDT_SCROLLWAIT), in the timer, scroll the view to show the bottom item full. + case WM_TIMER: + if (wParam == IDT_SCROLLWAIT) + { + ReDrawControl(FALSE, TRUE, NULL); + } + break; + default: + break; } - DWORD dwStyle = (DWORD)IUIGetWindowLong(hTreeCtrl, GWL_STYLE); - - if ((dwStyle & TVS_NOSCROLL) || (wNewTop == (UINT) - 1)) + if (message == WM_ERASEBKGND) { - // we've wrapped around (treat as a negative index) -- use min pos - // or there aren't enough items to scroll - wNewTop = 0; + return TRUE; } - if (wNewTop > si.nMax - si.nPage + 1) + if (message == WM_NCPAINT) { - // we've gone too far down -- use max pos - wNewTop = si.nMax - si.nPage + 1; - } - - hItem = _LibUIDK_TV_GetShownIndexItem(pMember, hItem, hTreeCtrl, wNewTop); + // Draw the resize scroll bar + if (pMember->m_wndHScroll.GetSafeHwnd() != NULL + && pMember->m_wndHScroll.IsWindowVisible() + && pMember->m_wndVScroll.GetSafeHwnd() != NULL + && pMember->m_wndVScroll.IsWindowVisible()) + { + int nVScrollBarWidth = GetSystemMetrics(SM_CXVSCROLL); + int nHScrollBarHeight = GetSystemMetrics(SM_CYHSCROLL); - // BUGBUG (scotth): refreshing in regedit sometimes hits this case - ASSERT(hItem); + CWindowDC dcWin(this); - if (NULL == hItem) - { - return FALSE; - } + CRect rcSizeBox2This; + GetWindowRect(rcSizeBox2This); + ScreenToClient(rcSizeBox2This); + rcSizeBox2This.left = rcSizeBox2This.right - nVScrollBarWidth; + rcSizeBox2This.top = rcSizeBox2This.bottom - nHScrollBarHeight; - SetScrollPos(hTreeCtrl, SB_VERT, wNewTop, TRUE); + // Draw parent part + DrawParentNonClientPart(this, &dcWin, rcSizeBox2This, NULL, NULL); - return (TRUE); -} + // Draw myself + IUIBitBlt(dcWin.GetSafeHdc(), rcSizeBox2This, pMember->m_hLevel1ResizedBkImage, + rcSizeBox2This.left, rcSizeBox2This.top, SRCCOPY); -// ---------------------------------------------------------------------------- -// -// WM_VSCROLLӦ -// ֻTreeؼĵһItem m_hTop m_hTopĿItemڻƵʱ򲼾֡ -// -// ---------------------------------------------------------------------------- -BOOL NEAR _LibUIDK_TV_VertScroll(HWND hTreeCtrl, TREEMEMBER *pMember, UINT wCode, UINT wOldPos, UINT wPos) -{ - int wNewPos = 0; - BOOL fChanged; + return 0; + } - if (SendMessage(hTreeCtrl, TVM_GET_TOP_ITEM, 0, 0) == NULL) - { - return FALSE; - } + LONG lStyle = GetWindowLong(m_hWnd, GWL_STYLE); + BOOL bBorder = ((lStyle & WS_BORDER) == WS_BORDER); + if (!bBorder) + { + return CTreeCtrl::WindowProc(message, wParam, lParam); + } - SCROLLINFO si; - si.cbSize = sizeof(SCROLLINFO); - si.fMask = SIF_ALL; - if (!GetScrollInfo(hTreeCtrl, SB_VERT, &si)) - { - return FALSE; - } - - switch (wCode) - { - case SB_BOTTOM: - wNewPos = si.nMax; - break; - - case SB_ENDSCROLL: - wNewPos = wOldPos; - break; - - case SB_LINEDOWN: - wNewPos = wOldPos + 1; - break; - - case SB_LINEUP: - wNewPos = wOldPos - 1; - if (wNewPos < 0) - { - wNewPos = 0; - } - break; - - case SB_PAGEDOWN: - wNewPos = wOldPos + si.nPage; - break; - - case SB_PAGEUP: - wNewPos = wOldPos - si.nPage; - if (wNewPos < 0) - { - wNewPos = 0; - } - break; - - case SB_THUMBPOSITION: - case SB_THUMBTRACK: - wNewPos = wPos; - break; - - case SB_TOP: - wNewPos = 0; - break; - } - - if (fChanged = _LibUIDK_TV_SmoothSetTopItem(hTreeCtrl, pMember, wNewPos)) - { - InvalidateRect(hTreeCtrl, NULL, FALSE); - UpdateWindow(hTreeCtrl); - } - return (fChanged); -} - -TV_ITEMDATA *TreeView_GetItemData(HWND hwnd, TREEMEMBER *pMember, HTREEITEM hItem) -{ - TVITEM item; - item.hItem = hItem; - item.mask = TVIF_PARAM; - pMember->m_bSetItemDataInternal = TRUE; - ::SendMessage(hwnd, TVM_GETITEM, 0, (LPARAM)&item); - pMember->m_bSetItemDataInternal = FALSE; - - TV_ITEMDATA *pItemData = (TV_ITEMDATA *)item.lParam; - if (pItemData == NULL) - { - pItemData = new TV_ITEMDATA; - item.lParam = (LPARAM)pItemData; - - pMember->m_bSetItemDataInternal = TRUE; - ::SendMessage(hwnd, TVM_SETITEM, 0, (LPARAM)&item); - pMember->m_bSetItemDataInternal = FALSE; - } - - return pItemData; -} - -// treeؼitem󣬸չitemܸ߶ -// ǵһitemΪm_hTop -int UpdateBranchHeightAfterAddItem(HWND hTreeCtrl, TREEMEMBER *pMember, HTREEITEM hNewItem) -{ - ASSERT(::IsWindow(hTreeCtrl)); - if (hNewItem == NULL) - { - return -1; - } - - TV_ITEMDATA *pItemData = TreeView_GetItemData(hTreeCtrl, pMember, hNewItem); - ASSERT(pItemData != NULL); - - int nBranchHeightAdd = 0; - if (pItemData->nItemHeight == 0) - { - nBranchHeightAdd = (SHORT)::SendMessage(hTreeCtrl, TVM_GETITEMHEIGHT, 0, 0L); - } - else - { - nBranchHeightAdd = pItemData->nItemHeight; - } - - // treeӵܸ߶ȣnBranchHeightAdd岻һ - // µItemĸItem۵״̬ʱnTotalHeightAddΪ0. - int nTotalHeightAdd = 0; - - // - // 1. һnBranchHeight - // - HTREEITEM hParent = (HTREEITEM)::SendMessage(hTreeCtrl, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hNewItem); - - // ǵһitem, õһɼitem m_hTop - if ((hParent == NULL) || (hParent == TVI_ROOT)) - { - nTotalHeightAdd = (SHORT)::SendMessage(hTreeCtrl, TVM_GETITEMHEIGHT, 0, 0L); - - HTREEITEM hTop = (HTREEITEM)::SendMessage(hTreeCtrl, TVM_GET_TOP_ITEM, 0, 0); - if (hTop == NULL) - { - ::SendMessage(hTreeCtrl, TVM_SET_TOP_ITEM, 0, (LPARAM)hNewItem); - } - } - - while (hParent != NULL) - { - TV_ITEMDATA *pParentItemData = TreeView_GetItemData(hTreeCtrl, pMember, hParent); - - // ֱӸItem,Dz۵״̬nBranchHeight - pParentItemData->nBranchHeight += nBranchHeightAdd; - - // ۵ItemͲϼitemˡ - int nState = TreeView_GetItemState(hTreeCtrl, hParent, TVIS_EXPANDED); - if (IsIncludeFlag(nState, TVIS_EXPANDED)) - { - nTotalHeightAdd = nBranchHeightAdd; - } - else - { - break; - } - - hParent = TreeView_GetParent(hTreeCtrl, hParent); - } - - // - // 2. treeܸ߶ - // - if (nTotalHeightAdd != 0) - { - SendMessage(hTreeCtrl, TVM_SET_TOTAL_SHOW_HEIGHT, TRUE, nTotalHeightAdd); - } - - return 0; -} - -// treeؼɾitem󣬸չitemܸ߶ -int UpdateBranchHeightAfterDeleteItem(HWND hTreeCtrl, TREEMEMBER *pMember, HTREEITEM hDeleteItem) -{ - ASSERT(::IsWindow(hTreeCtrl)); - if (hDeleteItem == NULL) - { - return -1; - } - - TV_ITEMDATA *pItemData = TreeView_GetItemData(hTreeCtrl, pMember, hDeleteItem); - ASSERT(pItemData != NULL); - - int nBranchHeightDelete = 0; - if (pItemData->nItemHeight == 0) - { - nBranchHeightDelete = (SHORT)::SendMessage(hTreeCtrl, TVM_GETITEMHEIGHT, 0, 0L); - } - else - { - nBranchHeightDelete = pItemData->nItemHeight; - } - - int nState = TreeView_GetItemState(hTreeCtrl, hDeleteItem, TVIS_EXPANDED); - if (IsIncludeFlag(nState, TVIS_EXPANDED)) - { - nBranchHeightDelete += pItemData->nBranchHeight; - } - - // treeݼСܸ߶ȣnBranchHeightDelete岻һ - // ɾItemĸItem۵״̬ʱnTotalHeighDeleteΪ0. - int nTotalHeighDelete = 0; - - // - // 1. һnBranchHeight - // - HTREEITEM hParent = (HTREEITEM)::SendMessage(hTreeCtrl, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hDeleteItem); - while (hParent != NULL) - { - TV_ITEMDATA *pParentItemData = TreeView_GetItemData(hTreeCtrl, pMember, hParent); - - // ۸itemDz۵״̬nBranchHeightС - pParentItemData->nBranchHeight -= nBranchHeightDelete; - - // ۵ItemͲϼitemˡ - int nState = TreeView_GetItemState(hTreeCtrl, hParent, TVIS_EXPANDED); - if (IsIncludeFlag(nState, TVIS_EXPANDED)) - { - nTotalHeighDelete = nBranchHeightDelete; - } - else - { - break; - } - - hParent = TreeView_GetParent(hTreeCtrl, hParent); - } - - // - // 2. treeܸ߶ - // - if (nTotalHeighDelete != 0) - { - SendMessage(hTreeCtrl, TVM_SET_TOTAL_SHOW_HEIGHT, TRUE, -nTotalHeighDelete); - } - - return 0; -} - -// treeؼitem߶ȷ仯󣬸¿ɼitemܸ߶ -int UpdateBranchHeightAfterItemHeightChanged(HWND hTreeCtrl, TREEMEMBER *pMember, HTREEITEM hItem, - int nItemOldHeight, int nItemNewHeight) -{ - ASSERT(::IsWindow(hTreeCtrl)); - if (hItem == NULL) - { - return -1; - } - - // ֧߶ӵֵ - int nBranchHeightAdd = nItemNewHeight - nItemOldHeight; - - // treeӵܸ߶ȣnBranchHeightAdd岻һ - // µItemĸItem۵״̬ʱnTotalHeightAddΪ0. - int nTotalHeightAdd = 0; - - HTREEITEM hParent = (HTREEITEM)::SendMessage(hTreeCtrl, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hItem); - if (hParent == NULL || hParent == TVI_ROOT) - { - nTotalHeightAdd = nBranchHeightAdd; - } - - // - // 1. һnBranchHeight - // - while (hParent != NULL) - { - TV_ITEMDATA *pParentItemData = TreeView_GetItemData(hTreeCtrl, pMember, hParent); - - // ֱӸItem,Dz۵״̬nBranchHeight - pParentItemData->nBranchHeight += nBranchHeightAdd; - - // ۵ItemͲϼitemˡ - int nState = TreeView_GetItemState(hTreeCtrl, hParent, TVIS_EXPANDED); - if (IsIncludeFlag(nState, TVIS_EXPANDED)) - { - nTotalHeightAdd = nBranchHeightAdd; - } - else - { - break; - } - - hParent = TreeView_GetParent(hTreeCtrl, hParent); - } - - // - // 2. treeܸ߶ - // - if (nTotalHeightAdd != 0) - { - SendMessage(hTreeCtrl, TVM_SET_TOTAL_SHOW_HEIGHT, TRUE, nTotalHeightAdd); - } - - return 0; -} - -// treeؼչijitem󣬸¿ɼitemܸ߶ -int UpdateBranchHeightAfterExpand(HWND hTreeCtrl, TREEMEMBER *pMember, HTREEITEM hExpandItem, BOOL bOldExpand, BOOL bNewExpand) -{ - ASSERT(::IsWindow(hTreeCtrl)); - if (hExpandItem == NULL) - { - return -1; - } - - // - // 1. չ£ItemĸItemӵķ֧߶ - // - int nParentBranchHeightAdd = 0; - BOOL fChange = FALSE; // Ƿи߶ȵĸı䡣 - - if (bOldExpand) - { - // ۵item - if (!bNewExpand) - { - TV_ITEMDATA *pData = TreeView_GetItemData(hTreeCtrl, pMember, hExpandItem); - nParentBranchHeightAdd = -pData->nBranchHeight; - fChange = TRUE; - } - } - else - { - // չitem - if (bNewExpand) - { - TV_ITEMDATA *pData = TreeView_GetItemData(hTreeCtrl, pMember, hExpandItem); - nParentBranchHeightAdd = pData->nBranchHeight; - fChange = TRUE; - } - } - - if (!fChange) - { - return 0; - } - - // - // Treeܸ߶Ƿӣֻбչ۵ItemиItemȫչ״̬ӡ - // - BOOL bTotalHeightAdd = TRUE; - - // - // 2. һnBranchHeight, ۵չitemҪnBranchHeight - // - HTREEITEM hParent = (HTREEITEM)::SendMessage(hTreeCtrl, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hExpandItem); - - // ֱӸItemǷ۵ҪnBranchHeight - if (hParent != NULL) - { - TV_ITEMDATA *pParentItemData = TreeView_GetItemData(hTreeCtrl, pMember, hParent); - pParentItemData->nBranchHeight += nParentBranchHeightAdd; - - UINT nState = TreeView_GetItemState(hTreeCtrl, hParent, TVIS_EXPANDED); - if (!IsIncludeFlag(nState, TVIS_EXPANDED)) - { - bTotalHeightAdd = FALSE; - } - } - - while (hParent != NULL) - { - hParent = (HTREEITEM)::SendMessage(hTreeCtrl, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hParent); - if (hParent == NULL) - { - break; - } - - UINT nState = TreeView_GetItemState(hTreeCtrl, hParent, TVIS_EXPANDED); - - // ۵ItemͲϼitemˡ - if (IsIncludeFlag(nState, TVIS_EXPANDED)) - { - TV_ITEMDATA *pParentItemData = TreeView_GetItemData(hTreeCtrl, pMember, hParent); - pParentItemData->nBranchHeight += nParentBranchHeightAdd; - } - else - { - bTotalHeightAdd = FALSE; - break; - } - } - - if (bTotalHeightAdd != 0) - { - SendMessage(hTreeCtrl, TVM_SET_TOTAL_SHOW_HEIGHT, TRUE, nParentBranchHeightAdd); - } - - return 0; -} - -// ---------------------------------------------------------------------------- -// -// Determine what part of what item is at the given (x,y) location in the -// tree's client area. If the location is outside the client area, NULL is -// returned with the TVHT_TOLEFT, TVHT_TORIGHT, TVHT_ABOVE, and/or TVHT_BELOW -// flags set in the wHitCode as appropriate. If the location is below the -// last item, NULL is returned with wHitCode set to TVHT_NOWHERE. Otherwise, -// the item is returned with wHitCode set to either TVHT_ONITEMINDENT, -// TVHT_ONITEMBUTTON, TVHT_ONITEMICON, TVHT_ONITEMLABEL, or TVHT_ONITEMRIGHT -// -// ---------------------------------------------------------------------------- - -HTREEITEM _LibUIDK_TV_CheckHit(HWND hTreeCtrl, TREEMEMBER *pMember, int x, int y, UINT FAR *wHitCode) -{ - HTREEITEM hItem = (HTREEITEM)SendMessage(hTreeCtrl, TVM_GET_TOP_ITEM, 0, 0); - int cxState; - - TVITEMEX sItem; - - *wHitCode = 0; - - CRect rcWnd; - GetWindowRect(hTreeCtrl, rcWnd); - - if (x < 0) - { - *wHitCode |= TVHT_TOLEFT; - } - else if (x > (int)rcWnd.Width()) - { - *wHitCode |= TVHT_TORIGHT; - } - - if (y < 0) - { - *wHitCode |= TVHT_ABOVE; - } - else if (y > (int)rcWnd.Height()) - { - *wHitCode |= TVHT_BELOW; - } - - if (*wHitCode) - { - return NULL; - } - - HTREEITEM hItemRet = NULL; - HTREEITEM hWolk = hItem; - int nTopYOffset = (int)SendMessage(hTreeCtrl, TVM_GET_TOP_ITEM_YOFFSET, 0, 0); - int nCountHeight = 0; - int nDefaultItemHeight = TreeView_GetItemHeight(hTreeCtrl); - int cxIndent = TreeView_GetIndent(hTreeCtrl); - while (hWolk != NULL) - { - if (nCountHeight > y - nTopYOffset) - { - break; - } - - // 鲻ҰΧڣ - TV_ITEMDATA *pTvItemData = TreeView_GetItemData(hTreeCtrl, pMember, hWolk); - - int nBranchHeight = pTvItemData->nBranchHeight; - int nItemHeight = (pTvItemData->nItemHeight == 0 ? nDefaultItemHeight : pTvItemData->nItemHeight); - if (nCountHeight + nItemHeight + nBranchHeight <= y - nTopYOffset) - { - HTREEITEM hOldItem = hWolk; - hWolk = (HTREEITEM)::SendMessage(hTreeCtrl, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hWolk); - - if (hWolk == NULL) - { - hWolk = _LibUIDK_TV_GetNextVisItem(hTreeCtrl, hOldItem); - } - - nCountHeight += nItemHeight + nBranchHeight; - continue; - } - - if (nCountHeight <= y - nTopYOffset && nCountHeight + nItemHeight > y - nTopYOffset) - { - hItemRet = hWolk; - break; - } - - hWolk = _LibUIDK_TV_GetNextVisItem(hTreeCtrl, hWolk); - nCountHeight += nItemHeight; - } - - if (!hItemRet) - { - *wHitCode = TVHT_NOWHERE; - return NULL; - } - CSize sizeBorder = (DWORD)SendMessage(hTreeCtrl, TVM_GETBORDER, 0, 0); - x -= (sizeBorder.cx + (hItemRet->iLevel * cxIndent)); - x += GetScrollPos(hTreeCtrl, SB_HORZ); - - LONG_PTR lStyle = IUIGetWindowLong(hTreeCtrl, GWL_STYLE); - if ((lStyle & (TVS_HASLINES | TVS_HASBUTTONS)) && - (lStyle & TVS_LINESATROOT)) - { - // Subtract some more to make up for the pluses at the root - x -= cxIndent; - } - - // instead of TV_GetItem(pTree, hItemRet, TVIF_CHILDREN, &sItem); - sItem.mask = TVIF_CHILDREN; - sItem.hItem = hItemRet; - TreeView_GetItem(hTreeCtrl, &sItem); - - CSize sizeState = (DWORD)SendMessage(hTreeCtrl, TVM_GET_STATE_IMAGE_SIZE, 0, 0); - CSize sizeImage = (DWORD)SendMessage(hTreeCtrl, TVM_GET_NORMAL_IMAGE_SIZE, 0, 0); - cxState = TV_StateIndex(&sItem) ? sizeState.cx : 0; - if (x <= (int)(hItemRet->iWidth + sizeImage.cx + cxState)) - { - if (x >= 0) - { - if (TreeView_GetImageList(hTreeCtrl, TVSIL_STATE) != NULL && (x < cxState)) - { - *wHitCode = TVHT_ONITEMSTATEICON; - } - else if (TreeView_GetImageList(hTreeCtrl, TVSIL_NORMAL) != NULL - && (x < (int) sizeImage.cx + cxState)) - { - *wHitCode = TVHT_ONITEMICON; - } - else - { - *wHitCode = TVHT_ONITEMLABEL; - } - } - else if ((x >= -cxIndent) && sItem.cChildren && (lStyle & TVS_HASBUTTONS)) - { - *wHitCode = TVHT_ONITEMBUTTON; - } - else - { - *wHitCode = TVHT_ONITEMINDENT; - } - } - else - { - *wHitCode = TVHT_ONITEMRIGHT; - } - - return hItemRet; -} - -HTREEITEM NEAR _LibUIDK_TV_OnHitTest(HWND hTreeCtrl, TREEMEMBER *pMember, LPTV_HITTESTINFO lptvh) -{ - if (!lptvh) - { - return 0; //BUGBUG: Validate LPTVHITTEST - } - - lptvh->hItem = _LibUIDK_TV_CheckHit(hTreeCtrl, pMember, lptvh->pt.x, lptvh->pt.y, &lptvh->flags); - - return lptvh->hItem; -} - -void NEAR _LibUIDK_TV_CancelEditTimer(PTREE pTree) -{ - if (pTree->fNameEditPending) - { - KillTimer(pTree->ci.hwnd, IDT_NAMEEDIT); - pTree->fNameEditPending = FALSE; - } -} - -// This is tricky because CheckForDragBegin yields and the app may have -// destroyed the item we are thinking about dragging -// -// To give the app some feedback, we give the hItem the drop highlight -// if it isn't already the caret. This also allows us to check if the -// item got deleted behind our back - TV_DeleteItemRecurse makes sure -// that deleted items are never the hCaret or hDropTarget. -// -// After TV_CheckForDragBegin, the caller must call TV_FinishCheckDrag -// to clean up the UI changes that TV_CheckForDragBegin temporarily -// performed. -// -BOOL _LibUIDK_TV_CheckForDragBegin(PTREE pTree, HWND hTreeCtrl, HTREEITEM hItem, int x, int y) -{ - BOOL fDrag; - - // - // If the item is not the caret, then make it the (temporary) - // drop target so the user gets some feedback. - // - // BUGBUG raymondc - If hItem == pTree->hCaret, it still might not - // be visible if the control doesn't yet have focus and the treeview - // is not marked showselalways. Maybe we should just always set - // hItem to DROPHILITE. - // - HTREEITEM hCaret = TreeView_GetNextItem(hTreeCtrl, NULL, TVGN_CARET); - if (hItem == hCaret) - { - pTree->hOldDrop = NULL; - pTree->fRestoreOldDrop = FALSE; - } - else - { - pTree->hOldDrop = pTree->hDropTarget; - pTree->fRestoreOldDrop = TRUE; - TV_SelectItem(pTree, TVGN_DROPHILITE, hItem, 0, TVC_BYMOUSE); - ASSERT(hItem == pTree->hDropTarget); - } - - // - // We are dragging the hItem if CheckForDragBegin says okay, - // and TV_DeleteItemRecurse didn't wipe us out. - // - fDrag = CheckForDragBegin(hTreeCtrl, x, y) && - (hItem == pTree->hDropTarget || hItem == hCaret); - - return fDrag; -} - -void _LibUIDK_TV_FinishCheckDrag(PTREE pTree) -{ - // - // Clean up our temporary UI changes that happened when we started - // dragging. - // - if (pTree->fRestoreOldDrop) - { - HTREEITEM hOldDrop = pTree->hOldDrop; - pTree->fRestoreOldDrop = FALSE; - pTree->hOldDrop = NULL; - TV_SelectItem(pTree, TVGN_DROPHILITE, hOldDrop, 0, TVC_BYMOUSE); - } -} - -// ---------------------------------------------------------------------------- -// -// If the tooltip bubble is up, then pop it. -// -// ---------------------------------------------------------------------------- - -void _LibUIDK_TV_PopBubble(HWND hTreeCrl) -{ - HWND hToolTips = TreeView_GetToolTips(hTreeCrl); - if (hToolTips) - { - SendMessage(hToolTips, TTM_POP, 0L, 0L); - } -} - -// ---------------------------------------------------------------------------- -// -// Sends a TVN_BEGINDRAG or TVN_BEGINRDRAG notification with information in the ptDrag and -// itemNew fields of an NM_TREEVIEW structure -// -// ---------------------------------------------------------------------------- - -BOOL NEAR _LibUIDK_TV_SendBeginDrag(PTREE pTree, HWND hTreeCtrl, int code, TREEITEM FAR *hItem, int x, int y) -{ - NM_TREEVIEW nm; - - _LibUIDK_TV_PopBubble(hTreeCtrl); // dismiss the infotip if we start to drag - - nm.itemNew.hItem = hItem; - nm.itemNew.state = hItem->state; - nm.itemNew.lParam = hItem->lParam; - nm.itemNew.mask = (TVIF_HANDLE | TVIF_STATE | TVIF_PARAM); - nm.itemOld.mask = 0; - nm.ptDrag.x = x; - nm.ptDrag.y = y; - - return (BOOL)CCSendNotify(&pTree->ci, code, &nm.hdr); -} - -void _LibUIDK_TV_HandleStateIconClick(HWND hTreeCtrl, HTREEITEM hItem) -{ - // instead of TV_GetItem(pTree, hItem, TVIF_STATE, &tvi); - TVITEMEX tvi; - tvi.mask = TVIF_STATE; - tvi.stateMask = TVIS_STATEIMAGEMASK; - tvi.hItem = hItem; - TreeView_GetItem(hTreeCtrl, &tvi); - - int iState = STATEIMAGEMASKTOINDEX(tvi.state & tvi.stateMask); - iState %= (ImageList_GetImageCount(TreeView_GetImageList(hTreeCtrl, TVSIL_STATE)) - 1); - iState++; - - tvi.mask = TVIF_STATE; - tvi.state = INDEXTOSTATEIMAGEMASK(iState); - tvi.hItem = hItem; - - TreeView_SetItem(hTreeCtrl, &tvi); -} - -// ---------------------------------------------------------------------------- -// -// WM_LBUTTONDBLCLK message -- toggle expand/collapse state of item's children -// WM_LBUTTONDOWN message -- on item's button, do same as WM_LBUTTONDBLCLK, -// otherwise select item and ensure that item is fully visible -// -// ---------------------------------------------------------------------------- - -void NEAR _LibUIDK_TV_ButtonDown(PTREE pTree, HWND hTreeCtrl, UINT wMsg, UINT wFlags, int x, int y, UINT TVBD_flags) -{ - UINT wHitCode; - HTREEITEM hItem; - HWND hwndTree; - LRESULT lResult; -#ifdef _X86_ - NMEUDORA nmeu; - nmeu.MustBeNonzero = 1; - COMPILETIME_ASSERT(FIELD_OFFSET(NMEUDORA, MustBeNonzero) == 0x3C); -#endif - - POINT pt; - GetMessagePosClient(hTreeCtrl, &pt); - SendMessage(hTreeCtrl, TVM_SET_CAPTURE_POINT, 0, MAKELPARAM(pt.x, pt.y)); - - // instead of TV_DismissEdit(pTree, FALSE) - BOOL bRet = (BOOL)SendMessage(hTreeCtrl, TVM_ENDEDITLABELNOW, FALSE, 0); - if (!bRet) // end any previous editing (accept it) - { - return; // Something happened such that we should not process button down - } - - // Instead of TV_CheckHit - TV_HITTESTINFO ht; - ht.pt = CPoint(x, y); - TreeView_HitTest(hTreeCtrl, &ht); - wHitCode = ht.flags; - hItem = ht.hItem; - - // Excel likes to destroy the entire tree when it gets a double-click - // so we need to watch the item in case it vanishes behind our back. - hwndTree = hTreeCtrl; - LONG_PTR lStyle = IUIGetWindowLong(hTreeCtrl, GWL_STYLE); - - if (wMsg == WM_LBUTTONDBLCLK) - { - // - // Cancel any name editing that might happen. - // - - _LibUIDK_TV_CancelEditTimer(pTree); - - int cxIndent = TreeView_GetIndent(hTreeCtrl); - if (wHitCode & (TVHT_ONITEM | TVHT_ONITEMBUTTON)) - { - goto ExpandItem; - } - - // - // Collapses node above the line double clicked on - // - else if ((lStyle & TVS_HASLINES) && (wHitCode & TVHT_ONITEMINDENT) && - (abs(x % cxIndent - cxIndent / 2) <= g_cxDoubleClk)) - { - - int i; - - for (i = hItem->iLevel - x / cxIndent + ((lStyle & TVS_LINESATROOT) ? 1 : 0); i > 1; i--) - { - hItem = hItem->hParent; - } - -ExpandItem: -#ifdef _X86_ - lResult = CCSendNotify(&pTree->ci, wFlags & MK_RBUTTON ? NM_RDBLCLK : NM_DBLCLK, &nmeu.nmhdr); -#else - lResult = CCSendNotify(&pTree->ci, wFlags & MK_RBUTTON ? NM_RDBLCLK : NM_DBLCLK, NULL); -#endif - if (!IsWindow(hwndTree)) - { - goto bail; - } - if (!lResult) - { - // don't auto expand this if we're in single expand mode because the first click did it already - if (!(lStyle & TVS_SINGLEEXPAND)) - { - TV_Expand(pTree, TVE_TOGGLE, hItem, TRUE); - } - } - - } - - pTree->fScrollWait = FALSE; - } - else // WM_LBUTTONDOWN - { - if (wHitCode == TVHT_ONITEMBUTTON) - { - if (!CCSendNotify(&pTree->ci, NM_CLICK, NULL)) - { - if (TVBD_flags & TVBD_FROMWHEEL) - { - TV_Expand(pTree, (TVBD_flags & TVBD_WHEELFORWARD) ? TVE_EXPAND : TVE_COLLAPSE, hItem, TRUE); - } - else - { - TV_Expand(pTree, TVE_TOGGLE, hItem, TRUE); - } - } - } - else if (wHitCode & TVHT_ONITEM || - ((lStyle & TVS_FULLROWSELECT) && (wHitCode & (TVHT_ONITEMRIGHT | TVHT_ONITEMINDENT)))) - { - BOOL fSameItem, bDragging; - - ASSERT(hItem); - - HTREEITEM hCaret = TreeView_GetNextItem(hTreeCtrl, NULL, TVGN_CARET); - fSameItem = (hItem == hCaret); - - if (TVBD_flags & TVBD_FROMWHEEL) - { - bDragging = FALSE; - } - else if (lStyle & TVS_DISABLEDRAGDROP) - { - bDragging = FALSE; - } - else - { - bDragging = _LibUIDK_TV_CheckForDragBegin(pTree, hTreeCtrl, hItem, x, y); - _LibUIDK_TV_FinishCheckDrag(pTree); - } - - if (bDragging) - { - pTree->htiDrag = hItem; - _LibUIDK_TV_SendBeginDrag(pTree, hTreeCtrl, TVN_BEGINDRAG, hItem, x, y); - return; - } - - if (!CCSendNotify(&pTree->ci, NM_CLICK, NULL)) - { - - if (wHitCode == TVHT_ONITEMSTATEICON && - (lStyle & TVS_CHECKBOXES)) - { - _LibUIDK_TV_HandleStateIconClick(hTreeCtrl, hItem); - } - else - { - // Only set the caret (selection) if not dragging - // instead of TV_SelectItem(pTree, TVGN_CARET, hItem, TVSIF_NOTIFY | TVSIF_UPDATENOW, TVC_BYMOUSE); - TreeView_SelectItem(hTreeCtrl, hItem); - - if (fSameItem && (wHitCode & TVHT_ONITEMLABEL) && pTree->fFocus) - { - // - // The item and window are currently selected and user clicked - // on label. Try to enter into name editing mode. - // - SetTimer(hTreeCtrl, IDT_NAMEEDIT, GetDoubleClickTime(), NULL); - pTree->fNameEditPending = TRUE; - } - - if (fSameItem && lStyle & TVS_SINGLEEXPAND) - { - // single click on the focus item toggles expand state - TV_Expand(pTree, TVE_TOGGLE, hCaret, TRUE); - } - } - } - } - else - { - CCSendNotify(&pTree->ci, NM_CLICK, NULL); - } - } - - if (!pTree->fFocus) - { - SetFocus(hTreeCtrl); - } - -bail: - ; -} - -// ---------------------------------------------------------------------------- -// -// Scroll window vertically as needed to make given item fully visible -// vertically -// -// ---------------------------------------------------------------------------- - -BOOL NEAR _LibUIDK_TV_ScrollVertIntoView(PTREE pTree, TREEMEMBER *pMember, HWND hTreeCtrl, HTREEITEM hItem) -{ - // This function has crashed in stress before, so we need to assert the incoming parameters. - ASSERT(hItem); - ASSERT(pMember && pMember->m_hTop); - - // Do nothing if the parameters are invalid - if (!hItem || pMember == NULL || pMember->m_hTop == NULL) - { - return FALSE; - } - - // Do nothing if this item is not visible - if (!ITEM_VISIBLE(hItem)) - { - return FALSE; - } - - if (hItem->iShownIndex <= pMember->m_hTop->iShownIndex) - { - pMember->m_hTop = hItem; - pMember->m_nTopItemYOffset = 0; - - // ¹ - int nPos = _LibUIDK_TV_GetTopItemScrollPos(pMember, pMember->m_hTop, hTreeCtrl); - SetScrollPos(hTreeCtrl, SB_VERT, nPos, TRUE); - InvalidateRect(hTreeCtrl, NULL, FALSE); - return 0; - } - - if (hItem->iShownIndex > pMember->m_hTop->iShownIndex) - { - CRect rcClient; - GetClientRect(hTreeCtrl, rcClient); - - // жItemDzʾtreeС - int nCountHeight = 0; - HTREEITEM hWolk = pMember->m_hTop; - // hItemǷȫtreeɼ - BOOL bFullInTree = FALSE; - do - { - TV_ITEMDATA *pData = TreeView_GetItemData(hTreeCtrl, pMember, hWolk); - - int nItemHeight = pData->nItemHeight; - if (nItemHeight == 0) - { - nItemHeight = TreeView_GetItemHeight(hTreeCtrl); - } - nCountHeight += nItemHeight; - - if (nCountHeight + pMember->m_nTopItemYOffset > rcClient.Height()) - { - break; - } - - if (hWolk == hItem) - { - bFullInTree = TRUE; - break; - } - - hWolk = _LibUIDK_TV_GetNextVisItem(hTreeCtrl, hWolk); - } - while (hWolk != NULL); - - if (bFullInTree) - { - InvalidateRect(hTreeCtrl, NULL, FALSE); - return 0; - } - - // hItem¹ʱtreeƵΧڣtree¶ - // ϱ - hWolk = hItem; - nCountHeight = 0; - while (hWolk != NULL) - { - TV_ITEMDATA *pData = TreeView_GetItemData(hTreeCtrl, pMember, hWolk); - - int nItemHeight = pData->nItemHeight; - if (nItemHeight == 0) - { - nItemHeight = TreeView_GetItemHeight(hTreeCtrl); - } - nCountHeight += nItemHeight; - - if (rcClient.Height() - nCountHeight <= 0) - { - pMember->m_hTop = hWolk; - pMember->m_nTopItemYOffset = rcClient.Height() - nCountHeight; - - // 㴹ֱλ - int nPos = _LibUIDK_TV_GetTopItemScrollPos(pMember, pMember->m_hTop, hTreeCtrl); - SetScrollPos(hTreeCtrl, SB_VERT, nPos, TRUE); - - break; - } - - hWolk = TV_GetPrevVisItem(hWolk); - } - - InvalidateRect(hTreeCtrl, NULL, FALSE); - - return 0; - } - - return FALSE; -} - -LRESULT TreeParentWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - WNDPROC wndprocOld = CWndProcList::GetOldWndProc(hwnd, (WNDPROC)TreeParentWndProc); - if (wndprocOld == NULL) - { - return 0; - } - - if (uMsg == WM_NOTIFY) - { - NMHDR *pnmhdr = (NMHDR *)lParam; - - switch (pnmhdr->code) - { - // ˫Item򰴷չ۵ItemᴥTVM_EXPANDֻеôExpandŻִ - // ԣTVN_ITEMEXPANDEDϢ洦ꡢ̻ʹôչ۵Item. - case TVN_ITEMEXPANDED: - { - NMTREEVIEW *pnmTree = (NMTREEVIEW *)lParam; - BOOL bNewExpand = ((pnmTree->itemNew.state & TVIS_EXPANDED) == TVIS_EXPANDED); - TREEMEMBER *pMember = (TREEMEMBER *)SendMessage(pnmhdr->hwndFrom, TVM_GET_MEMBER, 0, 0); - UpdateBranchHeightAfterExpand(pnmhdr->hwndFrom, pMember, pnmTree->itemNew.hItem, - !bNewExpand, bNewExpand); - _LibUIDK_TV_CalcScrollBars(pnmhdr->hwndFrom, pMember); - } - break; - - default: - break; - } - } - - return CallWindowProc(wndprocOld, hwnd, uMsg, wParam, lParam); -} - -LRESULT CSkinTreeCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) -{ - // TODO: Add your specialized code here and/or call the base class - TREEMEMBER *pMember = (TREEMEMBER *)m_pMember; - - switch (message) - { - case WM_WINDOWPOSCHANGED: - Ctrl_OnWindowPosChanged(this, wParam, lParam); - break; - - case WM_CREATE: - { - - // Hook the parent. - WNDPROC procOld = (WNDPROC)IUISetWindowLong(GetParent()->GetSafeHwnd(), - GWLP_WNDPROC, (LONG_PTR)TreeParentWndProc); - CWndProcList::AddToMap(GetParent()->GetSafeHwnd(), procOld, (WNDPROC)TreeParentWndProc); - } - break; - - case WM_GETBACKGROUND: - { - LRESULT lr = CTreeCtrl::WindowProc(message, wParam, lParam); // Give derived class a chance. - if (lr != 0) // The derived class has handle. - { - return lr; - } - - BOOL *pbCompatibleBitmap = (BOOL *)lParam; - - if (m_bmpCompatible.GetSafeHandle() == NULL) - { - if (pbCompatibleBitmap != NULL) - { - *pbCompatibleBitmap = FALSE; - } - - return NULL; - } - else - { - if (pbCompatibleBitmap != NULL) - { - *pbCompatibleBitmap = TRUE; - } - - return (LRESULT)m_bmpCompatible.GetSafeHandle(); - } - } - } - - PTREE pTree = (PTREE)GetWindowPtr(m_hWnd, 0); - -#define TVMP_CALCSCROLLBARS (TV_FIRST + 0x1000) - - LRESULT lr = 0; - if (pTree != NULL && pMember->m_bSmoothScroll) - { - if (message == g_uDragImages) - { - lr = CTreeCtrl::WindowProc(message, wParam, lParam); - return lr; - } - - switch (message) - { - case TVM_GETNEXTITEM: - if (wParam == TVGN_FIRSTVISIBLE) - { - return (LRESULT)pMember->m_hTop; - } - break; - - case TVM_INSERTITEM: - lr = CTreeCtrl::WindowProc(message, wParam, lParam); - UpdateBranchHeightAfterAddItem(m_hWnd, pMember, (HTREEITEM)lr); - _LibUIDK_TV_CalcScrollBars(m_hWnd, pMember); - return lr; - - case TVM_DELETEITEM: - { - if (HTREEITEM(lParam) == pMember->m_hTop) - { - pMember->m_hTop = NULL; - pMember->m_nTopItemYOffset = 0; - } - - ReleaseItemControl(HTREEITEM(lParam)); - - TV_ITEMDATA *pItemData = TreeView_GetItemData(m_hWnd, pMember, HTREEITEM(lParam)); - - UpdateBranchHeightAfterDeleteItem(m_hWnd, pMember, HTREEITEM(lParam)); - lr = CTreeCtrl::WindowProc(message, wParam, lParam); - delete pItemData; - - if (GetRootItem() == NULL) - { - pMember->m_cxMax = 0; - } - _LibUIDK_TV_CalcScrollBars(m_hWnd, pMember); - } - - return lr; - - case TVMP_CALCSCROLLBARS: - _LibUIDK_TV_CalcScrollBars(m_hWnd, pMember); - return 0; - - case WM_SETREDRAW: - pMember->m_bRedraw = (BOOL)wParam; - - // ﲻܵCTreeCtrl::WindowProc(message, wParam, lParam); - // ΪӦWM_SETREDRAWϢʱTV_ScrollBarsAfterSetWidth - // TV_ScrollBarsAfterSetWidthѹλóɻеֵ - pTree->fRedraw = TRUE && pMember->m_bRedraw; - if (pTree->fRedraw) - { - // This use to only refresh the items from hTop down, this is bad as if items are inserted - // before the visible point within the tree then we would fail! - if (pTree->hRoot) - { - pTree->cShowing = TV_UpdateShownIndexes(pTree, pTree->hRoot); - } - } - - if ((BOOL)wParam) - { - _LibUIDK_TV_CalcScrollBars(m_hWnd, pMember); - InvalidateRect(NULL, FALSE); - } - return lr; - - case TVM_SETBORDER: - lr = CTreeCtrl::WindowProc(message, wParam, lParam); - _LibUIDK_TV_CalcScrollBars(m_hWnd, pMember); - return lr; - - case WM_ISREDRAW: - return (LRESULT)pMember->m_bRedraw; - - case WM_VSCROLL: - { - int nOldPos = GetScrollPos(SB_VERT); - // ϶ʱЧ, ΪWM_VSCROLLбtackposֻ16λֵ65535 - // ʹGetScrollInfoõ32λtrack pos. - int nTrackPos = 0; - UINT uCode = GET_WM_VSCROLL_CODE(wParam, lParam); - if (uCode == SB_THUMBPOSITION || uCode == SB_THUMBTRACK) - { - SCROLLINFO si; - si.cbSize = sizeof(SCROLLINFO); - si.fMask = SIF_TRACKPOS; - GetScrollInfo(SB_VERT, &si, SIF_TRACKPOS); - nTrackPos = si.nTrackPos; - } - lr = CTreeCtrl::WindowProc(message, wParam, lParam); - _LibUIDK_TV_VertScroll(m_hWnd, pMember, uCode, nOldPos, nTrackPos); - return lr; - } - - case WM_KEYDOWN: - lr = CTreeCtrl::WindowProc(message, wParam, lParam); - _LibUIDK_TV_ScrollVertIntoView(pTree, pMember, m_hWnd, TreeView_GetNextItem(m_hWnd, NULL, TVGN_CARET)); - InvalidateRect(NULL); - return lr; - - case TVM_HITTEST: - return (LRESULT)_LibUIDK_TV_OnHitTest(m_hWnd, pMember, (LPTV_HITTESTINFO)lParam); - - case WM_LBUTTONDBLCLK: - case WM_LBUTTONDOWN: - _LibUIDK_TV_ButtonDown(pTree, m_hWnd, message, (UINT) wParam, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0); - return 0; - - case TVM_SETIMAGELIST: - lr = CTreeCtrl::WindowProc(message, wParam, lParam); - - if (int(wParam) == TVSIL_STATE) - { - if (HIMAGELIST(lParam) != NULL) - { - ImageList_GetIconSize(HIMAGELIST(lParam), &pMember->m_cxState, &pMember->m_cyState); - } - else - { - pMember->m_cxState = 0; - } - } - else if (int(wParam) == TVSIL_NORMAL) - { - int cx = 0; - int cy = 0; - if (HIMAGELIST(lParam) != NULL - && ImageList_GetIconSize(HIMAGELIST(lParam), &cx, &cy)) - { - pMember->m_cxImage = (cx + MAGIC_INDENT); - pMember->m_cyImage = (SHORT)cy; - } - else - { - pMember->m_cxImage = pMember->m_cyImage = 0; - } - } - - return lr; - - case TVM_SELECTITEM: - SetRedraw(FALSE); - lr = CTreeCtrl::WindowProc(message, wParam, lParam); - SetRedraw(TRUE); - return lr; - - case WM_MOUSEWHEEL: - if (pMember->m_bSmoothScroll) - { - LONG_PTR lStyle = IUIGetWindowLong(m_hWnd, GWL_STYLE); - BOOL bScroll = (!IsIncludeFlag(lStyle, TVS_NOSCROLL)); - - if (bScroll) - { - int nOldPos = GetScrollPos(SB_VERT); - short zDelta = HIWORD(wParam); - if (zDelta > 0) - { - _LibUIDK_TV_VertScroll(m_hWnd, pMember, SB_THUMBTRACK, nOldPos, max(0, nOldPos - GetVScrollMouseWhellStep())); - } - else - { - _LibUIDK_TV_VertScroll(m_hWnd, pMember, SB_THUMBTRACK, nOldPos, nOldPos + GetVScrollMouseWhellStep()); - } - } - } - break; - - // ֧ƽʱعHoverʱʾ - case WM_MOUSEMOVE: - if (pMember->m_bHoverScrollBarMode) - { - TRACKMOUSEEVENT tme; - tme.cbSize = sizeof(TRACKMOUSEEVENT); - tme.dwFlags = TME_LEAVE; - tme.hwndTrack = m_hWnd; - ::TrackMouseEvent(&tme); - - LONG_PTR lStyle = IUIGetWindowLong(m_hWnd, GWL_STYLE); - if (IsIncludeFlag(lStyle, TVS_NOSCROLL)) - { - lStyle &= ~TVS_NOSCROLL; - IUISetWindowLong(m_hWnd, GWL_STYLE, lStyle); - - int nOldPos = pMember->m_nTopItemYScrollPos; - ::SendMessage(m_hWnd, TVMP_CALCSCROLLBARS, 0, 0); - ::SetScrollPos(m_hWnd, SB_VERT, nOldPos, TRUE); - pMember->m_nTopItemYScrollPos = nOldPos; - } - } - break; - - // 뿪ϵбع - // TreeĹƶTreeĿͻҲյWM_NCMOUSELEAVE - case WM_NCMOUSELEAVE: - if (pMember->m_bHoverScrollBarMode) - { - LONG_PTR lStyle = IUIGetWindowLong(m_hWnd, GWL_STYLE); - if (!IsIncludeFlag(lStyle, TVS_NOSCROLL)) - { - POINT pt; - GetCursorPos(&pt); - - CRect rcTree; - ::GetWindowRect(m_hWnd, rcTree); - - if (!rcTree.PtInRect(pt)) - { - lStyle |= TVS_NOSCROLL; - IUISetWindowLong(m_hWnd, GWL_STYLE, lStyle); - - ::SetScrollRange(m_hWnd, SB_VERT, 0, 0, TRUE); - } - } - } - break; - - // 뿪ϵбع - // ƶTreeĹϺҲյWM_MOUSELEAVE - case WM_MOUSELEAVE: - if (pMember->m_bHoverScrollBarMode) - { - LONG_PTR lStyle = IUIGetWindowLong(m_hWnd, GWL_STYLE); - if (!IsIncludeFlag(lStyle, TVS_NOSCROLL)) - { - POINT pt; - GetCursorPos(&pt); - - CRect rcTree; - ::GetWindowRect(m_hWnd, rcTree); - - if (!rcTree.PtInRect(pt)) - { - lStyle |= TVS_NOSCROLL; - IUISetWindowLong(m_hWnd, GWL_STYLE, lStyle); - - ::SetScrollRange(m_hWnd, SB_VERT, 0, 0, TRUE); - } - } - } - break; - - - // ԶϢ - case TVM_GET_TOTAL_SHOW_HEIGHT: - return (LRESULT)pMember->m_nTotalShowHeight; - - case TVM_SET_TOTAL_SHOW_HEIGHT: - if ((BOOL)wParam) - { - pMember->m_nTotalShowHeight += (int)lParam; - } - else - { - pMember->m_nTotalShowHeight = (int)lParam; - } - break; - - case TVM_SET_TOP_ITEM: - pMember->m_hTop = (HTREEITEM)lParam; - return 0; - - case TVM_GET_TOP_ITEM: - return (LRESULT)pMember->m_hTop; - - case TVM_SET_TOP_ITEM_YOFFSET: - pMember->m_nTopItemYOffset = (int)lParam; - return 0; - - case TVM_GET_TOP_ITEM_YOFFSET: - return (LRESULT)pMember->m_nTopItemYOffset; - - case TVM_GET_STATE_IMAGE_SIZE: - return (LRESULT)MAKEWORD(pMember->m_cxState, pMember->m_cyState); - - case TVM_GET_NORMAL_IMAGE_SIZE: - return (LRESULT)MAKEWORD(pMember->m_cxImage, pMember->m_cyImage); - - case TVM_SET_CXMAX: - pMember->m_cxMax = (WORD)wParam; - return 0; - - case TVM_GET_CXMAX: - return pMember->m_cxMax; - - case TVM_SET_CAPTURE_POINT: - pMember->m_ptCapture.x = GET_X_LPARAM(lParam); - pMember->m_ptCapture.y = GET_Y_LPARAM(lParam); - return 0; - - case TVM_GET_CAPTURE_POINT: - return (LRESULT)MAKELPARAM(pMember->m_ptCapture.x, pMember->m_ptCapture.y); - - case TVM_SET_TOPITEM_YSCROLLPOS: - pMember->m_nTopItemYScrollPos = (int)lParam; - return 0; - - case TVM_GET_TOPITEM_YSCROLLPOS: - return pMember->m_nTopItemYScrollPos; - - case WLNM_NOTCREATEASCHILD: - return pMember->m_bWindowlessNotCreateAsChild; - } - } - - // the CTreeCtrl can't response SB_THUMBTRACK and SB_THUMBPOSITION message send by custom in Vista, - // but can response in XP. - // So, when CTreeCtrl receive these two message, use CTreeCtrl::SetScrollInfo to scroll content. - // if the XP, SetScrollInfo call cause flash. - if ((message == WM_VSCROLL || message == WM_HSCROLL) && pMember->m_bUseCustomScrollBar) - { - WORD sbCode = LOWORD(wParam); - if ((sbCode == SB_THUMBTRACK || sbCode == SB_THUMBPOSITION) - && IUIIsWindowsVistaOrGreater()/*Vista or later*/) - { - int nPos = HIWORD(wParam); - - if (message == WM_VSCROLL) - { - SCROLLINFO siv = {0}; - siv.cbSize = sizeof(SCROLLINFO); - siv.fMask = SIF_ALL; - GetScrollInfo(SB_VERT, &siv); - siv.nPos = nPos; - SetRedraw(FALSE); - SetScrollInfo(SB_VERT, &siv); - SetRedraw(TRUE); - ReDrawControl(FALSE, TRUE, NULL); - UpdateWindow(); - } - else if (message == WM_HSCROLL) - { - SCROLLINFO sih = {0}; - sih.cbSize = sizeof(SCROLLINFO); - sih.fMask = SIF_ALL; - GetScrollInfo(SB_HORZ, &sih); - sih.nPos = nPos; - SetScrollInfo(SB_HORZ, &sih); - } - } - - // If in XP, call Invalidate must before WindowProc to avoid flash - if (IUIIsWindowsVersion(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 0, VER_LESS)) - { - ReDrawControl(FALSE, TRUE, NULL); - } - LRESULT lr = CTreeCtrl::WindowProc(message, wParam, lParam); - UpdateCustomScrollInfo(this); - // if in vista or later, call Invalidate must after WindowProc - if (IUIIsWindowsVistaOrGreater()) - { - ReDrawControl(FALSE, TRUE, NULL); - } - return lr; - } - - switch (message) - { - case WM_HSCROLL: - case WM_MOUSEWHEEL: - ReDrawControl(FALSE, TRUE, NULL); - break; - // If the bottom item is part visible, click it will start a timer with - // id 43(IDT_SCROLLWAIT), in the timer, scroll the view to show the bottom item full. - case WM_TIMER: - if (wParam == IDT_SCROLLWAIT) - { - ReDrawControl(FALSE, TRUE, NULL); - } - break; - default: - break; - } - - if (message == WM_ERASEBKGND) - { - return TRUE; - } - - if (message == WM_NCPAINT) - { - // Draw the resize scroll bar - if (pMember->m_wndHScroll.GetSafeHwnd() != NULL - && pMember->m_wndHScroll.IsWindowVisible() - && pMember->m_wndVScroll.GetSafeHwnd() != NULL - && pMember->m_wndVScroll.IsWindowVisible()) - { - int nVScrollBarWidth = GetSystemMetrics(SM_CXVSCROLL); - int nHScrollBarHeight = GetSystemMetrics(SM_CYHSCROLL); - - CWindowDC dcWin(this); - - CRect rcSizeBox2This; - GetWindowRect(rcSizeBox2This); - ScreenToClient(rcSizeBox2This); - rcSizeBox2This.left = rcSizeBox2This.right - nVScrollBarWidth; - rcSizeBox2This.top = rcSizeBox2This.bottom - nHScrollBarHeight; - - // Draw parent part - DrawParentNonClientPart(this, &dcWin, rcSizeBox2This, NULL, NULL); - - // Draw myself - IUIBitBlt(dcWin.GetSafeHdc(), rcSizeBox2This, pMember->m_hLevel1ResizedBkImage, - rcSizeBox2This.left, rcSizeBox2This.top, SRCCOPY); - - return 0; - } - - LONG lStyle = GetWindowLong(m_hWnd, GWL_STYLE); - BOOL bBorder = ((lStyle & WS_BORDER) == WS_BORDER); - if (!bBorder) - { - return CTreeCtrl::WindowProc(message, wParam, lParam); - } - - // Draw the border and scroll bar - DefWindowProc(message, wParam, lParam); + // Draw the border and scroll bar + DefWindowProc(message, wParam, lParam); if (pMember->m_bCacheMode) { @@ -3027,87 +1294,19 @@ LRESULT CSkinTreeCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) COLORREF cr = GetTextColor(); dcMem.SetTextColor(cr); + UINT uVisibleCount = GetVisibleCount(); HTREEITEM hTI = GetFirstVisibleItem(); - TRACE(_T("========top %x, yOffset=%d, text=%s\n"), hTI, pMember->m_nTopItemYOffset, GetItemText(hTI)); - int nDrawHeight = 0;// ѻitemܸ߶ - int i = 0; CRect rcItem; - rcItem.right = rcClient.right; - while (hTI != NULL) + for (UINT i = 0; (i < uVisibleCount + 1) && (hTI != NULL); ++i) { TV_ITEMDATA *pData = TreeView_GetItemData(m_hWnd, pMember, hTI); - int nItemHeight = pData->nItemHeight; - if (nItemHeight == 0) - { - nItemHeight = GetItemHeight(); - } - // һμʱϴֱƫ - if (nDrawHeight == 0) - { - nDrawHeight += pMember->m_nTopItemYOffset; - } - - rcItem.top = nDrawHeight; - rcItem.bottom = rcItem.top + nItemHeight; - - // ؼ˳ - if (nDrawHeight > rcClient.Height()) - { - // After the last item animation finish, kill the timer. - KillTimer(IDTT_ANIMATION_CONTENT); - pMember->m_bAnimationMode = false; - pMember->m_nCurTimerTick = 0; - pMember->m_vAnimationData.clear(); - - NMHDR nmhdr; - nmhdr.hwndFrom = m_hWnd; - nmhdr.idFrom = GetDlgCtrlID(); - nmhdr.code = TVN_ANIMATION_END; - GetParent()->SendMessage(WM_NOTIFY, nmhdr.idFrom, LPARAM(&nmhdr)); - - break; - } - - nDrawHeight += nItemHeight; - - if (pMember->m_bAnimationMode) - { - // Each item's left margin is different. - int nFrameIndex = 0; - if (pMember->m_bTogetherAnimation) - { - nFrameIndex = pMember->m_nCurTimerTick; - } - else - { - if (pMember->m_nCurTimerTick - i >= 0) - { - nFrameIndex = pMember->m_nCurTimerTick - i; - } - else - { - nFrameIndex = 0; - } - if (nFrameIndex >= (int)pMember->m_vAnimationData.size()) - { - nFrameIndex = (int)pMember->m_vAnimationData.size() - 1; - } - } - - OnDrawItem(&dcMem, hTI, rcItem, pMember->m_vAnimationData[nFrameIndex]); - } - else if (pMember->m_bAnimateRemoveMode) - { - OnDrawItem(&dcMem, hTI, rcItem, 0); - } - else - { - OnDrawItem(&dcMem, hTI, rcItem, 0); - } + GetItemRect(hTI, rcItem, FALSE); + rcItem.right = rcClient.right; + + OnDrawItem(&dcMem, hTI, rcItem, 0); hTI = GetNextVisibleItem(hTI); - i++; } // Draw windowless children control. @@ -3130,6 +1329,9 @@ LRESULT CSkinTreeCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) dcMem.SelectObject(pbmpMemOld); UpdateCustomScrollBar(); + + // 0Win11ϣTreeؼݣʾʱʾɵTree + return 0; } } @@ -3392,125 +1594,6 @@ LRESULT CSkinTreeCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) } } - if (message == WM_TIMER) - { - if (wParam == IDTT_ANIMATION_CONTENT) - { - Invalidate(); - - pMember->m_nCurTimerTick++; - - return 0; // The List control default handle may Kill the timer. - } - - else if (wParam == IDTT_INSERT_ITEM) - { - CRect rcItem; - GetItemRect(pMember->m_hInsertItem, rcItem, FALSE); - - if (pMember->m_nCurInsertItemTimerTick >= (int)pMember->m_vInsertItemAnimationData.size()) - { - KillTimer(IDTT_INSERT_ITEM); - - pMember->m_bAnimationInsertItem = false; - pMember->m_hInsertItem = NULL; - pMember->m_nCurInsertItemTimerTick = 0; - pMember->m_vInsertItemAnimationData.clear(); - - NMHDR nmhdr; - nmhdr.hwndFrom = m_hWnd; - nmhdr.idFrom = GetDlgCtrlID(); - nmhdr.code = TVN_ANIMATION_INSERT_ITEM_END; - GetParent()->SendMessage(WM_NOTIFY, nmhdr.idFrom, LPARAM(&nmhdr)); - - InvalidateRect(rcItem); - - return 0; - } - - InvalidateRect(rcItem); - - pMember->m_nCurInsertItemTimerTick++; - - return 0; - } - - else if (wParam == IDTT_DELETE_ITEM) - { - if (pMember->m_nCurDeleteItemTimerTick >= (int)pMember->m_vDeletedItemAnimationData.size()) - { - KillTimer(IDTT_DELETE_ITEM); - DeleteItem(pMember->m_hDeletedItem); - - pMember->m_hDeletedItem = NULL; - pMember->m_nCurDeleteItemTimerTick = 0; - pMember->m_vDeletedItemAnimationData.clear(); - - return 0; - } - - SetItemHeightEx(pMember->m_hDeletedItem, pMember->m_vDeletedItemAnimationData[pMember->m_nCurDeleteItemTimerTick]); - - pMember->m_nCurDeleteItemTimerTick++; - - return 0; - } - - else if (wParam == IDTT_REMOVE_ITEM) - { - CRect rcItem; - GetItemRect(pMember->m_hRemoveItem, rcItem, FALSE); - InvalidateRect(rcItem); - - if (pMember->m_nCurRemoveItemTimerTick == 0) - { - UpdateWindow(); - } - - pMember->m_nCurRemoveItemTimerTick++; - - if (pMember->m_nCurRemoveItemTimerTick >= (int)pMember->m_vRemoveItemAnimationData.size()) - { - KillTimer(IDTT_REMOVE_ITEM); - - pMember->m_bAnimateRemoveMode = false; - pMember->m_nCurRemoveItemTimerTick = 0; - pMember->m_vRemoveItemAnimationData.clear(); - pMember->m_bmpCachedRemovedItem.DeleteObject(); - - NMHDR nmhdr; - nmhdr.hwndFrom = m_hWnd; - nmhdr.idFrom = GetDlgCtrlID(); - nmhdr.code = TVN_ANIMATION_REMOVE_ITEM_END; - NMTREEVIEW tv; - tv.hdr = nmhdr; - tv.itemNew.hItem = pMember->m_hRemoveItem; - GetParent()->SendMessage(WM_NOTIFY, nmhdr.idFrom, LPARAM(&tv)); - - return 0; - } - } - - else if (wParam == IDTT_VER_SCROLL) - { - ScrollWindow(0, -pMember->m_vVerScrollAnimationData[pMember->m_nCurVerScrollTimerTick]); - - pMember->m_nCurVerScrollTimerTick++; - if (pMember->m_nCurVerScrollTimerTick >= (int)pMember->m_vVerScrollAnimationData.size()) - { - KillTimer(IDTT_VER_SCROLL); - SendMessage(WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), (LPARAM)0); - - pMember->m_nCurVerScrollTimerTick = 0; - pMember->m_vVerScrollAnimationData.clear(); - - return 0; - } - - return 0; - } - } - if (message == TVM_GET_MEMBER) { return (LRESULT)pMember; @@ -3643,45 +1726,6 @@ int CSkinTreeCtrl::UpdateImageListCache() ////////////////////////////////////////////////////////////////////////// -int CSkinTreeCtrl::SmoothScroll(BOOL bSmooth) -{ - ASSERT(!::IsWindow(m_hWnd)); - - TREEMEMBER *pMember = (TREEMEMBER *)m_pMember; - - pMember->m_bSmoothScroll = bSmooth; - - return 0; -} - -BOOL CSkinTreeCtrl::IsSmoothScroll() const -{ - TREEMEMBER *pMember = (TREEMEMBER *)m_pMember; - - return pMember->m_bSmoothScroll; -} - -int CSkinTreeCtrl::SetVScrollMouseWhellStep(int nStep) -{ - if (nStep <= 0) - { - return -1; - } - - TREEMEMBER *pMember = (TREEMEMBER *)m_pMember; - - pMember->m_nVScrollMouseWhellStep = nStep; - - return 0; -} - -int CSkinTreeCtrl::GetVScrollMouseWhellStep() const -{ - TREEMEMBER *pMember = (TREEMEMBER *)m_pMember; - - return pMember->m_nVScrollMouseWhellStep; -} - // Set the images for background int CSkinTreeCtrl::SetImages(UINT uMask, LPCTSTR lpszImageNameN, LPCTSTR lpszImageNameD) { @@ -4462,18 +2506,13 @@ int CSkinTreeCtrl::SetItemHeightEx(HTREEITEM hItem, UINT cyItemHeight) return -1; } - int nItemOldHeight = pTvItemData->nItemHeight; - if (nItemOldHeight == 0) - { - nItemOldHeight = GetItemHeight(); - } - - pTvItemData->nItemHeight = cyItemHeight; - - UpdateBranchHeightAfterItemHeightChanged(m_hWnd, pMember, hItem, - nItemOldHeight, pTvItemData->nItemHeight); + int nItemOldHeight = GetItemHeight(); - _LibUIDK_TV_CalcScrollBars(m_hWnd, pMember); + TVITEMEX itemEx; + itemEx.mask = TVIF_INTEGRAL; + itemEx.hItem = hItem; + itemEx.iIntegral = cyItemHeight / nItemOldHeight; + BOOL bRet = (BOOL)::SendMessage(m_hWnd, TVM_SETITEM, 0, LPARAM(&itemEx)); // Must call SetRedraw(TRUE) to refresh the tree to update item rect and scroll bar. SetRedraw(TRUE); @@ -4491,7 +2530,14 @@ UINT CSkinTreeCtrl::GetItemHeightEx(HTREEITEM hItem) const return 0; } - return pTvItemData->nItemHeight; + TVITEMEX itemEx; + itemEx.mask = TVIF_INTEGRAL; + itemEx.hItem = hItem; + BOOL bRet = (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, LPARAM(&itemEx)); + + _ASSERT(FALSE); + int nItemOldHeight = GetItemHeight(); + return itemEx.iIntegral * nItemOldHeight; } // Not include children's children. @@ -4630,82 +2676,6 @@ int CSkinTreeCtrl::OnDrawItem(CDC *pDC, HTREEITEM hItem, LPCRECT lprcItem, int n rcText = rcItem; rcText.left = nTextLeft; - // Generate a bitmap by the item UI. - if (pMember->m_bAnimateRemoveMode - && hItem == pMember->m_hRemoveItem - && pMember->m_bmpCachedRemovedItem.GetSafeHandle() == NULL) - { - // Cache the item draw. - CDC dcMemDest; - dcMemDest.CreateCompatibleDC(pDC); - - pMember->m_bmpCachedRemovedItem.CreateCompatibleBitmap(pDC, rcItem.Width(), rcItem.Height()); - HBITMAP hBmpOld = (HBITMAP)::SelectObject(dcMemDest.GetSafeHdc(), - (HBITMAP)pMember->m_bmpCachedRemovedItem.GetSafeHandle()); - - // Copy pDC the cached bitmap - dcMemDest.BitBlt(0, 0, rcItem.Width(), rcItem.Height(), - pDC, rcItem.left, rcItem.top, SRCCOPY); - - // Draw item background - CRect rcItemDraw = rcItem; - rcItemDraw.OffsetRect(-rcItem.left, -rcItem.top); - OnDrawItemBk(&dcMemDest, hItem, rcItemDraw); - - // Draw button and image - CRect rcTextDraw = rcText; - rcTextDraw.OffsetRect(-rcItem.left, -rcItem.top); - OnDrawItemIcon(&dcMemDest, hItem, rcItemDraw, rcTextDraw, nLeftMargin); - - // Draw text - OnDrawText(&dcMemDest, hItem, rcItemDraw, rcTextDraw, nLeftMargin); - - ::SelectObject(dcMemDest, hBmpOld); - // - // CWindowDC dc(NULL); - // BitBltG(dc.GetSafeHdc(), rcItem, - // (HBITMAP)pMember->m_bmpCachedRemovedItem.GetSafeHandle(), 0, 0, SRCCOPY); - } - - // Generate a bitmap by the item UI. - if (pMember->m_bAnimationInsertItem - && hItem == pMember->m_hInsertItem - && pMember->m_bmpCachedInsertItem.GetSafeHandle() == NULL) - { - // Cache the item draw. - CDC dcMemDest; - dcMemDest.CreateCompatibleDC(pDC); - - pMember->m_bmpCachedInsertItem.CreateCompatibleBitmap(pDC, rcItem.Width(), rcItem.Height()); - HBITMAP hBmpOld = (HBITMAP)::SelectObject(dcMemDest.GetSafeHdc(), - (HBITMAP)pMember->m_bmpCachedInsertItem.GetSafeHandle()); - - // Copy pDC the cached bitmap - dcMemDest.BitBlt(0, 0, rcItem.Width(), rcItem.Height(), - pDC, rcItem.left, rcItem.top, SRCCOPY); - - // Draw item background - CRect rcItemDraw = rcItem; - rcItemDraw.OffsetRect(-rcItem.left, -rcItem.top); - OnDrawItemBk(&dcMemDest, hItem, rcItemDraw); - - // Draw item line - if (IsEnableItemLine()) - { - OnDrawItemLine(&dcMemDest, hItem, rcItemDraw); - } - - // Draw button and image - CRect rcTextDraw = rcText; - rcTextDraw.OffsetRect(-rcItem.left, -rcItem.top); - OnDrawItemIcon(&dcMemDest, hItem, rcItemDraw, rcTextDraw, nLeftMargin); - - // Draw text - OnDrawText(&dcMemDest, hItem, rcItemDraw, rcTextDraw, nLeftMargin); - - ::SelectObject(dcMemDest, hBmpOld); - } - // Draw item background OnDrawItemBk(pDC, hItem, rcItem); @@ -4715,194 +2685,94 @@ int CSkinTreeCtrl::OnDrawItem(CDC *pDC, HTREEITEM hItem, LPCRECT lprcItem, int n OnDrawItemLine(pDC, hItem, rcItem); } - if (pMember->m_hRemoveItem == hItem) - { - if (pMember->m_bAnimateRemoveMode) - { - if (pMember->m_nCurRemoveItemTimerTick > 0) - { - CRect rcDraw; - rcDraw.left = rcItem.CenterPoint().x - - rcItem.Width() - * pMember->m_vRemoveItemAnimationData[pMember->m_nCurRemoveItemTimerTick].nPercent - / 200; - rcDraw.top = rcItem.CenterPoint().y - - rcItem.Height() - * pMember->m_vRemoveItemAnimationData[pMember->m_nCurRemoveItemTimerTick].nPercent - / 200; - rcDraw.right = rcDraw.left - + rcItem.Width() - * pMember->m_vRemoveItemAnimationData[pMember->m_nCurRemoveItemTimerTick].nPercent - / 100; - rcDraw.bottom = rcDraw.top - + rcItem.Height() - * pMember->m_vRemoveItemAnimationData[pMember->m_nCurRemoveItemTimerTick].nPercent - / 100; - - // FadeInOut - float fAlpha = (float)pMember->m_vRemoveItemAnimationData[pMember->m_nCurRemoveItemTimerTick].nTransparent / (float)255; - ColorMatrix cm = - { - 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, fAlpha, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 1.0f - }; - - ImageAttributes ia; - ia.SetColorMatrix(&cm); - - Bitmap *bmp = Bitmap::FromHBITMAP((HBITMAP)pMember->m_bmpCachedRemovedItem.GetSafeHandle(), NULL); + pMember->m_bSetItemDataInternal = TRUE; + TV_ITEMDATA *pData = (TV_ITEMDATA *)GetItemData(hItem); + pMember->m_bSetItemDataInternal = FALSE; - Graphics g(pDC->GetSafeHdc()); - g.DrawImage(bmp, Rect(rcDraw.left, rcDraw.top, rcDraw.Width(), rcDraw.Height()), 0, 0, rcItem.Width(), rcItem.Height(), UnitPixel, &ia); - } - } - else - { - // Remove item animation end, and Delete item animation not start. Don't show the item. - } - } - else if (pMember->m_hInsertItem == hItem) + if (pData != NULL && pData->pBindObject != NULL) { - if (pMember->m_bAnimationInsertItem - && pMember->m_nCurInsertItemTimerTick < (int)pMember->m_vInsertItemAnimationData.size()) + if (pData->pBindObject->uBindWndID > 0) { - CRect rcDraw; - rcDraw.left = rcItem.CenterPoint().x - - rcItem.Width() - * pMember->m_vInsertItemAnimationData[pMember->m_nCurInsertItemTimerTick].nPercent - / 200; - rcDraw.top = rcItem.CenterPoint().y - - rcItem.Height() - * pMember->m_vInsertItemAnimationData[pMember->m_nCurInsertItemTimerTick].nPercent - / 200; - rcDraw.right = rcDraw.left - + rcItem.Width() - * pMember->m_vInsertItemAnimationData[pMember->m_nCurInsertItemTimerTick].nPercent - / 100; - rcDraw.bottom = rcDraw.top - + rcItem.Height() - * pMember->m_vInsertItemAnimationData[pMember->m_nCurInsertItemTimerTick].nPercent - / 100; - - // FadeInOut - float fAlpha = (float)pMember->m_vInsertItemAnimationData[pMember->m_nCurInsertItemTimerTick].nTransparent / (float)255; - ColorMatrix cm = + if (!pData->pBindObject->bAlreadyCreateChildren) { - 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, fAlpha, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 1.0f - }; - - ImageAttributes ia; - ia.SetColorMatrix(&cm); - - Bitmap *bmp = Bitmap::FromHBITMAP((HBITMAP)pMember->m_bmpCachedInsertItem.GetSafeHandle(), NULL); + pMember->m_bWindowlessNotCreateAsChild = true; + _InstantiateItemBindTemplate(pData->pBindObject, this); + pMember->m_bWindowlessNotCreateAsChild = false; - Graphics g(pDC->GetSafeHdc()); - g.DrawImage(bmp, Rect(rcDraw.left, rcDraw.top, rcDraw.Width(), rcDraw.Height()), - 0, 0, rcItem.Width(), rcItem.Height(), UnitPixel, &ia); - } - else - { - - } - } - else - { - pMember->m_bSetItemDataInternal = TRUE; - TV_ITEMDATA *pData = (TV_ITEMDATA *)GetItemData(hItem); - pMember->m_bSetItemDataInternal = FALSE; + // Do something on instantiating item template. + NMHDR nmhdr; + nmhdr.hwndFrom = m_hWnd; + nmhdr.idFrom = GetDlgCtrlID(); + nmhdr.code = TVN_INSTANTIATE_ITEM_TEMPLATE; + NMTREEVIEW tvhdr; + tvhdr.hdr = nmhdr; + tvhdr.itemNew.hItem = hItem; + GetParent()->SendMessage(WM_NOTIFY, nmhdr.idFrom, LPARAM(&tvhdr)); + } - if (pData != NULL && pData->pBindObject != NULL) - { - if (pData->pBindObject->uBindWndID > 0) + if (pData->pBindObject->bAlreadyCreateChildren) { - if (!pData->pBindObject->bAlreadyCreateChildren) + if (!pData->pBindObject->vSubWLWnd.empty()) { - pMember->m_bWindowlessNotCreateAsChild = true; - _InstantiateItemBindTemplate(pData->pBindObject, this); - pMember->m_bWindowlessNotCreateAsChild = false; - - // Do something on instantiating item template. - NMHDR nmhdr; - nmhdr.hwndFrom = m_hWnd; - nmhdr.idFrom = GetDlgCtrlID(); - nmhdr.code = TVN_INSTANTIATE_ITEM_TEMPLATE; - NMTREEVIEW tvhdr; - tvhdr.hdr = nmhdr; - tvhdr.itemNew.hItem = hItem; - GetParent()->SendMessage(WM_NOTIFY, nmhdr.idFrom, LPARAM(&tvhdr)); - } + // Relayout the children. + if (rcItem != pData->pBindObject->rcLastParentLayout) + { + _RelayoutItemBindObject(this, rcItem, pData->pBindObject); + } - if (pData->pBindObject->bAlreadyCreateChildren) - { - if (!pData->pBindObject->vSubWLWnd.empty()) + // Draw windowless children. + std::vector::iterator it = pData->pBindObject->vSubWLWnd.begin(); + for (; it != pData->pBindObject->vSubWLWnd.end(); ++it) { - // Relayout the children. - if (rcItem != pData->pBindObject->rcLastParentLayout) + CONTROL_TYPE eControlType = it->m_eControlType; + if (eControlType == CT_WL_RECTCTRL + || eControlType == CT_WL_SPLITTER + || eControlType == CT_WL_LINE + || eControlType == CT_WL_TEXT + || eControlType == CT_WL_PICTURE + || eControlType == CT_WL_BUTTON + || eControlType == CT_WL_CHECK + || eControlType == CT_WL_RADIO + || eControlType == CT_WL_SLIDER + || eControlType == CT_WL_RICHEDIT + || eControlType == CT_WL_RICHEDIT_IM + || eControlType == CT_TASK_WND_MGR + || eControlType == CT_PNL_DOCK + || eControlType == CT_UNIFORM_GRID + || eControlType == CT_PNL_STACK) { - _RelayoutItemBindObject(this, rcItem, pData->pBindObject); - } + CWLWnd *pWLWnd = (CWLWnd *)it->m_pChildCtrl; - // Draw windowless children. - std::vector::iterator it = pData->pBindObject->vSubWLWnd.begin(); - for (; it != pData->pBindObject->vSubWLWnd.end(); ++it) - { - CONTROL_TYPE eControlType = it->m_eControlType; - if (eControlType == CT_WL_RECTCTRL - || eControlType == CT_WL_SPLITTER - || eControlType == CT_WL_LINE - || eControlType == CT_WL_TEXT - || eControlType == CT_WL_PICTURE - || eControlType == CT_WL_BUTTON - || eControlType == CT_WL_CHECK - || eControlType == CT_WL_RADIO - || eControlType == CT_WL_SLIDER - || eControlType == CT_WL_RICHEDIT - || eControlType == CT_WL_RICHEDIT_IM - || eControlType == CT_TASK_WND_MGR - || eControlType == CT_PNL_DOCK - || eControlType == CT_UNIFORM_GRID - || eControlType == CT_PNL_STACK) + if (!pWLWnd->IsCreated()) { - CWLWnd *pWLWnd = (CWLWnd *)it->m_pChildCtrl; - - if (!pWLWnd->IsCreated()) - { - continue; - } + continue; + } - if (pWLWnd->IsWindowVisible()) - { - //pWLWnd->SetDrawOffset(rcItem.TopLeft()); + if (pWLWnd->IsWindowVisible()) + { + //pWLWnd->SetDrawOffset(rcItem.TopLeft()); - // Apply child's region. - HRGN hOldRgn = ApplyWLRgn(this, pDC, pWLWnd); + // Apply child's region. + HRGN hOldRgn = ApplyWLRgn(this, pDC, pWLWnd); - DrawWLWindow(pDC->GetSafeHdc(), pWLWnd); + DrawWLWindow(pDC->GetSafeHdc(), pWLWnd); - ::SelectClipRgn(pDC->GetSafeHdc(), hOldRgn); - DeleteObject(hOldRgn); - } + ::SelectClipRgn(pDC->GetSafeHdc(), hOldRgn); + DeleteObject(hOldRgn); } } } } } } - else - { - // Draw button and image - OnDrawItemIcon(pDC, hItem, rcItem, rcText, nLeftMargin); + } + else + { + // Draw button and image + OnDrawItemIcon(pDC, hItem, rcItem, rcText, nLeftMargin); - // Draw text - OnDrawText(pDC, hItem, rcItem, rcText, nLeftMargin); - } + // Draw text + OnDrawText(pDC, hItem, rcItem, rcText, nLeftMargin); } // Draw focus rect @@ -5686,122 +3556,3 @@ BOOL CSkinTreeCtrl::IsHoverScrollBarMode() const return pMember->m_bHoverScrollBarMode; } - -int CSkinTreeCtrl::AnimateContent(std::vector &vAnimationData, int nElapse/*ms*/, BOOL bTogetherAnimate) -{ - TREEMEMBER *pMember = (TREEMEMBER *)m_pMember; - - if (vAnimationData.size() == 0) - { - return -1; - } - - pMember->m_bAnimationMode = true; - pMember->m_bTogetherAnimation = bTogetherAnimate; - pMember->m_nCurTimerTick = 0; - pMember->m_vAnimationData = vAnimationData; - - SetTimer(IDTT_ANIMATION_CONTENT, nElapse, NULL); - - return 0; -} - -HTREEITEM CSkinTreeCtrl::AnimateInsertItem(LPCTSTR lpszItem, int nItemHeight, - DWORD dwItemData, std::vector &vAnimationData, - int nElapse/*ms*/, HTREEITEM hParent/* = TVI_ROOT*/, HTREEITEM hInsertAfter/* = TVI_LAST*/) -{ - TREEMEMBER *pMember = (TREEMEMBER *)m_pMember; - - if (vAnimationData.size() == 0) - { - return NULL; - } - - pMember->m_bAnimationInsertItem = true; - pMember->m_hInsertItem = InsertItem(lpszItem, hParent, hInsertAfter); - if (pMember->m_hInsertItem == NULL) - { - pMember->m_bAnimationInsertItem = false; - return NULL; - } - EnsureVisible(pMember->m_hInsertItem); - - SetItemHeightEx(pMember->m_hInsertItem, nItemHeight); - SetItemData(pMember->m_hInsertItem, dwItemData); - - pMember->m_vInsertItemAnimationData = vAnimationData; - SetTimer(IDTT_INSERT_ITEM, nElapse, NULL); - - return pMember->m_hInsertItem; -} - -// Not delete item. -int CSkinTreeCtrl::AnimateRemoveItem(HTREEITEM hItem, std::vector &vAnimationData, int nElapse/*ms*/) -{ - TREEMEMBER *pMember = (TREEMEMBER *)m_pMember; - - if (vAnimationData.size() == 0) - { - return -1; - } - - pMember->m_bAnimateRemoveMode = true; - pMember->m_hRemoveItem = hItem; - pMember->m_vRemoveItemAnimationData = vAnimationData; - pMember->m_nCurRemoveItemTimerTick = 0; - - SetTimer(IDTT_REMOVE_ITEM, nElapse, NULL); - - return 0; -} - -int CSkinTreeCtrl::AnimateDeleteItem(HTREEITEM hItem, std::vector &vAnimationData, int nElapse/*ms*/) -{ - TREEMEMBER *pMember = (TREEMEMBER *)m_pMember; - - if (vAnimationData.size() == 0) - { - return -1; - } - - int nHeight = GetItemHeightEx(hItem); - if (nHeight == -1) - { - return -2; - } - - pMember->m_hDeletedItem = hItem; - pMember->m_vDeletedItemAnimationData = vAnimationData; - pMember->m_nCurDeleteItemTimerTick = 0; - - SetTimer(IDTT_DELETE_ITEM, nElapse, NULL); - - return 0; -} - -int CSkinTreeCtrl::AnimateVerticalScroll(std::vector &vAnimationData, int nElapse/*ms*/) -{ - TREEMEMBER *pMember = (TREEMEMBER *)m_pMember; - - if (vAnimationData.size() == 0) - { - return -1; - } - - SCROLLINFO siv = {0}; - siv.cbSize = sizeof(SCROLLINFO); - siv.fMask = SIF_ALL; - GetScrollInfo(SB_VERT, &siv); - - if (siv.nPos + (int)siv.nPage >= siv.nMax - siv.nMin) - { - return -2; // Already scroll to end. - } - - pMember->m_nCurVerScrollTimerTick = 0; - pMember->m_vVerScrollAnimationData = vAnimationData; - - SetTimer(IDTT_VER_SCROLL, nElapse, NULL); - - return 0; -} diff --git a/LibUIDK/SliderCtrlEx.cpp b/LibUIDK/SliderCtrlEx.cpp index e890932..273ebdc 100644 --- a/LibUIDK/SliderCtrlEx.cpp +++ b/LibUIDK/SliderCtrlEx.cpp @@ -93,10 +93,6 @@ int CSliderCtrlEx::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetImages(CONTROL_STATE_UNCHECKED_ALL, strImageName[1], strImageName[2], strImageName[3], strImageName[4]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } SetBkImageResizeMode(pCtrlProp->m_eBkImageResizeMode); SetBkImageResizePoint(pCtrlProp->m_ptImageResize); diff --git a/LibUIDK/SplitterBar.cpp b/LibUIDK/SplitterBar.cpp index fe6ef03..37668fe 100644 --- a/LibUIDK/SplitterBar.cpp +++ b/LibUIDK/SplitterBar.cpp @@ -532,10 +532,6 @@ int CSplitterBar::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetBkImages(CONTROL_STATE_UNCHECKED_ALL, strImageName[1], strImageName[2], strImageName[3], strImageName[4]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } SetOrientation(((SPLITTERPROPERTIES *)pCtrlProp)->m_eOrientation); diff --git a/LibUIDK/TaskWndMgr.cpp b/LibUIDK/TaskWndMgr.cpp index 46f3f20..6fde804 100644 --- a/LibUIDK/TaskWndMgr.cpp +++ b/LibUIDK/TaskWndMgr.cpp @@ -376,6 +376,12 @@ int CTaskWndMgr::AddTaskWindow( LPCTSTR lpszWindowName/* = NULL*/, DWORD dwStyle/* = WS_TASKSTYLE*/) { + if (NULL == pTaskPanel) + { + _ASSERT(FALSE); + return -1; + } + TASKWNDMGRMEMBER *pMember = (TASKWNDMGRMEMBER *)m_pMember; CTaskWndInfo twi; diff --git a/LibUIDK/TreeListCtrl.cpp b/LibUIDK/TreeListCtrl.cpp index fb07dcf..6176f8b 100644 --- a/LibUIDK/TreeListCtrl.cpp +++ b/LibUIDK/TreeListCtrl.cpp @@ -792,10 +792,6 @@ int CTreeListCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetBkImage(CONTROL_STATE_CHECKED_ALL, strImageName[1], strImageName[2]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE2; ++i) - { - ReleaseIUIImage(strImageName[i]); - } SetBkImageResizeMode(pCtrlProp->m_eBkImageResizeMode); SetBkImageResizePoint(pCtrlProp->m_ptImageResize); diff --git a/LibUIDK/UIMgr.cpp b/LibUIDK/UIMgr.cpp index 8737862..ac38534 100644 --- a/LibUIDK/UIMgr.cpp +++ b/LibUIDK/UIMgr.cpp @@ -6532,71 +6532,71 @@ int GetExportProcAddress() #if (_MSC_VER <= 1310) // VC2003 HMODULE hComCtrl32 = LoadLibrary(_T("ComCtl32.dll")); - IUI_DPA_InsertPtr = (fnDPA_InsertPtr)GetProcAddress(hComCtrl32, "DPA_InsertPtr"); + IUI_DPA_InsertPtr = (fnDPA_InsertPtr)GetProcAddress(hComCtrl32, _T("DPA_InsertPtr")); _ASSERT(IUI_DPA_InsertPtr != NULL); - IUI_DPA_DeletePtr = (fnDPA_DeletePtr)GetProcAddress(hComCtrl32, "DPA_DeletePtr"); + IUI_DPA_DeletePtr = (fnDPA_DeletePtr)GetProcAddress(hComCtrl32, _T("DPA_DeletePtr")); _ASSERT(IUI_DPA_DeletePtr != NULL); - IUI_DPA_GetPtr = (fnDPA_GetPtr)GetProcAddress(hComCtrl32, "DPA_GetPtr"); + IUI_DPA_GetPtr = (fnDPA_GetPtr)GetProcAddress(hComCtrl32, _T("DPA_GetPtr")); _ASSERT(IUI_DPA_GetPtr != NULL); - IUI_DPA_SetPtr = (fnDPA_SetPtr)GetProcAddress(hComCtrl32, "DPA_SetPtr"); + IUI_DPA_SetPtr = (fnDPA_SetPtr)GetProcAddress(hComCtrl32, _T("DPA_SetPtr")); _ASSERT(IUI_DPA_SetPtr != NULL); - IUI_DPA_EnumCallback = (fnDPA_EnumCallback)GetProcAddress(hComCtrl32, "DPA_EnumCallback"); + IUI_DPA_EnumCallback = (fnDPA_EnumCallback)GetProcAddress(hComCtrl32, _T("DPA_EnumCallback")); _ASSERT(IUI_DPA_EnumCallback != NULL); - IUI_DPA_DeleteAllPtrs = (fnDPA_DeleteAllPtrs)GetProcAddress(hComCtrl32, "DPA_DeleteAllPtrs"); + IUI_DPA_DeleteAllPtrs = (fnDPA_DeleteAllPtrs)GetProcAddress(hComCtrl32, _T("DPA_DeleteAllPtrs")); _ASSERT(IUI_DPA_DeleteAllPtrs != NULL); - IUI_DPA_DestroyCallback = (fnDPA_DestroyCallback)GetProcAddress(hComCtrl32, "DPA_DestroyCallback"); + IUI_DPA_DestroyCallback = (fnDPA_DestroyCallback)GetProcAddress(hComCtrl32, _T("DPA_DestroyCallback")); _ASSERT(IUI_DPA_DestroyCallback != NULL); - IUI_DPA_Destroy = (fnDPA_Destroy)GetProcAddress(hComCtrl32, "DPA_Destroy"); + IUI_DPA_Destroy = (fnDPA_Destroy)GetProcAddress(hComCtrl32, _T("DPA_Destroy")); _ASSERT(IUI_DPA_Destroy != NULL); - IUI_DPA_Sort = (fnDPA_Sort)GetProcAddress(hComCtrl32, "DPA_Sort"); + IUI_DPA_Sort = (fnDPA_Sort)GetProcAddress(hComCtrl32, _T("DPA_Sort")); _ASSERT(IUI_DPA_Sort != NULL); - IUI_DPA_Create = (fnDPA_Create)GetProcAddress(hComCtrl32, "DPA_Create"); + IUI_DPA_Create = (fnDPA_Create)GetProcAddress(hComCtrl32, _T("DPA_Create")); _ASSERT(IUI_DPA_Create != NULL); - IUI_DPA_CreateEx = (fnDPA_CreateEx)GetProcAddress(hComCtrl32, "DPA_CreateEx"); + IUI_DPA_CreateEx = (fnDPA_CreateEx)GetProcAddress(hComCtrl32, _T("DPA_CreateEx")); _ASSERT(IUI_DPA_CreateEx != NULL); - IUI_DPA_Grow = (fnDPA_Grow)GetProcAddress(hComCtrl32, "DPA_Grow"); + IUI_DPA_Grow = (fnDPA_Grow)GetProcAddress(hComCtrl32, _T("DPA_Grow")); _ASSERT(IUI_DPA_Grow != NULL); - IUI_DPA_Clone = (fnDPA_Clone)GetProcAddress(hComCtrl32, "DPA_Clone"); + IUI_DPA_Clone = (fnDPA_Clone)GetProcAddress(hComCtrl32, _T("DPA_Clone")); _ASSERT(IUI_DPA_Clone != NULL); - IUI_DPA_GetPtrIndex = (fnDPA_GetPtrIndex)GetProcAddress(hComCtrl32, "DPA_GetPtrIndex"); + IUI_DPA_GetPtrIndex = (fnDPA_GetPtrIndex)GetProcAddress(hComCtrl32, _T("DPA_GetPtrIndex")); _ASSERT(IUI_DPA_GetPtrIndex != NULL); // DSA_* - IUI_DSA_Destroy = (fnDSA_Destroy)GetProcAddress(hComCtrl32, "DSA_Destroy"); + IUI_DSA_Destroy = (fnDSA_Destroy)GetProcAddress(hComCtrl32, _T("DSA_Destroy")); _ASSERT(IUI_DSA_Destroy != NULL); - IUI_DSA_GetItemPtr = (fnDSA_GetItemPtr)GetProcAddress(hComCtrl32, "DSA_GetItemPtr"); + IUI_DSA_GetItemPtr = (fnDSA_GetItemPtr)GetProcAddress(hComCtrl32, _T("DSA_GetItemPtr")); _ASSERT(IUI_DSA_GetItemPtr != NULL); - IUI_DSA_InsertItem = (fnDSA_InsertItem)GetProcAddress(hComCtrl32, "DSA_InsertItem"); + IUI_DSA_InsertItem = (fnDSA_InsertItem)GetProcAddress(hComCtrl32, _T("DSA_InsertItem")); _ASSERT(IUI_DSA_InsertItem != NULL); - IUI_DSA_Create = (fnDSA_Create)GetProcAddress(hComCtrl32, "DSA_Create"); + IUI_DSA_Create = (fnDSA_Create)GetProcAddress(hComCtrl32, _T("DSA_Create")); _ASSERT(IUI_DSA_Create != NULL); - IUI_DSA_GetItem = (fnDSA_GetItem)GetProcAddress(hComCtrl32, "DSA_GetItem"); + IUI_DSA_GetItem = (fnDSA_GetItem)GetProcAddress(hComCtrl32, _T("DSA_GetItem")); _ASSERT(IUI_DSA_GetItem != NULL); - IUI_DSA_SetItem = (fnDSA_SetItem)GetProcAddress(hComCtrl32, "DSA_SetItem"); + IUI_DSA_SetItem = (fnDSA_SetItem)GetProcAddress(hComCtrl32, _T("DSA_SetItem")); _ASSERT(IUI_DSA_SetItem != NULL); - IUI_DSA_DeleteItem = (fnDSA_DeleteItem)GetProcAddress(hComCtrl32, "DSA_DeleteItem"); + IUI_DSA_DeleteItem = (fnDSA_DeleteItem)GetProcAddress(hComCtrl32, _T("DSA_DeleteItem")); _ASSERT(IUI_DSA_DeleteItem != NULL); - IUI_DSA_DestroyCallback = (fnDSA_DestroyCallback)GetProcAddress(hComCtrl32, "DSA_DestroyCallback"); + IUI_DSA_DestroyCallback = (fnDSA_DestroyCallback)GetProcAddress(hComCtrl32, _T("DSA_DestroyCallback")); _ASSERT(IUI_DSA_DestroyCallback != NULL); FreeLibrary(hComCtrl32); @@ -6604,7 +6604,7 @@ int GetExportProcAddress() HMODULE hKernel32 = LoadLibrary(_T("Kernel32.dll")); - IUI_ReleaseActCtx = (fnReleaseActCtx)GetProcAddress(hKernel32, "ReleaseActCtx"); + IUI_ReleaseActCtx = (fnReleaseActCtx)GetProcAddress(hKernel32, _T("ReleaseActCtx")); _ASSERT(IUI_ReleaseActCtx != NULL); FreeLibrary(hKernel32); @@ -6644,32 +6644,19 @@ int CUIMgr::SetUIPath(LPCTSTR lpszUIPath, BOOL bCheckVersion/* = TRUE*/) ASSERT(lpszUIPath != NULL); ASSERT(AfxIsValidString(lpszUIPath)); - BOOL bIsAbsolutePath = FALSE; - int nLen = (int)_tcslen(lpszUIPath); - int i = 0; - for (i = 0; i < nLen; ++i) - { - if (lpszUIPath[i] == ':') - { - bIsAbsolutePath = TRUE; - break; - } - } + BOOL bIsRelativePath = PathIsRelative(lpszUIPath); - if (bIsAbsolutePath) + if (bIsRelativePath) { - m_strUIPath = lpszUIPath; + TCHAR szFullName[MAX_PATH] = {0}; + GetModuleFileName(NULL, szFullName, MAX_PATH - 1); + PathRemoveFileSpec(szFullName); + PathAppend(szFullName, lpszUIPath); + m_strUIPath = szFullName; } else { - TCHAR szFullName[MAX_PATH] = {0}; - GetModuleFileName(NULL, szFullName, MAX_PATH - 1); - TCHAR szDisc[_MAX_PATH] = {0}; - TCHAR szPath[_MAX_PATH] = {0}; - TSPLITPATH(szFullName, szDisc, _MAX_PATH, szPath, _MAX_PATH, NULL, 0, NULL, 0); - TSTRCAT(szDisc, _MAX_PATH, szPath); - m_strUIPath = szDisc; - m_strUIPath += lpszUIPath; + m_strUIPath = lpszUIPath; } if (!PathFileExists(m_strUIPath)) diff --git a/LibUIDK/UIWnd.cpp b/LibUIDK/UIWnd.cpp index a1b48ff..19fc517 100644 --- a/LibUIDK/UIWnd.cpp +++ b/LibUIDK/UIWnd.cpp @@ -1958,7 +1958,12 @@ int CUIWnd::AlphaBlendBkImageAndColor() if (pMember->m_himgOrigBk->GetSafeHBITMAP() == NULL) { - return 1; + pMember->m_himgOrigBk->SafeLoadSavedImage(); + + if (pMember->m_himgOrigBk->GetSafeHBITMAP() == NULL) + { + return 1; + } } CClientDC dc(this); @@ -1988,7 +1993,7 @@ int CUIWnd::AlphaBlendBkImageAndColor() ReleaseIUIImage(pMember->m_himgBK); AddCustomImage(_T("IDC_IMG_BK"), (HBITMAP)bmpDest.Detach()); pMember->m_himgBK = CreateIUIImage(_T("IDC_IMG_BK")); - ReleaseIUIImage(_T("IDC_IMG_BK")); + ReleaseIUIImage(pMember->m_himgBK); if (hFontOld != NULL) { diff --git a/LibUIDK/UIWndBase.cpp b/LibUIDK/UIWndBase.cpp index 6b709fc..f161032 100644 --- a/LibUIDK/UIWndBase.cpp +++ b/LibUIDK/UIWndBase.cpp @@ -102,7 +102,8 @@ CUIWndBase::~CUIWndBase() if (m_himgBK != NULL) { - ReleaseIUIImage(m_himgBK->GetSafeImageName()); + ReleaseIUIImage(m_himgBK); + m_himgBK = NULL; } if (m_pMember != NULL) diff --git a/LibUIDK/Utils.h b/LibUIDK/Utils.h index f7610bf..8544a6e 100644 --- a/LibUIDK/Utils.h +++ b/LibUIDK/Utils.h @@ -357,7 +357,7 @@ namespace LibUIDK #define NearSize(pb) LocalSize(pb) //L -#define IncrementSearchFree(pis) ((pis)->pszCharBuf ? free((pis)->pszCharBuf) : 0) +#define IncrementSearchFree(pis) ((pis)->pszCharBuf ? free((pis)->pszCharBuf) : (void)0) ////////////////////////////////////////////////////////////////////////// // mem.h diff --git a/LibUIDK/WLSliderCtrl.cpp b/LibUIDK/WLSliderCtrl.cpp index 162a871..723289d 100644 --- a/LibUIDK/WLSliderCtrl.cpp +++ b/LibUIDK/WLSliderCtrl.cpp @@ -121,10 +121,6 @@ int CWLSliderCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) SetImages(CONTROL_STATE_CHECKED_ALL, strImageName[1], strImageName[2], strImageName[3], strImageName[4]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE4; ++i) - { - ReleaseIUIImage(strImageName[i]); - } } // Thumb images diff --git a/LibUIDK/WLText.cpp b/LibUIDK/WLText.cpp index c1b7f7d..f35bf62 100644 --- a/LibUIDK/WLText.cpp +++ b/LibUIDK/WLText.cpp @@ -214,10 +214,6 @@ int CWLText::BindStyle(const CTRLPROPERTIES *pCtrlProp) { SetBitmap(CONTROL_STATE_UNCHECKED_ND, strImageName[1], strImageName[2]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE2; ++i) - { - ReleaseIUIImage(strImageName[i]); - } SetBkImageResizeMode(pCtrlProp->m_eBkImageResizeMode); SetBkImageResizePoint(pCtrlProp->m_ptImageResize); diff --git a/LibUIDK/WaveCtrl.cpp b/LibUIDK/WaveCtrl.cpp index 7027ecb..a10778e 100644 --- a/LibUIDK/WaveCtrl.cpp +++ b/LibUIDK/WaveCtrl.cpp @@ -175,10 +175,6 @@ int CWaveCtrl::BindStyle(const CTRLPROPERTIES *pCtrlProp) { SetBkImage(CONTROL_STATE_NORMAL | CONTROL_STATE_DISABLED, strImageName[1], strImageName[2]); } - for (int i = 0; i < 1 + COMBINEIMAGESIZE2; ++i) - { - ReleaseIUIImage(strImageName[i]); - } SetBkImageResizeMode(pCtrlProp->m_eBkImageResizeMode); SetBkImageResizePoint(pCtrlProp->m_ptImageResize); diff --git a/LibUIDK/tvmem.cpp b/LibUIDK/tvmem.cpp index 63525be..25f7718 100644 --- a/LibUIDK/tvmem.cpp +++ b/LibUIDK/tvmem.cpp @@ -320,7 +320,7 @@ BOOL NEAR PASCAL TV_CreateRoot(PTREE pTree) void NEAR DumpItem(TREEITEM FAR *hItem) { - LPTSTR p; + LPCTSTR p; if (hItem->lpstr == LPSTR_TEXTCALLBACK) { diff --git a/UIShop/ClassWizardDlg.cpp b/UIShop/ClassWizardDlg.cpp index 206dd9d..fe286ff 100644 --- a/UIShop/ClassWizardDlg.cpp +++ b/UIShop/ClassWizardDlg.cpp @@ -33,7 +33,6 @@ CClassWizardDlg::CClassWizardDlg(CWnd *pParent /*=NULL*/) { //{{AFX_DATA_INIT(CClassWizardDlg) //}}AFX_DATA_INIT - m_uCodeStyle = IDC_RAD_VC_NET; memset(m_szBrowseRoot, 0, sizeof(TCHAR) * MAX_PATH); } @@ -88,16 +87,6 @@ int CClassWizardDlg::SaveSettings() // .Cpp file WritePrivateProfileString(m_strWindowID, g_lpszClassCppFile, m_strCppFile, strFile); - // Code style - if (m_uCodeStyle == IDC_RAD_VC6) - { - WritePrivateProfileString(m_strWindowID, g_lpszCodeStyleVC6, _T("1"), strFile); - } - else - { - WritePrivateProfileString(m_strWindowID, g_lpszCodeStyleVC6, _T("0"), strFile); - } - return 0; } @@ -137,19 +126,6 @@ BOOL CClassWizardDlg::OnInitDialog() m_strCppFile = szClassCppFile; } - // Check code style - CButton *pBtnVC6 = (CButton *)GetDlgItem(IDC_RAD_VC6); - CButton *pBtnVCNET = (CButton *)GetDlgItem(IDC_RAD_VC_NET); - BOOL bCodeStyleVC6 = GetPrivateProfileInt(m_strWindowID, g_lpszCodeStyleVC6, 0, strFile); - if (bCodeStyleVC6) - { - pBtnVC6->SetCheck(BST_CHECKED); - } - else - { - pBtnVCNET->SetCheck(BST_CHECKED); - } - // Init location TCHAR szLocation[MAX_PATH] = {0}; GetPrivateProfileString(g_lpszClassWizardSection, g_lpszLocationKey, _T(""), szLocation, MAX_PATH, strFile); @@ -223,8 +199,6 @@ void CClassWizardDlg::OnOK() return; } - m_uCodeStyle = GetCheckedRadioButton(IDC_RAD_VC6, IDC_RAD_VC_NET); - // Save to configuration file SaveSettings(); @@ -297,7 +271,7 @@ void CClassWizardDlg::OnBnClickedBtnGoto() return; } - int nRet = (int)ShellExecute(NULL, _T("open"), m_strLocation, NULL, NULL, SW_SHOW); + INT_PTR nRet = (INT_PTR)ShellExecute(NULL, _T("open"), m_strLocation, NULL, NULL, SW_SHOW); if (nRet > 32) { return; // Successful. @@ -406,19 +380,6 @@ void CClassWizardDlg::OnBnClickedBtnMerge() // .cpp File classGen.m_Dictionary[_T("CppFile")] = m_strCppFile; - // Code Style - switch (m_uCodeStyle) - { - case IDC_RAD_VC6: - classGen.m_Dictionary[_T("CODESTYLE_VC60")] = _T("1"); - break; - case IDC_RAD_VC_NET: - classGen.m_Dictionary[_T("CODESTYLE_VCNET")] = _T("1"); - break; - default: - break; - } - // Generate event handler if (m_bGenEventHandler) { diff --git a/UIShop/ClassWizardDlg.h b/UIShop/ClassWizardDlg.h index 59d785a..ad21d2c 100644 --- a/UIShop/ClassWizardDlg.h +++ b/UIShop/ClassWizardDlg.h @@ -25,7 +25,6 @@ class CClassWizardDlg : public CDialog BOOL m_bGenVariable; BOOL m_bGenDoDataExchange; //}}AFX_DATA - UINT m_uCodeStyle; TCHAR m_szBrowseRoot[MAX_PATH]; protected: diff --git a/UIShop/ControlWnd.cpp b/UIShop/ControlWnd.cpp index b7d05e0..5591173 100644 --- a/UIShop/ControlWnd.cpp +++ b/UIShop/ControlWnd.cpp @@ -38,6 +38,9 @@ CControlWnd::CControlWnd() m_nIndex = 0; m_pCtrlProperties = NULL; + m_hImgCombine = NULL; + m_hImgNormal = NULL; + m_hForeground = NULL; m_pMoveSender = NULL; m_nXMove = 0; m_nYMove = 0; @@ -57,6 +60,7 @@ CControlWnd::~CControlWnd() BEGIN_MESSAGE_MAP(CControlWnd, CWnd) //{{AFX_MSG_MAP(CControlWnd) ON_WM_CREATE() + ON_WM_DESTROY() ON_WM_PAINT() ON_WM_NCHITTEST() ON_WM_GETMINMAXINFO() @@ -98,6 +102,28 @@ int CControlWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) return 0; } +void CControlWnd::OnDestroy() +{ + CWnd::OnDestroy(); + + // TODO: Add your message handler code here + if (NULL != m_hImgCombine) + { + ReleaseIUIImage(m_hImgCombine); + m_hImgCombine = NULL; + } + if (NULL != m_hImgNormal) + { + ReleaseIUIImage(m_hImgNormal); + m_hImgNormal = NULL; + } + if (NULL != m_hForeground) + { + ReleaseIUIImage(m_hForeground); + m_hForeground = NULL; + } +} + int GetControlPreviewFont(HFONT *phFont, const CTRLPROPERTIES *pCtrlProp) { if (phFont == NULL) @@ -277,34 +303,40 @@ int CControlWnd::DrawControlImage( if (bCombineBk) { - HIUIIMAGE hImgNormal = CreateIUIImage(strBmpNormal[0]); + if (NULL == m_hImgCombine) + { + m_hImgCombine = CreateIUIImage(strBmpNormal[0]); + } - if (hImgNormal->GetSafeHBITMAP() != NULL) + if (m_hImgCombine->GetSafeHBITMAP() != NULL) { if (eBkImgResizeMode == IRM_9GRID) { - IUIPartNineGridBlt(pDC->GetSafeHdc(), rcDest, hImgNormal, + IUIPartNineGridBlt(pDC->GetSafeHdc(), rcDest, m_hImgCombine, pCtrlProp->m_ptImageResize, pCtrlProp->m_uXRepeatPixel, pCtrlProp->m_uYRepeatPixel, nPart, 0); } else if (eBkImgResizeMode == IRM_STRETCH || eBkImgResizeMode == IRM_STRETCH_HIGH_QUALITY) { - IUIPartStretchBlt(pDC->GetSafeHdc(), rcDest, hImgNormal, nPart, 0, + IUIPartStretchBlt(pDC->GetSafeHdc(), rcDest, m_hImgCombine, nPart, 0, eBkImgResizeMode); } } } else { - HIUIIMAGE hImgNormal = CreateIUIImage(strBmpNormal[1]); + if (NULL == m_hImgNormal) + { + m_hImgNormal = CreateIUIImage(strBmpNormal[1]); + } - if (hImgNormal->GetSafeHBITMAP() != NULL) + if (m_hImgNormal->GetSafeHBITMAP() != NULL) { if (eBkImgResizeMode == IRM_9GRID) { IUINineGridBltEx(pDC->GetSafeHdc(), rcDest, - hImgNormal, + m_hImgNormal, pCtrlProp->m_ptImageResize, pCtrlProp->m_uXRepeatPixel, pCtrlProp->m_uYRepeatPixel, -1, (BYTE)(LONG)pCtrlProp->m_lBkImgTransparent); } @@ -312,18 +344,18 @@ int CControlWnd::DrawControlImage( || eBkImgResizeMode == IRM_STRETCH_HIGH_QUALITY) { IUIAlphaStretchBlt(pDC->GetSafeHdc(), rcDest, - hImgNormal, (BYTE)(LONG)pCtrlProp->m_lBkImgTransparent, + m_hImgNormal, (BYTE)(LONG)pCtrlProp->m_lBkImgTransparent, eBkImgResizeMode); } else if (eBkImgResizeMode == IRM_CENTER) { IUIBitBlt( pDC->GetSafeHdc(), - (rcWnd.Width() - hImgNormal->GetWidth()) / 2, - (rcWnd.Height() - hImgNormal->GetHeight()) / 2, - hImgNormal->GetWidth(), - hImgNormal->GetHeight(), - hImgNormal, + (rcWnd.Width() - m_hImgNormal->GetWidth()) / 2, + (rcWnd.Height() - m_hImgNormal->GetHeight()) / 2, + m_hImgNormal->GetWidth(), + m_hImgNormal->GetHeight(), + m_hImgNormal, 0, 0, SRCCOPY); @@ -333,7 +365,6 @@ int CControlWnd::DrawControlImage( } // Draw foreground image of the control - HIUIIMAGE hForeground; BOOL bCombineFg = TRUE; CString strFgImageName[9]; FOREGROUND_ALIGN_HOR eFah = FAH_CENTER; @@ -377,16 +408,16 @@ int CControlWnd::DrawControlImage( if (bCombineFg) { - hForeground = CreateIUIImage(strFgImageName[0]); - IUIPartDrawForeground(pDC->GetSafeHdc(), rcClient, rcForegroundMargin, hForeground, - CRect(0, 0, hForeground->GetWidth() / nPartCount, hForeground->GetHeight()), + m_hForeground = CreateIUIImage(strFgImageName[0]); + IUIPartDrawForeground(pDC->GetSafeHdc(), rcClient, rcForegroundMargin, m_hForeground, + CRect(0, 0, m_hForeground->GetWidth() / nPartCount, m_hForeground->GetHeight()), eFah, eFav, RGB(255, 0, 255), 255); } else { - hForeground = CreateIUIImage(strFgImageName[1]); + m_hForeground = CreateIUIImage(strFgImageName[1]); IUIDrawForeground(pDC->GetSafeHdc(), - rcClient, rcForegroundMargin, hForeground, eFah, eFav, RGB(255, 0, 255), 255); + rcClient, rcForegroundMargin, m_hForeground, eFah, eFav, RGB(255, 0, 255), 255); } } @@ -1257,12 +1288,12 @@ void CControlWnd::OnNcLButtonDown(UINT nHitTest, CPoint point) } else { - const std::vector *pPropIndex = g_pFrm->GetFormatBrushPropIndex(); + const std::vector *pPropIndex = g_pFrm->GetFormatBrushPropIndex(); - int nIndexCount = pPropIndex->size(); + size_t nIndexCount = pPropIndex->size(); for (int i = 0; i < nIndexCount; ++i) { - int nIndex = (*pPropIndex)[i]; // The nIndex prop need be format. + INT nIndex = (INT)(INT_PTR)(*pPropIndex)[i]; // The nIndex prop need be format. const IUI_VARIANT *pVar = pFormatBrush->GetProperty(nIndex); m_pCtrlProperties->SetProperty(nIndex, pVar); } diff --git a/UIShop/ControlWnd.h b/UIShop/ControlWnd.h index afd02f1..a815b52 100644 --- a/UIShop/ControlWnd.h +++ b/UIShop/ControlWnd.h @@ -44,6 +44,7 @@ class CControlWnd : public CWnd afx_msg void OnRButtonUp(UINT nFlags, CPoint point); afx_msg void OnCtrlProperties(); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnDestroy(); afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); afx_msg void OnMoving(UINT fwSide, LPRECT pRect); afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI); @@ -76,6 +77,9 @@ class CControlWnd : public CWnd protected: // control's properties CTRLPROPERTIES *m_pCtrlProperties; + HIUIIMAGE m_hImgCombine; + HIUIIMAGE m_hImgNormal; + HIUIIMAGE m_hForeground; public: // General properties diff --git a/UIShop/EventHandlerWizardDlg.cpp b/UIShop/EventHandlerWizardDlg.cpp index a3b122a..eeb0f80 100644 --- a/UIShop/EventHandlerWizardDlg.cpp +++ b/UIShop/EventHandlerWizardDlg.cpp @@ -27,7 +27,6 @@ CEventHandlerWizardDlg::CEventHandlerWizardDlg(CWnd *pParent /*=NULL*/) , m_strLocation(_T("")) , m_strMergeTool(_T("")) { - m_uCodeStyle = IDC_RAD_VC_NET; memset(m_szBrowseRoot, 0, sizeof(TCHAR) * MAX_PATH); } @@ -69,8 +68,6 @@ int CEventHandlerWizardDlg::SaveSettings() CString strFile = CUIMgr::GetUIPathWithoutTitle() + _T("Settings.ini"); WritePrivateProfileString(g_lpszEventHandlerWizardSection, g_lpszLocationKey, m_strLocation, strFile); - WritePrivateProfileString(g_lpszEventHandlerWizardSection, - g_lpszCodeStyleVC6, (m_uCodeStyle == IDC_RAD_VC6) ? _T("1") : _T("0"), strFile); WritePrivateProfileString(g_lpszEventHandlerWizardSection, g_lpszMergeToolPath, m_strMergeTool, strFile); @@ -203,8 +200,6 @@ void CEventHandlerWizardDlg::OnOK() return; } - m_uCodeStyle = GetCheckedRadioButton(IDC_RAD_VC6, IDC_RAD_VC_NET); - // Save to configuration file SaveSettings(); @@ -277,7 +272,7 @@ void CEventHandlerWizardDlg::OnBnClickedBtnGoto() return; } - int nRet = (int)ShellExecute(NULL, _T("open"), m_strLocation, NULL, NULL, SW_SHOW); + INT_PTR nRet = (INT_PTR)ShellExecute(NULL, _T("open"), m_strLocation, NULL, NULL, SW_SHOW); if (nRet > 32) { return; // Successful. diff --git a/UIShop/FileView.cpp b/UIShop/FileView.cpp index 253a473..6bf7e53 100644 --- a/UIShop/FileView.cpp +++ b/UIShop/FileView.cpp @@ -127,7 +127,7 @@ int OpenFolderAndSelectItems(LPCWSTR lpsFolder, LPCWSTR *lpsItems, int nCount) HINSTANCE hRet = ShellExecute(NULL, TEXT("open"), TEXT("explorer.exe"), strParam, NULL, SW_SHOWNORMAL); - if ((UINT)hRet <= HINSTANCE_ERROR) + if ((UINT_PTR)hRet <= HINSTANCE_ERROR) { return -1; } @@ -209,8 +209,10 @@ BEGIN_MESSAGE_MAP(CFileView, CDockablePane) ON_UPDATE_COMMAND_UI(IDSM_ADD_CLASS, &CFileView::OnUpdateAddClass) ON_COMMAND(IDSM_ADD_ALL_CLASSES, &CFileView::OnAddAllClasses) ON_UPDATE_COMMAND_UI(IDSM_ADD_ALL_CLASSES, &CFileView::OnUpdateAddAllClasses) +#ifdef ADV ON_COMMAND(IDSM_ADD_EVENT_HANDLER_CLASS, &CFileView::OnAddEventHandlerClass) ON_UPDATE_COMMAND_UI(IDSM_ADD_EVENT_HANDLER_CLASS, &CFileView::OnUpdateAddEventHandlerClass) +#endif ON_COMMAND(IDSM_ADD_ALL_EVENT_HANDLER_CLASSES, &CFileView::OnAddAllEventHandlerClasses) ON_UPDATE_COMMAND_UI(IDSM_ADD_ALL_EVENT_HANDLER_CLASSES, &CFileView::OnUpdateAddAllEventHandlerClasses) ON_COMMAND(IDSM_INSERT_GENERAL_FONT, &CFileView::OnInsertGeneralFont) @@ -242,7 +244,7 @@ int CFileView::InsertWindowsGroup(HTREEITEM hRoot) // set item data to tree item TREE_ITEMDATA *pData = new TREE_ITEMDATA; pData->eTreeItemType = WINDOWS_ROOT; - m_treeWindow.SetItemData(m_hWindowsRoot, (DWORD)pData); + m_treeWindow.SetItemData(m_hWindowsRoot, (DWORD_PTR)pData); UpdateUIWindowsCount(); } @@ -260,7 +262,7 @@ int CFileView::InsertWindowsGroup(HTREEITEM hRoot) // set item data to tree item TREE_ITEMDATA *pData = new TREE_ITEMDATA; pData->eTreeItemType = WINDOWS_NODE; - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); // create the CUIDesignWnd pData->wndUIDesign.SetUIWndProperties(pUIWndProp); @@ -280,7 +282,7 @@ int CFileView::InitFontResourceBranch() m_hResDefaultFontBranch = m_treeWindow.InsertItem(_T("Default Font"), m_hResourceRoot); TREE_ITEMDATA *pData = new TREE_ITEMDATA; pData->eTreeItemType = RES_DEFAULT_FONT_BRANCH; - m_treeWindow.SetItemData(m_hResDefaultFontBranch, (DWORD)pData); + m_treeWindow.SetItemData(m_hResDefaultFontBranch, (DWORD_PTR)pData); // // Insert default font @@ -307,7 +309,7 @@ int CFileView::InitFontResourceBranch() m_hResFontBranch = m_treeWindow.InsertItem(_T("Font"), m_hResourceRoot); pData = new TREE_ITEMDATA; pData->eTreeItemType = RES_FONT_BRANCH; - m_treeWindow.SetItemData(m_hResFontBranch, (DWORD)pData); + m_treeWindow.SetItemData(m_hResFontBranch, (DWORD_PTR)pData); int nCount = CUIMgr::GetResourceCount(REST_FONT); for (int i = 0; i < nCount; ++i) @@ -337,7 +339,7 @@ HTREEITEM CFileView::InsertConditionFont(HTREEITEM hParentItem, FONTRESOURCEITEM TREE_ITEMDATA *pData = new TREE_ITEMDATA; pData->eTreeItemType = RES_CONDITION_FONT_NODE; pData->pResFont = pConditionFont; - m_treeWindow.SetItemData(hRetItem, (DWORD)pData); + m_treeWindow.SetItemData(hRetItem, (DWORD_PTR)pData); InsertConditionFontChildren(hRetItem, pConditionFont); @@ -354,7 +356,7 @@ int CFileView::InsertConditionFontChildren(HTREEITEM hParentItem, FONTRESOURCEIT TREE_ITEMDATA *pData = new TREE_ITEMDATA; pData->eTreeItemType = RES_CONDITION_CHILD_FONT_NODE; pData->pResourceOrStyle = it->second; - m_treeWindow.SetItemData(hFont, (DWORD)pData); + m_treeWindow.SetItemData(hFont, (DWORD_PTR)pData); } return 0; @@ -380,7 +382,7 @@ HTREEITEM CFileView::InsertGeneralFont(HTREEITEM hParentItem, FONTRESOURCEITEM * TREE_ITEMDATA *pData = new TREE_ITEMDATA; pData->eTreeItemType = RES_GENERAL_FONT_NODE; pData->pResFont = pGeneralFont; - m_treeWindow.SetItemData(hRetItem, (DWORD)pData); + m_treeWindow.SetItemData(hRetItem, (DWORD_PTR)pData); return hRetItem; } @@ -393,7 +395,7 @@ int CFileView::InitColorResourceBranch() m_hResDefaultColorBranch = m_treeWindow.InsertItem(_T("Default Color"), m_hResourceRoot); TREE_ITEMDATA *pData = new TREE_ITEMDATA; pData->eTreeItemType = RES_DEFAULT_COLOR_BRANCH; - m_treeWindow.SetItemData(m_hResDefaultColorBranch, (DWORD)pData); + m_treeWindow.SetItemData(m_hResDefaultColorBranch, (DWORD_PTR)pData); // Insert default resource to tree RESCOLORPROPERTIES *pResDefaultColor = CUIMgr::GetDefaultColorResource(); @@ -403,7 +405,7 @@ int CFileView::InitColorResourceBranch() pData = new TREE_ITEMDATA; pData->eTreeItemType = RES_COLOR_NODE; pData->pResourceOrStyle = pResDefaultColor; - m_treeWindow.SetItemData(m_hResDefaultColor, (DWORD)pData); + m_treeWindow.SetItemData(m_hResDefaultColor, (DWORD_PTR)pData); // // Insert Color resource @@ -411,7 +413,7 @@ int CFileView::InitColorResourceBranch() m_hResColorBranch = m_treeWindow.InsertItem(_T("Color"), m_hResourceRoot); pData = new TREE_ITEMDATA; pData->eTreeItemType = RES_COLOR_BRANCH; - m_treeWindow.SetItemData(m_hResColorBranch, (DWORD)pData); + m_treeWindow.SetItemData(m_hResColorBranch, (DWORD_PTR)pData); int nCount = CUIMgr::GetResourceCount(REST_COLOR); for (int i = 0; i < nCount; ++i) @@ -427,7 +429,7 @@ int CFileView::InitColorResourceBranch() // set item data to tree item pData->pResourceOrStyle = pResProp; - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); } return 0; @@ -439,7 +441,7 @@ HTREEITEM CFileView::InsertEachStyle(LPCTSTR lpszNode, TREE_ITEM_TYPE eTreeItemT hItemRet = m_treeWindow.InsertItem(lpszNode, m_hStyleRoot); TREE_ITEMDATA *pData = new TREE_ITEMDATA; pData->eTreeItemType = eTreeItemTypeRoot; - m_treeWindow.SetItemData(hItemRet, (DWORD)pData); + m_treeWindow.SetItemData(hItemRet, (DWORD_PTR)pData); int nCount = CUIMgr::GetStyleCount(eStyleType); for (int i = 0; i < nCount; ++i) @@ -455,7 +457,7 @@ HTREEITEM CFileView::InsertEachStyle(LPCTSTR lpszNode, TREE_ITEM_TYPE eTreeItemT // set item data to tree item pData->pResourceOrStyle = pStyleProp; - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); } return hItemRet; @@ -466,7 +468,7 @@ int CFileView::InitStyleBrach() m_hStyleRoot = m_treeWindow.InsertItem(_T("Style")); TREE_ITEMDATA *pData = new TREE_ITEMDATA; pData->eTreeItemType = STYLE_ROOT; - m_treeWindow.SetItemData(m_hStyleRoot, (DWORD)pData); + m_treeWindow.SetItemData(m_hStyleRoot, (DWORD_PTR)pData); // Insert each style m_hStylePushButtonRoot = InsertEachStyle(_T("PushButton"), STYLE_PUSHBUTTON_ROOT, STYLE_PUSHBUTTON_NODE, STYLET_PUSHBUTTON, CT_STYLE_PUSHBUTTON); @@ -575,7 +577,7 @@ BOOL CFileView::OnOpenFile() m_hResourceRoot = m_treeWindow.InsertItem(_T("Resource")); TREE_ITEMDATA *pData = new TREE_ITEMDATA; pData->eTreeItemType = RESOURCE_ROOT; - m_treeWindow.SetItemData(m_hResourceRoot, (DWORD)pData); + m_treeWindow.SetItemData(m_hResourceRoot, (DWORD_PTR)pData); InitFontResourceBranch(); InitColorResourceBranch(); @@ -828,7 +830,7 @@ int CFileView::InsertResource(TREE_ITEM_TYPE eTreeItemType) // Set Item data pData->pResFont = pFri; - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); } else if (eTreeItemType == RES_COLOR_NODE) { @@ -842,7 +844,7 @@ int CFileView::InsertResource(TREE_ITEM_TYPE eTreeItemType) CUIMgr::AddColorResourceItem(pResProp); // Set Item data - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); } else if (eTreeItemType == STYLE_MENU_NODE) { @@ -853,7 +855,7 @@ int CFileView::InsertResource(TREE_ITEM_TYPE eTreeItemType) hItem = m_treeWindow.InsertItem(strResID, hRoot); // Set Item data - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); } else if (eTreeItemType == STYLE_HEADERCTRL_NODE) { @@ -864,7 +866,7 @@ int CFileView::InsertResource(TREE_ITEM_TYPE eTreeItemType) hItem = m_treeWindow.InsertItem(strResID, hRoot); // Set Item data - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); } else if (eTreeItemType == STYLE_HORSCROLLBAR_NODE) { @@ -875,7 +877,7 @@ int CFileView::InsertResource(TREE_ITEM_TYPE eTreeItemType) hItem = m_treeWindow.InsertItem(strResID, hRoot); // Set Item data - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); } else if (eTreeItemType == STYLE_VERSCROLLBAR_NODE) { @@ -886,7 +888,7 @@ int CFileView::InsertResource(TREE_ITEM_TYPE eTreeItemType) hItem = m_treeWindow.InsertItem(strResID, hRoot); // Set Item data - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); } else if (eTreeItemType == STYLE_SPLITTER_NODE) { @@ -897,7 +899,7 @@ int CFileView::InsertResource(TREE_ITEM_TYPE eTreeItemType) hItem = m_treeWindow.InsertItem(strResID, hRoot); // Set Item data - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); } else if (eTreeItemType == STYLE_WL_LINE_NODE) { @@ -908,7 +910,7 @@ int CFileView::InsertResource(TREE_ITEM_TYPE eTreeItemType) hItem = m_treeWindow.InsertItem(strResID, hRoot); // Set Item data - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); } else if (eTreeItemType == STYLE_WL_PIC_NODE) { @@ -919,7 +921,7 @@ int CFileView::InsertResource(TREE_ITEM_TYPE eTreeItemType) hItem = m_treeWindow.InsertItem(strResID, hRoot); // Set Item data - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); } else { @@ -1026,7 +1028,7 @@ int CFileView::InsertStyle(TREE_ITEM_TYPE eTreeItemType) // Set item data to tree item TREE_ITEMDATA *pData = new TREE_ITEMDATA; pData->eTreeItemType = eTreeItemType; - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); pStyleProp->m_strID = strResID; @@ -1255,7 +1257,7 @@ void CFileView::OnInsertWindow() // set item data to tree item TREE_ITEMDATA *pData = new TREE_ITEMDATA; pData->eTreeItemType = WINDOWS_NODE; - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); pUIProp = CUIMgr::AllocUIWNDPROPERTIES(); pUIProp->m_strID = strWindowID; @@ -1606,8 +1608,10 @@ void CFileView::OnTestCurFrame() break; } +#ifdef ADV int nCurFrame = g_pFrm->GetStoryboardPanel()->GetCurFrame(); pData->wndTest.SeekToFrame(nCurFrame); +#endif // ADV } void CFileView::OnDeleteWindow() @@ -1797,19 +1801,6 @@ void CFileView::OnAddClass() // .cpp File classGen.m_Dictionary[_T("CppFile")] = dlg.m_strCppFile; - // Code Style - switch (dlg.m_uCodeStyle) - { - case IDC_RAD_VC6: - classGen.m_Dictionary[_T("CODESTYLE_VC60")] = _T("1"); - break; - case IDC_RAD_VC_NET: - classGen.m_Dictionary[_T("CODESTYLE_VCNET")] = _T("1"); - break; - default: - break; - } - // Generate event handler if (dlg.m_bGenEventHandler) { @@ -2119,19 +2110,6 @@ void CFileView::OnAddEventHandlerClass() // .cpp File eventHandlerGen.m_Dictionary[_T("CppFile")] = dlg.m_strCppFile; - // Code Style - switch (dlg.m_uCodeStyle) - { - case IDC_RAD_VC6: - eventHandlerGen.m_Dictionary[_T("CODESTYLE_VC60")] = _T("1"); - break; - case IDC_RAD_VC_NET: - eventHandlerGen.m_Dictionary[_T("CODESTYLE_VCNET")] = _T("1"); - break; - default: - break; - } - eventHandlerGen.GenerateEventHandlerFile(); } @@ -2347,7 +2325,7 @@ void CFileView::OnInsertConditionFontChild() // Insert to tree HTREEITEM hItem = m_treeWindow.InsertItem(strID, 3, 3, hParentItem); - m_treeWindow.SetItemData(hItem, (DWORD)pData); + m_treeWindow.SetItemData(hItem, (DWORD_PTR)pData); // Insert to CUIMgr pParentData->pResFont->m_mapConditionFont[strID] = pFontProp; diff --git a/UIShop/FormatBrushDlg.cpp b/UIShop/FormatBrushDlg.cpp index e8af009..ad6aed1 100644 --- a/UIShop/FormatBrushDlg.cpp +++ b/UIShop/FormatBrushDlg.cpp @@ -89,8 +89,8 @@ void CFormatBrushDlg::OnBnClickedOk() if (bCheck) { - int nIndexInProp = m_lstFormatBrush.GetItemData(i); - g_pFrm->AddFormatBrushPropIndex(nIndexInProp); + DWORD_PTR nIndexInProp = m_lstFormatBrush.GetItemData(i); + g_pFrm->AddFormatBrushPropIndex((int)(INT_PTR)nIndexInProp); } } diff --git a/UIShop/GenerateResource.cpp b/UIShop/GenerateResource.cpp index a2c97d1..f2ab503 100644 --- a/UIShop/GenerateResource.cpp +++ b/UIShop/GenerateResource.cpp @@ -138,7 +138,7 @@ int CGenerateResource::GetUIFileList(std::vector *pvImageList, std::vec // Sort #ifdef _DEBUG - int nCount = pvImageList->size(); + size_t nCount = pvImageList->size(); for (int i = 0; i < nCount; ++i) { CString s = *(pvImageList->begin() + i); @@ -152,7 +152,7 @@ int CGenerateResource::GetUIFileList(std::vector *pvImageList, std::vec std::sort(pvBmpList->begin(), pvBmpList->end(), ImageNameCompare); #ifdef _DEBUG - int nCount2 = pvImageList->size(); + size_t nCount2 = pvImageList->size(); for (int i = 0; i < nCount2; ++i) { CString s = *(pvImageList->begin() + i); @@ -167,7 +167,7 @@ int CGenerateResource::GetUIFileList(std::vector *pvImageList, std::vec std::vector::iterator posBmp = unique(pvBmpList->begin(), pvBmpList->end(), ImageNameCompare2); #ifdef _DEBUG - int nCount3 = pvImageList->size(); + size_t nCount3 = pvImageList->size(); for (int i = 0; i < nCount3; ++i) { CString s = *(pvImageList->begin() + i); @@ -181,7 +181,7 @@ int CGenerateResource::GetUIFileList(std::vector *pvImageList, std::vec pvBmpList->erase(posBmp, pvBmpList->end()); #ifdef _DEBUG - int nCount4 = pvImageList->size(); + size_t nCount4 = pvImageList->size(); for (int i = 0; i < nCount4; ++i) { CString s = *(pvImageList->begin() + i); diff --git a/UIShop/ImageSymbolsDlg.cpp b/UIShop/ImageSymbolsDlg.cpp index 5770b76..965d7b9 100644 --- a/UIShop/ImageSymbolsDlg.cpp +++ b/UIShop/ImageSymbolsDlg.cpp @@ -101,7 +101,7 @@ BOOL CImageSymbolsDlg::OnInitDialog() // Delete duplicate elements. std::vector vImageFiles; - int nImageCount = vImages.size(); + size_t nImageCount = vImages.size(); for (int i = 0; i < nImageCount; ++i) { CString strImage = vImages[i]; @@ -151,7 +151,7 @@ void CImageSymbolsDlg::OnBnClickedBtnMoveToUnused() } // Move unused files to 'Unused' folder - int nCount = m_vFiles.size(); + size_t nCount = m_vFiles.size(); for (int i = 0; i < nCount; ++i) { CString strFile = m_vFiles[i]; diff --git a/UIShop/MainFrm.cpp b/UIShop/MainFrm.cpp index 9a5edd3..47a6fc7 100644 --- a/UIShop/MainFrm.cpp +++ b/UIShop/MainFrm.cpp @@ -220,37 +220,6 @@ int CMainFrame::CustomizeProject(CNewProjectDlg *pDlg) strAppClass += _T("App"); m_ProjectGen.m_Dictionary[_T("APP_CLASS")] = strAppClass; - // Project type - switch (pDlg->m_uVSEdition) - { - case IDC_RAD_VC60: - m_ProjectGen.m_Dictionary[_T("PROJECT_VC60")] = _T("1"); - break; - case IDC_RAD_VC71: - m_ProjectGen.m_Dictionary[_T("PROJECT_VC71")] = _T("1"); - break; - case IDC_RAD_VC80: - m_ProjectGen.m_Dictionary[_T("PROJECT_VC80")] = _T("1"); - break; - case IDC_RAD_VC90: - m_ProjectGen.m_Dictionary[_T("PROJECT_VC90")] = _T("1"); - break; - case IDC_RAD_VC100: - m_ProjectGen.m_Dictionary[_T("PROJECT_VC100")] = _T("1"); - break; - case IDC_RAD_VC110: - m_ProjectGen.m_Dictionary[_T("PROJECT_VC110")] = _T("1"); - break; - case IDC_RAD_VC120: - m_ProjectGen.m_Dictionary[_T("PROJECT_VC120")] = _T("1"); - break; - case IDC_RAD_VC140: - m_ProjectGen.m_Dictionary[_T("PROJECT_VC140")] = _T("1"); - break; - default: - break; - } - // MDI, the key not same as it defined in MFC. switch (pDlg->m_uProType) { @@ -415,6 +384,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) EnableAutoHidePanes(CBRS_ALIGN_ANY); // Load menu item image (not placed on any standard toolbars): + // ͼ*.bmpÿͼ겻16*16,ĴWin10ϵ± CMFCToolBar::AddToolBarForImageCollection(IDR_MENU_IMAGES, theApp.m_bHiColorIcons ? IDB_MENU_IMAGES_24 : 0); // create docking windows @@ -428,8 +398,10 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) DockPane(&m_wndFileView); m_wndProperties.EnableDocking(CBRS_ALIGN_ANY); DockPane(&m_wndProperties); +#ifdef ADV m_wndStoryboard.EnableDocking(CBRS_ALIGN_ANY); DockPane(&m_wndStoryboard); +#endif // Enable enhanced windows management dialog EnableWindowsDialog(ID_WINDOW_MANAGER, IDS_WINDOWS_MANAGER, TRUE); @@ -501,6 +473,7 @@ BOOL CMainFrame::CreateDockingWindows() return FALSE; // failed to create } +#ifdef ADV // Create storyboard panel CString strStoryboardWnd; bNameValid = strStoryboardWnd.LoadString(IDS_STORYBOARD_WND); @@ -510,7 +483,7 @@ BOOL CMainFrame::CreateDockingWindows() TRACE0("Failed to create Storyboaed window\n"); return FALSE; // failed to create } - +#endif SetDockingWindowIcons(theApp.m_bHiColorIcons); return TRUE; @@ -709,10 +682,12 @@ CPropertiesWnd *CMainFrame::GetPropertiesWnd() return &m_wndProperties; } +#ifdef ADV CStoryboardPane *CMainFrame::GetStoryboardPanel() { return &m_wndStoryboard; } +#endif int CMainFrame::GetFileMRUMessage(UINT nID, CString *pstrMsg) { @@ -760,13 +735,14 @@ int CMainFrame::AddFormatBrushPropIndex(int nIndex) return 0; } -const std::vector *CMainFrame::GetFormatBrushPropIndex() const +const std::vector *CMainFrame::GetFormatBrushPropIndex() const { return &m_vBrushPropIndex; } STORY_FRAME *CMainFrame::InsertFrame() { +#ifdef ADV int nFrame = m_wndStoryboard.GetCurFrame(); if (nFrame < 0) { @@ -813,6 +789,9 @@ STORY_FRAME *CMainFrame::InsertFrame() GetUIShopDoc()->SetModifiedFlag(TRUE); return pItem; +#else + return NULL; +#endif // ADV } LRESULT CMainFrame::OnSetMessageString(WPARAM wParam, LPARAM lParam) @@ -2133,7 +2112,7 @@ void CMainFrame::OnDesignBackgroundShow() return; } - int nCtrlCount = pUIDesignWnd->m_listCtrl.size(); + size_t nCtrlCount = pUIDesignWnd->m_listCtrl.size(); if (pUIDesignWnd->m_bBackgroundShow) { diff --git a/UIShop/MainFrm.h b/UIShop/MainFrm.h index 3ae2c13..a665891 100644 --- a/UIShop/MainFrm.h +++ b/UIShop/MainFrm.h @@ -29,7 +29,9 @@ class CMainFrame : public CMDIFrameWndEx CUIShopDoc *GetUIShopDoc(); CFileView *GetFileView(); CPropertiesWnd *GetPropertiesWnd(); +#ifdef ADV CStoryboardPane *GetStoryboardPanel(); +#endif int ShowTBControlBar(BOOL bShow); int GetFileMRUMessage(UINT nID, CString *pstrMsg); @@ -37,7 +39,7 @@ class CMainFrame : public CMDIFrameWndEx const CTRLPROPERTIES *GetFormatBrushProp() const; int SetFormatBrushProp(const CTRLPROPERTIES *pProp); int AddFormatBrushPropIndex(int nIndex); - const std::vector *GetFormatBrushPropIndex() const; + const std::vector *GetFormatBrushPropIndex() const; STORY_FRAME *InsertFrame(); @@ -197,7 +199,9 @@ class CMainFrame : public CMDIFrameWndEx CMFCStatusBar m_wndStatusBar; CFileView m_wndFileView; CPropertiesWnd m_wndProperties; +#ifdef ADV CStoryboardPane m_wndStoryboard; +#endif CUIShopView *m_pViewUIShop; CProjectGen m_ProjectGen; @@ -205,5 +209,5 @@ class CMainFrame : public CMDIFrameWndEx BOOL m_bFormatBrush; const CTRLPROPERTIES *m_pFormatBrushProp; - std::vector m_vBrushPropIndex; + std::vector m_vBrushPropIndex; }; diff --git a/UIShop/MsgWizardDlg.cpp b/UIShop/MsgWizardDlg.cpp index 60733cb..9e777c1 100644 --- a/UIShop/MsgWizardDlg.cpp +++ b/UIShop/MsgWizardDlg.cpp @@ -88,7 +88,7 @@ void CMsgWizardDlg::OnTvnItemChangedTreeControls(NMHDR *pNMHDR, LRESULT *pResult strCode = "In *.h file:\r\n"; strCode += "\r\n"; - int nSelControlCount = vSelControls.size(); + size_t nSelControlCount = vSelControls.size(); // CSkinButton *m_pBtn1; for (int i = 0; i < nSelControlCount; ++i) diff --git a/UIShop/NewProjectDlg.cpp b/UIShop/NewProjectDlg.cpp index 837f164..bc31158 100644 --- a/UIShop/NewProjectDlg.cpp +++ b/UIShop/NewProjectDlg.cpp @@ -5,7 +5,6 @@ #include "uishop.h" #include "NewProjectDlg.h" #include -#include #ifdef _DEBUG #define new DEBUG_NEW @@ -27,7 +26,6 @@ CNewProjectDlg::CNewProjectDlg(CWnd* pParent /*=NULL*/) m_strLocation = _T(""); //}}AFX_DATA_INIT m_bDatabase = FALSE; - m_uVSEdition = IDC_RAD_VC60; m_uProType = IDC_RAD_PROJECT_GENERAL; } @@ -92,22 +90,10 @@ void CNewProjectDlg::OnOK() } } - m_uVSEdition = GetCheckedRadioButton(IDC_RAD_VC60, IDC_RAD_VC140); m_uProType = GetCheckedRadioButton(IDC_RAD_PROJECT_GENERAL, IDC_RAD_PROJECT_WEISHI); m_uDBID = GetCheckedRadioButton(IDC_RAD_NONE, IDC_RAD_HEADER); m_uCommentID = GetCheckedRadioButton(IDC_RAD_YES, IDC_RAD_NO); - // - // vs汾m_uVSEditionlocationm_strLocation - // - CString strSettingsFile = GetExecutePath() + _T("Settings.ini"); - TCHAR szBuf[MAX_PATH] = {0}; - - StringCchPrintf(szBuf, MAX_PATH, _T("%d"), m_uVSEdition); - WritePrivateProfileString(_T("NewProject"), _T("VSEdition"), szBuf, strSettingsFile); - - WritePrivateProfileString(_T("NewProject"), _T("Location"), m_strLocation, strSettingsFile); - CDialog::OnOK(); } @@ -153,7 +139,7 @@ void CNewProjectDlg::OnBnClickedBtnGoto() if (!bRet) return; - int nRet = (int)ShellExecute(NULL, _T("open"), m_strLocation, NULL, NULL, SW_SHOW); + INT_PTR nRet = (INT_PTR)ShellExecute(NULL, _T("open"), m_strLocation, NULL, NULL, SW_SHOW); if (nRet > 32) return; // Successful. @@ -172,49 +158,26 @@ BOOL CNewProjectDlg::OnInitDialog() CDialog::OnInitDialog(); // TODO: Add extra initialization here - + // - // ȡ vs汾m_uVSEditionlocationm_strLocation + // ȡ locationm_strLocation // CString strFile = GetExecutePath() + _T("Settings.ini"); - - // Project type - CButton *pBtn = NULL; - int nID = GetPrivateProfileInt(_T("NewProject"), _T("VSEdition"), 0, strFile); - if (0 == nID) - { - pBtn = (CButton *)GetDlgItem(IDC_RAD_VC60); - } - else - { - pBtn = (CButton *)GetDlgItem(nID); - } - if (NULL != pBtn) - { - pBtn->SetCheck(BST_CHECKED); - } - + TCHAR szBuf[MAX_PATH] = {0}; GetPrivateProfileString(_T("NewProject"), _T("Location"), _T(""), szBuf, MAX_PATH, strFile); m_strLocation = szBuf; + CButton *pBtn = NULL; + pBtn = (CButton *)GetDlgItem(IDC_RAD_PROJECT_GENERAL); - if (NULL != pBtn) - { - pBtn->SetCheck(BST_CHECKED); - } + pBtn->SetCheck(BST_CHECKED); pBtn = (CButton *)GetDlgItem(IDC_RAD_NONE); - if (NULL != pBtn) - { - pBtn->SetCheck(BST_CHECKED); - } + pBtn->SetCheck(BST_CHECKED); pBtn = (CButton *)GetDlgItem(IDC_RAD_YES); - if (NULL != pBtn) - { - pBtn->SetCheck(BST_CHECKED); - } + pBtn->SetCheck(BST_CHECKED); UpdateData(FALSE); diff --git a/UIShop/NewProjectDlg.h b/UIShop/NewProjectDlg.h index f09e687..8862f0c 100644 --- a/UIShop/NewProjectDlg.h +++ b/UIShop/NewProjectDlg.h @@ -25,7 +25,6 @@ class CNewProjectDlg : public CDialog CString m_strLocation; //}}AFX_DATA BOOL m_bDatabase; - UINT m_uVSEdition; UINT m_uProType; UINT m_uDBID; UINT m_uCommentID; diff --git a/UIShop/ProjectGen.cpp b/UIShop/ProjectGen.cpp index 5194002..6fb20a3 100644 --- a/UIShop/ProjectGen.cpp +++ b/UIShop/ProjectGen.cpp @@ -522,6 +522,17 @@ int CProjectGen::InitProjectGUID() #endif m_Dictionary[_T("SOLUTION_GUID")] = (LPCTSTR)_bstr_t(strGUID); + // solution2 guid + CoCreateGuid(&guid); + StringFromGUID2(guid, wszName, sizeof(wszName)); + wcstombs_s(&nSizeConverted, szName, sizeof(szName), wszName, sizeof(szName)); +#ifdef _UNICODE + strGUID = wszName; +#else + strGUID = szName; +#endif + m_Dictionary[_T("SOLUTION_GUID2")] = (LPCTSTR)_bstr_t(strGUID); + return 0; } diff --git a/UIShop/PropertiesWnd.cpp b/UIShop/PropertiesWnd.cpp index a77094d..97a9953 100644 --- a/UIShop/PropertiesWnd.cpp +++ b/UIShop/PropertiesWnd.cpp @@ -40,7 +40,7 @@ int InitWindowIDOptions(CMFCPropertyGridProperty *pProp, BOOL bIncludeSelf) CString strCurWinID = (LPCTSTR)pWndProp->m_strID; std::vector *pWindows = CUIMgr::GetUIWndPropertiesList(); - int nCount = pWindows->size(); + size_t nCount = pWindows->size(); for (int i = 0; i < nCount; ++i) { UIWNDPROPERTIES *pWindow = (*pWindows)[i]; diff --git a/UIShop/Resource.h b/UIShop/Resource.h index 3cc6cc2..f48f809 100644 --- a/UIShop/Resource.h +++ b/UIShop/Resource.h @@ -87,8 +87,6 @@ #define IDC_EDT_H_FILE 1005 #define IDC_EDT_CPP_FILE 1006 #define IDC_BTN_BROWSE 1007 -#define IDC_RAD_VC6 1008 -#define IDC_RAD_VC_NET 1009 #define IDC_CHK_GEN_HANDLER 1010 #define IDC_CHK_GEN_VARIABLE 1011 #define IDC_CHK_GEN_DO_DATA_EXCHANGE 1012 @@ -135,20 +133,9 @@ #define IDC_CMB_MERGE_TOOL_PATH 1057 #define IDC_BTN_BROWSE_MERGE_TOOL 1058 #define IDC_BTN_MERGE 1059 -#define IDC_STA_HOME_PAGE 1060 -#define IDC_STA_SOURCE_CODE 1061 -#define IDC_STA_INFO 1062 #define IDC_LST_TABORDER 1078 #define IDC_BTN_MOVEUP 1079 #define IDC_BTN_MOVEDOWN 1080 -#define IDC_RAD_VC60 1231 -#define IDC_RAD_VC71 1232 -#define IDC_RAD_VC80 1233 -#define IDC_RAD_VC90 1234 -#define IDC_RAD_VC100 1235 -#define IDC_RAD_VC110 1236 -#define IDC_RAD_VC120 1237 -#define IDC_RAD_VC140 1238 #define IDC_EDT_PROJECTNAME 1250 #define IDC_EDT_LOCATION 1251 #define IDC_RAD_NONE 1252 diff --git a/UIShop/StoryboardSldCtrl.cpp b/UIShop/StoryboardSldCtrl.cpp index c67e93d..7c077e8 100644 --- a/UIShop/StoryboardSldCtrl.cpp +++ b/UIShop/StoryboardSldCtrl.cpp @@ -42,7 +42,7 @@ void CStoryboardSldCtrl::DrawHorzSlider(CDC *pMemDC) // Set frame position. if (m_pUIDesignWnd != NULL) { - int nStoryCount = m_pUIDesignWnd->GetUIWndProperties()->m_vStoryFrame.size(); + size_t nStoryCount = m_pUIDesignWnd->GetUIWndProperties()->m_vStoryFrame.size(); for (int i = 0; i < nStoryCount; ++i) { STORY_FRAME *pFrame = m_pUIDesignWnd->GetUIWndProperties()->m_vStoryFrame[i]; diff --git a/UIShop/SyncSkinTabOrderDlg.cpp b/UIShop/SyncSkinTabOrderDlg.cpp index 800f362..6ac4983 100644 --- a/UIShop/SyncSkinTabOrderDlg.cpp +++ b/UIShop/SyncSkinTabOrderDlg.cpp @@ -68,7 +68,7 @@ int CSyncSkinTabOrderDlg::SyncSkinTabOrder(const CString &strSkinSource, const C std::vector *pvSourceWindowList = CUIMgr::GetUIWndPropertiesList(); std::vector vSourceWindows; - int nSourceWindowCount = pvSourceWindowList->size(); + size_t nSourceWindowCount = pvSourceWindowList->size(); for (int i = 0; i < nSourceWindowCount; ++i) { UIWNDPROPERTIES *pWindow = (*pvSourceWindowList)[i]; @@ -76,7 +76,7 @@ int CSyncSkinTabOrderDlg::SyncSkinTabOrder(const CString &strSkinSource, const C CSyncWindow syncWin; syncWin.m_strWindowName = (LPCTSTR)pWindow->m_strID; - int nChildCount = pWindow->m_vControls.size(); + size_t nChildCount = pWindow->m_vControls.size(); for (int j = 0; j < nChildCount; ++j) { CTRLPROPERTIES *pCtrlProp = pWindow->m_vControls[j]; @@ -95,14 +95,14 @@ int CSyncSkinTabOrderDlg::SyncSkinTabOrder(const CString &strSkinSource, const C strSourceTree += _T("WindowTree.txt"); FILE *fpSource = TFOPEN(strSourceTree.GetBuffer(0), _T("wb")); - int nSourceCount = vSourceWindows.size(); + size_t nSourceCount = vSourceWindows.size(); for (int i = 0; i < nSourceCount; ++i) { CStringA strWindowID = _bstr_t(vSourceWindows[i].m_strWindowName.GetBuffer(0)); fputs(strWindowID, fpSource); fputs("\r\n", fpSource); - int nChildCount = vSourceWindows[i].m_vControls.size(); + size_t nChildCount = vSourceWindows[i].m_vControls.size(); for (int j = 0; j < nChildCount; ++j) { CStringA strCtrlID = _bstr_t(vSourceWindows[i].m_vControls[j].GetBuffer(0)); @@ -121,7 +121,7 @@ int CSyncSkinTabOrderDlg::SyncSkinTabOrder(const CString &strSkinSource, const C // Load target skin CUIMgr::SetUIPath(strSkinTarget); std::vector *pvTargetWindowList = CUIMgr::GetUIWndPropertiesList(); - int nTargetWindowCount = pvTargetWindowList->size(); + size_t nTargetWindowCount = pvTargetWindowList->size(); for (int i = 0; i < nSourceWindowCount; ++i) { CString strWindowID = vSourceWindows[i].m_strWindowName; @@ -144,7 +144,7 @@ int CSyncSkinTabOrderDlg::SyncSkinTabOrder(const CString &strSkinSource, const C UIWNDPROPERTIES *pTargetUIWnd = CUIMgr::GetWindowItem(i); ASSERT(strWindowID == (LPCTSTR)pTargetUIWnd->m_strID); - int nChildCount = vSourceWindows[i].m_vControls.size(); + size_t nChildCount = vSourceWindows[i].m_vControls.size(); for (int j = 0; j < nChildCount; ++j) { CString strCtrlID = vSourceWindows[i].m_vControls[j]; @@ -169,7 +169,7 @@ int CSyncSkinTabOrderDlg::SyncSkinTabOrder(const CString &strSkinSource, const C strTargetTree += _T("WindowTree.txt"); FILE *fpTarget = TFOPEN(strTargetTree.GetBuffer(0), _T("wb")); - int nTargetCount = pvTargetWindowList->size(); + size_t nTargetCount = pvTargetWindowList->size(); for (int i = 0; i < nTargetCount; ++i) { UIWNDPROPERTIES *pUIWnd = (*pvTargetWindowList)[i]; @@ -178,7 +178,7 @@ int CSyncSkinTabOrderDlg::SyncSkinTabOrder(const CString &strSkinSource, const C fputs(strWindowID, fpTarget); fputs("\r\n", fpTarget); - int nChildCount = pUIWnd->m_vControls.size(); + size_t nChildCount = pUIWnd->m_vControls.size(); for (int j = 0; j < nChildCount; ++j) { CStringA strCtrlID = (LPCSTR)pUIWnd->m_vControls[j]->m_strID; diff --git a/UIShop/Template/ChildWndHandler.cpp b/UIShop/Template/ChildWndHandler.cpp index 153c34c..d67afb0 100644 --- a/UIShop/Template/ChildWndHandler.cpp +++ b/UIShop/Template/ChildWndHandler.cpp @@ -1,68 +1,66 @@ -#include "StdAfx.h" -#include "ChildWndHandler.h" +// ChildWnd.cpp : implementation of the CChildWnd class +// + +#include "stdafx.h" +#include "ChildWnd.h" #ifdef _DEBUG -#define new IUI_DEBUG_NEW +#define new IUI_DEBUG_NEW #endif // _DEBUG +// CChildWnd -IUI_BEGIN_MESSAGE_MAP(CChildWndHandler) - IUI_ON_MESSAGE(WM_CREATE, &CChildWndHandler::OnCreate) - IUI_ON_MESSAGE(WM_DESTROY, &CChildWndHandler::OnDestroy) - IUI_ON_MESSAGE(WM_GETCHILDMSGHANDLER, &CChildWndHandler::OnGetChildMsgHandler) - IUI_ON_MESSAGE(WM_RELEASECHILDMSGHANDLER, &CChildWndHandler::OnReleaseChildMsgHandler) - IUI_ON_BN_CLICKED(IDC_BTN_CHILD, &CChildWndHandler::OnBtnChild) -IUI_END_MESSAGE_MAP() +BEGIN_MESSAGE_MAP(CChildWnd, CUIWnd) + ON_WM_CREATE() + ON_BN_CLICKED(IDC_BTN_CHILD, OnBtnChild) +END_MESSAGE_MAP() +// CChildWnd construction/destruction -CChildWndHandler::CChildWndHandler(UINT uWinID) - : CUIWndHandler(uWinID) +CChildWnd::CChildWnd() { + m_pBtnChild = NULL; + } -CChildWndHandler::~CChildWndHandler() +CChildWnd::~CChildWnd() { } +void CChildWnd::DoDataExchange(CDataExchange* pDX) +{ + CUIWnd::DoDataExchange(pDX); + +} + ////////////////////////////////////////////////////////////////////////// -// Messages +// protected -LRESULT CChildWndHandler::OnCreate(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam) +int CChildWnd::InitControls() { - return 0; -} + m_pBtnChild = (CSkinButton *)GetDlgItem(IDC_BTN_CHILD); + ASSERT(m_pBtnChild->GetSafeHwnd() != NULL); -LRESULT CChildWndHandler::OnDestroy(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam) -{ return 0; } -// Ϊؼ󶨵ĴָϢӳ -LRESULT CChildWndHandler::OnGetChildMsgHandler(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam) +///////////////////////////////////////////////////////////////////////////// +// CChildWnd message handlers + +int CChildWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) { - UINT uWinID = (UINT)wParam; - CUIWndHandler **ppHandler = (CUIWndHandler **)lParam; + if (CUIWnd::OnCreate(lpCreateStruct) == -1) + return -1; - return 0; -} + if (InitControls() != 0) + return -1; -// ͷſؼ󶨵ĴڶӦϢӳ, ͷź󷵻TRUE򷵻FALSE -LRESULT CChildWndHandler::OnReleaseChildMsgHandler(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam) -{ - UINT uWinID = (UINT)wParam; - CHILDMSGHANDLER *pChildMsgHandler = (CHILDMSGHANDLER *)lParam; - if (pChildMsgHandler == NULL) - { - return (LRESULT)FALSE; - } - - return (LRESULT)FALSE; + + return 0; } -LRESULT CChildWndHandler::OnBtnChild(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam) +void CChildWnd::OnBtnChild() { AfxMessageBox(_T("IDC_BTN_CHILD")); - - return 0; } diff --git a/UIShop/Template/ChildWndHandler.h b/UIShop/Template/ChildWndHandler.h index de256ec..989ede8 100644 --- a/UIShop/Template/ChildWndHandler.h +++ b/UIShop/Template/ChildWndHandler.h @@ -1,17 +1,29 @@ +// ChildWnd.h : interface of the CChildWnd class +// #pragma once - -class CChildWndHandler : public CUIWndHandler +class CChildWnd : public CUIWnd { public: - CChildWndHandler(UINT uWinID); - ~CChildWndHandler(); + CChildWnd(); + virtual ~CChildWnd(); + void WindowID() { IDD = IDW_CHILD; } + +protected: + int InitControls(); + +public: protected: - afx_msg LRESULT OnCreate(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnDestroy(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnGetChildMsgHandler(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnReleaseChildMsgHandler(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnBtnChild(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam); - IUI_DECLARE_MESSAGE_MAP() + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + // Generated message map functions +protected: + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnBtnChild(); + DECLARE_MESSAGE_MAP() + +protected: + CSkinButton *m_pBtnChild; + +public: }; diff --git a/UIShop/Template/MainWndHandler.cpp b/UIShop/Template/MainWndHandler.cpp index 495e27b..426c57c 100644 --- a/UIShop/Template/MainWndHandler.cpp +++ b/UIShop/Template/MainWndHandler.cpp @@ -1,91 +1,102 @@ -#include "StdAfx.h" -#include "MainWndHandler.h" -#include "ChildWndHandler.h" +// MainWnd.cpp : implementation of the CMainWnd class +// + +#include "stdafx.h" +#include "MainWnd.h" #ifdef _DEBUG #define new IUI_DEBUG_NEW #endif // _DEBUG +// CMainWnd -IUI_BEGIN_MESSAGE_MAP(CMainWndHandler) - IUI_ON_MESSAGE(WM_CREATE, &CMainWndHandler::OnCreate) - IUI_ON_MESSAGE(WM_DESTROY, &CMainWndHandler::OnDestroy) - IUI_ON_MESSAGE(WM_GETCHILDMSGHANDLER, &CMainWndHandler::OnGetChildMsgHandler) - IUI_ON_MESSAGE(WM_RELEASECHILDMSGHANDLER, &CMainWndHandler::OnReleaseChildMsgHandler) - IUI_ON_BN_CLICKED(IDC_BTN_OK, &CMainWndHandler::OnBtnOk) -IUI_END_MESSAGE_MAP() +BEGIN_MESSAGE_MAP(CMainWnd, CUIWnd) + ON_WM_CREATE() + ON_BN_CLICKED(IDC_BTN_MIN, OnBtnMin) + ON_BN_CLICKED(IDC_CHK_MAX, OnChkMax) + ON_BN_CLICKED(IDC_BTN_CLOSE, OnBtnClose) + ON_BN_CLICKED(IDC_BTN_OK, OnBtnOk) +END_MESSAGE_MAP() +// CMainWnd construction/destruction -CMainWndHandler::CMainWndHandler(UINT uWinID) - : CUIWndHandler(uWinID) +CMainWnd::CMainWnd() { + m_pStaTitle = NULL; + m_pBtnMin = NULL; + m_pChkMax = NULL; + m_pBtnClose = NULL; + m_pStaMsg = NULL; + m_pBtnOk = NULL; + m_pRcChild = NULL; + + m_bMax = FALSE; +} +CMainWnd::~CMainWnd() +{ } -CMainWndHandler::~CMainWndHandler() +void CMainWnd::DoDataExchange(CDataExchange* pDX) { + CUIWnd::DoDataExchange(pDX); + DDX_Check(pDX, IDC_CHK_MAX, m_bMax); } + ////////////////////////////////////////////////////////////////////////// -// Messages +// protected -LRESULT CMainWndHandler::OnCreate(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam) +int CMainWnd::InitControls() { + m_pStaTitle = (CSkinStatic *)GetDlgItem(IDC_STA_TITLE); + ASSERT(m_pStaTitle->GetSafeHwnd() != NULL); + m_pBtnMin = (CSkinButton *)GetDlgItem(IDC_BTN_MIN); + ASSERT(m_pBtnMin->GetSafeHwnd() != NULL); + m_pChkMax = (CSkinButton *)GetDlgItem(IDC_CHK_MAX); + ASSERT(m_pChkMax->GetSafeHwnd() != NULL); + m_pBtnClose = (CSkinButton *)GetDlgItem(IDC_BTN_CLOSE); + ASSERT(m_pBtnClose->GetSafeHwnd() != NULL); + m_pStaMsg = (CSkinStatic *)GetDlgItem(IDC_STA_MSG); + ASSERT(m_pStaMsg->GetSafeHwnd() != NULL); + m_pBtnOk = (CSkinButton *)GetDlgItem(IDC_BTN_OK); + ASSERT(m_pBtnOk->GetSafeHwnd() != NULL); + m_pRcChild = GetRectChild(IDC_WL_RECT_CHILD); + ASSERT(m_pRcChild->IsCreated()); + return 0; } -LRESULT CMainWndHandler::OnDestroy(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam) +///////////////////////////////////////////////////////////////////////////// +// CMainWnd message handlers + +int CMainWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) { + if (CUIWnd::OnCreate(lpCreateStruct) == -1) + return -1; + + if (InitControls() != 0) + return -1; + + m_wndChild.Create(NULL, WS_VISIBLE, m_pRcChild, this, IDW_CHILD); + return 0; } -// Ϊؼ󶨵ĴָϢӳ -LRESULT CMainWndHandler::OnGetChildMsgHandler(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam) +void CMainWnd::OnBtnMin() { - UINT uWinID = (UINT)wParam; - CHILDMSGHANDLER *pChildMsgHandler = (CHILDMSGHANDLER *)lParam; - if (pChildMsgHandler == NULL) - { - return 0; - } - - if (uWinID == IDW_CHILD) - { - pChildMsgHandler->pUIWndHandler = new CChildWndHandler(uWinID); - } - - return 0; } -// ͷſؼ󶨵ĴڶӦϢӳ, ͷź󷵻TRUE򷵻FALSE -LRESULT CMainWndHandler::OnReleaseChildMsgHandler(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam) +void CMainWnd::OnChkMax() { - UINT uWinID = (UINT)wParam; - CHILDMSGHANDLER *pChildMsgHandler = (CHILDMSGHANDLER *)lParam; - if (pChildMsgHandler == NULL) - { - return (LRESULT)FALSE; - } - - if (uWinID == IDW_CHILD) - { - ASSERT(pChildMsgHandler->pUIWndHandler != NULL); - SafeDelete(pChildMsgHandler->pUIWndHandler); - - return (LRESULT)TRUE; - } - - return (LRESULT)FALSE; } -LRESULT CMainWndHandler::OnBtnOk(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam) +void CMainWnd::OnBtnClose() { - CWnd *pWnd = pUIWnd->GetDlgItem(IDC_STA_MSG); +} +void CMainWnd::OnBtnOk() +{ AfxMessageBox(_T("IDC_BTN_OK")); - - pWnd->SetWindowText(_T("ťıͳˡ")); - - return 0; } diff --git a/UIShop/Template/MainWndHandler.h b/UIShop/Template/MainWndHandler.h index c8d803e..3bb5ba0 100644 --- a/UIShop/Template/MainWndHandler.h +++ b/UIShop/Template/MainWndHandler.h @@ -1,17 +1,45 @@ +// MainWnd.h : interface of the CMainWnd class +// #pragma once +#include "ChildWnd.h" -class CMainWndHandler : public CUIWndHandler + +class CMainWnd : public CUIWnd { public: - CMainWndHandler(UINT uWinID); - virtual ~CMainWndHandler(); + CMainWnd(); + virtual ~CMainWnd(); + void WindowID() { IDD = IDW_MAIN; } + +protected: + int InitControls(); + +public: + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + // Generated message map functions +protected: + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnBtnMin(); + afx_msg void OnChkMax(); + afx_msg void OnBtnClose(); + afx_msg void OnBtnOk(); + DECLARE_MESSAGE_MAP() + +protected: + CSkinStatic *m_pStaTitle; + CSkinButton *m_pBtnMin; + CSkinButton *m_pChkMax; + CSkinButton *m_pBtnClose; + CSkinStatic *m_pStaMsg; + CSkinButton *m_pBtnOk; + CRectCtrl *m_pRcChild; + +public: + BOOL m_bMax; protected: - afx_msg LRESULT OnCreate(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnDestroy(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnGetChildMsgHandler(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnReleaseChildMsgHandler(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam); - afx_msg LRESULT OnBtnOk(CUIWnd *pUIWnd, WPARAM wParam, LPARAM lParam); - IUI_DECLARE_MESSAGE_MAP() + CChildWnd m_wndChild; }; diff --git a/UIShop/Template/NewProj.inf b/UIShop/Template/NewProj.inf index 9ad565e..765cc41 100644 --- a/UIShop/Template/NewProj.inf +++ b/UIShop/Template/NewProj.inf @@ -24,10 +24,10 @@ $$// Canned parts, with canned names stdafx.cpp StdAfx.cpp $$IF(DLG) -MainWndHandler.h MainWndHandler.h -MainWndHandler.cpp MainWndHandler.cpp -ChildWndHandler.h ChildWndHandler.h -ChildWndHandler.cpp ChildWndHandler.cpp +MainWndHandler.h MainWnd.h +MainWndHandler.cpp MainWnd.cpp +ChildWndHandler.h ChildWnd.h +ChildWndHandler.cpp ChildWnd.cpp $$ENDIF // DLG $$IF(MDI) @@ -77,7 +77,7 @@ root.rc2 res\$$root$$.rc2 $$IF(MDI) =MDI_RootDoc.ico res\$$root$$Doc.ico =MDI_classviewicon.bmp res\classview.bmp -$$ENDIF +$$ENDIF // MDI $$// Project files @@ -134,6 +134,13 @@ stdafx_80.h stdafx.h $$//targetver_100.h targetver.h $$ENDIF //PROJECT_VC140 +vs2019.sln $$root$$_vs2019.sln +vs2019.vcxproj $$root$$_vs2019.vcxproj +$$IF(PROJECT_VC2019) +stdafx_80.h stdafx.h +$$//targetver_100.h targetver.h +$$ENDIF //PROJECT_VC140 + $$// binary and skins file /Bin diff --git a/UIShop/Template/Root.cpp b/UIShop/Template/Root.cpp index 7dc19dc..ee453d0 100644 --- a/UIShop/Template/Root.cpp +++ b/UIShop/Template/Root.cpp @@ -13,7 +13,7 @@ #include "$$root$$View.h" $$ENDIF $$IF(DLG) -#include "MainWndHandler.h" +#include "MainWnd.h" $$ENDIF @@ -58,9 +58,6 @@ END_MESSAGE_MAP() $$ENDIF m_bCallLibUIDKMsgMap = TRUE; m_pMainFrame = NULL; -$$IF(!MDI) - m_pMainWndHandler = NULL; -$$ENDIF } $$IF(ATL_SUPPORT) @@ -217,10 +214,9 @@ BOOL $$APP_CLASS$$::InitInstance() m_pFrame->Update(); $$ENDIF $$IF(!MDI) - m_pMainWndHandler = new CMainWndHandler(IDW_MAIN); - m_pMainFrame = CUIMgr::LoadFrame(IDR_MAINFRAME, WS_VISIBLE | WS_POPUP, - IDW_MAIN, m_pMainWndHandler); - if (m_pMainFrame == NULL) + m_pMainFrame = new CMainWnd; + m_pMainFrame->LoadFrame(IDR_MAINFRAME, WS_VISIBLE | WS_POPUP, NULL); + if (m_pMainFrame->GetSafeHwnd() == NULL) { // Search the error code in LibUIDK.h, the first error code is E_LOADBMPB. DWORD dwLastError = m_pMainFrame->GetLastCreateError(); @@ -253,8 +249,6 @@ int $$APP_CLASS$$::ExitInstance() { SafeDelete(m_pMainFrame); } - - SafeDelete(m_pMainWndHandler); $$ENDIF CUIMgr::ReleaseSkin(); diff --git a/UIShop/Template/Root.dsp b/UIShop/Template/Root.dsp index 234c2c3..fbc2484 100644 --- a/UIShop/Template/Root.dsp +++ b/UIShop/Template/Root.dsp @@ -7,19 +7,19 @@ CFG=$$root$$ - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "$$root$$.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "$$root$$.mak" CFG="$$root$$ - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "$$root$$ - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "$$root$$ - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -81,7 +81,7 @@ LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /out:"Bin/$$root$$_D.exe" /pdbtype:sept -!ENDIF +!ENDIF # Begin Target @@ -158,7 +158,7 @@ SOURCE=.\MainFrm.cpp $$ENDIF // MDI # Begin Source File -SOURCE=.\MainWndHandler.cpp +SOURCE=.\MainWnd.cpp # End Source File # Begin Source File @@ -237,7 +237,7 @@ SOURCE=.\MainFrm.h $$ENDIF // MDI # Begin Source File -SOURCE=.\MainWndHandler.h +SOURCE=.\MainWnd.h # End Source File # Begin Source File diff --git a/UIShop/Template/Root.h b/UIShop/Template/Root.h index 11ddf6f..4cb2d25 100644 --- a/UIShop/Template/Root.h +++ b/UIShop/Template/Root.h @@ -19,9 +19,6 @@ #include "resource.h" // main symbols class CMainFrame; -$$IF(!MDI) -class CMainWndHandler; -$$ENDIF ///////////////////////////////////////////////////////////////////////////// // $$APP_CLASS$$: @@ -72,9 +69,6 @@ class $$APP_CLASS$$ : public CWinApp $$ENDIF BOOL m_bCallLibUIDKMsgMap; CUIWnd *m_pMainFrame; -$$IF(!MDI) - CMainWndHandler *m_pMainWndHandler; -$$ENDIF }; $$IF(PROJECT_VC60) diff --git a/UIShop/Template/Root_100.vcxproj b/UIShop/Template/Root_100.vcxproj index 5fa2421..a32b5bb 100644 --- a/UIShop/Template/Root_100.vcxproj +++ b/UIShop/Template/Root_100.vcxproj @@ -158,8 +158,8 @@ $$IF(IM) $$ENDIF // IM $$IF(DLG) - - + + $$ENDIF // DLG @@ -187,8 +187,8 @@ $$IF(MDI) $$ENDIF // MDI $$IF(DLG) - - + + $$ENDIF // DLG Create diff --git a/UIShop/Template/Root_71.vcproj b/UIShop/Template/Root_71.vcproj index 741e1cf..e458281 100644 --- a/UIShop/Template/Root_71.vcproj +++ b/UIShop/Template/Root_71.vcproj @@ -132,7 +132,7 @@ $$IF(DLG) + RelativePath=".\MainWnd.cpp"> $$ENDIF // DLG $$IF(DLG) + RelativePath=".\MainWnd.h"> $$ENDIF // DLG $$IF(DLG) $$ENDIF // DLG @@ -203,7 +203,7 @@ $$ENDIF // DLG $$IF(DLG) $$ENDIF // DLG @@ -291,7 +291,7 @@ $$ENDIF // IM > $$IF(DLG) $$ENDIF // DLG @@ -301,7 +301,7 @@ $$ENDIF // DLG $$IF(DLG) $$ENDIF // DLG diff --git a/UIShop/Template/Root_90.vcproj b/UIShop/Template/Root_90.vcproj index eeddf07..78f9e94 100644 --- a/UIShop/Template/Root_90.vcproj +++ b/UIShop/Template/Root_90.vcproj @@ -193,11 +193,11 @@ $$IF(DLG) $$ENDIF // DLG @@ -289,11 +289,11 @@ $$ENDIF // IM $$IF(DLG) $$ENDIF // DLG diff --git a/UIShop/Template/stdafx_80.h b/UIShop/Template/stdafx_80.h index aa385d7..c2d28b8 100644 --- a/UIShop/Template/stdafx_80.h +++ b/UIShop/Template/stdafx_80.h @@ -311,7 +311,7 @@ using namespace Render; #endif // end _UNICODE #endif #endif -#if (_MSC_VER >= 1910) // VC2017 +#if (_MSC_VER == 1910) // VC2017 #ifdef _DEBUG #ifdef _UNICODE #ifdef _AFXDLL @@ -342,3 +342,34 @@ using namespace Render; #endif // end _UNICODE #endif #endif +#if (_MSC_VER == 1927) // VC2019 + #ifdef _DEBUG + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK_vs2019ud.lib") + #else // Static + #pragma comment (lib, "LibUIDK_vs2019sud.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK_vs2019d.lib") + #else // Static + #pragma comment (lib, "LibUIDK_vs2019sd.lib") + #endif + #endif // end _UNICODE + #else // Release + #ifdef _UNICODE + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK_vs2019u.lib") + #else // Static + #pragma comment (lib, "LibUIDK_vs2019su.lib") + #endif + #else // ANSI + #ifdef _AFXDLL + #pragma comment (lib, "LibUIDK_vs2019.lib") + #else // Static + #pragma comment (lib, "LibUIDK_vs2019s.lib") + #endif + #endif // end _UNICODE + #endif +#endif diff --git a/UIShop/Template/the.xui b/UIShop/Template/the.xui index ae8467b..a09d4f5 100644 --- a/UIShop/Template/the.xui +++ b/UIShop/Template/the.xui @@ -15,6 +15,7 @@ + @@ -88,13 +89,13 @@ - + + - + - @@ -111,6 +112,7 @@ + diff --git a/UIShop/Template/vs2019.sln b/UIShop/Template/vs2019.sln new file mode 100644 index 0000000..907a70e --- /dev/null +++ b/UIShop/Template/vs2019.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30517.126 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("$$SOLUTION_GUID$$") = "$$root$$", "$$root$$_vs2019.vcxproj", "$$PROJECT_GUID$$" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + $$PROJECT_GUID$$.Debug|x64.ActiveCfg = Debug|x64 + $$PROJECT_GUID$$.Debug|x64.Build.0 = Debug|x64 + $$PROJECT_GUID$$.Debug|x86.ActiveCfg = Debug|Win32 + $$PROJECT_GUID$$.Debug|x86.Build.0 = Debug|Win32 + $$PROJECT_GUID$$.Release|x64.ActiveCfg = Release|x64 + $$PROJECT_GUID$$.Release|x64.Build.0 = Release|x64 + $$PROJECT_GUID$$.Release|x86.ActiveCfg = Release|Win32 + $$PROJECT_GUID$$.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = $$SOLUTION_GUID2$$ + EndGlobalSection +EndGlobal diff --git a/UIShop/Template/vs2019.vcxproj b/UIShop/Template/vs2019.vcxproj new file mode 100644 index 0000000..c123183 --- /dev/null +++ b/UIShop/Template/vs2019.vcxproj @@ -0,0 +1,222 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + + 16.0 + $$PROJECT_GUID$$ + MFCProj + $$Root$$ + 10.0 + + + + Application + true + v142 + Unicode + Dynamic + + + Application + false + v142 + true + Unicode + Dynamic + + + Application + true + v142 + Unicode + Dynamic + + + Application + false + v142 + true + Unicode + Dynamic + + + + + + + + + + + + + + + + + + + + + true + $(LIBUIDKINCLUDE);$(WindowsSdkDir)\common\include;$(IncludePath) + $(LIBUIDKLIB);$(WindowsSdkDir)\common\lib;$(LibraryPath) + $(SolutionDir)Bin\ + + + true + $(LIBUIDKINCLUDE);$(IncludePath) + $(LIBUIDKLIB);$(VSInstallDir)SDK\v2.0\lib\amd64;$(LibraryPath) + $(SolutionDir)Bin\ + + + false + $(LIBUIDKINCLUDE);$(WindowsSdkDir)\common\include;$(IncludePath) + $(LIBUIDKLIB);$(WindowsSdkDir)\common\lib;$(LibraryPath) + $(SolutionDir)Bin\ + + + false + $(LIBUIDKINCLUDE);$(IncludePath) + $(LIBUIDKLIB);$(VSInstallDir)SDK\v2.0\lib\amd64;$(LibraryPath) + $(SolutionDir)Bin\ + + + + Use + Level3 + true + WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) + stdafx.h + + + Windows + + + false + true + _DEBUG;%(PreprocessorDefinitions) + + + 0x0409 + _DEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Use + Level3 + true + _WINDOWS;_DEBUG;%(PreprocessorDefinitions) + stdafx.h + + + Windows + + + false + true + _DEBUG;%(PreprocessorDefinitions) + + + 0x0409 + _DEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Use + Level3 + true + true + true + WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) + stdafx.h + + + Windows + true + true + + + false + true + NDEBUG;%(PreprocessorDefinitions) + + + 0x0409 + NDEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Use + Level3 + true + true + true + _WINDOWS;NDEBUG;%(PreprocessorDefinitions) + stdafx.h + + + Windows + true + true + + + false + true + NDEBUG;%(PreprocessorDefinitions) + + + 0x0409 + NDEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + + \ No newline at end of file diff --git a/UIShop/TestWnd.cpp b/UIShop/TestWnd.cpp index f99c4b1..c1a5294 100644 --- a/UIShop/TestWnd.cpp +++ b/UIShop/TestWnd.cpp @@ -851,7 +851,6 @@ int CTestWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) { CSkinListCtrl *pWnd = (CSkinListCtrl *)CWnd::FromHandle(hWnd); pWnd->SetImageList(&m_imgList, LVSIL_NORMAL); - pWnd->EnableOwnerDraw(TRUE); pWnd->EnableToolTips(TRUE); if (!bOwnerData) diff --git a/UIShop/TransformDialogDlg.cpp b/UIShop/TransformDialogDlg.cpp index ff1e90b..23afc68 100644 --- a/UIShop/TransformDialogDlg.cpp +++ b/UIShop/TransformDialogDlg.cpp @@ -68,7 +68,7 @@ void CTransformDialogDlg::OnBnClickedBtnGoSource() if (!bRet) return; - int nRet = (int)ShellExecute(NULL, _T("open"), GetFilePath(m_strResSource), NULL, NULL, SW_SHOW); + INT_PTR nRet = (INT_PTR)ShellExecute(NULL, _T("open"), GetFilePath(m_strResSource), NULL, NULL, SW_SHOW); if (nRet > 32) return; // Successful. @@ -103,7 +103,7 @@ void CTransformDialogDlg::OnBnClickedBtnGoTarget() if (!bRet) return; - int nRet = (int)ShellExecute(NULL, _T("open"), GetFilePath(m_strXUITarget), NULL, NULL, SW_SHOW); + INT_PTR nRet = (INT_PTR)ShellExecute(NULL, _T("open"), GetFilePath(m_strXUITarget), NULL, NULL, SW_SHOW); if (nRet > 32) return; // Successful. diff --git a/UIShop/UIDesignWnd.cpp b/UIShop/UIDesignWnd.cpp index 2c637f0..740e7f7 100644 --- a/UIShop/UIDesignWnd.cpp +++ b/UIShop/UIDesignWnd.cpp @@ -180,7 +180,7 @@ void CUIDesignWnd::DrawBkImage(CDC *pMemDC) void CUIDesignWnd::DrawBackgroundShowControls(CDC *pMemDC) { // The hidden window less picture controls need 'Backgournd Show'. - int nCtrlCount = m_listCtrl.size(); + size_t nCtrlCount = m_listCtrl.size(); for (int i = 0; i < nCtrlCount; ++i) { CControlWnd *pCtrlWnd = m_listCtrl[i]; @@ -229,21 +229,21 @@ void CUIDesignWnd::OnLButtonDown(UINT nFlags, CPoint point) if (rcRightBorder.PtInRect(point)) { - LONG lNew = (LONG)LoadCursor(NULL, IDC_SIZEWE); + LONG_PTR lNew = (LONG_PTR)LoadCursor(NULL, IDC_SIZEWE); SetClassLongPtr(this->GetSafeHwnd(), GCLP_HCURSOR, lNew); m_nHitTestRet = HTRIGHT; } else if (rcBottomBorder.PtInRect(point)) { - LONG lNew = (LONG)LoadCursor(NULL, IDC_SIZENS); + LONG_PTR lNew = (LONG_PTR)LoadCursor(NULL, IDC_SIZENS); SetClassLongPtr(this->GetSafeHwnd(), GCLP_HCURSOR, lNew); m_nHitTestRet = HTBOTTOM; } else if (rcRightBottom.PtInRect(point)) { - LONG lNew = (LONG)LoadCursor(NULL, IDC_SIZENWSE); + LONG_PTR lNew = (LONG_PTR)LoadCursor(NULL, IDC_SIZENWSE); SetClassLongPtr(this->GetSafeHwnd(), GCLP_HCURSOR, lNew); m_nHitTestRet = HTBOTTOMRIGHT; @@ -318,12 +318,12 @@ void CUIDesignWnd::OnMouseMove(UINT nFlags, CPoint point) CONTROL_TYPE eControlType = g_pFrm->GetCurSelControlType(); if (eControlType != CT_ARROW) { - LONG lNew = (LONG)LoadCursor(NULL, IDC_CROSS); + LONG_PTR lNew = (LONG_PTR)LoadCursor(NULL, IDC_CROSS); SetClassLongPtr(this->GetSafeHwnd(), GCLP_HCURSOR, lNew); } else { - LONG lNew = (LONG)LoadCursor(NULL, IDC_ARROW); + LONG_PTR lNew = (LONG_PTR)LoadCursor(NULL, IDC_ARROW); SetClassLongPtr(this->GetSafeHwnd(), GCLP_HCURSOR, lNew); } @@ -1622,7 +1622,7 @@ int CUIDesignWnd::GetSelectedControlsCount() int CUIDesignWnd::HighlightControl(const CTRLPROPERTIES *pCtrlProp) { - int nCount = m_listCtrl.size(); + size_t nCount = m_listCtrl.size(); for (int i = 0; i < nCount; ++i) { CControlWnd *pWnd = m_listCtrl[i]; @@ -1789,7 +1789,7 @@ int CUIDesignWnd::SetCurStoryFrame(int nFrame) } // Update view to story frame - int nCtrlCount = m_listCtrl.size(); + size_t nCtrlCount = m_listCtrl.size(); for (int i = 0; i < nCtrlCount; ++i) { CControlWnd *pWnd = m_listCtrl[i]; @@ -1906,7 +1906,7 @@ int CUIDesignWnd::MoveSelectedControls(CControlWnd *pSender, int nXOffset, int n int CUIDesignWnd::GetControlIndex(const CTRLPROPERTIES *pCtrlProp) { - int nChildCount = m_pUIWndProperties->m_vControls.size(); + size_t nChildCount = m_pUIWndProperties->m_vControls.size(); int nIndex = -1; for (int i = 0; i < nChildCount; ++i) diff --git a/UIShop/UIShop.cpp b/UIShop/UIShop.cpp index e285e56..2977ad4 100644 --- a/UIShop/UIShop.cpp +++ b/UIShop/UIShop.cpp @@ -268,7 +268,6 @@ class CPromptDocManager2 : public CPromptDocManager BEGIN_MESSAGE_MAP(CUIShopApp, CWinAppEx) ON_COMMAND(ID_APP_ABOUT, &CUIShopApp::OnAppAbout) // Standard file based document commands -// ON_COMMAND(ID_FILE_NEW, &CWinAppEx::OnFileNew) ON_COMMAND(ID_FILE_OPEN, &CWinAppEx::OnFileOpen) END_MESSAGE_MAP() diff --git a/UIShop/UIShop.rc b/UIShop/UIShop.rc index 0c53aa7..dd79334 100644 --- a/UIShop/UIShop.rc +++ b/UIShop/UIShop.rc @@ -286,7 +286,6 @@ IDR_MAINFRAME MENU BEGIN POPUP "&File" BEGIN - MENUITEM "&New\tCtrl+N", ID_FILE_NEW, INACTIVE MENUITEM "New LibUIDK Project...", ID_FILE_NEW_LIBUIDK_PROJECT MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN MENUITEM "&Close", ID_FILE_CLOSE @@ -431,8 +430,8 @@ BEGIN MENUITEM SEPARATOR MENUITEM "Add Class", IDSM_ADD_CLASS MENUITEM "Add All Classes", IDSM_ADD_ALL_CLASSES - MENUITEM "Add Event Handler Class", IDSM_ADD_EVENT_HANDLER_CLASS - MENUITEM "Add All Event Handler Classes", IDSM_ADD_ALL_EVENT_HANDLER_CLASSES + MENUITEM "Add Event Handler Class", IDSM_ADD_EVENT_HANDLER_CLASS, GRAYED + MENUITEM "Add All Event Handler Classes", IDSM_ADD_ALL_EVENT_HANDLER_CLASSES, GRAYED END END @@ -510,57 +509,45 @@ END // Dialog // -IDD_ABOUTBOX DIALOGEX 0, 0, 340, 101 +IDD_ABOUTBOX DIALOGEX 0, 0, 228, 66 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "About UIShop" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - ICON IDR_MAINFRAME,IDC_STATIC,14,14,21,20 - LTEXT "UIShop, LibUIDK Version 10.0",IDC_STA_VERSION,42,14,179,8,SS_NOPREFIX | SS_ENDELLIPSIS - LTEXT "Copyright (C) 2005-2019 iUIShop",IDC_STA_COPYRIGHT,42,26,179,8 - DEFPUSHBUTTON "OK",IDOK,283,80,50,14,WS_GROUP - LTEXT "http://www.iuishop.com",IDC_STA_HOME_PAGE,42,41,291,8 - LTEXT "???:https://github.com/iUIShop/LibUIDK",IDC_STA_SOURCE_CODE,42,53,291,8 - LTEXT "????????,???LibUIDK???????QQ:1584793892",IDC_STA_INFO,42,65,291,8 + ICON IDR_MAINFRAME,IDC_STATIC,14,14,20,20 + LTEXT "UIShop, Version 9.0",IDC_STA_VERSION,42,14,179,8,SS_NOPREFIX | SS_ENDELLIPSIS + LTEXT "Copyright (C) 2005-2018 iUIShop",IDC_STA_COPYRIGHT,42,26,179,8 + DEFPUSHBUTTON "OK",IDOK,171,45,50,14,WS_GROUP END -IDD_NEWPROJECT DIALOGEX 0, 0, 341, 270 +IDD_NEWPROJECT DIALOGEX 0, 0, 341, 222 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "New LibUIDK Project Wizard" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - DEFPUSHBUTTON "OK",IDOK,227,248,50,14 - PUSHBUTTON "Cancel",IDCANCEL,284,248,50,14 - GROUPBOX "Select Visual Studio Edition",IDC_STATIC,7,5,326,48 - CONTROL "Visual C++ 6.0",IDC_RAD_VC60,"Button",BS_AUTORADIOBUTTON,13,18,64,10 - CONTROL "Visual C++ 2003",IDC_RAD_VC71,"Button",BS_AUTORADIOBUTTON,87,18,69,10 - CONTROL "Visual C++ 2005",IDC_RAD_VC80,"Button",BS_AUTORADIOBUTTON,166,18,69,10 - CONTROL "Visual C++ 2008",IDC_RAD_VC90,"Button",BS_AUTORADIOBUTTON,245,18,69,10 - CONTROL "Visual C++ 2010",IDC_RAD_VC100,"Button",BS_AUTORADIOBUTTON,13,35,69,10 - CONTROL "Visual C++ 2012",IDC_RAD_VC110,"Button",BS_AUTORADIOBUTTON,87,35,69,10 - CONTROL "Visual C++ 2013",IDC_RAD_VC120,"Button",BS_AUTORADIOBUTTON,166,35,69,10 - CONTROL "Visual C++ 2015",IDC_RAD_VC140,"Button",BS_AUTORADIOBUTTON,245,35,69,10 - LTEXT "Select Project Type",IDC_STATIC,12,55,63,8 - CONTROL "General",IDC_RAD_PROJECT_GENERAL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,22,67,41,10 - CONTROL "Multiple documents",IDC_RAD_PROJECT_MDI,"Button",BS_AUTORADIOBUTTON,87,67,77,10 - CONTROL "IM",IDC_RAD_PROJECT_IM,"Button",BS_AUTORADIOBUTTON | WS_DISABLED,179,67,36,10 - CONTROL "Security Software",IDC_RAD_PROJECT_WEISHI,"Button",BS_AUTORADIOBUTTON | WS_DISABLED,245,67,75,10 - LTEXT "What database support would you like to include?",IDC_STATIC,12,80,266,10 - CONTROL "none",IDC_RAD_NONE,"Button",BS_AUTORADIOBUTTON,22,90,32,10 - CONTROL "Header files only",IDC_RAD_HEADER,"Button",BS_AUTORADIOBUTTON,22,101,84,10 - LTEXT "What other support would you like to include?",IDC_STATIC,12,114,181,8 - CONTROL "ActiveX controls",IDC_CHK_ACTIVEX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,124,80,10 - LTEXT "What features would you like to include?",IDC_STATIC,12,135,161,8 - CONTROL "Windows Sockets",IDC_CHK_SOCKET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,146,82,10 - LTEXT "Would you like to generate source file comments?",IDC_STATIC,12,157,193,8 - CONTROL "Yes, please",IDC_RAD_YES,"Button",BS_AUTORADIOBUTTON,22,167,60,10 - CONTROL "No, thank you",IDC_RAD_NO,"Button",BS_AUTORADIOBUTTON,22,178,68,10 - LTEXT "Project Name:",IDC_STATIC,12,190,46,8 - EDITTEXT IDC_EDT_PROJECTNAME,22,199,311,14,ES_AUTOHSCROLL - LTEXT "Location:",IDC_STATIC,12,216,30,8 - EDITTEXT IDC_EDT_LOCATION,22,226,235,14,ES_AUTOHSCROLL | ES_READONLY - PUSHBUTTON "...",IDC_BTN_BROWSER,268,226,28,14 - PUSHBUTTON "Go to",IDC_BTN_GOTO,306,226,28,14 + DEFPUSHBUTTON "OK",IDOK,227,200,50,14 + PUSHBUTTON "Cancel",IDCANCEL,284,200,50,14 + LTEXT "Select Project Type",IDC_STATIC,12,7,63,8 + CONTROL "General",IDC_RAD_PROJECT_GENERAL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,22,19,41,10 + CONTROL "Multiple documents",IDC_RAD_PROJECT_MDI,"Button",BS_AUTORADIOBUTTON | WS_DISABLED,87,19,77,10 + CONTROL "IM",IDC_RAD_PROJECT_IM,"Button",BS_AUTORADIOBUTTON | WS_DISABLED,179,19,36,10 + CONTROL "Security Software",IDC_RAD_PROJECT_WEISHI,"Button",BS_AUTORADIOBUTTON | WS_DISABLED,245,19,75,10 + LTEXT "What database support would you like to include?",IDC_STATIC,12,32,266,10 + CONTROL "none",IDC_RAD_NONE,"Button",BS_AUTORADIOBUTTON,22,42,32,10 + CONTROL "Header files only",IDC_RAD_HEADER,"Button",BS_AUTORADIOBUTTON,22,53,84,10 + LTEXT "What other support would you like to include?",IDC_STATIC,12,66,181,8 + CONTROL "ActiveX controls",IDC_CHK_ACTIVEX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,76,80,10 + LTEXT "What features would you like to include?",IDC_STATIC,12,87,161,8 + CONTROL "Windows Sockets",IDC_CHK_SOCKET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,98,82,10 + LTEXT "Would you like to generate source file comments?",IDC_STATIC,12,109,193,8 + CONTROL "Yes, please",IDC_RAD_YES,"Button",BS_AUTORADIOBUTTON,22,119,60,10 + CONTROL "No, thank you",IDC_RAD_NO,"Button",BS_AUTORADIOBUTTON,22,130,68,10 + LTEXT "Project Name:",IDC_STATIC,12,142,46,8 + EDITTEXT IDC_EDT_PROJECTNAME,22,151,311,14,ES_AUTOHSCROLL + LTEXT "Location:",IDC_STATIC,12,168,30,8 + EDITTEXT IDC_EDT_LOCATION,22,178,235,14,ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "...",IDC_BTN_BROWSER,268,178,28,14 + PUSHBUTTON "Go to",IDC_BTN_GOTO,306,178,28,14 END IDD_TABORDER DIALOGEX 0, 0, 405, 289 @@ -577,13 +564,13 @@ BEGIN PUSHBUTTON "Highlight",IDC_BTN_HIGHLIGHT,348,172,50,14 END -IDD_CLASS_WIZARD DIALOGEX 0, 0, 366, 215 +IDD_CLASS_WIZARD DIALOGEX 0, 0, 366, 180 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "LibUIDK Class Wizard" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - PUSHBUTTON "OK",IDOK,246,194,50,14 - PUSHBUTTON "Cancel",IDCANCEL,309,194,50,14 + PUSHBUTTON "OK",IDOK,246,159,50,14 + PUSHBUTTON "Cancel",IDCANCEL,309,159,50,14 LTEXT "Class Name:",IDC_STATIC,7,7,40,8 EDITTEXT IDC_EDT_CLASS_NAME,7,20,162,14,ES_AUTOHSCROLL LTEXT "Window ID:",IDC_STATIC,197,7,38,8,WS_DISABLED @@ -596,16 +583,13 @@ BEGIN EDITTEXT IDC_EDT_LOCATION,7,86,246,14,ES_AUTOHSCROLL | ES_READONLY PUSHBUTTON "Browse...",IDC_BTN_BROWSE,256,86,50,14 PUSHBUTTON "Goto",IDC_BTN_GOTO,309,86,50,14 - GROUPBOX "Code Style",IDC_STATIC,7,119,352,28 - CONTROL "Visual Studio 6.0",IDC_RAD_VC6,"Button",BS_AUTORADIOBUTTON,18,131,69,10 - CONTROL "Visual Studio.Net",IDC_RAD_VC_NET,"Button",BS_AUTORADIOBUTTON,179,131,70,10 CONTROL "Generate Control Event Handler",IDC_CHK_GEN_HANDLER, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,156,119,10 - CONTROL "Generate Control Variable",IDC_CHK_GEN_VARIABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,193,153,99,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,121,119,10 + CONTROL "Generate Control Variable",IDC_CHK_GEN_VARIABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,193,118,99,10 CONTROL "Generate DoDataExchange",IDC_CHK_GEN_DO_DATA_EXCHANGE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,172,103,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,137,103,10 LTEXT "Merge Tool Path:",IDC_STATIC,7,106,56,8 - COMBOBOX IDC_CMB_MERGE_TOOL_PATH,73,103,179,14,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CMB_MERGE_TOOL_PATH,73,103,179,48,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Browse...",IDC_BTN_BROWSE_MERGE_TOOL,256,103,50,14 PUSHBUTTON "Merge...",IDC_BTN_MERGE,309,103,50,14 END @@ -615,7 +599,7 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSM CAPTION "Image Symbols" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - CONTROL "",IDC_TREE_IMAGE_SYMBOLS,"SysTreeView32",TVS_SHOWSELALWAYS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,7,7,302,146 + CONTROL "",IDC_TREE_IMAGE_SYMBOLS,"SysTreeView32",TVS_EDITLABELS | TVS_SHOWSELALWAYS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,7,7,302,146 PUSHBUTTON "Move themes to 'Unused' folder",IDC_BTN_MOVE_TO_UNUSED,171,159,138,14 END @@ -773,9 +757,9 @@ BEGIN IDD_ABOUTBOX, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 333 + RIGHTMARGIN, 221 TOPMARGIN, 7 - BOTTOMMARGIN, 94 + BOTTOMMARGIN, 59 END IDD_NEWPROJECT, DIALOG @@ -783,7 +767,7 @@ BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 334 TOPMARGIN, 7 - BOTTOMMARGIN, 263 + BOTTOMMARGIN, 215 END IDD_TABORDER, DIALOG @@ -799,7 +783,7 @@ BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 359 TOPMARGIN, 7 - BOTTOMMARGIN, 208 + BOTTOMMARGIN, 173 END IDD_IMAGE_SYMBOLS, DIALOG @@ -1053,6 +1037,8 @@ IMICON_ONLINESTATE_AWAY.PNG TEMPLATE "Template\\IMICON_OnlineStat IMICON_ONLINESTATE_AWAY_BIG.PNG TEMPLATE "Template\\IMICON_OnlineState_Away_Big.png" IMICON_ONLINESTATE_BUSY.PNG TEMPLATE "Template\\IMICON_OnlineState_Busy.png" IMICON_ONLINESTATE_BUSY_BIG.PNG TEMPLATE "Template\\IMICON_OnlineState_Busy_big.png" +VS2019.SLN TEMPLATE "Template\\vs2019.sln" +VS2019.VCXPROJ TEMPLATE "Template\\vs2019.vcxproj" ///////////////////////////////////////////////////////////////////////////// // diff --git a/UIShop/UIShopView.cpp b/UIShop/UIShopView.cpp index 3e4c5e6..13c0995 100644 --- a/UIShop/UIShopView.cpp +++ b/UIShop/UIShopView.cpp @@ -625,7 +625,9 @@ void CUIShopView::SwitchWindow(CUIDesignWnd *pwndUIDesign) m_pFocusCtrlProp = NULL; } +#ifdef ADV g_pFrm->GetStoryboardPanel()->SetBindUIWnd(m_pWndUIDesign); +#endif } void CUIShopView::SwitchCtrlProperties(CTRLPROPERTIES *pCtrlResource) diff --git a/UIShop/UIShop_vs2010.vcxproj b/UIShop/UIShop_vs2010.vcxproj index dd5e428..a74f4ed 100644 --- a/UIShop/UIShop_vs2010.vcxproj +++ b/UIShop/UIShop_vs2010.vcxproj @@ -1402,13 +1402,49 @@ true true - - - + + true + true + true + true + true + true + true + true + + + true + true + true + true + true + true + true + true + + + true + true + true + true + true + true + true + true + - + + true + true + true + true + true + true + true + true + diff --git a/UIShop/UIShop_vs2010.vcxproj.filters b/UIShop/UIShop_vs2010.vcxproj.filters index ab82cc3..cf6ca24 100644 --- a/UIShop/UIShop_vs2010.vcxproj.filters +++ b/UIShop/UIShop_vs2010.vcxproj.filters @@ -409,11 +409,7 @@ Resource Files - - - - Resource Files @@ -426,7 +422,21 @@ Resource Files - + + LibUIDKRcSkin + + + LibUIDKRcSkin + + + LibUIDKRcSkin + + + Template + + + Resource Files + diff --git a/UIShop/UIShop_vs2017.sln b/UIShop/UIShop_vs2017.sln index dc30a15..ae9e317 100644 --- a/UIShop/UIShop_vs2017.sln +++ b/UIShop/UIShop_vs2017.sln @@ -26,8 +26,8 @@ Global {BB6A29CF-C13A-4964-B42B-AF060F6CBCF9}.Release|x64.Build.0 = Release|x64 {BB6A29CF-C13A-4964-B42B-AF060F6CBCF9}.Release|x86.ActiveCfg = Release|Win32 {BB6A29CF-C13A-4964-B42B-AF060F6CBCF9}.Release|x86.Build.0 = Release|Win32 - {B108C49C-6216-43A9-A266-619C2BEBFAD5}.Debug|x64.ActiveCfg = Debug|x64 - {B108C49C-6216-43A9-A266-619C2BEBFAD5}.Debug|x64.Build.0 = Debug|x64 + {B108C49C-6216-43A9-A266-619C2BEBFAD5}.Debug|x64.ActiveCfg = Debug Unicode|x64 + {B108C49C-6216-43A9-A266-619C2BEBFAD5}.Debug|x64.Build.0 = Debug Unicode|x64 {B108C49C-6216-43A9-A266-619C2BEBFAD5}.Debug|x86.ActiveCfg = Debug Unicode|Win32 {B108C49C-6216-43A9-A266-619C2BEBFAD5}.Debug|x86.Build.0 = Debug Unicode|Win32 {B108C49C-6216-43A9-A266-619C2BEBFAD5}.Release|x64.ActiveCfg = Release|x64 diff --git a/UIShop/UIShop_vs2017.vcxproj b/UIShop/UIShop_vs2017.vcxproj index b9c3157..d84fec3 100644 --- a/UIShop/UIShop_vs2017.vcxproj +++ b/UIShop/UIShop_vs2017.vcxproj @@ -76,15 +76,19 @@ true + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(VC_ExecutablePath_x86);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(FxCopDir);$(MSBuild_ExecutablePath);$(SystemRoot) true + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(FxCopDir);$(MSBuild_ExecutablePath);$(SystemRoot) false + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(VC_ExecutablePath_x86);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(FxCopDir);$(MSBuild_ExecutablePath);$(SystemRoot) false + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(FxCopDir);$(MSBuild_ExecutablePath);$(SystemRoot) @@ -96,7 +100,8 @@ Windows - ../LibUIDK/Lib/LibUIDKud_vs2017.lib + + false @@ -145,7 +150,8 @@ Windows true true - ../LibUIDK/Lib/LibUIDKsu_vs2017.lib + + false @@ -310,6 +316,11 @@ + + + {b108c49c-6216-43a9-a266-619c2bebfad5} + + diff --git a/UIShop/UIShop_vs2019.sln b/UIShop/UIShop_vs2019.sln new file mode 100644 index 0000000..e874d78 --- /dev/null +++ b/UIShop/UIShop_vs2019.sln @@ -0,0 +1,44 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30517.126 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UIShop_vs2019", "UIShop_vs2019.vcxproj", "{18517454-CCE0-415E-8247-9E0622480A4D}" + ProjectSection(ProjectDependencies) = postProject + {DC979C4F-ECB2-47FE-9721-EA973F964C4E} = {DC979C4F-ECB2-47FE-9721-EA973F964C4E} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibUIDK_vs2019", "..\LibUIDK\LibUIDK_vs2019.vcxproj", "{DC979C4F-ECB2-47FE-9721-EA973F964C4E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug Unicode|x64 = Debug Unicode|x64 + Debug Unicode|x86 = Debug Unicode|x86 + Release Unicode Static|x64 = Release Unicode Static|x64 + Release Unicode Static|x86 = Release Unicode Static|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {18517454-CCE0-415E-8247-9E0622480A4D}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 + {18517454-CCE0-415E-8247-9E0622480A4D}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 + {18517454-CCE0-415E-8247-9E0622480A4D}.Debug Unicode|x86.ActiveCfg = Debug Unicode|Win32 + {18517454-CCE0-415E-8247-9E0622480A4D}.Debug Unicode|x86.Build.0 = Debug Unicode|Win32 + {18517454-CCE0-415E-8247-9E0622480A4D}.Release Unicode Static|x64.ActiveCfg = Release Unicode Static|x64 + {18517454-CCE0-415E-8247-9E0622480A4D}.Release Unicode Static|x64.Build.0 = Release Unicode Static|x64 + {18517454-CCE0-415E-8247-9E0622480A4D}.Release Unicode Static|x86.ActiveCfg = Release Unicode Static|Win32 + {18517454-CCE0-415E-8247-9E0622480A4D}.Release Unicode Static|x86.Build.0 = Release Unicode Static|Win32 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Debug Unicode|x86.ActiveCfg = Debug Unicode|Win32 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Debug Unicode|x86.Build.0 = Debug Unicode|Win32 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Release Unicode Static|x64.ActiveCfg = Release Unicode Static|x64 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Release Unicode Static|x64.Build.0 = Release Unicode Static|x64 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Release Unicode Static|x86.ActiveCfg = Release Unicode Static|Win32 + {DC979C4F-ECB2-47FE-9721-EA973F964C4E}.Release Unicode Static|x86.Build.0 = Release Unicode Static|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C9F6AAA1-014D-4983-BF32-B1F30EDF86F2} + EndGlobalSection +EndGlobal diff --git a/UIShop/UIShop_vs2019.vcxproj b/UIShop/UIShop_vs2019.vcxproj new file mode 100644 index 0000000..aca23b6 --- /dev/null +++ b/UIShop/UIShop_vs2019.vcxproj @@ -0,0 +1,1352 @@ + + + + + Debug Unicode + Win32 + + + Release Unicode Static + Win32 + + + Debug Unicode + x64 + + + Release Unicode Static + x64 + + + + 16.0 + {18517454-CCE0-415E-8247-9E0622480A4D} + MFCProj + UIShop + 10.0 + + + + Application + true + v142 + Unicode + Dynamic + + + Application + false + v142 + true + Unicode + Static + + + Application + true + v142 + Unicode + Dynamic + + + Application + false + v142 + true + Unicode + Static + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Use + Level3 + true + WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) + StdAfx.h + + + Windows + + + + + + + false + true + _DEBUG;%(PreprocessorDefinitions) + + + 0x0804 + _DEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Use + Level3 + true + _WINDOWS;_DEBUG;%(PreprocessorDefinitions) + StdAfx.h + + + Windows + + + false + true + _DEBUG;%(PreprocessorDefinitions) + + + 0x0804 + _DEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Use + Level3 + true + true + true + WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) + StdAfx.h + MultiThreaded + + + Windows + true + true + + + false + true + NDEBUG;%(PreprocessorDefinitions) + + + 0x0804 + NDEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Use + Level3 + true + true + true + _WINDOWS;NDEBUG;%(PreprocessorDefinitions) + StdAfx.h + MultiThreaded + + + Windows + true + true + + + false + true + NDEBUG;%(PreprocessorDefinitions) + + + 0x0804 + NDEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + StdAfx.h + Create + StdAfx.h + Create + StdAfx.h + Create + StdAfx.h + + + + + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + + + + + + {dc979c4f-ecb2-47fe-9721-ea973f964c4e} + + + + + + \ No newline at end of file diff --git a/UIShop/UIShop_vs2019.vcxproj.filters b/UIShop/UIShop_vs2019.vcxproj.filters new file mode 100644 index 0000000..83bdee6 --- /dev/null +++ b/UIShop/UIShop_vs2019.vcxproj.filters @@ -0,0 +1,877 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {041897cc-f8e0-4bbf-9462-8dbe710b10b7} + + + {4ceeea55-ec49-47f4-b4d1-78c5611405ff} + + + + + + 资源文件 + + + 资源文件 + + + LibUIDKRcSkin + + + LibUIDKRcSkin + + + LibUIDKRcSkin + + + LibUIDKRcSkin + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + + + + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + 资源文件 + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + Template + + + + + 资源文件 + + + \ No newline at end of file diff --git a/UIShop/res/Toolbar256.bmp b/UIShop/res/Toolbar256.bmp index e81ccbc..8a49c17 100644 Binary files a/UIShop/res/Toolbar256.bmp and b/UIShop/res/Toolbar256.bmp differ