├── .gitignore ├── LICENSE ├── README.md └── testtab ├── readme.txt ├── readme.txt.bak ├── testtab ├── 360Safe.cpp ├── 360Safe.h ├── Afxthread.cpp ├── Afxthread.h ├── BeauMaster.htm ├── BeautMaster.cpp ├── BeautMaster.h ├── CNetWork.cpp ├── CNetWork.h ├── CTaskMgr.cpp ├── CTaskMgr.h ├── CleanRubbish.cpp ├── CleanRubbish.h ├── ClearHistory.cpp ├── ClearHistory.h ├── ClearMaster.cpp ├── ClearMaster.h ├── Control │ ├── UIActiveX.cpp │ ├── UIActiveX.h │ ├── UIButton.cpp │ ├── UIButton.h │ ├── UICheckBox.cpp │ ├── UICheckBox.h │ ├── UICombo.cpp │ ├── UICombo.h │ ├── UIComboBox.cpp │ ├── UIComboBox.h │ ├── UIDateTime.cpp │ ├── UIDateTime.h │ ├── UIEdit.cpp │ ├── UIEdit.h │ ├── UIFlash.cpp │ ├── UIFlash.h │ ├── UILabel.cpp │ ├── UILabel.h │ ├── UIList.cpp │ ├── UIList.h │ ├── UIOption.cpp │ ├── UIOption.h │ ├── UIProgress.cpp │ ├── UIProgress.h │ ├── UIRichEdit.cpp │ ├── UIRichEdit.h │ ├── UIScrollBar.cpp │ ├── UIScrollBar.h │ ├── UISlider.cpp │ ├── UISlider.h │ ├── UIText.cpp │ ├── UIText.h │ ├── UITreeView.cpp │ ├── UITreeView.h │ ├── UIWebBrowser.cpp │ └── UIWebBrowser.h ├── ControlEx.h ├── Core │ ├── UIBase.cpp │ ├── UIBase.h │ ├── UIContainer.cpp │ ├── UIContainer.h │ ├── UIControl.cpp │ ├── UIControl.h │ ├── UIDlgBuilder.cpp │ ├── UIDlgBuilder.h │ ├── UIManager.cpp │ ├── UIManager.h │ ├── UIMarkup.cpp │ ├── UIMarkup.h │ ├── UIRender.cpp │ ├── UIRender.h │ └── uidefine.h ├── DlgCleanRubbish.htm ├── DuiLib_u.dll ├── DuiLib_ud.dll ├── FileExplorer.cpp ├── FileExplorer.h ├── FileVerion.cpp ├── FileVerion.h ├── FileView.cpp ├── FileView.h ├── HBrowseFolder.cpp ├── HBrowseFolder.h ├── HSelectDlg.cpp ├── HSelectDlg.h ├── InterNetSetting.h ├── Layout │ ├── UIChildLayout.cpp │ ├── UIChildLayout.h │ ├── UIHorizontalLayout.cpp │ ├── UIHorizontalLayout.h │ ├── UITabLayout.cpp │ ├── UITabLayout.h │ ├── UITileLayout.cpp │ ├── UITileLayout.h │ ├── UIVerticalLayout.cpp │ └── UIVerticalLayout.h ├── MainDlg.cpp ├── MainDlg.h ├── ProcessConsumption.cpp ├── ProcessConsumption.h ├── ReadMe.txt ├── RegeDitDlg.cpp ├── RegeDitDlg.h ├── Settings.ini ├── SkinPPWTL.h ├── StartMag.cpp ├── StartMag.h ├── SystemInfoDlg.cpp ├── SystemInfoDlg.h ├── UIlib.h ├── UsbShaDuDlg.cpp ├── UsbShaDuDlg.h ├── Utils │ ├── FlashEventHandler.h │ ├── UIDelegate.cpp │ ├── UIDelegate.h │ ├── Utils.cpp │ ├── Utils.h │ ├── WebBrowserEventHandler.h │ ├── WinImplBase.cpp │ ├── WinImplBase.h │ ├── XUnzip.cpp │ ├── downloadmgr.h │ ├── flash11.tlh │ └── stb_image.c ├── lib │ ├── DuiLib.lib │ ├── DuiLib_d.lib │ ├── DuiLib_u.lib │ └── DuiLib_ud.lib ├── res │ ├── 360SafeRes.zip │ ├── FILE.ico │ ├── INFO.ico │ ├── PORT.ico │ ├── PROCESS.ICO │ ├── SRV.ico │ ├── icon1.ico │ ├── systeminfo.bmp │ ├── testtab.ico │ └── testtab.rc2 ├── resource.h ├── stdafx.cpp ├── stdafx.h ├── targetver.h ├── testtab.cpp ├── testtab.h ├── testtab.rc ├── testtab.vcproj ├── testtab.vcproj.2011-20130128NZ.Administrator.user ├── testtab.vcproj.CPP.abc.user ├── testtab.vcproj.GDCPP.abc.user ├── testtab.vcproj.MICROSOF-B47D37.Administrator.user ├── testtabDlg.cpp └── testtabDlg.h ├── windows.sln └── windows.suo /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | windows wopti 2 | =========== 3 | 4 | 大学四年自己写的最后一个程序,毕业设计,windows优化大师,现在开源出来,也是一个美好的回忆。 5 | 6 | by pipi 2013年7月22日1:12:40 7 | windows优化大师 8 | -------------------------------------------------------------------------------- /testtab/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/readme.txt -------------------------------------------------------------------------------- /testtab/readme.txt.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/readme.txt.bak -------------------------------------------------------------------------------- /testtab/testtab/360Safe.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/360Safe.cpp -------------------------------------------------------------------------------- /testtab/testtab/360Safe.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | using namespace DuiLib; 5 | 6 | #include 7 | #include 8 | #include "ControlEx.h" 9 | #include "resource.h" 10 | 11 | class C360SafeUI : public CWindowWnd, public INotifyUI 12 | { 13 | public: 14 | C360SafeUI(); 15 | LPCTSTR GetWindowClassName() const; 16 | UINT GetClassStyle() const; 17 | void OnFinalMessage(HWND /*hWnd*/); 18 | void Init(); 19 | 20 | void OnPrepare(); 21 | 22 | void Notify(TNotifyUI& msg); 23 | 24 | LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); 25 | 26 | LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); 27 | 28 | LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); 29 | 30 | LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); 31 | 32 | LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); 33 | 34 | LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); 35 | 36 | LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); 37 | 38 | LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); 39 | 40 | LRESULT OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); 41 | 42 | LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); 43 | 44 | LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam); 45 | 46 | void LoadSkin(); 47 | 48 | public: 49 | CPaintManagerUI m_pm; 50 | int m_skinflag; 51 | 52 | private: 53 | CButtonUI* m_pCloseBtn; 54 | CButtonUI* m_pMaxBtn; 55 | CButtonUI* m_pRestoreBtn; 56 | CButtonUI* m_pMinBtn; 57 | CButtonUI * m_open; 58 | COptionUI * m_PYouhua; 59 | COptionUI * m_PClear; 60 | COptionUI * m_pMeihua; 61 | 62 | //... 63 | }; 64 | -------------------------------------------------------------------------------- /testtab/testtab/Afxthread.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Afxthread.cpp -------------------------------------------------------------------------------- /testtab/testtab/Afxthread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CAfxThread : public CWinThread 4 | { 5 | DECLARE_DYNCREATE(CAfxThread) 6 | protected: 7 | CAfxThread(); // protected constructor used by dynamic creation 8 | 9 | 10 | // Overrides 11 | // ClassWizard generated virtual function overrides 12 | //{{AFX_VIRTUAL(CAfxThread) 13 | public: 14 | virtual BOOL InitInstance(); 15 | virtual int ExitInstance(); 16 | 17 | 18 | //}}AFX_VIRTUAL 19 | 20 | // Implementation 21 | protected: 22 | virtual ~CAfxThread(); 23 | 24 | // Generated message map functions 25 | //{{AFX_MSG(CAfxThread) 26 | // NOTE - the ClassWizard will add and remove member functions here. 27 | afx_msg void OnAfxTest1Msg(WPARAM wParam, LPARAM lParam); 28 | afx_msg void OnAfxTest2Msg(WPARAM wParam, LPARAM lParam); 29 | afx_msg void OnAfxHelloMsg(WPARAM wParam,LPARAM lParam); 30 | //}}AFX_MSG 31 | 32 | DECLARE_MESSAGE_MAP() 33 | }; 34 | 35 | -------------------------------------------------------------------------------- /testtab/testtab/BeauMaster.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/BeauMaster.htm -------------------------------------------------------------------------------- /testtab/testtab/BeautMaster.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/BeautMaster.cpp -------------------------------------------------------------------------------- /testtab/testtab/BeautMaster.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/BeautMaster.h -------------------------------------------------------------------------------- /testtab/testtab/CNetWork.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/CNetWork.cpp -------------------------------------------------------------------------------- /testtab/testtab/CNetWork.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/CNetWork.h -------------------------------------------------------------------------------- /testtab/testtab/CTaskMgr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/CTaskMgr.cpp -------------------------------------------------------------------------------- /testtab/testtab/CTaskMgr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/CTaskMgr.h -------------------------------------------------------------------------------- /testtab/testtab/CleanRubbish.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/CleanRubbish.cpp -------------------------------------------------------------------------------- /testtab/testtab/CleanRubbish.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/CleanRubbish.h -------------------------------------------------------------------------------- /testtab/testtab/ClearHistory.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/ClearHistory.cpp -------------------------------------------------------------------------------- /testtab/testtab/ClearHistory.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/ClearHistory.h -------------------------------------------------------------------------------- /testtab/testtab/ClearMaster.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/ClearMaster.cpp -------------------------------------------------------------------------------- /testtab/testtab/ClearMaster.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/ClearMaster.h -------------------------------------------------------------------------------- /testtab/testtab/Control/UIActiveX.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UIActiveX.cpp -------------------------------------------------------------------------------- /testtab/testtab/Control/UIActiveX.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIACTIVEX_H__ 2 | #define __UIACTIVEX_H__ 3 | 4 | #pragma once 5 | 6 | struct IOleObject; 7 | 8 | 9 | namespace DuiLib { 10 | ///////////////////////////////////////////////////////////////////////////////////// 11 | // 12 | 13 | class CActiveXCtrl; 14 | 15 | template< class T > 16 | class CSafeRelease 17 | { 18 | public: 19 | CSafeRelease(T* p) : m_p(p) { }; 20 | ~CSafeRelease() { if( m_p != NULL ) m_p->Release(); }; 21 | T* Detach() { T* t = m_p; m_p = NULL; return t; }; 22 | T* m_p; 23 | }; 24 | 25 | ///////////////////////////////////////////////////////////////////////////////////// 26 | // 27 | 28 | class UILIB_API CActiveXUI : public CControlUI, public IMessageFilterUI 29 | { 30 | friend class CActiveXCtrl; 31 | public: 32 | CActiveXUI(); 33 | virtual ~CActiveXUI(); 34 | 35 | LPCTSTR GetClass() const; 36 | LPVOID GetInterface(LPCTSTR pstrName); 37 | 38 | HWND GetHostWindow() const; 39 | 40 | bool IsDelayCreate() const; 41 | void SetDelayCreate(bool bDelayCreate = true); 42 | 43 | bool CreateControl(const CLSID clsid); 44 | bool CreateControl(LPCTSTR pstrCLSID); 45 | HRESULT GetControl(const IID iid, LPVOID* ppRet); 46 | CLSID GetClisd() const; 47 | CDuiString GetModuleName() const; 48 | void SetModuleName(LPCTSTR pstrText); 49 | 50 | void SetVisible(bool bVisible = true); 51 | void SetInternVisible(bool bVisible = true); 52 | void SetPos(RECT rc); 53 | void DoPaint(HDC hDC, const RECT& rcPaint); 54 | 55 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 56 | 57 | LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled); 58 | 59 | protected: 60 | virtual void ReleaseControl(); 61 | virtual bool DoCreateControl(); 62 | 63 | protected: 64 | CLSID m_clsid; 65 | CDuiString m_sModuleName; 66 | bool m_bCreated; 67 | bool m_bDelayCreate; 68 | IOleObject* m_pUnk; 69 | CActiveXCtrl* m_pControl; 70 | HWND m_hwndHost; 71 | }; 72 | 73 | } // namespace DuiLib 74 | 75 | #endif // __UIACTIVEX_H__ 76 | -------------------------------------------------------------------------------- /testtab/testtab/Control/UIButton.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "UIButton.h" 3 | 4 | namespace DuiLib 5 | { 6 | CButtonUI::CButtonUI() 7 | : m_uButtonState(0) 8 | , m_dwHotTextColor(0) 9 | , m_dwPushedTextColor(0) 10 | , m_dwFocusedTextColor(0) 11 | ,m_dwHotBkColor(0) 12 | { 13 | m_uTextStyle = DT_SINGLELINE | DT_VCENTER | DT_CENTER; 14 | } 15 | 16 | LPCTSTR CButtonUI::GetClass() const 17 | { 18 | return _T("ButtonUI"); 19 | } 20 | 21 | LPVOID CButtonUI::GetInterface(LPCTSTR pstrName) 22 | { 23 | if( _tcscmp(pstrName, DUI_CTR_BUTTON) == 0 ) return static_cast(this); 24 | return CLabelUI::GetInterface(pstrName); 25 | } 26 | 27 | UINT CButtonUI::GetControlFlags() const 28 | { 29 | return (IsKeyboardEnabled() ? UIFLAG_TABSTOP : 0) | (IsEnabled() ? UIFLAG_SETCURSOR : 0); 30 | } 31 | 32 | void CButtonUI::DoEvent(TEventUI& event) 33 | { 34 | if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) { 35 | if( m_pParent != NULL ) m_pParent->DoEvent(event); 36 | else CLabelUI::DoEvent(event); 37 | return; 38 | } 39 | 40 | if( event.Type == UIEVENT_SETFOCUS ) 41 | { 42 | Invalidate(); 43 | } 44 | if( event.Type == UIEVENT_KILLFOCUS ) 45 | { 46 | Invalidate(); 47 | } 48 | if( event.Type == UIEVENT_KEYDOWN ) 49 | { 50 | if (IsKeyboardEnabled()) { 51 | if( event.chKey == VK_SPACE || event.chKey == VK_RETURN ) { 52 | Activate(); 53 | return; 54 | } 55 | } 56 | } 57 | if( event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK ) 58 | { 59 | if( ::PtInRect(&m_rcItem, event.ptMouse) && IsEnabled() ) { 60 | m_uButtonState |= UISTATE_PUSHED | UISTATE_CAPTURED; 61 | Invalidate(); 62 | } 63 | return; 64 | } 65 | if( event.Type == UIEVENT_MOUSEMOVE ) 66 | { 67 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) { 68 | if( ::PtInRect(&m_rcItem, event.ptMouse) ) m_uButtonState |= UISTATE_PUSHED; 69 | else m_uButtonState &= ~UISTATE_PUSHED; 70 | Invalidate(); 71 | } 72 | return; 73 | } 74 | if( event.Type == UIEVENT_BUTTONUP ) 75 | { 76 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) { 77 | if( ::PtInRect(&m_rcItem, event.ptMouse) ) Activate(); 78 | m_uButtonState &= ~(UISTATE_PUSHED | UISTATE_CAPTURED); 79 | Invalidate(); 80 | } 81 | return; 82 | } 83 | if( event.Type == UIEVENT_CONTEXTMENU ) 84 | { 85 | if( IsContextMenuUsed() ) { 86 | m_pManager->SendNotify(this, DUI_MSGTYPE_MENU, event.wParam, event.lParam); 87 | } 88 | return; 89 | } 90 | if( event.Type == UIEVENT_MOUSEENTER ) 91 | { 92 | if( IsEnabled() ) { 93 | m_uButtonState |= UISTATE_HOT; 94 | Invalidate(); 95 | } 96 | // return; 97 | } 98 | if( event.Type == UIEVENT_MOUSELEAVE ) 99 | { 100 | if( IsEnabled() ) { 101 | m_uButtonState &= ~UISTATE_HOT; 102 | Invalidate(); 103 | } 104 | // return; 105 | } 106 | if( event.Type == UIEVENT_SETCURSOR ) { 107 | ::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND))); 108 | return; 109 | } 110 | CLabelUI::DoEvent(event); 111 | } 112 | 113 | bool CButtonUI::Activate() 114 | { 115 | if( !CControlUI::Activate() ) return false; 116 | if( m_pManager != NULL ) m_pManager->SendNotify(this, DUI_MSGTYPE_CLICK); 117 | return true; 118 | } 119 | 120 | void CButtonUI::SetEnabled(bool bEnable) 121 | { 122 | CControlUI::SetEnabled(bEnable); 123 | if( !IsEnabled() ) { 124 | m_uButtonState = 0; 125 | } 126 | } 127 | 128 | //************************************ 129 | // Method: SetHotBkColor 130 | // FullName: CButtonUI::SetHotBkColor 131 | // Access: public 132 | // Returns: void 133 | // Qualifier: 134 | // Parameter: DWORD dwColor 135 | // Note: 136 | //************************************ 137 | void CButtonUI::SetHotBkColor( DWORD dwColor ) 138 | { 139 | m_dwHotBkColor = dwColor; 140 | } 141 | 142 | //************************************ 143 | // Method: GetHotBkColor 144 | // FullName: CButtonUI::GetHotBkColor 145 | // Access: public 146 | // Returns: DWORD 147 | // Qualifier: const 148 | // Note: 149 | //************************************ 150 | DWORD CButtonUI::GetHotBkColor() const 151 | { 152 | return m_dwHotBkColor; 153 | } 154 | 155 | void CButtonUI::SetHotTextColor(DWORD dwColor) 156 | { 157 | m_dwHotTextColor = dwColor; 158 | } 159 | 160 | DWORD CButtonUI::GetHotTextColor() const 161 | { 162 | return m_dwHotTextColor; 163 | } 164 | 165 | void CButtonUI::SetPushedTextColor(DWORD dwColor) 166 | { 167 | m_dwPushedTextColor = dwColor; 168 | } 169 | 170 | DWORD CButtonUI::GetPushedTextColor() const 171 | { 172 | return m_dwPushedTextColor; 173 | } 174 | 175 | void CButtonUI::SetFocusedTextColor(DWORD dwColor) 176 | { 177 | m_dwFocusedTextColor = dwColor; 178 | } 179 | 180 | DWORD CButtonUI::GetFocusedTextColor() const 181 | { 182 | return m_dwFocusedTextColor; 183 | } 184 | 185 | LPCTSTR CButtonUI::GetNormalImage() 186 | { 187 | return m_sNormalImage; 188 | } 189 | 190 | void CButtonUI::SetNormalImage(LPCTSTR pStrImage) 191 | { 192 | m_sNormalImage = pStrImage; 193 | Invalidate(); 194 | } 195 | 196 | LPCTSTR CButtonUI::GetHotImage() 197 | { 198 | return m_sHotImage; 199 | } 200 | 201 | void CButtonUI::SetHotImage(LPCTSTR pStrImage) 202 | { 203 | m_sHotImage = pStrImage; 204 | Invalidate(); 205 | } 206 | 207 | LPCTSTR CButtonUI::GetPushedImage() 208 | { 209 | return m_sPushedImage; 210 | } 211 | 212 | void CButtonUI::SetPushedImage(LPCTSTR pStrImage) 213 | { 214 | m_sPushedImage = pStrImage; 215 | Invalidate(); 216 | } 217 | 218 | LPCTSTR CButtonUI::GetFocusedImage() 219 | { 220 | return m_sFocusedImage; 221 | } 222 | 223 | void CButtonUI::SetFocusedImage(LPCTSTR pStrImage) 224 | { 225 | m_sFocusedImage = pStrImage; 226 | Invalidate(); 227 | } 228 | 229 | LPCTSTR CButtonUI::GetDisabledImage() 230 | { 231 | return m_sDisabledImage; 232 | } 233 | 234 | void CButtonUI::SetDisabledImage(LPCTSTR pStrImage) 235 | { 236 | m_sDisabledImage = pStrImage; 237 | Invalidate(); 238 | } 239 | 240 | //************************************ 241 | // Method: GetForeImage 242 | // FullName: CButtonUI::GetForeImage 243 | // Access: public 244 | // Returns: LPCTSTR 245 | // Qualifier: 246 | // Note: 247 | //************************************ 248 | LPCTSTR CButtonUI::GetForeImage() 249 | { 250 | return m_sForeImage; 251 | } 252 | 253 | //************************************ 254 | // Method: SetForeImage 255 | // FullName: CButtonUI::SetForeImage 256 | // Access: public 257 | // Returns: void 258 | // Qualifier: 259 | // Parameter: LPCTSTR pStrImage 260 | // Note: 261 | //************************************ 262 | void CButtonUI::SetForeImage( LPCTSTR pStrImage ) 263 | { 264 | m_sForeImage = pStrImage; 265 | Invalidate(); 266 | } 267 | 268 | //************************************ 269 | // Method: GetHotForeImage 270 | // FullName: CButtonUI::GetHotForeImage 271 | // Access: public 272 | // Returns: LPCTSTR 273 | // Qualifier: 274 | // Note: 275 | //************************************ 276 | LPCTSTR CButtonUI::GetHotForeImage() 277 | { 278 | return m_sHotForeImage; 279 | } 280 | 281 | //************************************ 282 | // Method: SetHotForeImage 283 | // FullName: CButtonUI::SetHotForeImage 284 | // Access: public 285 | // Returns: void 286 | // Qualifier: 287 | // Parameter: LPCTSTR pStrImage 288 | // Note: 289 | //************************************ 290 | void CButtonUI::SetHotForeImage( LPCTSTR pStrImage ) 291 | { 292 | m_sHotForeImage = pStrImage; 293 | Invalidate(); 294 | } 295 | 296 | SIZE CButtonUI::EstimateSize(SIZE szAvailable) 297 | { 298 | if( m_cxyFixed.cy == 0 ) return CSize(m_cxyFixed.cx, m_pManager->GetFontInfo(GetFont())->tm.tmHeight + 8); 299 | return CControlUI::EstimateSize(szAvailable); 300 | } 301 | 302 | void CButtonUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 303 | { 304 | if( _tcscmp(pstrName, _T("normalimage")) == 0 ) SetNormalImage(pstrValue); 305 | else if( _tcscmp(pstrName, _T("hotimage")) == 0 ) SetHotImage(pstrValue); 306 | else if( _tcscmp(pstrName, _T("pushedimage")) == 0 ) SetPushedImage(pstrValue); 307 | else if( _tcscmp(pstrName, _T("focusedimage")) == 0 ) SetFocusedImage(pstrValue); 308 | else if( _tcscmp(pstrName, _T("disabledimage")) == 0 ) SetDisabledImage(pstrValue); 309 | else if( _tcscmp(pstrName, _T("foreimage")) == 0 ) SetForeImage(pstrValue); 310 | else if( _tcscmp(pstrName, _T("hotforeimage")) == 0 ) SetHotForeImage(pstrValue); 311 | else if( _tcscmp(pstrName, _T("hotbkcolor")) == 0 ) 312 | { 313 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); 314 | LPTSTR pstr = NULL; 315 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); 316 | SetHotBkColor(clrColor); 317 | } 318 | else if( _tcscmp(pstrName, _T("hottextcolor")) == 0 ) 319 | { 320 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); 321 | LPTSTR pstr = NULL; 322 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); 323 | SetHotTextColor(clrColor); 324 | } 325 | else if( _tcscmp(pstrName, _T("pushedtextcolor")) == 0 ) 326 | { 327 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); 328 | LPTSTR pstr = NULL; 329 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); 330 | SetPushedTextColor(clrColor); 331 | } 332 | else if( _tcscmp(pstrName, _T("focusedtextcolor")) == 0 ) 333 | { 334 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); 335 | LPTSTR pstr = NULL; 336 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); 337 | SetFocusedTextColor(clrColor); 338 | } 339 | else CLabelUI::SetAttribute(pstrName, pstrValue); 340 | } 341 | 342 | void CButtonUI::PaintText(HDC hDC) 343 | { 344 | if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED; 345 | else m_uButtonState &= ~ UISTATE_FOCUSED; 346 | if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED; 347 | else m_uButtonState &= ~ UISTATE_DISABLED; 348 | 349 | if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor(); 350 | if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor(); 351 | 352 | if( m_sText.IsEmpty() ) return; 353 | int nLinks = 0; 354 | RECT rc = m_rcItem; 355 | rc.left += m_rcTextPadding.left; 356 | rc.right -= m_rcTextPadding.right; 357 | rc.top += m_rcTextPadding.top; 358 | rc.bottom -= m_rcTextPadding.bottom; 359 | 360 | DWORD clrColor = IsEnabled()?m_dwTextColor:m_dwDisabledTextColor; 361 | 362 | if( ((m_uButtonState & UISTATE_PUSHED) != 0) && (GetPushedTextColor() != 0) ) 363 | clrColor = GetPushedTextColor(); 364 | else if( ((m_uButtonState & UISTATE_HOT) != 0) && (GetHotTextColor() != 0) ) 365 | clrColor = GetHotTextColor(); 366 | else if( ((m_uButtonState & UISTATE_FOCUSED) != 0) && (GetFocusedTextColor() != 0) ) 367 | clrColor = GetFocusedTextColor(); 368 | 369 | if( m_bShowHtml ) 370 | CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, m_sText, clrColor, \ 371 | NULL, NULL, nLinks, m_uTextStyle); 372 | else 373 | CRenderEngine::DrawText(hDC, m_pManager, rc, m_sText, clrColor, \ 374 | m_iFont, m_uTextStyle); 375 | } 376 | 377 | void CButtonUI::PaintStatusImage(HDC hDC) 378 | { 379 | if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED; 380 | else m_uButtonState &= ~ UISTATE_FOCUSED; 381 | if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED; 382 | else m_uButtonState &= ~ UISTATE_DISABLED; 383 | 384 | if( (m_uButtonState & UISTATE_DISABLED) != 0 ) { 385 | if( !m_sDisabledImage.IsEmpty() ) 386 | { 387 | if( !DrawImage(hDC, (LPCTSTR)m_sDisabledImage) ) m_sDisabledImage.Empty(); 388 | else goto Label_ForeImage; 389 | } 390 | } 391 | else if( (m_uButtonState & UISTATE_PUSHED) != 0 ) { 392 | if( !m_sPushedImage.IsEmpty() ) { 393 | if( !DrawImage(hDC, (LPCTSTR)m_sPushedImage) ){ 394 | m_sPushedImage.Empty(); 395 | } 396 | if( !m_sPushedForeImage.IsEmpty() ) 397 | { 398 | if( !DrawImage(hDC, (LPCTSTR)m_sPushedForeImage) ) 399 | m_sPushedForeImage.Empty(); 400 | return; 401 | } 402 | else goto Label_ForeImage; 403 | } 404 | } 405 | else if( (m_uButtonState & UISTATE_HOT) != 0 ) { 406 | if( !m_sHotImage.IsEmpty() ) { 407 | if( !DrawImage(hDC, (LPCTSTR)m_sHotImage) ){ 408 | m_sHotImage.Empty(); 409 | } 410 | if( !m_sHotForeImage.IsEmpty() ) { 411 | if( !DrawImage(hDC, (LPCTSTR)m_sHotForeImage) ) 412 | m_sHotForeImage.Empty(); 413 | return; 414 | } 415 | else goto Label_ForeImage; 416 | } 417 | else if(m_dwHotBkColor != 0) { 418 | CRenderEngine::DrawColor(hDC, m_rcPaint, GetAdjustColor(m_dwHotBkColor)); 419 | return; 420 | } 421 | } 422 | else if( (m_uButtonState & UISTATE_FOCUSED) != 0 ) { 423 | if( !m_sFocusedImage.IsEmpty() ) { 424 | if( !DrawImage(hDC, (LPCTSTR)m_sFocusedImage) ) m_sFocusedImage.Empty(); 425 | else goto Label_ForeImage; 426 | } 427 | } 428 | 429 | if( !m_sNormalImage.IsEmpty() ) { 430 | if( !DrawImage(hDC, (LPCTSTR)m_sNormalImage) ) m_sNormalImage.Empty(); 431 | else goto Label_ForeImage; 432 | } 433 | 434 | if(!m_sForeImage.IsEmpty() ) 435 | goto Label_ForeImage; 436 | 437 | return; 438 | 439 | Label_ForeImage: 440 | if(!m_sForeImage.IsEmpty() ) { 441 | if( !DrawImage(hDC, (LPCTSTR)m_sForeImage) ) m_sForeImage.Empty(); 442 | } 443 | } 444 | } -------------------------------------------------------------------------------- /testtab/testtab/Control/UIButton.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIBUTTON_H__ 2 | #define __UIBUTTON_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | class UILIB_API CButtonUI : public CLabelUI 9 | { 10 | public: 11 | CButtonUI(); 12 | 13 | LPCTSTR GetClass() const; 14 | LPVOID GetInterface(LPCTSTR pstrName); 15 | UINT GetControlFlags() const; 16 | 17 | bool Activate(); 18 | void SetEnabled(bool bEnable = true); 19 | void DoEvent(TEventUI& event); 20 | 21 | LPCTSTR GetNormalImage(); 22 | void SetNormalImage(LPCTSTR pStrImage); 23 | LPCTSTR GetHotImage(); 24 | void SetHotImage(LPCTSTR pStrImage); 25 | LPCTSTR GetPushedImage(); 26 | void SetPushedImage(LPCTSTR pStrImage); 27 | LPCTSTR GetFocusedImage(); 28 | void SetFocusedImage(LPCTSTR pStrImage); 29 | LPCTSTR GetDisabledImage(); 30 | void SetDisabledImage(LPCTSTR pStrImage); 31 | LPCTSTR GetForeImage(); 32 | void SetForeImage(LPCTSTR pStrImage); 33 | LPCTSTR GetHotForeImage(); 34 | void SetHotForeImage(LPCTSTR pStrImage); 35 | 36 | void SetHotBkColor(DWORD dwColor); 37 | DWORD GetHotBkColor() const; 38 | void SetHotTextColor(DWORD dwColor); 39 | DWORD GetHotTextColor() const; 40 | void SetPushedTextColor(DWORD dwColor); 41 | DWORD GetPushedTextColor() const; 42 | void SetFocusedTextColor(DWORD dwColor); 43 | DWORD GetFocusedTextColor() const; 44 | SIZE EstimateSize(SIZE szAvailable); 45 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 46 | 47 | void PaintText(HDC hDC); 48 | void PaintStatusImage(HDC hDC); 49 | 50 | protected: 51 | UINT m_uButtonState; 52 | 53 | DWORD m_dwHotBkColor; 54 | DWORD m_dwHotTextColor; 55 | DWORD m_dwPushedTextColor; 56 | DWORD m_dwFocusedTextColor; 57 | 58 | CDuiString m_sNormalImage; 59 | CDuiString m_sHotImage; 60 | CDuiString m_sHotForeImage; 61 | CDuiString m_sPushedImage; 62 | CDuiString m_sPushedForeImage; 63 | CDuiString m_sFocusedImage; 64 | CDuiString m_sDisabledImage; 65 | }; 66 | 67 | } // namespace DuiLib 68 | 69 | #endif // __UIBUTTON_H__ -------------------------------------------------------------------------------- /testtab/testtab/Control/UICheckBox.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "UICheckBox.h" 3 | 4 | namespace DuiLib 5 | { 6 | LPCTSTR CCheckBoxUI::GetClass() const 7 | { 8 | return _T("CheckBoxUI"); 9 | } 10 | 11 | void CCheckBoxUI::SetCheck(bool bCheck) 12 | { 13 | Selected(bCheck); 14 | } 15 | 16 | bool CCheckBoxUI::GetCheck() const 17 | { 18 | return IsSelected(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /testtab/testtab/Control/UICheckBox.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UICheckBox.h -------------------------------------------------------------------------------- /testtab/testtab/Control/UICombo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UICombo.cpp -------------------------------------------------------------------------------- /testtab/testtab/Control/UICombo.h: -------------------------------------------------------------------------------- 1 | #ifndef __UICOMBO_H__ 2 | #define __UICOMBO_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib { 7 | ///////////////////////////////////////////////////////////////////////////////////// 8 | // 9 | 10 | class CComboWnd; 11 | 12 | class UILIB_API CComboUI : public CContainerUI, public IListOwnerUI 13 | { 14 | friend class CComboWnd; 15 | public: 16 | CComboUI(); 17 | 18 | LPCTSTR GetClass() const; 19 | LPVOID GetInterface(LPCTSTR pstrName); 20 | 21 | void DoInit(); 22 | UINT GetControlFlags() const; 23 | 24 | CDuiString GetText() const; 25 | void SetEnabled(bool bEnable = true); 26 | 27 | CDuiString GetDropBoxAttributeList(); 28 | void SetDropBoxAttributeList(LPCTSTR pstrList); 29 | SIZE GetDropBoxSize() const; 30 | void SetDropBoxSize(SIZE szDropBox); 31 | 32 | int GetCurSel() const; 33 | bool SelectItem(int iIndex, bool bTakeFocus = false); 34 | 35 | bool SetItemIndex(CControlUI* pControl, int iIndex); 36 | bool Add(CControlUI* pControl); 37 | bool AddAt(CControlUI* pControl, int iIndex); 38 | bool Remove(CControlUI* pControl); 39 | bool RemoveAt(int iIndex); 40 | void RemoveAll(); 41 | 42 | bool Activate(); 43 | 44 | RECT GetTextPadding() const; 45 | void SetTextPadding(RECT rc); 46 | LPCTSTR GetNormalImage() const; 47 | void SetNormalImage(LPCTSTR pStrImage); 48 | LPCTSTR GetHotImage() const; 49 | void SetHotImage(LPCTSTR pStrImage); 50 | LPCTSTR GetPushedImage() const; 51 | void SetPushedImage(LPCTSTR pStrImage); 52 | LPCTSTR GetFocusedImage() const; 53 | void SetFocusedImage(LPCTSTR pStrImage); 54 | LPCTSTR GetDisabledImage() const; 55 | void SetDisabledImage(LPCTSTR pStrImage); 56 | 57 | TListInfoUI* GetListInfo(); 58 | void SetItemFont(int index); 59 | void SetItemTextStyle(UINT uStyle); 60 | RECT GetItemTextPadding() const; 61 | void SetItemTextPadding(RECT rc); 62 | DWORD GetItemTextColor() const; 63 | void SetItemTextColor(DWORD dwTextColor); 64 | DWORD GetItemBkColor() const; 65 | void SetItemBkColor(DWORD dwBkColor); 66 | LPCTSTR GetItemBkImage() const; 67 | void SetItemBkImage(LPCTSTR pStrImage); 68 | bool IsAlternateBk() const; 69 | void SetAlternateBk(bool bAlternateBk); 70 | DWORD GetSelectedItemTextColor() const; 71 | void SetSelectedItemTextColor(DWORD dwTextColor); 72 | DWORD GetSelectedItemBkColor() const; 73 | void SetSelectedItemBkColor(DWORD dwBkColor); 74 | LPCTSTR GetSelectedItemImage() const; 75 | void SetSelectedItemImage(LPCTSTR pStrImage); 76 | DWORD GetHotItemTextColor() const; 77 | void SetHotItemTextColor(DWORD dwTextColor); 78 | DWORD GetHotItemBkColor() const; 79 | void SetHotItemBkColor(DWORD dwBkColor); 80 | LPCTSTR GetHotItemImage() const; 81 | void SetHotItemImage(LPCTSTR pStrImage); 82 | DWORD GetDisabledItemTextColor() const; 83 | void SetDisabledItemTextColor(DWORD dwTextColor); 84 | DWORD GetDisabledItemBkColor() const; 85 | void SetDisabledItemBkColor(DWORD dwBkColor); 86 | LPCTSTR GetDisabledItemImage() const; 87 | void SetDisabledItemImage(LPCTSTR pStrImage); 88 | DWORD GetItemLineColor() const; 89 | void SetItemLineColor(DWORD dwLineColor); 90 | bool IsItemShowHtml(); 91 | void SetItemShowHtml(bool bShowHtml = true); 92 | 93 | SIZE EstimateSize(SIZE szAvailable); 94 | void SetPos(RECT rc); 95 | void DoEvent(TEventUI& event); 96 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 97 | 98 | void DoPaint(HDC hDC, const RECT& rcPaint); 99 | void PaintText(HDC hDC); 100 | void PaintStatusImage(HDC hDC); 101 | 102 | protected: 103 | CComboWnd* m_pWindow; 104 | 105 | int m_iCurSel; 106 | RECT m_rcTextPadding; 107 | CDuiString m_sDropBoxAttributes; 108 | SIZE m_szDropBox; 109 | UINT m_uButtonState; 110 | 111 | CDuiString m_sNormalImage; 112 | CDuiString m_sHotImage; 113 | CDuiString m_sPushedImage; 114 | CDuiString m_sFocusedImage; 115 | CDuiString m_sDisabledImage; 116 | 117 | TListInfoUI m_ListInfo; 118 | }; 119 | 120 | } // namespace DuiLib 121 | 122 | #endif // __UICOMBO_H__ 123 | -------------------------------------------------------------------------------- /testtab/testtab/Control/UIComboBox.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "UIComboBox.h" 3 | 4 | namespace DuiLib 5 | { 6 | CComboBoxUI::CComboBoxUI() 7 | { 8 | m_nArrowWidth = 0; 9 | } 10 | 11 | LPCTSTR CComboBoxUI::GetClass() const 12 | { 13 | return _T("ComboBoxUI"); 14 | } 15 | 16 | void CComboBoxUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 17 | { 18 | if (_tcscmp(pstrName, _T("arrowimage")) == 0) 19 | m_sArrowImage = pstrValue; 20 | else 21 | CComboUI::SetAttribute(pstrName, pstrValue); 22 | } 23 | 24 | void CComboBoxUI::PaintStatusImage(HDC hDC) 25 | { 26 | if (m_sArrowImage.IsEmpty()) 27 | CComboUI::PaintStatusImage(hDC); 28 | else 29 | { 30 | // get index 31 | if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED; 32 | else m_uButtonState &= ~ UISTATE_FOCUSED; 33 | if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED; 34 | else m_uButtonState &= ~ UISTATE_DISABLED; 35 | 36 | int nIndex = 0; 37 | if ((m_uButtonState & UISTATE_DISABLED) != 0) 38 | nIndex = 4; 39 | else if ((m_uButtonState & UISTATE_PUSHED) != 0) 40 | nIndex = 2; 41 | else if ((m_uButtonState & UISTATE_HOT) != 0) 42 | nIndex = 1; 43 | else if ((m_uButtonState & UISTATE_FOCUSED) != 0) 44 | nIndex = 3; 45 | 46 | // make modify string 47 | CDuiString sModify = m_sArrowImage; 48 | 49 | int nPos1 = sModify.Find(_T("source")); 50 | int nPos2 = sModify.Find(_T("'"), nPos1 + 7); 51 | if (nPos2 == -1) return; //first 52 | int nPos3 = sModify.Find(_T("'"), nPos2 + 1); 53 | if (nPos3 == -1) return; //second 54 | 55 | CDuiRect rcBmpPart; 56 | LPTSTR lpszValue = NULL; 57 | rcBmpPart.left = _tcstol(sModify.GetData() + nPos2 + 1, &lpszValue, 10); ASSERT(lpszValue); 58 | rcBmpPart.top = _tcstol(lpszValue + 1, &lpszValue, 10); ASSERT(lpszValue); 59 | rcBmpPart.right = _tcstol(lpszValue + 1, &lpszValue, 10); ASSERT(lpszValue); 60 | rcBmpPart.bottom = _tcstol(lpszValue + 1, &lpszValue, 10); ASSERT(lpszValue); 61 | 62 | m_nArrowWidth = rcBmpPart.GetWidth() / 5; 63 | rcBmpPart.left += nIndex * m_nArrowWidth; 64 | rcBmpPart.right = rcBmpPart.left + m_nArrowWidth; 65 | 66 | CDuiRect rcDest(0, 0, m_rcItem.right - m_rcItem.left, m_rcItem.bottom - m_rcItem.top); 67 | rcDest.Deflate(GetBorderSize(), GetBorderSize()); 68 | rcDest.left = rcDest.right - m_nArrowWidth; 69 | 70 | CDuiString sSource = sModify.Mid(nPos1, nPos3 + 1 - nPos1); 71 | CDuiString sReplace; 72 | sReplace.SmallFormat(_T("source='%d,%d,%d,%d' dest='%d,%d,%d,%d'"), 73 | rcBmpPart.left, rcBmpPart.top, rcBmpPart.right, rcBmpPart.bottom, 74 | rcDest.left, rcDest.top, rcDest.right, rcDest.bottom); 75 | 76 | sModify.Replace(sSource, sReplace); 77 | 78 | // draw image 79 | if (!DrawImage(hDC, m_sArrowImage, sModify)) 80 | m_sNormalImage.Empty(); 81 | } 82 | } 83 | 84 | void CComboBoxUI::PaintText(HDC hDC) 85 | { 86 | RECT rcText = m_rcItem; 87 | rcText.left += m_rcTextPadding.left; 88 | rcText.right -= m_rcTextPadding.right; 89 | rcText.top += m_rcTextPadding.top; 90 | rcText.bottom -= m_rcTextPadding.bottom; 91 | 92 | rcText.right -= m_nArrowWidth; // add this line than CComboUI::PaintText(HDC hDC) 93 | 94 | if( m_iCurSel >= 0 ) { 95 | CControlUI* pControl = static_cast(m_items[m_iCurSel]); 96 | IListItemUI* pElement = static_cast(pControl->GetInterface(_T("ListItem"))); 97 | if( pElement != NULL ) { 98 | pElement->DrawItemText(hDC, rcText); 99 | } 100 | else { 101 | RECT rcOldPos = pControl->GetPos(); 102 | pControl->SetPos(rcText); 103 | pControl->DoPaint(hDC, rcText); 104 | pControl->SetPos(rcOldPos); 105 | } 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /testtab/testtab/Control/UIComboBox.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UIComboBox.h -------------------------------------------------------------------------------- /testtab/testtab/Control/UIDateTime.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UIDateTime.cpp -------------------------------------------------------------------------------- /testtab/testtab/Control/UIDateTime.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UIDateTime.h -------------------------------------------------------------------------------- /testtab/testtab/Control/UIEdit.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIEDIT_H__ 2 | #define __UIEDIT_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | class CEditWnd; 9 | 10 | class UILIB_API CEditUI : public CLabelUI 11 | { 12 | friend class CEditWnd; 13 | public: 14 | CEditUI(); 15 | 16 | LPCTSTR GetClass() const; 17 | LPVOID GetInterface(LPCTSTR pstrName); 18 | UINT GetControlFlags() const; 19 | 20 | void SetEnabled(bool bEnable = true); 21 | void SetText(LPCTSTR pstrText); 22 | void SetMaxChar(UINT uMax); 23 | UINT GetMaxChar(); 24 | void SetReadOnly(bool bReadOnly); 25 | bool IsReadOnly() const; 26 | void SetPasswordMode(bool bPasswordMode); 27 | bool IsPasswordMode() const; 28 | void SetPasswordChar(TCHAR cPasswordChar); 29 | TCHAR GetPasswordChar() const; 30 | void SetNumberOnly(bool bNumberOnly); 31 | bool IsNumberOnly() const; 32 | int GetWindowStyls() const; 33 | 34 | LPCTSTR GetNormalImage(); 35 | void SetNormalImage(LPCTSTR pStrImage); 36 | LPCTSTR GetHotImage(); 37 | void SetHotImage(LPCTSTR pStrImage); 38 | LPCTSTR GetFocusedImage(); 39 | void SetFocusedImage(LPCTSTR pStrImage); 40 | LPCTSTR GetDisabledImage(); 41 | void SetDisabledImage(LPCTSTR pStrImage); 42 | void SetNativeEditBkColor(DWORD dwBkColor); 43 | DWORD GetNativeEditBkColor() const; 44 | 45 | void SetSel(long nStartChar, long nEndChar); 46 | void SetSelAll(); 47 | void SetReplaceSel(LPCTSTR lpszReplace); 48 | 49 | void SetPos(RECT rc); 50 | void SetVisible(bool bVisible = true); 51 | void SetInternVisible(bool bVisible = true); 52 | SIZE EstimateSize(SIZE szAvailable); 53 | void DoEvent(TEventUI& event); 54 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 55 | 56 | void PaintStatusImage(HDC hDC); 57 | void PaintText(HDC hDC); 58 | 59 | protected: 60 | CEditWnd* m_pWindow; 61 | 62 | UINT m_uMaxChar; 63 | bool m_bReadOnly; 64 | bool m_bPasswordMode; 65 | TCHAR m_cPasswordChar; 66 | UINT m_uButtonState; 67 | CDuiString m_sNormalImage; 68 | CDuiString m_sHotImage; 69 | CDuiString m_sFocusedImage; 70 | CDuiString m_sDisabledImage; 71 | DWORD m_dwEditbkColor; 72 | int m_iWindowStyls; 73 | }; 74 | } 75 | #endif // __UIEDIT_H__ -------------------------------------------------------------------------------- /testtab/testtab/Control/UIFlash.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UIFlash.cpp -------------------------------------------------------------------------------- /testtab/testtab/Control/UIFlash.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UIFlash.h -------------------------------------------------------------------------------- /testtab/testtab/Control/UILabel.h: -------------------------------------------------------------------------------- 1 | #ifndef __UILABEL_H__ 2 | #define __UILABEL_H__ 3 | 4 | #pragma once 5 | 6 | #include 7 | #pragma comment( lib, "GdiPlus.lib" ) 8 | using namespace Gdiplus; 9 | class UILIB_API Gdiplus::RectF; 10 | struct UILIB_API Gdiplus::GdiplusStartupInput; 11 | 12 | namespace DuiLib 13 | { 14 | class UILIB_API CLabelUI : public CControlUI 15 | { 16 | public: 17 | CLabelUI(); 18 | ~CLabelUI(); 19 | 20 | LPCTSTR GetClass() const; 21 | LPVOID GetInterface(LPCTSTR pstrName); 22 | 23 | void SetTextStyle(UINT uStyle); 24 | UINT GetTextStyle() const; 25 | void SetTextColor(DWORD dwTextColor); 26 | DWORD GetTextColor() const; 27 | void SetDisabledTextColor(DWORD dwTextColor); 28 | DWORD GetDisabledTextColor() const; 29 | void SetFont(int index); 30 | int GetFont() const; 31 | RECT GetTextPadding() const; 32 | void SetTextPadding(RECT rc); 33 | bool IsShowHtml(); 34 | void SetShowHtml(bool bShowHtml = true); 35 | 36 | SIZE EstimateSize(SIZE szAvailable); 37 | void DoEvent(TEventUI& event); 38 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 39 | 40 | void PaintText(HDC hDC); 41 | 42 | void SetEnabledEffect(bool _EnabledEffect); 43 | bool GetEnabledEffect(); 44 | void SetText(LPCTSTR pstrText); 45 | CDuiString GetText() const; 46 | void SetTransShadow(int _TransShadow); 47 | int GetTransShadow(); 48 | void SetTransShadow1(int _TransShadow); 49 | int GetTransShadow1(); 50 | void SetTransText(int _TransText); 51 | int GetTransText(); 52 | void SetTransText1(int _TransText); 53 | int GetTransText1(); 54 | void SetTransStroke(int _TransStroke); 55 | int GetTransStroke(); 56 | void SetGradientLength(int _GradientLength); 57 | int GetGradientLength(); 58 | void SetTextRenderingHintAntiAlias(int _TextRenderingHintAntiAlias); 59 | int GetTextRenderingHintAntiAlias(); 60 | void SetShadowOffset(int _offset,int _angle); 61 | RectF GetShadowOffset(); 62 | void SetTextColor1(DWORD _TextColor1); 63 | DWORD GetTextColor1(); 64 | void SetTextShadowColorA(DWORD _TextShadowColorA); 65 | DWORD GetTextShadowColorA(); 66 | void SetTextShadowColorB(DWORD _TextShadowColorB); 67 | DWORD GetTextShadowColorB(); 68 | void SetStrokeColor(DWORD _StrokeColor); 69 | DWORD GetStrokeColor(); 70 | void SetGradientAngle(int _SetGradientAngle); 71 | int GetGradientAngle(); 72 | void SetEnabledStroke(bool _EnabledStroke); 73 | bool GetEnabledStroke(); 74 | void SetEnabledShadow(bool _EnabledShadowe); 75 | bool GetEnabledShadow(); 76 | 77 | protected: 78 | DWORD m_dwTextColor; 79 | DWORD m_dwDisabledTextColor; 80 | int m_iFont; 81 | UINT m_uTextStyle; 82 | RECT m_rcTextPadding; 83 | bool m_bShowHtml; 84 | 85 | int m_hAlign; 86 | int m_vAlign; 87 | int m_TransShadow; 88 | int m_TransShadow1; 89 | int m_TransText; 90 | int m_TransText1; 91 | int m_TransStroke; 92 | int m_GradientLength; 93 | int m_GradientAngle; 94 | bool m_EnableEffect; 95 | bool m_EnabledStroke; 96 | bool m_EnabledShadow; 97 | DWORD m_dwTextColor1; 98 | DWORD m_dwTextShadowColorA; 99 | DWORD m_dwTextShadowColorB; 100 | DWORD m_dwStrokeColor; 101 | RectF m_ShadowOffset; 102 | CDuiString m_TextValue; 103 | ULONG_PTR m_gdiplusToken; 104 | GdiplusStartupInput m_gdiplusStartupInput; 105 | TextRenderingHint m_TextRenderingHintAntiAlias; 106 | }; 107 | } 108 | 109 | #endif // __UILABEL_H__ -------------------------------------------------------------------------------- /testtab/testtab/Control/UIList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UIList.cpp -------------------------------------------------------------------------------- /testtab/testtab/Control/UIList.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UIList.h -------------------------------------------------------------------------------- /testtab/testtab/Control/UIOption.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "UIOption.h" 3 | 4 | namespace DuiLib 5 | { 6 | COptionUI::COptionUI() : m_bSelected(false), m_dwSelectedTextColor(0) 7 | { 8 | } 9 | 10 | COptionUI::~COptionUI() 11 | { 12 | if( !m_sGroupName.IsEmpty() && m_pManager ) m_pManager->RemoveOptionGroup(m_sGroupName, this); 13 | } 14 | 15 | LPCTSTR COptionUI::GetClass() const 16 | { 17 | return _T("OptionUI"); 18 | } 19 | 20 | LPVOID COptionUI::GetInterface(LPCTSTR pstrName) 21 | { 22 | if( _tcscmp(pstrName, DUI_CTR_OPTION) == 0 ) return static_cast(this); 23 | return CButtonUI::GetInterface(pstrName); 24 | } 25 | 26 | void COptionUI::SetManager(CPaintManagerUI* pManager, CControlUI* pParent, bool bInit) 27 | { 28 | CControlUI::SetManager(pManager, pParent, bInit); 29 | if( bInit && !m_sGroupName.IsEmpty() ) { 30 | if (m_pManager) m_pManager->AddOptionGroup(m_sGroupName, this); 31 | } 32 | } 33 | 34 | LPCTSTR COptionUI::GetGroup() const 35 | { 36 | return m_sGroupName; 37 | } 38 | 39 | void COptionUI::SetGroup(LPCTSTR pStrGroupName) 40 | { 41 | if( pStrGroupName == NULL ) { 42 | if( m_sGroupName.IsEmpty() ) return; 43 | m_sGroupName.Empty(); 44 | } 45 | else { 46 | if( m_sGroupName == pStrGroupName ) return; 47 | if (!m_sGroupName.IsEmpty() && m_pManager) m_pManager->RemoveOptionGroup(m_sGroupName, this); 48 | m_sGroupName = pStrGroupName; 49 | } 50 | 51 | if( !m_sGroupName.IsEmpty() ) { 52 | if (m_pManager) m_pManager->AddOptionGroup(m_sGroupName, this); 53 | } 54 | else { 55 | if (m_pManager) m_pManager->RemoveOptionGroup(m_sGroupName, this); 56 | } 57 | 58 | Selected(m_bSelected); 59 | } 60 | 61 | bool COptionUI::IsSelected() const 62 | { 63 | return m_bSelected; 64 | } 65 | 66 | void COptionUI::Selected(bool bSelected) 67 | { 68 | if( m_bSelected == bSelected ) return; 69 | m_bSelected = bSelected; 70 | if( m_bSelected ) m_uButtonState |= UISTATE_SELECTED; 71 | else m_uButtonState &= ~UISTATE_SELECTED; 72 | 73 | if( m_pManager != NULL ) { 74 | if( !m_sGroupName.IsEmpty() ) { 75 | if( m_bSelected ) { 76 | CStdPtrArray* aOptionGroup = m_pManager->GetOptionGroup(m_sGroupName); 77 | for( int i = 0; i < aOptionGroup->GetSize(); i++ ) { 78 | COptionUI* pControl = static_cast(aOptionGroup->GetAt(i)); 79 | if( pControl != this ) { 80 | pControl->Selected(false); 81 | } 82 | } 83 | m_pManager->SendNotify(this, DUI_MSGTYPE_SELECTCHANGED); 84 | } 85 | } 86 | else { 87 | m_pManager->SendNotify(this, DUI_MSGTYPE_SELECTCHANGED); 88 | } 89 | } 90 | 91 | Invalidate(); 92 | } 93 | 94 | bool COptionUI::Activate() 95 | { 96 | if( !CButtonUI::Activate() ) return false; 97 | if( !m_sGroupName.IsEmpty() ) Selected(true); 98 | else Selected(!m_bSelected); 99 | 100 | return true; 101 | } 102 | 103 | void COptionUI::SetEnabled(bool bEnable) 104 | { 105 | CControlUI::SetEnabled(bEnable); 106 | if( !IsEnabled() ) { 107 | if( m_bSelected ) m_uButtonState = UISTATE_SELECTED; 108 | else m_uButtonState = 0; 109 | } 110 | } 111 | 112 | LPCTSTR COptionUI::GetSelectedImage() 113 | { 114 | return m_sSelectedImage; 115 | } 116 | 117 | void COptionUI::SetSelectedImage(LPCTSTR pStrImage) 118 | { 119 | m_sSelectedImage = pStrImage; 120 | Invalidate(); 121 | } 122 | 123 | //************************************ 124 | // Method: GetSelectedHotImage 125 | // FullName: COptionUI::GetSelectedHotImage 126 | // Access: public 127 | // Returns: LPCTSTR 128 | // Qualifier: 129 | // Node: 130 | //************************************ 131 | LPCTSTR COptionUI::GetSelectedHotImage() 132 | { 133 | return m_sSelectedHotImage; 134 | } 135 | //************************************ 136 | // Method: SetSelectedHotImage 137 | // FullName: COptionUI::SetSelectedHotImage 138 | // Access: public 139 | // Returns: void 140 | // Qualifier: 141 | // Parameter: LPCTSTR pStrImage 142 | // Node: 143 | //************************************ 144 | void COptionUI::SetSelectedHotImage( LPCTSTR pStrImage ) 145 | { 146 | m_sSelectedHotImage = pStrImage; 147 | Invalidate(); 148 | } 149 | 150 | void COptionUI::SetSelectedTextColor(DWORD dwTextColor) 151 | { 152 | m_dwSelectedTextColor = dwTextColor; 153 | } 154 | 155 | DWORD COptionUI::GetSelectedTextColor() 156 | { 157 | if (m_dwSelectedTextColor == 0) m_dwSelectedTextColor = m_pManager->GetDefaultFontColor(); 158 | return m_dwSelectedTextColor; 159 | } 160 | 161 | //************************************ 162 | // Method: SetSelectedBkColor 163 | // FullName: COptionUI::SetSelectedBkColor 164 | // Access: public 165 | // Returns: void 166 | // Qualifier: 167 | // Parameter: DWORD dwBkColor 168 | // Note: 169 | //************************************ 170 | void COptionUI::SetSelectedBkColor( DWORD dwBkColor ) 171 | { 172 | m_dwSelectedBkColor = dwBkColor; 173 | } 174 | 175 | //************************************ 176 | // Method: GetSelectBkColor 177 | // FullName: COptionUI::GetSelectBkColor 178 | // Access: public 179 | // Returns: DWORD 180 | // Qualifier: 181 | // Note: 182 | //************************************ 183 | DWORD COptionUI::GetSelectBkColor() 184 | { 185 | return m_dwSelectedBkColor; 186 | } 187 | 188 | LPCTSTR COptionUI::GetForeImage() 189 | { 190 | return m_sForeImage; 191 | } 192 | 193 | void COptionUI::SetForeImage(LPCTSTR pStrImage) 194 | { 195 | m_sForeImage = pStrImage; 196 | Invalidate(); 197 | } 198 | 199 | SIZE COptionUI::EstimateSize(SIZE szAvailable) 200 | { 201 | if( m_cxyFixed.cy == 0 ) return CSize(m_cxyFixed.cx, m_pManager->GetFontInfo(GetFont())->tm.tmHeight + 8); 202 | return CControlUI::EstimateSize(szAvailable); 203 | } 204 | 205 | void COptionUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 206 | { 207 | if( _tcscmp(pstrName, _T("group")) == 0 ) SetGroup(pstrValue); 208 | else if( _tcscmp(pstrName, _T("selected")) == 0 ) Selected(_tcscmp(pstrValue, _T("true")) == 0); 209 | else if( _tcscmp(pstrName, _T("selectedimage")) == 0 ) SetSelectedImage(pstrValue); 210 | else if( _tcscmp(pstrName, _T("selectedhotimage")) == 0 ) SetSelectedHotImage(pstrValue); 211 | else if( _tcscmp(pstrName, _T("foreimage")) == 0 ) SetForeImage(pstrValue); 212 | else if( _tcscmp(pstrName, _T("selectedbkcolor")) == 0 ) { 213 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); 214 | LPTSTR pstr = NULL; 215 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); 216 | SetSelectedBkColor(clrColor); 217 | } 218 | else if( _tcscmp(pstrName, _T("selectedtextcolor")) == 0 ) { 219 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); 220 | LPTSTR pstr = NULL; 221 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); 222 | SetSelectedTextColor(clrColor); 223 | } 224 | else CButtonUI::SetAttribute(pstrName, pstrValue); 225 | } 226 | 227 | void COptionUI::PaintStatusImage(HDC hDC) 228 | { 229 | m_uButtonState &= ~UISTATE_PUSHED; 230 | 231 | if( (m_uButtonState & UISTATE_HOT) != 0 && IsSelected() && !m_sSelectedHotImage.IsEmpty()) { 232 | if( !DrawImage(hDC, (LPCTSTR)m_sSelectedHotImage) ) 233 | m_sSelectedHotImage.Empty(); 234 | else goto Label_ForeImage; 235 | } 236 | else if( (m_uButtonState & UISTATE_SELECTED) != 0 ) { 237 | if( !m_sSelectedImage.IsEmpty() ) { 238 | if( !DrawImage(hDC, (LPCTSTR)m_sSelectedImage) ) m_sSelectedImage.Empty(); 239 | else goto Label_ForeImage; 240 | } 241 | else if(m_dwSelectedBkColor != 0) { 242 | CRenderEngine::DrawColor(hDC, m_rcPaint, GetAdjustColor(m_dwSelectedBkColor)); 243 | return; 244 | } 245 | } 246 | 247 | CButtonUI::PaintStatusImage(hDC); 248 | 249 | Label_ForeImage: 250 | if( !m_sForeImage.IsEmpty() ) { 251 | if( !DrawImage(hDC, (LPCTSTR)m_sForeImage) ) m_sForeImage.Empty(); 252 | } 253 | } 254 | 255 | void COptionUI::PaintText(HDC hDC) 256 | { 257 | if( (m_uButtonState & UISTATE_SELECTED) != 0 ) 258 | { 259 | DWORD oldTextColor = m_dwTextColor; 260 | if( m_dwSelectedTextColor != 0 ) m_dwTextColor = m_dwSelectedTextColor; 261 | 262 | if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor(); 263 | if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor(); 264 | 265 | if( m_sText.IsEmpty() ) return; 266 | int nLinks = 0; 267 | RECT rc = m_rcItem; 268 | rc.left += m_rcTextPadding.left; 269 | rc.right -= m_rcTextPadding.right; 270 | rc.top += m_rcTextPadding.top; 271 | rc.bottom -= m_rcTextPadding.bottom; 272 | 273 | if( m_bShowHtml ) 274 | CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, m_sText, IsEnabled()?m_dwTextColor:m_dwDisabledTextColor, \ 275 | NULL, NULL, nLinks, m_uTextStyle); 276 | else 277 | CRenderEngine::DrawText(hDC, m_pManager, rc, m_sText, IsEnabled()?m_dwTextColor:m_dwDisabledTextColor, \ 278 | m_iFont, m_uTextStyle); 279 | 280 | m_dwTextColor = oldTextColor; 281 | } 282 | else 283 | CButtonUI::PaintText(hDC); 284 | } 285 | } -------------------------------------------------------------------------------- /testtab/testtab/Control/UIOption.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIOPTION_H__ 2 | #define __UIOPTION_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | class UILIB_API COptionUI : public CButtonUI 9 | { 10 | public: 11 | COptionUI(); 12 | ~COptionUI(); 13 | 14 | LPCTSTR GetClass() const; 15 | LPVOID GetInterface(LPCTSTR pstrName); 16 | 17 | void SetManager(CPaintManagerUI* pManager, CControlUI* pParent, bool bInit = true); 18 | 19 | bool Activate(); 20 | void SetEnabled(bool bEnable = true); 21 | 22 | LPCTSTR GetSelectedImage(); 23 | void SetSelectedImage(LPCTSTR pStrImage); 24 | 25 | LPCTSTR GetSelectedHotImage(); 26 | void SetSelectedHotImage(LPCTSTR pStrImage); 27 | 28 | void SetSelectedTextColor(DWORD dwTextColor); 29 | DWORD GetSelectedTextColor(); 30 | 31 | void SetSelectedBkColor(DWORD dwBkColor); 32 | DWORD GetSelectBkColor(); 33 | 34 | LPCTSTR GetForeImage(); 35 | void SetForeImage(LPCTSTR pStrImage); 36 | 37 | LPCTSTR GetGroup() const; 38 | void SetGroup(LPCTSTR pStrGroupName = NULL); 39 | bool IsSelected() const; 40 | virtual void Selected(bool bSelected); 41 | 42 | SIZE EstimateSize(SIZE szAvailable); 43 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 44 | 45 | void PaintStatusImage(HDC hDC); 46 | void PaintText(HDC hDC); 47 | 48 | protected: 49 | bool m_bSelected; 50 | CDuiString m_sGroupName; 51 | 52 | DWORD m_dwSelectedBkColor; 53 | DWORD m_dwSelectedTextColor; 54 | 55 | CDuiString m_sSelectedImage; 56 | CDuiString m_sSelectedHotImage; 57 | CDuiString m_sForeImage; 58 | }; 59 | 60 | } // namespace DuiLib 61 | 62 | #endif // __UIOPTION_H__ -------------------------------------------------------------------------------- /testtab/testtab/Control/UIProgress.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "UIProgress.h" 3 | 4 | namespace DuiLib 5 | { 6 | CProgressUI::CProgressUI() : m_bHorizontal(true), m_nMin(0), m_nMax(100), m_nValue(0), m_bStretchForeImage(true) 7 | { 8 | m_uTextStyle = DT_SINGLELINE | DT_CENTER; 9 | SetFixedHeight(12); 10 | } 11 | 12 | LPCTSTR CProgressUI::GetClass() const 13 | { 14 | return _T("ProgressUI"); 15 | } 16 | 17 | LPVOID CProgressUI::GetInterface(LPCTSTR pstrName) 18 | { 19 | if( _tcscmp(pstrName, DUI_CTR_PROGRESS) == 0 ) return static_cast(this); 20 | return CLabelUI::GetInterface(pstrName); 21 | } 22 | 23 | bool CProgressUI::IsHorizontal() 24 | { 25 | return m_bHorizontal; 26 | } 27 | 28 | void CProgressUI::SetHorizontal(bool bHorizontal) 29 | { 30 | if( m_bHorizontal == bHorizontal ) return; 31 | 32 | m_bHorizontal = bHorizontal; 33 | Invalidate(); 34 | } 35 | 36 | int CProgressUI::GetMinValue() const 37 | { 38 | return m_nMin; 39 | } 40 | 41 | void CProgressUI::SetMinValue(int nMin) 42 | { 43 | m_nMin = nMin; 44 | Invalidate(); 45 | } 46 | 47 | int CProgressUI::GetMaxValue() const 48 | { 49 | return m_nMax; 50 | } 51 | 52 | void CProgressUI::SetMaxValue(int nMax) 53 | { 54 | m_nMax = nMax; 55 | Invalidate(); 56 | } 57 | 58 | int CProgressUI::GetValue() const 59 | { 60 | return m_nValue; 61 | } 62 | 63 | void CProgressUI::SetValue(int nValue) 64 | { 65 | m_nValue = nValue; 66 | Invalidate(); 67 | } 68 | 69 | LPCTSTR CProgressUI::GetForeImage() const 70 | { 71 | return m_sForeImage; 72 | } 73 | 74 | void CProgressUI::SetForeImage(LPCTSTR pStrImage) 75 | { 76 | if( m_sForeImage == pStrImage ) return; 77 | 78 | m_sForeImage = pStrImage; 79 | Invalidate(); 80 | } 81 | 82 | void CProgressUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 83 | { 84 | if( _tcscmp(pstrName, _T("foreimage")) == 0 ) SetForeImage(pstrValue); 85 | else if( _tcscmp(pstrName, _T("hor")) == 0 ) SetHorizontal(_tcscmp(pstrValue, _T("true")) == 0); 86 | else if( _tcscmp(pstrName, _T("min")) == 0 ) SetMinValue(_ttoi(pstrValue)); 87 | else if( _tcscmp(pstrName, _T("max")) == 0 ) SetMaxValue(_ttoi(pstrValue)); 88 | else if( _tcscmp(pstrName, _T("value")) == 0 ) SetValue(_ttoi(pstrValue)); 89 | else if( _tcscmp(pstrName, _T("isstretchfore"))==0) SetStretchForeImage(_tcscmp(pstrValue, _T("true")) == 0? true : false); 90 | else CLabelUI::SetAttribute(pstrName, pstrValue); 91 | } 92 | 93 | void CProgressUI::PaintStatusImage(HDC hDC) 94 | { 95 | if( m_nMax <= m_nMin ) m_nMax = m_nMin + 1; 96 | if( m_nValue > m_nMax ) m_nValue = m_nMax; 97 | if( m_nValue < m_nMin ) m_nValue = m_nMin; 98 | 99 | RECT rc = {0}; 100 | if( m_bHorizontal ) { 101 | rc.right = (m_nValue - m_nMin) * (m_rcItem.right - m_rcItem.left) / (m_nMax - m_nMin); 102 | rc.bottom = m_rcItem.bottom - m_rcItem.top; 103 | } 104 | else { 105 | rc.top = (m_rcItem.bottom - m_rcItem.top) * (m_nMax - m_nValue) / (m_nMax - m_nMin); 106 | rc.right = m_rcItem.right - m_rcItem.left; 107 | rc.bottom = m_rcItem.bottom - m_rcItem.top; 108 | } 109 | 110 | if( !m_sForeImage.IsEmpty() ) { 111 | m_sForeImageModify.Empty(); 112 | if (m_bStretchForeImage) 113 | m_sForeImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rc.left, rc.top, rc.right, rc.bottom); 114 | else 115 | m_sForeImageModify.SmallFormat(_T("dest='%d,%d,%d,%d' source='%d,%d,%d,%d'") 116 | , rc.left, rc.top, rc.right, rc.bottom 117 | , rc.left, rc.top, rc.right, rc.bottom); 118 | 119 | if( !DrawImage(hDC, (LPCTSTR)m_sForeImage, (LPCTSTR)m_sForeImageModify) ) m_sForeImage.Empty(); 120 | else return; 121 | } 122 | } 123 | 124 | bool CProgressUI::IsStretchForeImage() 125 | { 126 | return m_bStretchForeImage; 127 | } 128 | 129 | void CProgressUI::SetStretchForeImage( bool bStretchForeImage /*= true*/ ) 130 | { 131 | if (m_bStretchForeImage==bStretchForeImage) return; 132 | m_bStretchForeImage=bStretchForeImage; 133 | Invalidate(); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /testtab/testtab/Control/UIProgress.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIPROGRESS_H__ 2 | #define __UIPROGRESS_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | class UILIB_API CProgressUI : public CLabelUI 9 | { 10 | public: 11 | CProgressUI(); 12 | 13 | LPCTSTR GetClass() const; 14 | LPVOID GetInterface(LPCTSTR pstrName); 15 | 16 | bool IsHorizontal(); 17 | void SetHorizontal(bool bHorizontal = true); 18 | bool IsStretchForeImage(); 19 | void SetStretchForeImage(bool bStretchForeImage = true); 20 | int GetMinValue() const; 21 | void SetMinValue(int nMin); 22 | int GetMaxValue() const; 23 | void SetMaxValue(int nMax); 24 | int GetValue() const; 25 | void SetValue(int nValue); 26 | LPCTSTR GetForeImage() const; 27 | void SetForeImage(LPCTSTR pStrImage); 28 | 29 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 30 | void PaintStatusImage(HDC hDC); 31 | 32 | protected: 33 | bool m_bHorizontal; 34 | bool m_bStretchForeImage; 35 | int m_nMax; 36 | int m_nMin; 37 | int m_nValue; 38 | 39 | CDuiString m_sForeImage; 40 | CDuiString m_sForeImageModify; 41 | }; 42 | 43 | } // namespace DuiLib 44 | 45 | #endif // __UIPROGRESS_H__ 46 | -------------------------------------------------------------------------------- /testtab/testtab/Control/UIRichEdit.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UIRichEdit.cpp -------------------------------------------------------------------------------- /testtab/testtab/Control/UIRichEdit.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UIRichEdit.h -------------------------------------------------------------------------------- /testtab/testtab/Control/UIScrollBar.h: -------------------------------------------------------------------------------- 1 | #ifndef __UISCROLLBAR_H__ 2 | #define __UISCROLLBAR_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | class UILIB_API CScrollBarUI : public CControlUI 9 | { 10 | public: 11 | CScrollBarUI(); 12 | 13 | LPCTSTR GetClass() const; 14 | LPVOID GetInterface(LPCTSTR pstrName); 15 | 16 | CContainerUI* GetOwner() const; 17 | void SetOwner(CContainerUI* pOwner); 18 | 19 | void SetVisible(bool bVisible = true); 20 | void SetEnabled(bool bEnable = true); 21 | void SetFocus(); 22 | 23 | bool IsHorizontal(); 24 | void SetHorizontal(bool bHorizontal = true); 25 | int GetScrollRange() const; 26 | void SetScrollRange(int nRange); 27 | int GetScrollPos() const; 28 | void SetScrollPos(int nPos); 29 | int GetLineSize() const; 30 | void SetLineSize(int nSize); 31 | 32 | bool GetShowButton1(); 33 | void SetShowButton1(bool bShow); 34 | LPCTSTR GetButton1NormalImage(); 35 | void SetButton1NormalImage(LPCTSTR pStrImage); 36 | LPCTSTR GetButton1HotImage(); 37 | void SetButton1HotImage(LPCTSTR pStrImage); 38 | LPCTSTR GetButton1PushedImage(); 39 | void SetButton1PushedImage(LPCTSTR pStrImage); 40 | LPCTSTR GetButton1DisabledImage(); 41 | void SetButton1DisabledImage(LPCTSTR pStrImage); 42 | 43 | bool GetShowButton2(); 44 | void SetShowButton2(bool bShow); 45 | LPCTSTR GetButton2NormalImage(); 46 | void SetButton2NormalImage(LPCTSTR pStrImage); 47 | LPCTSTR GetButton2HotImage(); 48 | void SetButton2HotImage(LPCTSTR pStrImage); 49 | LPCTSTR GetButton2PushedImage(); 50 | void SetButton2PushedImage(LPCTSTR pStrImage); 51 | LPCTSTR GetButton2DisabledImage(); 52 | void SetButton2DisabledImage(LPCTSTR pStrImage); 53 | 54 | LPCTSTR GetThumbNormalImage(); 55 | void SetThumbNormalImage(LPCTSTR pStrImage); 56 | LPCTSTR GetThumbHotImage(); 57 | void SetThumbHotImage(LPCTSTR pStrImage); 58 | LPCTSTR GetThumbPushedImage(); 59 | void SetThumbPushedImage(LPCTSTR pStrImage); 60 | LPCTSTR GetThumbDisabledImage(); 61 | void SetThumbDisabledImage(LPCTSTR pStrImage); 62 | 63 | LPCTSTR GetRailNormalImage(); 64 | void SetRailNormalImage(LPCTSTR pStrImage); 65 | LPCTSTR GetRailHotImage(); 66 | void SetRailHotImage(LPCTSTR pStrImage); 67 | LPCTSTR GetRailPushedImage(); 68 | void SetRailPushedImage(LPCTSTR pStrImage); 69 | LPCTSTR GetRailDisabledImage(); 70 | void SetRailDisabledImage(LPCTSTR pStrImage); 71 | 72 | LPCTSTR GetBkNormalImage(); 73 | void SetBkNormalImage(LPCTSTR pStrImage); 74 | LPCTSTR GetBkHotImage(); 75 | void SetBkHotImage(LPCTSTR pStrImage); 76 | LPCTSTR GetBkPushedImage(); 77 | void SetBkPushedImage(LPCTSTR pStrImage); 78 | LPCTSTR GetBkDisabledImage(); 79 | void SetBkDisabledImage(LPCTSTR pStrImage); 80 | 81 | void SetPos(RECT rc); 82 | void DoEvent(TEventUI& event); 83 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 84 | 85 | void DoPaint(HDC hDC, const RECT& rcPaint); 86 | 87 | void PaintBk(HDC hDC); 88 | void PaintButton1(HDC hDC); 89 | void PaintButton2(HDC hDC); 90 | void PaintThumb(HDC hDC); 91 | void PaintRail(HDC hDC); 92 | 93 | protected: 94 | 95 | enum 96 | { 97 | DEFAULT_SCROLLBAR_SIZE = 16, 98 | DEFAULT_TIMERID = 10, 99 | }; 100 | 101 | bool m_bHorizontal; 102 | int m_nRange; 103 | int m_nScrollPos; 104 | int m_nLineSize; 105 | CContainerUI* m_pOwner; 106 | POINT ptLastMouse; 107 | int m_nLastScrollPos; 108 | int m_nLastScrollOffset; 109 | int m_nScrollRepeatDelay; 110 | 111 | CDuiString m_sBkNormalImage; 112 | CDuiString m_sBkHotImage; 113 | CDuiString m_sBkPushedImage; 114 | CDuiString m_sBkDisabledImage; 115 | 116 | bool m_bShowButton1; 117 | RECT m_rcButton1; 118 | UINT m_uButton1State; 119 | CDuiString m_sButton1NormalImage; 120 | CDuiString m_sButton1HotImage; 121 | CDuiString m_sButton1PushedImage; 122 | CDuiString m_sButton1DisabledImage; 123 | 124 | bool m_bShowButton2; 125 | RECT m_rcButton2; 126 | UINT m_uButton2State; 127 | CDuiString m_sButton2NormalImage; 128 | CDuiString m_sButton2HotImage; 129 | CDuiString m_sButton2PushedImage; 130 | CDuiString m_sButton2DisabledImage; 131 | 132 | RECT m_rcThumb; 133 | UINT m_uThumbState; 134 | CDuiString m_sThumbNormalImage; 135 | CDuiString m_sThumbHotImage; 136 | CDuiString m_sThumbPushedImage; 137 | CDuiString m_sThumbDisabledImage; 138 | 139 | CDuiString m_sRailNormalImage; 140 | CDuiString m_sRailHotImage; 141 | CDuiString m_sRailPushedImage; 142 | CDuiString m_sRailDisabledImage; 143 | 144 | CDuiString m_sImageModify; 145 | }; 146 | } 147 | 148 | #endif // __UISCROLLBAR_H__ -------------------------------------------------------------------------------- /testtab/testtab/Control/UISlider.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | #include "UISlider.h" 3 | 4 | namespace DuiLib 5 | { 6 | CSliderUI::CSliderUI() : m_uButtonState(0), m_nStep(1) 7 | { 8 | m_uTextStyle = DT_SINGLELINE | DT_CENTER; 9 | m_szThumb.cx = m_szThumb.cy = 10; 10 | } 11 | 12 | LPCTSTR CSliderUI::GetClass() const 13 | { 14 | return _T("SliderUI"); 15 | } 16 | 17 | UINT CSliderUI::GetControlFlags() const 18 | { 19 | if( IsEnabled() ) return UIFLAG_SETCURSOR; 20 | else return 0; 21 | } 22 | 23 | LPVOID CSliderUI::GetInterface(LPCTSTR pstrName) 24 | { 25 | if( _tcscmp(pstrName, DUI_CTR_SLIDER) == 0 ) return static_cast(this); 26 | return CProgressUI::GetInterface(pstrName); 27 | } 28 | 29 | void CSliderUI::SetEnabled(bool bEnable) 30 | { 31 | CControlUI::SetEnabled(bEnable); 32 | if( !IsEnabled() ) { 33 | m_uButtonState = 0; 34 | } 35 | } 36 | 37 | int CSliderUI::GetChangeStep() 38 | { 39 | return m_nStep; 40 | } 41 | 42 | void CSliderUI::SetChangeStep(int step) 43 | { 44 | m_nStep = step; 45 | } 46 | 47 | void CSliderUI::SetThumbSize(SIZE szXY) 48 | { 49 | m_szThumb = szXY; 50 | } 51 | 52 | RECT CSliderUI::GetThumbRect() const 53 | { 54 | if( m_bHorizontal ) { 55 | int left = m_rcItem.left + (m_rcItem.right - m_rcItem.left - m_szThumb.cx) * (m_nValue - m_nMin) / (m_nMax - m_nMin); 56 | int top = (m_rcItem.bottom + m_rcItem.top - m_szThumb.cy) / 2; 57 | return CDuiRect(left, top, left + m_szThumb.cx, top + m_szThumb.cy); 58 | } 59 | else { 60 | int left = (m_rcItem.right + m_rcItem.left - m_szThumb.cx) / 2; 61 | int top = m_rcItem.bottom - m_szThumb.cy - (m_rcItem.bottom - m_rcItem.top - m_szThumb.cy) * (m_nValue - m_nMin) / (m_nMax - m_nMin); 62 | return CDuiRect(left, top, left + m_szThumb.cx, top + m_szThumb.cy); 63 | } 64 | } 65 | 66 | LPCTSTR CSliderUI::GetThumbImage() const 67 | { 68 | return m_sThumbImage; 69 | } 70 | 71 | void CSliderUI::SetThumbImage(LPCTSTR pStrImage) 72 | { 73 | m_sThumbImage = pStrImage; 74 | Invalidate(); 75 | } 76 | 77 | LPCTSTR CSliderUI::GetThumbHotImage() const 78 | { 79 | return m_sThumbHotImage; 80 | } 81 | 82 | void CSliderUI::SetThumbHotImage(LPCTSTR pStrImage) 83 | { 84 | m_sThumbHotImage = pStrImage; 85 | Invalidate(); 86 | } 87 | 88 | LPCTSTR CSliderUI::GetThumbPushedImage() const 89 | { 90 | return m_sThumbPushedImage; 91 | } 92 | 93 | void CSliderUI::SetThumbPushedImage(LPCTSTR pStrImage) 94 | { 95 | m_sThumbPushedImage = pStrImage; 96 | Invalidate(); 97 | } 98 | 99 | void CSliderUI::DoEvent(TEventUI& event) 100 | { 101 | if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) { 102 | if( m_pParent != NULL ) m_pParent->DoEvent(event); 103 | else CProgressUI::DoEvent(event); 104 | return; 105 | } 106 | 107 | if( event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK ) 108 | { 109 | if( IsEnabled() ) { 110 | RECT rcThumb = GetThumbRect(); 111 | if( ::PtInRect(&rcThumb, event.ptMouse) ) { 112 | m_uButtonState |= UISTATE_CAPTURED; 113 | } 114 | } 115 | return; 116 | } 117 | if( event.Type == UIEVENT_BUTTONUP ) 118 | { 119 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) { 120 | m_uButtonState &= ~UISTATE_CAPTURED; 121 | } 122 | if( m_bHorizontal ) { 123 | if( event.ptMouse.x >= m_rcItem.right - m_szThumb.cx / 2 ) m_nValue = m_nMax; 124 | else if( event.ptMouse.x <= m_rcItem.left + m_szThumb.cx / 2 ) m_nValue = m_nMin; 125 | else m_nValue = m_nMin + (m_nMax - m_nMin) * (event.ptMouse.x - m_rcItem.left - m_szThumb.cx / 2 ) / (m_rcItem.right - m_rcItem.left - m_szThumb.cx); 126 | } 127 | else { 128 | if( event.ptMouse.y >= m_rcItem.bottom - m_szThumb.cy / 2 ) m_nValue = m_nMin; 129 | else if( event.ptMouse.y <= m_rcItem.top + m_szThumb.cy / 2 ) m_nValue = m_nMax; 130 | else m_nValue = m_nMin + (m_nMax - m_nMin) * (m_rcItem.bottom - event.ptMouse.y - m_szThumb.cy / 2 ) / (m_rcItem.bottom - m_rcItem.top - m_szThumb.cy); 131 | } 132 | m_pManager->SendNotify(this, DUI_MSGTYPE_VALUECHANGED); 133 | Invalidate(); 134 | return; 135 | } 136 | if( event.Type == UIEVENT_CONTEXTMENU ) 137 | { 138 | return; 139 | } 140 | if( event.Type == UIEVENT_SCROLLWHEEL ) 141 | { 142 | switch( LOWORD(event.wParam) ) { 143 | case SB_LINEUP: 144 | SetValue(GetValue() + GetChangeStep()); 145 | m_pManager->SendNotify(this, DUI_MSGTYPE_VALUECHANGED); 146 | return; 147 | case SB_LINEDOWN: 148 | SetValue(GetValue() - GetChangeStep()); 149 | m_pManager->SendNotify(this, DUI_MSGTYPE_VALUECHANGED); 150 | return; 151 | } 152 | } 153 | if( event.Type == UIEVENT_MOUSEMOVE ) 154 | { 155 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) { 156 | if( m_bHorizontal ) { 157 | if( event.ptMouse.x >= m_rcItem.right - m_szThumb.cx / 2 ) m_nValue = m_nMax; 158 | else if( event.ptMouse.x <= m_rcItem.left + m_szThumb.cx / 2 ) m_nValue = m_nMin; 159 | else m_nValue = m_nMin + (m_nMax - m_nMin) * (event.ptMouse.x - m_rcItem.left - m_szThumb.cx / 2 ) / (m_rcItem.right - m_rcItem.left - m_szThumb.cx); 160 | } 161 | else { 162 | if( event.ptMouse.y >= m_rcItem.bottom - m_szThumb.cy / 2 ) m_nValue = m_nMin; 163 | else if( event.ptMouse.y <= m_rcItem.top + m_szThumb.cy / 2 ) m_nValue = m_nMax; 164 | else m_nValue = m_nMin + (m_nMax - m_nMin) * (m_rcItem.bottom - event.ptMouse.y - m_szThumb.cy / 2 ) / (m_rcItem.bottom - m_rcItem.top - m_szThumb.cy); 165 | } 166 | Invalidate(); 167 | } 168 | return; 169 | } 170 | if( event.Type == UIEVENT_SETCURSOR ) 171 | { 172 | RECT rcThumb = GetThumbRect(); 173 | if( IsEnabled() && ::PtInRect(&rcThumb, event.ptMouse) ) { 174 | ::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND))); 175 | return; 176 | } 177 | } 178 | if( event.Type == UIEVENT_MOUSEENTER ) 179 | { 180 | if( IsEnabled() ) { 181 | m_uButtonState |= UISTATE_HOT; 182 | Invalidate(); 183 | } 184 | return; 185 | } 186 | if( event.Type == UIEVENT_MOUSELEAVE ) 187 | { 188 | if( IsEnabled() ) { 189 | m_uButtonState &= ~UISTATE_HOT; 190 | Invalidate(); 191 | } 192 | return; 193 | } 194 | CControlUI::DoEvent(event); 195 | } 196 | 197 | 198 | void CSliderUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 199 | { 200 | if( _tcscmp(pstrName, _T("thumbimage")) == 0 ) SetThumbImage(pstrValue); 201 | else if( _tcscmp(pstrName, _T("thumbhotimage")) == 0 ) SetThumbHotImage(pstrValue); 202 | else if( _tcscmp(pstrName, _T("thumbpushedimage")) == 0 ) SetThumbPushedImage(pstrValue); 203 | else if( _tcscmp(pstrName, _T("thumbsize")) == 0 ) { 204 | SIZE szXY = {0}; 205 | LPTSTR pstr = NULL; 206 | szXY.cx = _tcstol(pstrValue, &pstr, 10); ASSERT(pstr); 207 | szXY.cy = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr); 208 | SetThumbSize(szXY); 209 | } 210 | else if( _tcscmp(pstrName, _T("step")) == 0 ) { 211 | SetChangeStep(_ttoi(pstrValue)); 212 | } 213 | else CProgressUI::SetAttribute(pstrName, pstrValue); 214 | } 215 | 216 | void CSliderUI::PaintStatusImage(HDC hDC) 217 | { 218 | CProgressUI::PaintStatusImage(hDC); 219 | 220 | RECT rcThumb = GetThumbRect(); 221 | rcThumb.left -= m_rcItem.left; 222 | rcThumb.top -= m_rcItem.top; 223 | rcThumb.right -= m_rcItem.left; 224 | rcThumb.bottom -= m_rcItem.top; 225 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) { 226 | if( !m_sThumbPushedImage.IsEmpty() ) { 227 | m_sImageModify.Empty(); 228 | m_sImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rcThumb.left, rcThumb.top, rcThumb.right, rcThumb.bottom); 229 | if( !DrawImage(hDC, (LPCTSTR)m_sThumbPushedImage, (LPCTSTR)m_sImageModify) ) m_sThumbPushedImage.Empty(); 230 | else return; 231 | } 232 | } 233 | else if( (m_uButtonState & UISTATE_HOT) != 0 ) { 234 | if( !m_sThumbHotImage.IsEmpty() ) { 235 | m_sImageModify.Empty(); 236 | m_sImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rcThumb.left, rcThumb.top, rcThumb.right, rcThumb.bottom); 237 | if( !DrawImage(hDC, (LPCTSTR)m_sThumbHotImage, (LPCTSTR)m_sImageModify) ) m_sThumbHotImage.Empty(); 238 | else return; 239 | } 240 | } 241 | 242 | if( !m_sThumbImage.IsEmpty() ) { 243 | m_sImageModify.Empty(); 244 | m_sImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rcThumb.left, rcThumb.top, rcThumb.right, rcThumb.bottom); 245 | if( !DrawImage(hDC, (LPCTSTR)m_sThumbImage, (LPCTSTR)m_sImageModify) ) m_sThumbImage.Empty(); 246 | else return; 247 | } 248 | } 249 | } 250 | -------------------------------------------------------------------------------- /testtab/testtab/Control/UISlider.h: -------------------------------------------------------------------------------- 1 | #ifndef __UISLIDER_H__ 2 | #define __UISLIDER_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | class UILIB_API CSliderUI : public CProgressUI 9 | { 10 | public: 11 | CSliderUI(); 12 | 13 | LPCTSTR GetClass() const; 14 | UINT GetControlFlags() const; 15 | LPVOID GetInterface(LPCTSTR pstrName); 16 | 17 | void SetEnabled(bool bEnable = true); 18 | 19 | int GetChangeStep(); 20 | void SetChangeStep(int step); 21 | void SetThumbSize(SIZE szXY); 22 | RECT GetThumbRect() const; 23 | LPCTSTR GetThumbImage() const; 24 | void SetThumbImage(LPCTSTR pStrImage); 25 | LPCTSTR GetThumbHotImage() const; 26 | void SetThumbHotImage(LPCTSTR pStrImage); 27 | LPCTSTR GetThumbPushedImage() const; 28 | void SetThumbPushedImage(LPCTSTR pStrImage); 29 | 30 | void DoEvent(TEventUI& event); 31 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 32 | void PaintStatusImage(HDC hDC); 33 | 34 | protected: 35 | SIZE m_szThumb; 36 | UINT m_uButtonState; 37 | int m_nStep; 38 | 39 | CDuiString m_sThumbImage; 40 | CDuiString m_sThumbHotImage; 41 | CDuiString m_sThumbPushedImage; 42 | 43 | CDuiString m_sImageModify; 44 | }; 45 | } 46 | 47 | #endif // __UISLIDER_H__ -------------------------------------------------------------------------------- /testtab/testtab/Control/UIText.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | #include "UIText.h" 3 | 4 | namespace DuiLib 5 | { 6 | CTextUI::CTextUI() : m_nLinks(0), m_nHoverLink(-1) 7 | { 8 | m_uTextStyle = DT_WORDBREAK; 9 | m_rcTextPadding.left = 2; 10 | m_rcTextPadding.right = 2; 11 | ::ZeroMemory(m_rcLinks, sizeof(m_rcLinks)); 12 | } 13 | 14 | CTextUI::~CTextUI() 15 | { 16 | } 17 | 18 | LPCTSTR CTextUI::GetClass() const 19 | { 20 | return _T("TextUI"); 21 | } 22 | 23 | LPVOID CTextUI::GetInterface(LPCTSTR pstrName) 24 | { 25 | if( _tcscmp(pstrName, DUI_CTR_TEXT) == 0 ) return static_cast(this); 26 | return CLabelUI::GetInterface(pstrName); 27 | } 28 | 29 | UINT CTextUI::GetControlFlags() const 30 | { 31 | if( IsEnabled() && m_nLinks > 0 ) return UIFLAG_SETCURSOR; 32 | else return 0; 33 | } 34 | 35 | CDuiString* CTextUI::GetLinkContent(int iIndex) 36 | { 37 | if( iIndex >= 0 && iIndex < m_nLinks ) return &m_sLinks[iIndex]; 38 | return NULL; 39 | } 40 | 41 | void CTextUI::DoEvent(TEventUI& event) 42 | { 43 | if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) { 44 | if( m_pParent != NULL ) m_pParent->DoEvent(event); 45 | else CLabelUI::DoEvent(event); 46 | return; 47 | } 48 | 49 | if( event.Type == UIEVENT_SETCURSOR ) { 50 | for( int i = 0; i < m_nLinks; i++ ) { 51 | if( ::PtInRect(&m_rcLinks[i], event.ptMouse) ) { 52 | ::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND))); 53 | return; 54 | } 55 | } 56 | } 57 | if( event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK && IsEnabled() ) { 58 | for( int i = 0; i < m_nLinks; i++ ) { 59 | if( ::PtInRect(&m_rcLinks[i], event.ptMouse) ) { 60 | Invalidate(); 61 | return; 62 | } 63 | } 64 | } 65 | if( event.Type == UIEVENT_BUTTONUP && IsEnabled() ) { 66 | for( int i = 0; i < m_nLinks; i++ ) { 67 | if( ::PtInRect(&m_rcLinks[i], event.ptMouse) ) { 68 | m_pManager->SendNotify(this, DUI_MSGTYPE_LINK, i); 69 | return; 70 | } 71 | } 72 | } 73 | if( event.Type == UIEVENT_CONTEXTMENU ) 74 | { 75 | return; 76 | } 77 | // When you move over a link 78 | if( m_nLinks > 0 && event.Type == UIEVENT_MOUSEMOVE && IsEnabled() ) { 79 | int nHoverLink = -1; 80 | for( int i = 0; i < m_nLinks; i++ ) { 81 | if( ::PtInRect(&m_rcLinks[i], event.ptMouse) ) { 82 | nHoverLink = i; 83 | break; 84 | } 85 | } 86 | 87 | if(m_nHoverLink != nHoverLink) { 88 | m_nHoverLink = nHoverLink; 89 | Invalidate(); 90 | return; 91 | } 92 | } 93 | if( event.Type == UIEVENT_MOUSELEAVE ) { 94 | if( m_nLinks > 0 && IsEnabled() ) { 95 | if(m_nHoverLink != -1) { 96 | m_nHoverLink = -1; 97 | Invalidate(); 98 | return; 99 | } 100 | } 101 | } 102 | 103 | CLabelUI::DoEvent(event); 104 | } 105 | 106 | SIZE CTextUI::EstimateSize(SIZE szAvailable) 107 | { 108 | RECT rcText = { 0, 0, MAX(szAvailable.cx, m_cxyFixed.cx), 9999 }; 109 | rcText.left += m_rcTextPadding.left; 110 | rcText.right -= m_rcTextPadding.right; 111 | if( m_bShowHtml ) { 112 | int nLinks = 0; 113 | CRenderEngine::DrawHtmlText(m_pManager->GetPaintDC(), m_pManager, rcText, m_sText, m_dwTextColor, NULL, NULL, nLinks, DT_CALCRECT | m_uTextStyle); 114 | } 115 | else { 116 | CRenderEngine::DrawText(m_pManager->GetPaintDC(), m_pManager, rcText, m_sText, m_dwTextColor, m_iFont, DT_CALCRECT | m_uTextStyle); 117 | } 118 | SIZE cXY = {rcText.right - rcText.left + m_rcTextPadding.left + m_rcTextPadding.right, 119 | rcText.bottom - rcText.top + m_rcTextPadding.top + m_rcTextPadding.bottom}; 120 | 121 | if( m_cxyFixed.cy != 0 ) cXY.cy = m_cxyFixed.cy; 122 | return cXY; 123 | } 124 | 125 | void CTextUI::PaintText(HDC hDC) 126 | { 127 | if( m_sText.IsEmpty() ) { 128 | m_nLinks = 0; 129 | return; 130 | } 131 | 132 | if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor(); 133 | if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor(); 134 | 135 | if( m_sText.IsEmpty() ) return; 136 | 137 | m_nLinks = lengthof(m_rcLinks); 138 | RECT rc = m_rcItem; 139 | rc.left += m_rcTextPadding.left; 140 | rc.right -= m_rcTextPadding.right; 141 | rc.top += m_rcTextPadding.top; 142 | rc.bottom -= m_rcTextPadding.bottom; 143 | if( IsEnabled() ) { 144 | if( m_bShowHtml ) 145 | CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, m_sText, m_dwTextColor, \ 146 | m_rcLinks, m_sLinks, m_nLinks, m_uTextStyle); 147 | else 148 | CRenderEngine::DrawText(hDC, m_pManager, rc, m_sText, m_dwTextColor, \ 149 | m_iFont, m_uTextStyle); 150 | } 151 | else { 152 | if( m_bShowHtml ) 153 | CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, m_sText, m_dwDisabledTextColor, \ 154 | m_rcLinks, m_sLinks, m_nLinks, m_uTextStyle); 155 | else 156 | CRenderEngine::DrawText(hDC, m_pManager, rc, m_sText, m_dwDisabledTextColor, \ 157 | m_iFont, m_uTextStyle); 158 | } 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /testtab/testtab/Control/UIText.h: -------------------------------------------------------------------------------- 1 | #ifndef __UITEXT_H__ 2 | #define __UITEXT_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | class UILIB_API CTextUI : public CLabelUI 9 | { 10 | public: 11 | CTextUI(); 12 | ~CTextUI(); 13 | 14 | LPCTSTR GetClass() const; 15 | UINT GetControlFlags() const; 16 | LPVOID GetInterface(LPCTSTR pstrName); 17 | 18 | CDuiString* GetLinkContent(int iIndex); 19 | 20 | void DoEvent(TEventUI& event); 21 | SIZE EstimateSize(SIZE szAvailable); 22 | 23 | void PaintText(HDC hDC); 24 | 25 | protected: 26 | enum { MAX_LINK = 8 }; 27 | int m_nLinks; 28 | RECT m_rcLinks[MAX_LINK]; 29 | CDuiString m_sLinks[MAX_LINK]; 30 | int m_nHoverLink; 31 | }; 32 | 33 | } // namespace DuiLib 34 | 35 | #endif //__UITEXT_H__ -------------------------------------------------------------------------------- /testtab/testtab/Control/UITreeView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UITreeView.cpp -------------------------------------------------------------------------------- /testtab/testtab/Control/UITreeView.h: -------------------------------------------------------------------------------- 1 | #ifndef UITreeView_h__ 2 | #define UITreeView_h__ 3 | 4 | #include 5 | using namespace std; 6 | 7 | #pragma once 8 | 9 | namespace DuiLib 10 | { 11 | class CTreeViewUI; 12 | class CCheckBoxUI; 13 | class CLabelUI; 14 | class COptionUI; 15 | 16 | class UILIB_API CTreeNodeUI : public CListContainerElementUI 17 | { 18 | public: 19 | CTreeNodeUI(CTreeNodeUI* _ParentNode = NULL); 20 | ~CTreeNodeUI(void); 21 | 22 | public: 23 | LPCTSTR GetClass() const; 24 | LPVOID GetInterface(LPCTSTR pstrName); 25 | void DoEvent(TEventUI& event); 26 | void Invalidate(); 27 | bool Select(bool bSelect = true); 28 | 29 | bool Add(CControlUI* _pTreeNodeUI); 30 | bool AddAt(CControlUI* pControl, int iIndex); 31 | bool Remove(CControlUI* pControl); 32 | 33 | void SetVisibleTag(bool _IsVisible); 34 | bool GetVisibleTag(); 35 | void SetItemText(LPCTSTR pstrValue); 36 | CDuiString GetItemText(); 37 | void CheckBoxSelected(bool _Selected); 38 | bool IsCheckBoxSelected() const; 39 | bool IsHasChild() const; 40 | long GetTreeLevel() const; 41 | bool AddChildNode(CTreeNodeUI* _pTreeNodeUI); 42 | bool RemoveAt(CTreeNodeUI* _pTreeNodeUI); 43 | void SetParentNode(CTreeNodeUI* _pParentTreeNode); 44 | CTreeNodeUI* GetParentNode(); 45 | long GetCountChild(); 46 | void SetTreeView(CTreeViewUI* _CTreeViewUI); 47 | CTreeViewUI* GetTreeView(); 48 | CTreeNodeUI* GetChildNode(int _nIndex); 49 | void SetVisibleFolderBtn(bool _IsVisibled); 50 | bool GetVisibleFolderBtn(); 51 | void SetVisibleCheckBtn(bool _IsVisibled); 52 | bool GetVisibleCheckBtn(); 53 | void SetItemTextColor(DWORD _dwItemTextColor); 54 | DWORD GetItemTextColor() const; 55 | void SetItemHotTextColor(DWORD _dwItemHotTextColor); 56 | DWORD GetItemHotTextColor() const; 57 | void SetSelItemTextColor(DWORD _dwSelItemTextColor); 58 | DWORD GetSelItemTextColor() const; 59 | void SetSelItemHotTextColor(DWORD _dwSelHotItemTextColor); 60 | DWORD GetSelItemHotTextColor() const; 61 | 62 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 63 | 64 | CStdPtrArray GetTreeNodes(); 65 | 66 | int GetTreeIndex(); 67 | int GetNodeIndex(); 68 | 69 | private: 70 | CTreeNodeUI* GetLastNode(); 71 | CTreeNodeUI* CalLocation(CTreeNodeUI* _pTreeNodeUI); 72 | public: 73 | CHorizontalLayoutUI* GetTreeNodeHoriznotal() const {return pHoriz;}; 74 | CCheckBoxUI* GetFolderButton() const {return pFolderButton;}; 75 | CLabelUI* GetDottedLine() const {return pDottedLine;}; 76 | CCheckBoxUI* GetCheckBox() const {return pCheckBox;}; 77 | COptionUI* GetItemButton() const {return pItemButton;}; 78 | 79 | private: 80 | long m_iTreeLavel; 81 | bool m_bIsVisable; 82 | bool m_bIsCheckBox; 83 | DWORD m_dwItemTextColor; 84 | DWORD m_dwItemHotTextColor; 85 | DWORD m_dwSelItemTextColor; 86 | DWORD m_dwSelItemHotTextColor; 87 | 88 | CTreeViewUI* pTreeView; 89 | CHorizontalLayoutUI* pHoriz; 90 | CCheckBoxUI* pFolderButton; 91 | CLabelUI* pDottedLine; 92 | CCheckBoxUI* pCheckBox; 93 | COptionUI* pItemButton; 94 | 95 | CTreeNodeUI* pParentTreeNode; 96 | 97 | CStdPtrArray mTreeNodes; 98 | }; 99 | 100 | class UILIB_API CTreeViewUI : public CListUI,public INotifyUI 101 | { 102 | public: 103 | CTreeViewUI(void); 104 | ~CTreeViewUI(void); 105 | 106 | public: 107 | virtual LPCTSTR GetClass() const; 108 | virtual LPVOID GetInterface(LPCTSTR pstrName); 109 | virtual bool Add(CTreeNodeUI* pControl ); 110 | virtual long AddAt(CTreeNodeUI* pControl, int iIndex ); 111 | virtual bool AddAt(CTreeNodeUI* pControl,CTreeNodeUI* _IndexNode); 112 | virtual bool Remove(CTreeNodeUI* pControl); 113 | virtual bool RemoveAt(int iIndex); 114 | virtual void RemoveAll(); 115 | virtual bool OnCheckBoxChanged(void* param); 116 | virtual bool OnFolderChanged(void* param); 117 | virtual bool OnDBClickItem(void* param); 118 | virtual bool SetItemCheckBox(bool _Selected,CTreeNodeUI* _TreeNode = NULL); 119 | virtual void SetItemExpand(bool _Expanded,CTreeNodeUI* _TreeNode = NULL); 120 | virtual void Notify(TNotifyUI& msg); 121 | virtual void SetVisibleFolderBtn(bool _IsVisibled); 122 | virtual bool GetVisibleFolderBtn(); 123 | virtual void SetVisibleCheckBtn(bool _IsVisibled); 124 | virtual bool GetVisibleCheckBtn(); 125 | virtual void SetItemMinWidth(UINT _ItemMinWidth); 126 | virtual UINT GetItemMinWidth(); 127 | virtual void SetItemTextColor(DWORD _dwItemTextColor); 128 | virtual void SetItemHotTextColor(DWORD _dwItemHotTextColor); 129 | virtual void SetSelItemTextColor(DWORD _dwSelItemTextColor); 130 | virtual void SetSelItemHotTextColor(DWORD _dwSelHotItemTextColor); 131 | 132 | virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 133 | private: 134 | UINT m_uItemMinWidth; 135 | bool m_bVisibleFolderBtn; 136 | bool m_bVisibleCheckBtn; 137 | }; 138 | } 139 | 140 | 141 | #endif // UITreeView_h__ 142 | -------------------------------------------------------------------------------- /testtab/testtab/Control/UIWebBrowser.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UIWebBrowser.cpp -------------------------------------------------------------------------------- /testtab/testtab/Control/UIWebBrowser.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Control/UIWebBrowser.h -------------------------------------------------------------------------------- /testtab/testtab/ControlEx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/ControlEx.h -------------------------------------------------------------------------------- /testtab/testtab/Core/UIBase.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Core/UIBase.cpp -------------------------------------------------------------------------------- /testtab/testtab/Core/UIBase.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIBASE_H__ 2 | #define __UIBASE_H__ 3 | 4 | 5 | #pragma once 6 | 7 | namespace DuiLib { 8 | ///////////////////////////////////////////////////////////////////////////////////// 9 | // 10 | 11 | #define UI_WNDSTYLE_CONTAINER (0) 12 | #define UI_WNDSTYLE_FRAME (WS_VISIBLE | WS_OVERLAPPEDWINDOW) 13 | #define UI_WNDSTYLE_CHILD (WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN) 14 | #define UI_WNDSTYLE_DIALOG (WS_VISIBLE | WS_POPUPWINDOW | WS_CAPTION | WS_DLGFRAME | WS_CLIPSIBLINGS | WS_CLIPCHILDREN) 15 | 16 | #define UI_WNDSTYLE_EX_FRAME (WS_EX_WINDOWEDGE) 17 | #define UI_WNDSTYLE_EX_DIALOG (WS_EX_TOOLWINDOW | WS_EX_DLGMODALFRAME) 18 | 19 | #define UI_CLASSSTYLE_CONTAINER (0) 20 | #define UI_CLASSSTYLE_FRAME (CS_VREDRAW | CS_HREDRAW) 21 | #define UI_CLASSSTYLE_CHILD (CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS | CS_SAVEBITS) 22 | #define UI_CLASSSTYLE_DIALOG (CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS | CS_SAVEBITS) 23 | 24 | 25 | ///////////////////////////////////////////////////////////////////////////////////// 26 | // 27 | #ifndef ASSERT 28 | #define ASSERT(expr) _ASSERTE(expr) 29 | #endif 30 | 31 | #ifdef _DEBUG 32 | #ifndef DUITRACE 33 | #define DUITRACE DUI__Trace 34 | #endif 35 | #define DUITRACEMSG DUI__TraceMsg 36 | #else 37 | #ifndef DUITRACE 38 | #define DUITRACE 39 | #endif 40 | #define DUITRACEMSG _T("") 41 | #endif 42 | 43 | void UILIB_API DUI__Trace(LPCTSTR pstrFormat, ...); 44 | LPCTSTR UILIB_API DUI__TraceMsg(UINT uMsg); 45 | 46 | ///////////////////////////////////////////////////////////////////////////////////// 47 | // 48 | 49 | class UILIB_API CNotifyPump 50 | { 51 | public: 52 | bool AddVirtualWnd(CDuiString strName,CNotifyPump* pObject); 53 | bool RemoveVirtualWnd(CDuiString strName); 54 | void NotifyPump(TNotifyUI& msg); 55 | bool LoopDispatch(TNotifyUI& msg); 56 | DUI_DECLARE_MESSAGE_MAP() 57 | private: 58 | CStdStringPtrMap m_VirtualWndMap; 59 | }; 60 | 61 | class UILIB_API CWindowWnd 62 | { 63 | public: 64 | CWindowWnd(); 65 | 66 | HWND GetHWND() const; 67 | operator HWND() const; 68 | 69 | bool RegisterWindowClass(); 70 | bool RegisterSuperclass(); 71 | 72 | HWND Create(HWND hwndParent, LPCTSTR pstrName, DWORD dwStyle, DWORD dwExStyle, const RECT rc, HMENU hMenu = NULL); 73 | HWND Create(HWND hwndParent, LPCTSTR pstrName, DWORD dwStyle, DWORD dwExStyle, int x = CW_USEDEFAULT, int y = CW_USEDEFAULT, int cx = CW_USEDEFAULT, int cy = CW_USEDEFAULT, HMENU hMenu = NULL); 74 | HWND CreateDuiWindow(HWND hwndParent, LPCTSTR pstrWindowName,DWORD dwStyle =0, DWORD dwExStyle =0); 75 | HWND Subclass(HWND hWnd); 76 | void Unsubclass(); 77 | void ShowWindow(bool bShow = true, bool bTakeFocus = true); 78 | UINT ShowModal(); 79 | void Close(UINT nRet = IDOK); 80 | void CenterWindow(); 81 | void SetIcon(UINT nRes); 82 | 83 | LRESULT SendMessage(UINT uMsg, WPARAM wParam = 0, LPARAM lParam = 0L); 84 | LRESULT PostMessage(UINT uMsg, WPARAM wParam = 0, LPARAM lParam = 0L); 85 | void ResizeClient(int cx = -1, int cy = -1); 86 | 87 | protected: 88 | virtual LPCTSTR GetWindowClassName() const = 0; 89 | virtual LPCTSTR GetSuperClassName() const; 90 | virtual UINT GetClassStyle() const; 91 | 92 | virtual LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam); 93 | virtual void OnFinalMessage(HWND hWnd); 94 | 95 | static LRESULT CALLBACK __WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 96 | static LRESULT CALLBACK __ControlProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 97 | 98 | protected: 99 | HWND m_hWnd; 100 | WNDPROC m_OldWndProc; 101 | bool m_bSubclassed; 102 | }; 103 | 104 | } // namespace DuiLib 105 | 106 | #endif // __UIBASE_H__ 107 | -------------------------------------------------------------------------------- /testtab/testtab/Core/UIContainer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Core/UIContainer.cpp -------------------------------------------------------------------------------- /testtab/testtab/Core/UIContainer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Core/UIContainer.h -------------------------------------------------------------------------------- /testtab/testtab/Core/UIControl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Core/UIControl.cpp -------------------------------------------------------------------------------- /testtab/testtab/Core/UIControl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Core/UIControl.h -------------------------------------------------------------------------------- /testtab/testtab/Core/UIDlgBuilder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Core/UIDlgBuilder.cpp -------------------------------------------------------------------------------- /testtab/testtab/Core/UIDlgBuilder.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIDLGBUILDER_H__ 2 | #define __UIDLGBUILDER_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib { 7 | 8 | class IDialogBuilderCallback 9 | { 10 | public: 11 | virtual CControlUI* CreateControl(LPCTSTR pstrClass) = 0; 12 | }; 13 | 14 | 15 | class UILIB_API CDialogBuilder 16 | { 17 | public: 18 | CDialogBuilder(); 19 | CControlUI* Create(STRINGorID xml, LPCTSTR type = NULL, IDialogBuilderCallback* pCallback = NULL, 20 | CPaintManagerUI* pManager = NULL, CControlUI* pParent = NULL); 21 | CControlUI* Create(IDialogBuilderCallback* pCallback = NULL, CPaintManagerUI* pManager = NULL, 22 | CControlUI* pParent = NULL); 23 | 24 | CMarkup* GetMarkup(); 25 | 26 | void GetLastErrorMessage(LPTSTR pstrMessage, SIZE_T cchMax) const; 27 | void GetLastErrorLocation(LPTSTR pstrSource, SIZE_T cchMax) const; 28 | private: 29 | CControlUI* _Parse(CMarkupNode* parent, CControlUI* pParent = NULL, CPaintManagerUI* pManager = NULL); 30 | 31 | CMarkup m_xml; 32 | IDialogBuilderCallback* m_pCallback; 33 | LPCTSTR m_pstrtype; 34 | }; 35 | 36 | } // namespace DuiLib 37 | 38 | #endif // __UIDLGBUILDER_H__ 39 | -------------------------------------------------------------------------------- /testtab/testtab/Core/UIManager.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIMANAGER_H__ 2 | #define __UIMANAGER_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib { 7 | ///////////////////////////////////////////////////////////////////////////////////// 8 | // 9 | 10 | class CControlUI; 11 | 12 | 13 | ///////////////////////////////////////////////////////////////////////////////////// 14 | // 15 | 16 | typedef enum EVENTTYPE_UI 17 | { 18 | UIEVENT__FIRST = 1, 19 | UIEVENT__KEYBEGIN, 20 | UIEVENT_KEYDOWN, 21 | UIEVENT_KEYUP, 22 | UIEVENT_CHAR, 23 | UIEVENT_SYSKEY, 24 | UIEVENT__KEYEND, 25 | UIEVENT__MOUSEBEGIN, 26 | UIEVENT_MOUSEMOVE, 27 | UIEVENT_MOUSELEAVE, 28 | UIEVENT_MOUSEENTER, 29 | UIEVENT_MOUSEHOVER, 30 | UIEVENT_BUTTONDOWN, 31 | UIEVENT_BUTTONUP, 32 | UIEVENT_RBUTTONDOWN, 33 | UIEVENT_DBLCLICK, 34 | UIEVENT_CONTEXTMENU, 35 | UIEVENT_SCROLLWHEEL, 36 | UIEVENT__MOUSEEND, 37 | UIEVENT_KILLFOCUS, 38 | UIEVENT_SETFOCUS, 39 | UIEVENT_WINDOWSIZE, 40 | UIEVENT_SETCURSOR, 41 | UIEVENT_TIMER, 42 | UIEVENT_NOTIFY, 43 | UIEVENT_COMMAND, 44 | UIEVENT__LAST, 45 | }; 46 | 47 | ///////////////////////////////////////////////////////////////////////////////////// 48 | // 49 | 50 | // Flags for CControlUI::GetControlFlags() 51 | #define UIFLAG_TABSTOP 0x00000001 52 | #define UIFLAG_SETCURSOR 0x00000002 53 | #define UIFLAG_WANTRETURN 0x00000004 54 | 55 | // Flags for FindControl() 56 | #define UIFIND_ALL 0x00000000 57 | #define UIFIND_VISIBLE 0x00000001 58 | #define UIFIND_ENABLED 0x00000002 59 | #define UIFIND_HITTEST 0x00000004 60 | #define UIFIND_TOP_FIRST 0x00000008 61 | #define UIFIND_ME_FIRST 0x80000000 62 | 63 | // Flags for the CDialogLayout stretching 64 | #define UISTRETCH_NEWGROUP 0x00000001 65 | #define UISTRETCH_NEWLINE 0x00000002 66 | #define UISTRETCH_MOVE_X 0x00000004 67 | #define UISTRETCH_MOVE_Y 0x00000008 68 | #define UISTRETCH_SIZE_X 0x00000010 69 | #define UISTRETCH_SIZE_Y 0x00000020 70 | 71 | // Flags used for controlling the paint 72 | #define UISTATE_FOCUSED 0x00000001 73 | #define UISTATE_SELECTED 0x00000002 74 | #define UISTATE_DISABLED 0x00000004 75 | #define UISTATE_HOT 0x00000008 76 | #define UISTATE_PUSHED 0x00000010 77 | #define UISTATE_READONLY 0x00000020 78 | #define UISTATE_CAPTURED 0x00000040 79 | 80 | 81 | 82 | ///////////////////////////////////////////////////////////////////////////////////// 83 | // 84 | 85 | typedef struct tagTFontInfo 86 | { 87 | HFONT hFont; 88 | CDuiString sFontName; 89 | int iSize; 90 | bool bBold; 91 | bool bUnderline; 92 | bool bItalic; 93 | TEXTMETRIC tm; 94 | } TFontInfo; 95 | 96 | typedef struct tagTImageInfo 97 | { 98 | HBITMAP hBitmap; 99 | int nX; 100 | int nY; 101 | bool alphaChannel; 102 | CDuiString sResType; 103 | DWORD dwMask; 104 | } TImageInfo; 105 | 106 | // Structure for notifications from the system 107 | // to the control implementation. 108 | typedef struct tagTEventUI 109 | { 110 | int Type; 111 | CControlUI* pSender; 112 | DWORD dwTimestamp; 113 | POINT ptMouse; 114 | TCHAR chKey; 115 | WORD wKeyState; 116 | WPARAM wParam; 117 | LPARAM lParam; 118 | } TEventUI; 119 | 120 | // Structure for relative position to the parent 121 | typedef struct tagTRelativePosUI 122 | { 123 | bool bRelative; 124 | SIZE szParent; 125 | int nMoveXPercent; 126 | int nMoveYPercent; 127 | int nZoomXPercent; 128 | int nZoomYPercent; 129 | }TRelativePosUI; 130 | 131 | // Listener interface 132 | class INotifyUI 133 | { 134 | public: 135 | virtual void Notify(TNotifyUI& msg) = 0; 136 | }; 137 | 138 | // MessageFilter interface 139 | class IMessageFilterUI 140 | { 141 | public: 142 | virtual LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled) = 0; 143 | }; 144 | 145 | class ITranslateAccelerator 146 | { 147 | public: 148 | virtual LRESULT TranslateAccelerator(MSG *pMsg) = 0; 149 | }; 150 | 151 | 152 | ///////////////////////////////////////////////////////////////////////////////////// 153 | // 154 | typedef CControlUI* (*LPCREATECONTROL)(LPCTSTR pstrType); 155 | 156 | 157 | class UILIB_API CPaintManagerUI 158 | { 159 | public: 160 | CPaintManagerUI(); 161 | ~CPaintManagerUI(); 162 | 163 | public: 164 | void Init(HWND hWnd); 165 | void NeedUpdate(); 166 | void Invalidate(RECT& rcItem); 167 | 168 | HDC GetPaintDC() const; 169 | HWND GetPaintWindow() const; 170 | HWND GetTooltipWindow() const; 171 | 172 | POINT GetMousePos() const; 173 | SIZE GetClientSize() const; 174 | SIZE GetInitSize(); 175 | void SetInitSize(int cx, int cy); 176 | RECT& GetSizeBox(); 177 | void SetSizeBox(RECT& rcSizeBox); 178 | RECT& GetCaptionRect(); 179 | void SetCaptionRect(RECT& rcCaption); 180 | SIZE GetRoundCorner() const; 181 | void SetRoundCorner(int cx, int cy); 182 | SIZE GetMinInfo() const; 183 | void SetMinInfo(int cx, int cy); 184 | SIZE GetMaxInfo() const; 185 | void SetMaxInfo(int cx, int cy); 186 | int GetTransparent() const; 187 | void SetTransparent(int nOpacity); 188 | void SetBackgroundTransparent(bool bTrans); 189 | bool IsShowUpdateRect() const; 190 | void SetShowUpdateRect(bool show); 191 | 192 | static HINSTANCE GetInstance(); 193 | static CDuiString GetInstancePath(); 194 | static CDuiString GetCurrentPath(); 195 | static HINSTANCE GetResourceDll(); 196 | static const CDuiString& GetResourcePath(); 197 | static const CDuiString& GetResourceZip(); 198 | static bool IsCachedResourceZip(); 199 | static HANDLE GetResourceZipHandle(); 200 | static void SetInstance(HINSTANCE hInst); 201 | static void SetCurrentPath(LPCTSTR pStrPath); 202 | static void SetResourceDll(HINSTANCE hInst); 203 | static void SetResourcePath(LPCTSTR pStrPath); 204 | static void SetResourceZip(LPVOID pVoid, unsigned int len); 205 | static void SetResourceZip(LPCTSTR pstrZip, bool bCachedResourceZip = false); 206 | static void GetHSL(short* H, short* S, short* L); 207 | static void SetHSL(bool bUseHSL, short H, short S, short L); // H:0~360, S:0~200, L:0~200 208 | static void ReloadSkin(); 209 | static bool LoadPlugin(LPCTSTR pstrModuleName); 210 | static CStdPtrArray* GetPlugins(); 211 | 212 | bool UseParentResource(CPaintManagerUI* pm); 213 | CPaintManagerUI* GetParentResource() const; 214 | 215 | DWORD GetDefaultDisabledColor() const; 216 | void SetDefaultDisabledColor(DWORD dwColor); 217 | DWORD GetDefaultFontColor() const; 218 | void SetDefaultFontColor(DWORD dwColor); 219 | DWORD GetDefaultLinkFontColor() const; 220 | void SetDefaultLinkFontColor(DWORD dwColor); 221 | DWORD GetDefaultLinkHoverFontColor() const; 222 | void SetDefaultLinkHoverFontColor(DWORD dwColor); 223 | DWORD GetDefaultSelectedBkColor() const; 224 | void SetDefaultSelectedBkColor(DWORD dwColor); 225 | TFontInfo* GetDefaultFontInfo(); 226 | void SetDefaultFont(LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic); 227 | DWORD GetCustomFontCount() const; 228 | HFONT AddFont(LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic); 229 | HFONT AddFontAt(int index, LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic); 230 | HFONT GetFont(int index); 231 | HFONT GetFont(LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic); 232 | bool FindFont(HFONT hFont); 233 | bool FindFont(LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic); 234 | int GetFontIndex(HFONT hFont); 235 | int GetFontIndex(LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic); 236 | bool RemoveFont(HFONT hFont); 237 | bool RemoveFontAt(int index); 238 | void RemoveAllFonts(); 239 | TFontInfo* GetFontInfo(int index); 240 | TFontInfo* GetFontInfo(HFONT hFont); 241 | 242 | const TImageInfo* GetImage(LPCTSTR bitmap); 243 | const TImageInfo* GetImageEx(LPCTSTR bitmap, LPCTSTR type = NULL, DWORD mask = 0); 244 | const TImageInfo* AddImage(LPCTSTR bitmap, LPCTSTR type = NULL, DWORD mask = 0); 245 | const TImageInfo* AddImage(LPCTSTR bitmap, HBITMAP hBitmap, int iWidth, int iHeight, bool bAlpha); 246 | bool RemoveImage(LPCTSTR bitmap); 247 | void RemoveAllImages(); 248 | void ReloadAllImages(); 249 | 250 | void AddDefaultAttributeList(LPCTSTR pStrControlName, LPCTSTR pStrControlAttrList); 251 | LPCTSTR GetDefaultAttributeList(LPCTSTR pStrControlName) const; 252 | bool RemoveDefaultAttributeList(LPCTSTR pStrControlName); 253 | const CStdStringPtrMap& GetDefaultAttribultes() const; 254 | void RemoveAllDefaultAttributeList(); 255 | 256 | bool AttachDialog(CControlUI* pControl); 257 | bool InitControls(CControlUI* pControl, CControlUI* pParent = NULL); 258 | void ReapObjects(CControlUI* pControl); 259 | 260 | bool AddOptionGroup(LPCTSTR pStrGroupName, CControlUI* pControl); 261 | CStdPtrArray* GetOptionGroup(LPCTSTR pStrGroupName); 262 | void RemoveOptionGroup(LPCTSTR pStrGroupName, CControlUI* pControl); 263 | void RemoveAllOptionGroups(); 264 | 265 | CControlUI* GetFocus() const; 266 | void SetFocus(CControlUI* pControl); 267 | void SetFocusNeeded(CControlUI* pControl); 268 | 269 | bool SetNextTabControl(bool bForward = true); 270 | 271 | bool SetTimer(CControlUI* pControl, UINT nTimerID, UINT uElapse); 272 | bool KillTimer(CControlUI* pControl, UINT nTimerID); 273 | void KillTimer(CControlUI* pControl); 274 | void RemoveAllTimers(); 275 | 276 | void SetCapture(); 277 | void ReleaseCapture(); 278 | bool IsCaptured(); 279 | 280 | bool AddNotifier(INotifyUI* pControl); 281 | bool RemoveNotifier(INotifyUI* pControl); 282 | void SendNotify(TNotifyUI& Msg, bool bAsync = false); 283 | void SendNotify(CControlUI* pControl, LPCTSTR pstrMessage, WPARAM wParam = 0, LPARAM lParam = 0, bool bAsync = false); 284 | 285 | bool AddPreMessageFilter(IMessageFilterUI* pFilter); 286 | bool RemovePreMessageFilter(IMessageFilterUI* pFilter); 287 | 288 | bool AddMessageFilter(IMessageFilterUI* pFilter); 289 | bool RemoveMessageFilter(IMessageFilterUI* pFilter); 290 | 291 | int GetPostPaintCount() const; 292 | bool AddPostPaint(CControlUI* pControl); 293 | bool RemovePostPaint(CControlUI* pControl); 294 | bool SetPostPaintIndex(CControlUI* pControl, int iIndex); 295 | 296 | void AddDelayedCleanup(CControlUI* pControl); 297 | 298 | bool AddTranslateAccelerator(ITranslateAccelerator *pTranslateAccelerator); 299 | bool RemoveTranslateAccelerator(ITranslateAccelerator *pTranslateAccelerator); 300 | bool TranslateAccelerator(LPMSG pMsg); 301 | 302 | CControlUI* GetRoot() const; 303 | CControlUI* FindControl(POINT pt) const; 304 | CControlUI* FindControl(LPCTSTR pstrName) const; 305 | CControlUI* FindSubControlByPoint(CControlUI* pParent, POINT pt) const; 306 | CControlUI* FindSubControlByName(CControlUI* pParent, LPCTSTR pstrName) const; 307 | CControlUI* FindSubControlByClass(CControlUI* pParent, LPCTSTR pstrClass, int iIndex = 0); 308 | CStdPtrArray* FindSubControlsByClass(CControlUI* pParent, LPCTSTR pstrClass); 309 | CStdPtrArray* GetSubControlsByClass(); 310 | 311 | static void MessageLoop(); 312 | static bool TranslateMessage(const LPMSG pMsg); 313 | static void Term(); 314 | 315 | bool MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lRes); 316 | bool PreMessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lRes); 317 | void UsedVirtualWnd(bool bUsed); 318 | 319 | private: 320 | static CControlUI* CALLBACK __FindControlFromNameHash(CControlUI* pThis, LPVOID pData); 321 | static CControlUI* CALLBACK __FindControlFromCount(CControlUI* pThis, LPVOID pData); 322 | static CControlUI* CALLBACK __FindControlFromPoint(CControlUI* pThis, LPVOID pData); 323 | static CControlUI* CALLBACK __FindControlFromTab(CControlUI* pThis, LPVOID pData); 324 | static CControlUI* CALLBACK __FindControlFromShortcut(CControlUI* pThis, LPVOID pData); 325 | static CControlUI* CALLBACK __FindControlFromUpdate(CControlUI* pThis, LPVOID pData); 326 | static CControlUI* CALLBACK __FindControlFromName(CControlUI* pThis, LPVOID pData); 327 | static CControlUI* CALLBACK __FindControlFromClass(CControlUI* pThis, LPVOID pData); 328 | static CControlUI* CALLBACK __FindControlsFromClass(CControlUI* pThis, LPVOID pData); 329 | 330 | private: 331 | HWND m_hWndPaint; 332 | int m_nOpacity; 333 | HDC m_hDcPaint; 334 | HDC m_hDcOffscreen; 335 | HDC m_hDcBackground; 336 | HBITMAP m_hbmpOffscreen; 337 | HBITMAP m_hbmpBackground; 338 | HWND m_hwndTooltip; 339 | TOOLINFO m_ToolTip; 340 | bool m_bShowUpdateRect; 341 | // 342 | CControlUI* m_pRoot; 343 | CControlUI* m_pFocus; 344 | CControlUI* m_pEventHover; 345 | CControlUI* m_pEventClick; 346 | CControlUI* m_pEventKey; 347 | // 348 | POINT m_ptLastMousePos; 349 | SIZE m_szMinWindow; 350 | SIZE m_szMaxWindow; 351 | SIZE m_szInitWindowSize; 352 | RECT m_rcSizeBox; 353 | SIZE m_szRoundCorner; 354 | RECT m_rcCaption; 355 | UINT m_uTimerID; 356 | bool m_bFirstLayout; 357 | bool m_bUpdateNeeded; 358 | bool m_bFocusNeeded; 359 | bool m_bOffscreenPaint; 360 | bool m_bAlphaBackground; 361 | bool m_bMouseTracking; 362 | bool m_bMouseCapture; 363 | bool m_bUsedVirtualWnd; 364 | 365 | // 366 | CStdPtrArray m_aNotifiers; 367 | CStdPtrArray m_aTimers; 368 | CStdPtrArray m_aPreMessageFilters; 369 | CStdPtrArray m_aMessageFilters; 370 | CStdPtrArray m_aPostPaintControls; 371 | CStdPtrArray m_aDelayedCleanup; 372 | CStdPtrArray m_aAsyncNotify; 373 | CStdPtrArray m_aFoundControls; 374 | CStdStringPtrMap m_mNameHash; 375 | CStdStringPtrMap m_mOptionGroup; 376 | // 377 | CPaintManagerUI* m_pParentResourcePM; 378 | DWORD m_dwDefaultDisabledColor; 379 | DWORD m_dwDefaultFontColor; 380 | DWORD m_dwDefaultLinkFontColor; 381 | DWORD m_dwDefaultLinkHoverFontColor; 382 | DWORD m_dwDefaultSelectedBkColor; 383 | TFontInfo m_DefaultFontInfo; 384 | CStdPtrArray m_aCustomFonts; 385 | 386 | CStdStringPtrMap m_mImageHash; 387 | CStdStringPtrMap m_DefaultAttrHash; 388 | // 389 | static HINSTANCE m_hInstance; 390 | static HINSTANCE m_hResourceInstance; 391 | static CDuiString m_pStrResourcePath; 392 | static CDuiString m_pStrResourceZip; 393 | static bool m_bCachedResourceZip; 394 | static HANDLE m_hResourceZip; 395 | static short m_H; 396 | static short m_S; 397 | static short m_L; 398 | static CStdPtrArray m_aPreMessages; 399 | static CStdPtrArray m_aPlugins; 400 | 401 | public: 402 | static CDuiString m_pStrDefaultFontName; 403 | CStdPtrArray m_aTranslateAccelerator; 404 | }; 405 | 406 | } // namespace DuiLib 407 | 408 | #endif // __UIMANAGER_H__ 409 | -------------------------------------------------------------------------------- /testtab/testtab/Core/UIMarkup.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Core/UIMarkup.cpp -------------------------------------------------------------------------------- /testtab/testtab/Core/UIMarkup.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIMARKUP_H__ 2 | #define __UIMARKUP_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib { 7 | 8 | enum 9 | { 10 | XMLFILE_ENCODING_UTF8 = 0, 11 | XMLFILE_ENCODING_UNICODE = 1, 12 | XMLFILE_ENCODING_ASNI = 2, 13 | }; 14 | 15 | class CMarkup; 16 | class CMarkupNode; 17 | 18 | 19 | class UILIB_API CMarkup 20 | { 21 | friend class CMarkupNode; 22 | public: 23 | CMarkup(LPCTSTR pstrXML = NULL); 24 | ~CMarkup(); 25 | 26 | bool Load(LPCTSTR pstrXML); 27 | bool LoadFromMem(BYTE* pByte, DWORD dwSize, int encoding = XMLFILE_ENCODING_UTF8); 28 | bool LoadFromFile(LPCTSTR pstrFilename, int encoding = XMLFILE_ENCODING_UTF8); 29 | void Release(); 30 | bool IsValid() const; 31 | 32 | void SetPreserveWhitespace(bool bPreserve = true); 33 | void GetLastErrorMessage(LPTSTR pstrMessage, SIZE_T cchMax) const; 34 | void GetLastErrorLocation(LPTSTR pstrSource, SIZE_T cchMax) const; 35 | 36 | CMarkupNode GetRoot(); 37 | 38 | private: 39 | typedef struct tagXMLELEMENT 40 | { 41 | ULONG iStart; 42 | ULONG iChild; 43 | ULONG iNext; 44 | ULONG iParent; 45 | ULONG iData; 46 | } XMLELEMENT; 47 | 48 | LPTSTR m_pstrXML; 49 | XMLELEMENT* m_pElements; 50 | ULONG m_nElements; 51 | ULONG m_nReservedElements; 52 | TCHAR m_szErrorMsg[100]; 53 | TCHAR m_szErrorXML[50]; 54 | bool m_bPreserveWhitespace; 55 | 56 | private: 57 | bool _Parse(); 58 | bool _Parse(LPTSTR& pstrText, ULONG iParent); 59 | XMLELEMENT* _ReserveElement(); 60 | inline void _SkipWhitespace(LPTSTR& pstr) const; 61 | inline void _SkipWhitespace(LPCTSTR& pstr) const; 62 | inline void _SkipIdentifier(LPTSTR& pstr) const; 63 | inline void _SkipIdentifier(LPCTSTR& pstr) const; 64 | bool _ParseData(LPTSTR& pstrText, LPTSTR& pstrData, char cEnd); 65 | void _ParseMetaChar(LPTSTR& pstrText, LPTSTR& pstrDest); 66 | bool _ParseAttributes(LPTSTR& pstrText); 67 | bool _Failed(LPCTSTR pstrError, LPCTSTR pstrLocation = NULL); 68 | }; 69 | 70 | 71 | class UILIB_API CMarkupNode 72 | { 73 | friend class CMarkup; 74 | private: 75 | CMarkupNode(); 76 | CMarkupNode(CMarkup* pOwner, int iPos); 77 | 78 | public: 79 | bool IsValid() const; 80 | 81 | CMarkupNode GetParent(); 82 | CMarkupNode GetSibling(); 83 | CMarkupNode GetChild(); 84 | CMarkupNode GetChild(LPCTSTR pstrName); 85 | 86 | bool HasSiblings() const; 87 | bool HasChildren() const; 88 | LPCTSTR GetName() const; 89 | LPCTSTR GetValue() const; 90 | 91 | bool HasAttributes(); 92 | bool HasAttribute(LPCTSTR pstrName); 93 | int GetAttributeCount(); 94 | LPCTSTR GetAttributeName(int iIndex); 95 | LPCTSTR GetAttributeValue(int iIndex); 96 | LPCTSTR GetAttributeValue(LPCTSTR pstrName); 97 | bool GetAttributeValue(int iIndex, LPTSTR pstrValue, SIZE_T cchMax); 98 | bool GetAttributeValue(LPCTSTR pstrName, LPTSTR pstrValue, SIZE_T cchMax); 99 | 100 | private: 101 | void _MapAttributes(); 102 | 103 | enum { MAX_XML_ATTRIBUTES = 64 }; 104 | 105 | typedef struct 106 | { 107 | ULONG iName; 108 | ULONG iValue; 109 | } XMLATTRIBUTE; 110 | 111 | int m_iPos; 112 | int m_nAttributes; 113 | XMLATTRIBUTE m_aAttributes[MAX_XML_ATTRIBUTES]; 114 | CMarkup* m_pOwner; 115 | }; 116 | 117 | } // namespace DuiLib 118 | 119 | #endif // __UIMARKUP_H__ 120 | -------------------------------------------------------------------------------- /testtab/testtab/Core/UIRender.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Core/UIRender.cpp -------------------------------------------------------------------------------- /testtab/testtab/Core/UIRender.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Core/UIRender.h -------------------------------------------------------------------------------- /testtab/testtab/Core/uidefine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Core/uidefine.h -------------------------------------------------------------------------------- /testtab/testtab/DlgCleanRubbish.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/DlgCleanRubbish.htm -------------------------------------------------------------------------------- /testtab/testtab/DuiLib_u.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/DuiLib_u.dll -------------------------------------------------------------------------------- /testtab/testtab/DuiLib_ud.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/DuiLib_ud.dll -------------------------------------------------------------------------------- /testtab/testtab/FileExplorer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/FileExplorer.cpp -------------------------------------------------------------------------------- /testtab/testtab/FileExplorer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/FileExplorer.h -------------------------------------------------------------------------------- /testtab/testtab/FileVerion.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/FileVerion.cpp -------------------------------------------------------------------------------- /testtab/testtab/FileVerion.h: -------------------------------------------------------------------------------- 1 | // by Manuel Laflamme 2 | ////////////////////////////////////////////////////////////////////// 3 | 4 | #pragma once 5 | class CFileVersion 6 | { 7 | // Construction 8 | public: 9 | CFileVersion(); 10 | // Operations 11 | public: 12 | BOOL Open(LPCTSTR lpszModuleName); 13 | void Close(); 14 | CString QueryValue(LPCTSTR lpszValueName, DWORD dwLangCharset = 0); 15 | CString GetFileDescription() {return QueryValue(_T("FileDescription")); }; 16 | CString GetFileVersion() {return QueryValue(_T("FileVersion")); }; 17 | CString GetInternalName() {return QueryValue(_T("InternalName")); }; 18 | CString GetCompanyName() {return QueryValue(_T("CompanyName")); }; 19 | CString GetLegalCopyright() {return QueryValue(_T("LegalCopyright")); }; 20 | CString GetOriginalFilename() {return QueryValue(_T("OriginalFilename"));}; 21 | CString GetProductName() {return QueryValue(_T("ProductName")); }; 22 | CString GetProductVersion() {return QueryValue(_T("ProductVersion")); }; 23 | BOOL GetFixedInfo(VS_FIXEDFILEINFO& vsffi); 24 | CString GetFixedFileVersion(); 25 | CString GetFixedProductVersion(); 26 | // Attributes 27 | protected: 28 | LPBYTE m_lpVersionData; 29 | DWORD m_dwLangCharset; 30 | // Implementation 31 | public: 32 | ~CFileVersion(); 33 | }; -------------------------------------------------------------------------------- /testtab/testtab/FileView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/FileView.cpp -------------------------------------------------------------------------------- /testtab/testtab/FileView.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/FileView.h -------------------------------------------------------------------------------- /testtab/testtab/HBrowseFolder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/HBrowseFolder.cpp -------------------------------------------------------------------------------- /testtab/testtab/HBrowseFolder.h: -------------------------------------------------------------------------------- 1 | #ifndef __HBROWSEFOLDER__H__ 2 | #define __HBROWSEFOLDER__H__ 3 | #pragma once 4 | 5 | class CHBrowseFolder 6 | { 7 | public: 8 | CHBrowseFolder(); 9 | virtual ~CHBrowseFolder(); 10 | TCHAR *GetDirPath(); 11 | int DoModal(CWnd *pParentWnd,const TCHAR *pStartPath=NULL); 12 | BOOL IsValuePath(const TCHAR *pDirPath); 13 | static int CALLBACK BrowseCallbackProc(HWND hWnd,UINT uMsg,LPARAM lParam,LPARAM lpData); 14 | private: 15 | TCHAR *m_pDirPath; 16 | }; 17 | 18 | #endif -------------------------------------------------------------------------------- /testtab/testtab/HSelectDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/HSelectDlg.cpp -------------------------------------------------------------------------------- /testtab/testtab/HSelectDlg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/HSelectDlg.h -------------------------------------------------------------------------------- /testtab/testtab/InterNetSetting.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/InterNetSetting.h -------------------------------------------------------------------------------- /testtab/testtab/Layout/UIChildLayout.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "UIChildLayout.h" 3 | 4 | namespace DuiLib 5 | { 6 | CChildLayoutUI::CChildLayoutUI() 7 | { 8 | 9 | } 10 | 11 | void CChildLayoutUI::Init() 12 | { 13 | if (!m_pstrXMLFile.IsEmpty()) 14 | { 15 | CDialogBuilder builder; 16 | CContainerUI* pChildWindow = static_cast(builder.Create(m_pstrXMLFile.GetData(), (UINT)0)); 17 | if (pChildWindow) 18 | { 19 | this->Add(pChildWindow); 20 | } 21 | else 22 | { 23 | this->RemoveAll(); 24 | } 25 | } 26 | } 27 | 28 | void CChildLayoutUI::SetAttribute( LPCTSTR pstrName, LPCTSTR pstrValue ) 29 | { 30 | if( _tcscmp(pstrName, _T("xmlfile")) == 0 ) 31 | SetChildLayoutXML(pstrValue); 32 | else 33 | CContainerUI::SetAttribute(pstrName,pstrValue); 34 | } 35 | 36 | void CChildLayoutUI::SetChildLayoutXML( DuiLib::CDuiString pXML ) 37 | { 38 | m_pstrXMLFile=pXML; 39 | } 40 | 41 | DuiLib::CDuiString CChildLayoutUI::GetChildLayoutXML() 42 | { 43 | return m_pstrXMLFile; 44 | } 45 | 46 | LPVOID CChildLayoutUI::GetInterface( LPCTSTR pstrName ) 47 | { 48 | if( _tcscmp(pstrName, DUI_CTR_CHILDLAYOUT) == 0 ) return static_cast(this); 49 | return CControlUI::GetInterface(pstrName); 50 | } 51 | 52 | LPCTSTR CChildLayoutUI::GetClass() const 53 | { 54 | return _T("ChildLayoutUI"); 55 | } 56 | } // namespace DuiLib 57 | -------------------------------------------------------------------------------- /testtab/testtab/Layout/UIChildLayout.h: -------------------------------------------------------------------------------- 1 | #ifndef __UICHILDLAYOUT_H__ 2 | #define __UICHILDLAYOUT_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | class UILIB_API CChildLayoutUI : public CContainerUI 9 | { 10 | public: 11 | CChildLayoutUI(); 12 | 13 | void Init(); 14 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 15 | void SetChildLayoutXML(CDuiString pXML); 16 | DuiLib::CDuiString GetChildLayoutXML(); 17 | virtual LPVOID GetInterface(LPCTSTR pstrName); 18 | virtual LPCTSTR GetClass() const; 19 | 20 | private: 21 | DuiLib::CDuiString m_pstrXMLFile; 22 | }; 23 | } // namespace DuiLib 24 | #endif // __UICHILDLAYOUT_H__ 25 | -------------------------------------------------------------------------------- /testtab/testtab/Layout/UIHorizontalLayout.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "UIHorizontalLayout.h" 3 | 4 | namespace DuiLib 5 | { 6 | CHorizontalLayoutUI::CHorizontalLayoutUI() : m_iSepWidth(0), m_uButtonState(0), m_bImmMode(false) 7 | { 8 | ptLastMouse.x = ptLastMouse.y = 0; 9 | ::ZeroMemory(&m_rcNewPos, sizeof(m_rcNewPos)); 10 | } 11 | 12 | LPCTSTR CHorizontalLayoutUI::GetClass() const 13 | { 14 | return _T("HorizontalLayoutUI"); 15 | } 16 | 17 | LPVOID CHorizontalLayoutUI::GetInterface(LPCTSTR pstrName) 18 | { 19 | if( _tcscmp(pstrName, DUI_CTR_HORIZONTALLAYOUT) == 0 ) return static_cast(this); 20 | return CContainerUI::GetInterface(pstrName); 21 | } 22 | 23 | UINT CHorizontalLayoutUI::GetControlFlags() const 24 | { 25 | if( IsEnabled() && m_iSepWidth != 0 ) return UIFLAG_SETCURSOR; 26 | else return 0; 27 | } 28 | 29 | void CHorizontalLayoutUI::SetPos(RECT rc) 30 | { 31 | CControlUI::SetPos(rc); 32 | rc = m_rcItem; 33 | 34 | // Adjust for inset 35 | rc.left += m_rcInset.left; 36 | rc.top += m_rcInset.top; 37 | rc.right -= m_rcInset.right; 38 | rc.bottom -= m_rcInset.bottom; 39 | 40 | if( m_items.GetSize() == 0) { 41 | ProcessScrollBar(rc, 0, 0); 42 | return; 43 | } 44 | 45 | if( m_pVerticalScrollBar && m_pVerticalScrollBar->IsVisible() ) rc.right -= m_pVerticalScrollBar->GetFixedWidth(); 46 | if( m_pHorizontalScrollBar && m_pHorizontalScrollBar->IsVisible() ) rc.bottom -= m_pHorizontalScrollBar->GetFixedHeight(); 47 | 48 | // Determine the width of elements that are sizeable 49 | SIZE szAvailable = { rc.right - rc.left, rc.bottom - rc.top }; 50 | if( m_pHorizontalScrollBar && m_pHorizontalScrollBar->IsVisible() ) 51 | szAvailable.cx += m_pHorizontalScrollBar->GetScrollRange(); 52 | 53 | int nAdjustables = 0; 54 | int cxFixed = 0; 55 | int nEstimateNum = 0; 56 | for( int it1 = 0; it1 < m_items.GetSize(); it1++ ) { 57 | CControlUI* pControl = static_cast(m_items[it1]); 58 | if( !pControl->IsVisible() ) continue; 59 | if( pControl->IsFloat() ) continue; 60 | SIZE sz = pControl->EstimateSize(szAvailable); 61 | if( sz.cx == 0 ) { 62 | nAdjustables++; 63 | } 64 | else { 65 | if( sz.cx < pControl->GetMinWidth() ) sz.cx = pControl->GetMinWidth(); 66 | if( sz.cx > pControl->GetMaxWidth() ) sz.cx = pControl->GetMaxWidth(); 67 | } 68 | cxFixed += sz.cx + pControl->GetPadding().left + pControl->GetPadding().right; 69 | nEstimateNum++; 70 | } 71 | cxFixed += (nEstimateNum - 1) * m_iChildPadding; 72 | 73 | int cxExpand = 0; 74 | if( nAdjustables > 0 ) cxExpand = MAX(0, (szAvailable.cx - cxFixed) / nAdjustables); 75 | // Position the elements 76 | SIZE szRemaining = szAvailable; 77 | int iPosX = rc.left; 78 | if( m_pHorizontalScrollBar && m_pHorizontalScrollBar->IsVisible() ) { 79 | iPosX -= m_pHorizontalScrollBar->GetScrollPos(); 80 | } 81 | int iAdjustable = 0; 82 | int cxFixedRemaining = cxFixed; 83 | for( int it2 = 0; it2 < m_items.GetSize(); it2++ ) { 84 | CControlUI* pControl = static_cast(m_items[it2]); 85 | if( !pControl->IsVisible() ) continue; 86 | if( pControl->IsFloat() ) { 87 | SetFloatPos(it2); 88 | continue; 89 | } 90 | RECT rcPadding = pControl->GetPadding(); 91 | szRemaining.cx -= rcPadding.left; 92 | SIZE sz = pControl->EstimateSize(szRemaining); 93 | if( sz.cx == 0 ) { 94 | iAdjustable++; 95 | sz.cx = cxExpand; 96 | // Distribute remaining to last element (usually round-off left-overs) 97 | if( iAdjustable == nAdjustables ) { 98 | sz.cx = MAX(0, szRemaining.cx - rcPadding.right - cxFixedRemaining); 99 | } 100 | if( sz.cx < pControl->GetMinWidth() ) sz.cx = pControl->GetMinWidth(); 101 | if( sz.cx > pControl->GetMaxWidth() ) sz.cx = pControl->GetMaxWidth(); 102 | } 103 | else { 104 | if( sz.cx < pControl->GetMinWidth() ) sz.cx = pControl->GetMinWidth(); 105 | if( sz.cx > pControl->GetMaxWidth() ) sz.cx = pControl->GetMaxWidth(); 106 | 107 | cxFixedRemaining -= sz.cx; 108 | } 109 | 110 | sz.cy = pControl->GetFixedHeight(); 111 | if( sz.cy == 0 ) sz.cy = rc.bottom - rc.top - rcPadding.top - rcPadding.bottom; 112 | if( sz.cy < 0 ) sz.cy = 0; 113 | if( sz.cy < pControl->GetMinHeight() ) sz.cy = pControl->GetMinHeight(); 114 | if( sz.cy > pControl->GetMaxHeight() ) sz.cy = pControl->GetMaxHeight(); 115 | 116 | RECT rcCtrl = { iPosX + rcPadding.left, rc.top + rcPadding.top, iPosX + sz.cx + rcPadding.left + rcPadding.right, rc.top + rcPadding.top + sz.cy}; 117 | pControl->SetPos(rcCtrl); 118 | iPosX += sz.cx + m_iChildPadding + rcPadding.left + rcPadding.right; 119 | szRemaining.cx -= sz.cx + m_iChildPadding + rcPadding.right; 120 | } 121 | 122 | // Process the scrollbar 123 | ProcessScrollBar(rc, 0, 0); 124 | } 125 | 126 | void CHorizontalLayoutUI::DoPostPaint(HDC hDC, const RECT& rcPaint) 127 | { 128 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 && !m_bImmMode ) { 129 | RECT rcSeparator = GetThumbRect(true); 130 | CRenderEngine::DrawColor(hDC, rcSeparator, 0xAA000000); 131 | } 132 | } 133 | 134 | void CHorizontalLayoutUI::SetSepWidth(int iWidth) 135 | { 136 | m_iSepWidth = iWidth; 137 | } 138 | 139 | int CHorizontalLayoutUI::GetSepWidth() const 140 | { 141 | return m_iSepWidth; 142 | } 143 | 144 | void CHorizontalLayoutUI::SetSepImmMode(bool bImmediately) 145 | { 146 | if( m_bImmMode == bImmediately ) return; 147 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 && !m_bImmMode && m_pManager != NULL ) { 148 | m_pManager->RemovePostPaint(this); 149 | } 150 | 151 | m_bImmMode = bImmediately; 152 | } 153 | 154 | bool CHorizontalLayoutUI::IsSepImmMode() const 155 | { 156 | return m_bImmMode; 157 | } 158 | 159 | void CHorizontalLayoutUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 160 | { 161 | if( _tcscmp(pstrName, _T("sepwidth")) == 0 ) SetSepWidth(_ttoi(pstrValue)); 162 | else if( _tcscmp(pstrName, _T("sepimm")) == 0 ) SetSepImmMode(_tcscmp(pstrValue, _T("true")) == 0); 163 | else CContainerUI::SetAttribute(pstrName, pstrValue); 164 | } 165 | 166 | void CHorizontalLayoutUI::DoEvent(TEventUI& event) 167 | { 168 | if( m_iSepWidth != 0 ) { 169 | if( event.Type == UIEVENT_BUTTONDOWN && IsEnabled() ) 170 | { 171 | RECT rcSeparator = GetThumbRect(false); 172 | if( ::PtInRect(&rcSeparator, event.ptMouse) ) { 173 | m_uButtonState |= UISTATE_CAPTURED; 174 | ptLastMouse = event.ptMouse; 175 | m_rcNewPos = m_rcItem; 176 | if( !m_bImmMode && m_pManager ) m_pManager->AddPostPaint(this); 177 | return; 178 | } 179 | } 180 | if( event.Type == UIEVENT_BUTTONUP ) 181 | { 182 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) { 183 | m_uButtonState &= ~UISTATE_CAPTURED; 184 | m_rcItem = m_rcNewPos; 185 | if( !m_bImmMode && m_pManager ) m_pManager->RemovePostPaint(this); 186 | NeedParentUpdate(); 187 | return; 188 | } 189 | } 190 | if( event.Type == UIEVENT_MOUSEMOVE ) 191 | { 192 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) { 193 | LONG cx = event.ptMouse.x - ptLastMouse.x; 194 | ptLastMouse = event.ptMouse; 195 | RECT rc = m_rcNewPos; 196 | if( m_iSepWidth >= 0 ) { 197 | if( cx > 0 && event.ptMouse.x < m_rcNewPos.right - m_iSepWidth ) return; 198 | if( cx < 0 && event.ptMouse.x > m_rcNewPos.right ) return; 199 | rc.right += cx; 200 | if( rc.right - rc.left <= GetMinWidth() ) { 201 | if( m_rcNewPos.right - m_rcNewPos.left <= GetMinWidth() ) return; 202 | rc.right = rc.left + GetMinWidth(); 203 | } 204 | if( rc.right - rc.left >= GetMaxWidth() ) { 205 | if( m_rcNewPos.right - m_rcNewPos.left >= GetMaxWidth() ) return; 206 | rc.right = rc.left + GetMaxWidth(); 207 | } 208 | } 209 | else { 210 | if( cx > 0 && event.ptMouse.x < m_rcNewPos.left ) return; 211 | if( cx < 0 && event.ptMouse.x > m_rcNewPos.left - m_iSepWidth ) return; 212 | rc.left += cx; 213 | if( rc.right - rc.left <= GetMinWidth() ) { 214 | if( m_rcNewPos.right - m_rcNewPos.left <= GetMinWidth() ) return; 215 | rc.left = rc.right - GetMinWidth(); 216 | } 217 | if( rc.right - rc.left >= GetMaxWidth() ) { 218 | if( m_rcNewPos.right - m_rcNewPos.left >= GetMaxWidth() ) return; 219 | rc.left = rc.right - GetMaxWidth(); 220 | } 221 | } 222 | 223 | CDuiRect rcInvalidate = GetThumbRect(true); 224 | m_rcNewPos = rc; 225 | m_cxyFixed.cx = m_rcNewPos.right - m_rcNewPos.left; 226 | 227 | if( m_bImmMode ) { 228 | m_rcItem = m_rcNewPos; 229 | NeedParentUpdate(); 230 | } 231 | else { 232 | rcInvalidate.Join(GetThumbRect(true)); 233 | rcInvalidate.Join(GetThumbRect(false)); 234 | if( m_pManager ) m_pManager->Invalidate(rcInvalidate); 235 | } 236 | return; 237 | } 238 | } 239 | if( event.Type == UIEVENT_SETCURSOR ) 240 | { 241 | RECT rcSeparator = GetThumbRect(false); 242 | if( IsEnabled() && ::PtInRect(&rcSeparator, event.ptMouse) ) { 243 | ::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZEWE))); 244 | return; 245 | } 246 | } 247 | } 248 | CContainerUI::DoEvent(event); 249 | } 250 | 251 | RECT CHorizontalLayoutUI::GetThumbRect(bool bUseNew) const 252 | { 253 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 && bUseNew) { 254 | if( m_iSepWidth >= 0 ) return CDuiRect(m_rcNewPos.right - m_iSepWidth, m_rcNewPos.top, m_rcNewPos.right, m_rcNewPos.bottom); 255 | else return CDuiRect(m_rcNewPos.left, m_rcNewPos.top, m_rcNewPos.left - m_iSepWidth, m_rcNewPos.bottom); 256 | } 257 | else { 258 | if( m_iSepWidth >= 0 ) return CDuiRect(m_rcItem.right - m_iSepWidth, m_rcItem.top, m_rcItem.right, m_rcItem.bottom); 259 | else return CDuiRect(m_rcItem.left, m_rcItem.top, m_rcItem.left - m_iSepWidth, m_rcItem.bottom); 260 | } 261 | } 262 | } 263 | -------------------------------------------------------------------------------- /testtab/testtab/Layout/UIHorizontalLayout.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIHORIZONTALLAYOUT_H__ 2 | #define __UIHORIZONTALLAYOUT_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | class UILIB_API CHorizontalLayoutUI : public CContainerUI 9 | { 10 | public: 11 | CHorizontalLayoutUI(); 12 | 13 | LPCTSTR GetClass() const; 14 | LPVOID GetInterface(LPCTSTR pstrName); 15 | UINT GetControlFlags() const; 16 | 17 | void SetSepWidth(int iWidth); 18 | int GetSepWidth() const; 19 | void SetSepImmMode(bool bImmediately); 20 | bool IsSepImmMode() const; 21 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 22 | void DoEvent(TEventUI& event); 23 | 24 | void SetPos(RECT rc); 25 | void DoPostPaint(HDC hDC, const RECT& rcPaint); 26 | 27 | RECT GetThumbRect(bool bUseNew = false) const; 28 | 29 | protected: 30 | int m_iSepWidth; 31 | UINT m_uButtonState; 32 | POINT ptLastMouse; 33 | RECT m_rcNewPos; 34 | bool m_bImmMode; 35 | }; 36 | } 37 | #endif // __UIHORIZONTALLAYOUT_H__ 38 | -------------------------------------------------------------------------------- /testtab/testtab/Layout/UITabLayout.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "UITabLayout.h" 3 | 4 | namespace DuiLib 5 | { 6 | CTabLayoutUI::CTabLayoutUI() : m_iCurSel(-1) 7 | { 8 | } 9 | 10 | LPCTSTR CTabLayoutUI::GetClass() const 11 | { 12 | return _T("TabLayoutUI"); 13 | } 14 | 15 | LPVOID CTabLayoutUI::GetInterface(LPCTSTR pstrName) 16 | { 17 | if( _tcscmp(pstrName, DUI_CTR_TABLAYOUT) == 0 ) return static_cast(this); 18 | return CContainerUI::GetInterface(pstrName); 19 | } 20 | 21 | bool CTabLayoutUI::Add(CControlUI* pControl) 22 | { 23 | bool ret = CContainerUI::Add(pControl); 24 | if( !ret ) return ret; 25 | 26 | if(m_iCurSel == -1 && pControl->IsVisible()) 27 | { 28 | m_iCurSel = GetItemIndex(pControl); 29 | } 30 | else 31 | { 32 | pControl->SetVisible(false); 33 | } 34 | 35 | return ret; 36 | } 37 | 38 | bool CTabLayoutUI::AddAt(CControlUI* pControl, int iIndex) 39 | { 40 | bool ret = CContainerUI::AddAt(pControl, iIndex); 41 | if( !ret ) return ret; 42 | 43 | if(m_iCurSel == -1 && pControl->IsVisible()) 44 | { 45 | m_iCurSel = GetItemIndex(pControl); 46 | } 47 | else if( m_iCurSel != -1 && iIndex <= m_iCurSel ) 48 | { 49 | m_iCurSel += 1; 50 | } 51 | else 52 | { 53 | pControl->SetVisible(false); 54 | } 55 | 56 | return ret; 57 | } 58 | 59 | bool CTabLayoutUI::Remove(CControlUI* pControl) 60 | { 61 | if( pControl == NULL) return false; 62 | 63 | int index = GetItemIndex(pControl); 64 | bool ret = CContainerUI::Remove(pControl); 65 | if( !ret ) return false; 66 | 67 | if( m_iCurSel == index) 68 | { 69 | if( GetCount() > 0 ) 70 | { 71 | m_iCurSel=0; 72 | GetItemAt(m_iCurSel)->SetVisible(true); 73 | } 74 | else 75 | m_iCurSel=-1; 76 | NeedParentUpdate(); 77 | } 78 | else if( m_iCurSel > index ) 79 | { 80 | m_iCurSel -= 1; 81 | } 82 | 83 | return ret; 84 | } 85 | 86 | void CTabLayoutUI::RemoveAll() 87 | { 88 | m_iCurSel = -1; 89 | CContainerUI::RemoveAll(); 90 | NeedParentUpdate(); 91 | } 92 | 93 | int CTabLayoutUI::GetCurSel() const 94 | { 95 | return m_iCurSel; 96 | } 97 | 98 | bool CTabLayoutUI::SelectItem(int iIndex) 99 | { 100 | if( iIndex < 0 || iIndex >= m_items.GetSize() ) return false; 101 | if( iIndex == m_iCurSel ) return true; 102 | 103 | int iOldSel = m_iCurSel; 104 | m_iCurSel = iIndex; 105 | for( int it = 0; it < m_items.GetSize(); it++ ) 106 | { 107 | if( it == iIndex ) { 108 | GetItemAt(it)->SetVisible(true); 109 | GetItemAt(it)->SetFocus(); 110 | SetPos(m_rcItem); 111 | } 112 | else GetItemAt(it)->SetVisible(false); 113 | } 114 | NeedParentUpdate(); 115 | 116 | if( m_pManager != NULL ) { 117 | m_pManager->SetNextTabControl(); 118 | m_pManager->SendNotify(this, DUI_MSGTYPE_TABSELECT, m_iCurSel, iOldSel); 119 | } 120 | return true; 121 | } 122 | 123 | bool CTabLayoutUI::SelectItem( CControlUI* pControl ) 124 | { 125 | int iIndex=GetItemIndex(pControl); 126 | if (iIndex==-1) 127 | return false; 128 | else 129 | return SelectItem(iIndex); 130 | } 131 | 132 | void CTabLayoutUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 133 | { 134 | if( _tcscmp(pstrName, _T("selectedid")) == 0 ) SelectItem(_ttoi(pstrValue)); 135 | return CContainerUI::SetAttribute(pstrName, pstrValue); 136 | } 137 | 138 | void CTabLayoutUI::SetPos(RECT rc) 139 | { 140 | CControlUI::SetPos(rc); 141 | rc = m_rcItem; 142 | 143 | // Adjust for inset 144 | rc.left += m_rcInset.left; 145 | rc.top += m_rcInset.top; 146 | rc.right -= m_rcInset.right; 147 | rc.bottom -= m_rcInset.bottom; 148 | 149 | for( int it = 0; it < m_items.GetSize(); it++ ) { 150 | CControlUI* pControl = static_cast(m_items[it]); 151 | if( !pControl->IsVisible() ) continue; 152 | if( pControl->IsFloat() ) { 153 | SetFloatPos(it); 154 | continue; 155 | } 156 | 157 | if( it != m_iCurSel ) continue; 158 | 159 | RECT rcPadding = pControl->GetPadding(); 160 | rc.left += rcPadding.left; 161 | rc.top += rcPadding.top; 162 | rc.right -= rcPadding.right; 163 | rc.bottom -= rcPadding.bottom; 164 | 165 | SIZE szAvailable = { rc.right - rc.left, rc.bottom - rc.top }; 166 | 167 | SIZE sz = pControl->EstimateSize(szAvailable); 168 | if( sz.cx == 0 ) { 169 | sz.cx = MAX(0, szAvailable.cx); 170 | } 171 | if( sz.cx < pControl->GetMinWidth() ) sz.cx = pControl->GetMinWidth(); 172 | if( sz.cx > pControl->GetMaxWidth() ) sz.cx = pControl->GetMaxWidth(); 173 | 174 | if(sz.cy == 0) { 175 | sz.cy = MAX(0, szAvailable.cy); 176 | } 177 | if( sz.cy < pControl->GetMinHeight() ) sz.cy = pControl->GetMinHeight(); 178 | if( sz.cy > pControl->GetMaxHeight() ) sz.cy = pControl->GetMaxHeight(); 179 | 180 | RECT rcCtrl = { rc.left, rc.top, rc.left + sz.cx, rc.top + sz.cy}; 181 | pControl->SetPos(rcCtrl); 182 | } 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /testtab/testtab/Layout/UITabLayout.h: -------------------------------------------------------------------------------- 1 | #ifndef __UITABLAYOUT_H__ 2 | #define __UITABLAYOUT_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | class UILIB_API CTabLayoutUI : public CContainerUI 9 | { 10 | public: 11 | CTabLayoutUI(); 12 | LPCTSTR GetClass() const; 13 | LPVOID GetInterface(LPCTSTR pstrName); 14 | bool Add(CControlUI* pControl); 15 | bool AddAt(CControlUI* pControl, int iIndex); 16 | bool Remove(CControlUI* pControl); 17 | void RemoveAll(); 18 | int GetCurSel() const; 19 | bool SelectItem(int iIndex); 20 | bool SelectItem(CControlUI* pControl); 21 | void SetPos(RECT rc); 22 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 23 | 24 | protected: 25 | int m_iCurSel; 26 | }; 27 | } 28 | #endif // __UITABLAYOUT_H__ 29 | -------------------------------------------------------------------------------- /testtab/testtab/Layout/UITileLayout.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "UITileLayout.h" 3 | 4 | namespace DuiLib 5 | { 6 | CTileLayoutUI::CTileLayoutUI() : m_nColumns(1) 7 | { 8 | m_szItem.cx = m_szItem.cy = 0; 9 | } 10 | 11 | LPCTSTR CTileLayoutUI::GetClass() const 12 | { 13 | return _T("TileLayoutUI"); 14 | } 15 | 16 | LPVOID CTileLayoutUI::GetInterface(LPCTSTR pstrName) 17 | { 18 | if( _tcscmp(pstrName, DUI_CTR_TILELAYOUT) == 0 ) return static_cast(this); 19 | return CContainerUI::GetInterface(pstrName); 20 | } 21 | 22 | SIZE CTileLayoutUI::GetItemSize() const 23 | { 24 | return m_szItem; 25 | } 26 | 27 | void CTileLayoutUI::SetItemSize(SIZE szItem) 28 | { 29 | if( m_szItem.cx != szItem.cx || m_szItem.cy != szItem.cy ) { 30 | m_szItem = szItem; 31 | NeedUpdate(); 32 | } 33 | } 34 | 35 | int CTileLayoutUI::GetColumns() const 36 | { 37 | return m_nColumns; 38 | } 39 | 40 | void CTileLayoutUI::SetColumns(int nCols) 41 | { 42 | if( nCols <= 0 ) return; 43 | m_nColumns = nCols; 44 | NeedUpdate(); 45 | } 46 | 47 | void CTileLayoutUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 48 | { 49 | if( _tcscmp(pstrName, _T("itemsize")) == 0 ) { 50 | SIZE szItem = { 0 }; 51 | LPTSTR pstr = NULL; 52 | szItem.cx = _tcstol(pstrValue, &pstr, 10); ASSERT(pstr); 53 | szItem.cy = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr); 54 | SetItemSize(szItem); 55 | } 56 | else if( _tcscmp(pstrName, _T("columns")) == 0 ) SetColumns(_ttoi(pstrValue)); 57 | else CContainerUI::SetAttribute(pstrName, pstrValue); 58 | } 59 | 60 | void CTileLayoutUI::SetPos(RECT rc) 61 | { 62 | CControlUI::SetPos(rc); 63 | rc = m_rcItem; 64 | 65 | // Adjust for inset 66 | rc.left += m_rcInset.left; 67 | rc.top += m_rcInset.top; 68 | rc.right -= m_rcInset.right; 69 | rc.bottom -= m_rcInset.bottom; 70 | 71 | if( m_items.GetSize() == 0) { 72 | ProcessScrollBar(rc, 0, 0); 73 | return; 74 | } 75 | 76 | if( m_pVerticalScrollBar && m_pVerticalScrollBar->IsVisible() ) rc.right -= m_pVerticalScrollBar->GetFixedWidth(); 77 | if( m_pHorizontalScrollBar && m_pHorizontalScrollBar->IsVisible() ) rc.bottom -= m_pHorizontalScrollBar->GetFixedHeight(); 78 | 79 | // Position the elements 80 | if( m_szItem.cx > 0 ) m_nColumns = (rc.right - rc.left) / m_szItem.cx; 81 | if( m_nColumns == 0 ) m_nColumns = 1; 82 | 83 | int cyNeeded = 0; 84 | int cxWidth = (rc.right - rc.left) / m_nColumns; 85 | if( m_pHorizontalScrollBar && m_pHorizontalScrollBar->IsVisible() ) 86 | cxWidth = (rc.right - rc.left + m_pHorizontalScrollBar->GetScrollRange() ) / m_nColumns; ; 87 | 88 | int cyHeight = 0; 89 | int iCount = 0; 90 | POINT ptTile = { rc.left, rc.top }; 91 | if( m_pVerticalScrollBar && m_pVerticalScrollBar->IsVisible() ) { 92 | ptTile.y -= m_pVerticalScrollBar->GetScrollPos(); 93 | } 94 | int iPosX = rc.left; 95 | if( m_pHorizontalScrollBar && m_pHorizontalScrollBar->IsVisible() ) { 96 | iPosX -= m_pHorizontalScrollBar->GetScrollPos(); 97 | ptTile.x = iPosX; 98 | } 99 | for( int it1 = 0; it1 < m_items.GetSize(); it1++ ) { 100 | CControlUI* pControl = static_cast(m_items[it1]); 101 | if( !pControl->IsVisible() ) continue; 102 | if( pControl->IsFloat() ) { 103 | SetFloatPos(it1); 104 | continue; 105 | } 106 | 107 | // Determine size 108 | RECT rcTile = { ptTile.x, ptTile.y, ptTile.x + cxWidth, ptTile.y }; 109 | if( (iCount % m_nColumns) == 0 ) 110 | { 111 | int iIndex = iCount; 112 | for( int it2 = it1; it2 < m_items.GetSize(); it2++ ) { 113 | CControlUI* pLineControl = static_cast(m_items[it2]); 114 | if( !pLineControl->IsVisible() ) continue; 115 | if( pLineControl->IsFloat() ) continue; 116 | 117 | RECT rcPadding = pLineControl->GetPadding(); 118 | SIZE szAvailable = { rcTile.right - rcTile.left - rcPadding.left - rcPadding.right, 9999 }; 119 | if( iIndex == iCount || (iIndex + 1) % m_nColumns == 0 ) { 120 | szAvailable.cx -= m_iChildPadding / 2; 121 | } 122 | else { 123 | szAvailable.cx -= m_iChildPadding; 124 | } 125 | 126 | if( szAvailable.cx < pControl->GetMinWidth() ) szAvailable.cx = pControl->GetMinWidth(); 127 | if( szAvailable.cx > pControl->GetMaxWidth() ) szAvailable.cx = pControl->GetMaxWidth(); 128 | 129 | SIZE szTile = pLineControl->EstimateSize(szAvailable); 130 | if( szTile.cx < pControl->GetMinWidth() ) szTile.cx = pControl->GetMinWidth(); 131 | if( szTile.cx > pControl->GetMaxWidth() ) szTile.cx = pControl->GetMaxWidth(); 132 | if( szTile.cy < pControl->GetMinHeight() ) szTile.cy = pControl->GetMinHeight(); 133 | if( szTile.cy > pControl->GetMaxHeight() ) szTile.cy = pControl->GetMaxHeight(); 134 | 135 | cyHeight = MAX(cyHeight, szTile.cy + rcPadding.top + rcPadding.bottom); 136 | if( (++iIndex % m_nColumns) == 0) break; 137 | } 138 | } 139 | 140 | RECT rcPadding = pControl->GetPadding(); 141 | 142 | rcTile.left += rcPadding.left + m_iChildPadding / 2; 143 | rcTile.right -= rcPadding.right + m_iChildPadding / 2; 144 | if( (iCount % m_nColumns) == 0 ) { 145 | rcTile.left -= m_iChildPadding / 2; 146 | } 147 | 148 | if( ( (iCount + 1) % m_nColumns) == 0 ) { 149 | rcTile.right += m_iChildPadding / 2; 150 | } 151 | 152 | // Set position 153 | rcTile.top = ptTile.y + rcPadding.top; 154 | rcTile.bottom = ptTile.y + cyHeight; 155 | 156 | SIZE szAvailable = { rcTile.right - rcTile.left, rcTile.bottom - rcTile.top }; 157 | SIZE szTile = pControl->EstimateSize(szAvailable); 158 | if( szTile.cx == 0 ) szTile.cx = szAvailable.cx; 159 | if( szTile.cy == 0 ) szTile.cy = szAvailable.cy; 160 | if( szTile.cx < pControl->GetMinWidth() ) szTile.cx = pControl->GetMinWidth(); 161 | if( szTile.cx > pControl->GetMaxWidth() ) szTile.cx = pControl->GetMaxWidth(); 162 | if( szTile.cy < pControl->GetMinHeight() ) szTile.cy = pControl->GetMinHeight(); 163 | if( szTile.cy > pControl->GetMaxHeight() ) szTile.cy = pControl->GetMaxHeight(); 164 | RECT rcPos = {(rcTile.left + rcTile.right - szTile.cx) / 2, (rcTile.top + rcTile.bottom - szTile.cy) / 2, 165 | (rcTile.left + rcTile.right - szTile.cx) / 2 + szTile.cx, (rcTile.top + rcTile.bottom - szTile.cy) / 2 + szTile.cy}; 166 | pControl->SetPos(rcPos); 167 | 168 | if( (++iCount % m_nColumns) == 0 ) { 169 | ptTile.x = iPosX; 170 | ptTile.y += cyHeight + m_iChildPadding; 171 | cyHeight = 0; 172 | } 173 | else { 174 | ptTile.x += cxWidth; 175 | } 176 | cyNeeded = rcTile.bottom - rc.top; 177 | if( m_pVerticalScrollBar && m_pVerticalScrollBar->IsVisible() ) cyNeeded += m_pVerticalScrollBar->GetScrollPos(); 178 | } 179 | 180 | // Process the scrollbar 181 | ProcessScrollBar(rc, 0, cyNeeded); 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /testtab/testtab/Layout/UITileLayout.h: -------------------------------------------------------------------------------- 1 | #ifndef __UITILELAYOUT_H__ 2 | #define __UITILELAYOUT_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | class UILIB_API CTileLayoutUI : public CContainerUI 9 | { 10 | public: 11 | CTileLayoutUI(); 12 | 13 | LPCTSTR GetClass() const; 14 | LPVOID GetInterface(LPCTSTR pstrName); 15 | 16 | void SetPos(RECT rc); 17 | 18 | SIZE GetItemSize() const; 19 | void SetItemSize(SIZE szItem); 20 | int GetColumns() const; 21 | void SetColumns(int nCols); 22 | 23 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 24 | 25 | protected: 26 | SIZE m_szItem; 27 | int m_nColumns; 28 | }; 29 | } 30 | #endif // __UITILELAYOUT_H__ 31 | -------------------------------------------------------------------------------- /testtab/testtab/Layout/UIVerticalLayout.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "UIVerticalLayout.h" 3 | 4 | namespace DuiLib 5 | { 6 | CVerticalLayoutUI::CVerticalLayoutUI() : m_iSepHeight(0), m_uButtonState(0), m_bImmMode(false) 7 | { 8 | ptLastMouse.x = ptLastMouse.y = 0; 9 | ::ZeroMemory(&m_rcNewPos, sizeof(m_rcNewPos)); 10 | } 11 | 12 | LPCTSTR CVerticalLayoutUI::GetClass() const 13 | { 14 | return _T("VerticalLayoutUI"); 15 | } 16 | 17 | LPVOID CVerticalLayoutUI::GetInterface(LPCTSTR pstrName) 18 | { 19 | if( _tcscmp(pstrName, DUI_CTR_VERTICALLAYOUT) == 0 ) return static_cast(this); 20 | return CContainerUI::GetInterface(pstrName); 21 | } 22 | 23 | UINT CVerticalLayoutUI::GetControlFlags() const 24 | { 25 | if( IsEnabled() && m_iSepHeight != 0 ) return UIFLAG_SETCURSOR; 26 | else return 0; 27 | } 28 | 29 | void CVerticalLayoutUI::SetPos(RECT rc) 30 | { 31 | CControlUI::SetPos(rc); 32 | rc = m_rcItem; 33 | 34 | // Adjust for inset 35 | rc.left += m_rcInset.left; 36 | rc.top += m_rcInset.top; 37 | rc.right -= m_rcInset.right; 38 | rc.bottom -= m_rcInset.bottom; 39 | if( m_pVerticalScrollBar && m_pVerticalScrollBar->IsVisible() ) rc.right -= m_pVerticalScrollBar->GetFixedWidth(); 40 | if( m_pHorizontalScrollBar && m_pHorizontalScrollBar->IsVisible() ) rc.bottom -= m_pHorizontalScrollBar->GetFixedHeight(); 41 | 42 | if( m_items.GetSize() == 0) { 43 | ProcessScrollBar(rc, 0, 0); 44 | return; 45 | } 46 | 47 | // Determine the minimum size 48 | SIZE szAvailable = { rc.right - rc.left, rc.bottom - rc.top }; 49 | if( m_pHorizontalScrollBar && m_pHorizontalScrollBar->IsVisible() ) 50 | szAvailable.cx += m_pHorizontalScrollBar->GetScrollRange(); 51 | 52 | int nAdjustables = 0; 53 | int cyFixed = 0; 54 | int nEstimateNum = 0; 55 | for( int it1 = 0; it1 < m_items.GetSize(); it1++ ) { 56 | CControlUI* pControl = static_cast(m_items[it1]); 57 | if( !pControl->IsVisible() ) continue; 58 | if( pControl->IsFloat() ) continue; 59 | SIZE sz = pControl->EstimateSize(szAvailable); 60 | if( sz.cy == 0 ) { 61 | nAdjustables++; 62 | } 63 | else { 64 | if( sz.cy < pControl->GetMinHeight() ) sz.cy = pControl->GetMinHeight(); 65 | if( sz.cy > pControl->GetMaxHeight() ) sz.cy = pControl->GetMaxHeight(); 66 | } 67 | cyFixed += sz.cy + pControl->GetPadding().top + pControl->GetPadding().bottom; 68 | nEstimateNum++; 69 | } 70 | cyFixed += (nEstimateNum - 1) * m_iChildPadding; 71 | 72 | // Place elements 73 | int cyNeeded = 0; 74 | int cyExpand = 0; 75 | if( nAdjustables > 0 ) cyExpand = MAX(0, (szAvailable.cy - cyFixed) / nAdjustables); 76 | // Position the elements 77 | SIZE szRemaining = szAvailable; 78 | int iPosY = rc.top; 79 | if( m_pVerticalScrollBar && m_pVerticalScrollBar->IsVisible() ) { 80 | iPosY -= m_pVerticalScrollBar->GetScrollPos(); 81 | } 82 | int iPosX = rc.left; 83 | if( m_pHorizontalScrollBar && m_pHorizontalScrollBar->IsVisible() ) { 84 | iPosX -= m_pHorizontalScrollBar->GetScrollPos(); 85 | } 86 | int iAdjustable = 0; 87 | int cyFixedRemaining = cyFixed; 88 | for( int it2 = 0; it2 < m_items.GetSize(); it2++ ) { 89 | CControlUI* pControl = static_cast(m_items[it2]); 90 | if( !pControl->IsVisible() ) continue; 91 | if( pControl->IsFloat() ) { 92 | SetFloatPos(it2); 93 | continue; 94 | } 95 | 96 | RECT rcPadding = pControl->GetPadding(); 97 | szRemaining.cy -= rcPadding.top; 98 | SIZE sz = pControl->EstimateSize(szRemaining); 99 | if( sz.cy == 0 ) { 100 | iAdjustable++; 101 | sz.cy = cyExpand; 102 | // Distribute remaining to last element (usually round-off left-overs) 103 | if( iAdjustable == nAdjustables ) { 104 | sz.cy = MAX(0, szRemaining.cy - rcPadding.bottom - cyFixedRemaining); 105 | } 106 | if( sz.cy < pControl->GetMinHeight() ) sz.cy = pControl->GetMinHeight(); 107 | if( sz.cy > pControl->GetMaxHeight() ) sz.cy = pControl->GetMaxHeight(); 108 | } 109 | else { 110 | if( sz.cy < pControl->GetMinHeight() ) sz.cy = pControl->GetMinHeight(); 111 | if( sz.cy > pControl->GetMaxHeight() ) sz.cy = pControl->GetMaxHeight(); 112 | cyFixedRemaining -= sz.cy; 113 | } 114 | 115 | sz.cx = pControl->GetFixedWidth(); 116 | if( sz.cx == 0 ) sz.cx = szAvailable.cx - rcPadding.left - rcPadding.right; 117 | if( sz.cx < 0 ) sz.cx = 0; 118 | if( sz.cx < pControl->GetMinWidth() ) sz.cx = pControl->GetMinWidth(); 119 | if( sz.cx > pControl->GetMaxWidth() ) sz.cx = pControl->GetMaxWidth(); 120 | 121 | RECT rcCtrl = { iPosX + rcPadding.left, iPosY + rcPadding.top, iPosX + rcPadding.left + sz.cx, iPosY + sz.cy + rcPadding.top + rcPadding.bottom }; 122 | pControl->SetPos(rcCtrl); 123 | 124 | iPosY += sz.cy + m_iChildPadding + rcPadding.top + rcPadding.bottom; 125 | cyNeeded += sz.cy + rcPadding.top + rcPadding.bottom; 126 | szRemaining.cy -= sz.cy + m_iChildPadding + rcPadding.bottom; 127 | } 128 | cyNeeded += (nEstimateNum - 1) * m_iChildPadding; 129 | 130 | // Process the scrollbar 131 | ProcessScrollBar(rc, 0, cyNeeded); 132 | } 133 | 134 | void CVerticalLayoutUI::DoPostPaint(HDC hDC, const RECT& rcPaint) 135 | { 136 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 && !m_bImmMode ) { 137 | RECT rcSeparator = GetThumbRect(true); 138 | CRenderEngine::DrawColor(hDC, rcSeparator, 0xAA000000); 139 | } 140 | } 141 | 142 | void CVerticalLayoutUI::SetSepHeight(int iHeight) 143 | { 144 | m_iSepHeight = iHeight; 145 | } 146 | 147 | int CVerticalLayoutUI::GetSepHeight() const 148 | { 149 | return m_iSepHeight; 150 | } 151 | 152 | void CVerticalLayoutUI::SetSepImmMode(bool bImmediately) 153 | { 154 | if( m_bImmMode == bImmediately ) return; 155 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 && !m_bImmMode && m_pManager != NULL ) { 156 | m_pManager->RemovePostPaint(this); 157 | } 158 | 159 | m_bImmMode = bImmediately; 160 | } 161 | 162 | bool CVerticalLayoutUI::IsSepImmMode() const 163 | { 164 | return m_bImmMode; 165 | } 166 | 167 | void CVerticalLayoutUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 168 | { 169 | if( _tcscmp(pstrName, _T("sepheight")) == 0 ) SetSepHeight(_ttoi(pstrValue)); 170 | else if( _tcscmp(pstrName, _T("sepimm")) == 0 ) SetSepImmMode(_tcscmp(pstrValue, _T("true")) == 0); 171 | else CContainerUI::SetAttribute(pstrName, pstrValue); 172 | } 173 | 174 | void CVerticalLayoutUI::DoEvent(TEventUI& event) 175 | { 176 | if( m_iSepHeight != 0 ) { 177 | if( event.Type == UIEVENT_BUTTONDOWN && IsEnabled() ) 178 | { 179 | RECT rcSeparator = GetThumbRect(false); 180 | if( ::PtInRect(&rcSeparator, event.ptMouse) ) { 181 | m_uButtonState |= UISTATE_CAPTURED; 182 | ptLastMouse = event.ptMouse; 183 | m_rcNewPos = m_rcItem; 184 | if( !m_bImmMode && m_pManager ) m_pManager->AddPostPaint(this); 185 | return; 186 | } 187 | } 188 | if( event.Type == UIEVENT_BUTTONUP ) 189 | { 190 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) { 191 | m_uButtonState &= ~UISTATE_CAPTURED; 192 | m_rcItem = m_rcNewPos; 193 | if( !m_bImmMode && m_pManager ) m_pManager->RemovePostPaint(this); 194 | NeedParentUpdate(); 195 | return; 196 | } 197 | } 198 | if( event.Type == UIEVENT_MOUSEMOVE ) 199 | { 200 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) { 201 | LONG cy = event.ptMouse.y - ptLastMouse.y; 202 | ptLastMouse = event.ptMouse; 203 | RECT rc = m_rcNewPos; 204 | if( m_iSepHeight >= 0 ) { 205 | if( cy > 0 && event.ptMouse.y < m_rcNewPos.bottom + m_iSepHeight ) return; 206 | if( cy < 0 && event.ptMouse.y > m_rcNewPos.bottom ) return; 207 | rc.bottom += cy; 208 | if( rc.bottom - rc.top <= GetMinHeight() ) { 209 | if( m_rcNewPos.bottom - m_rcNewPos.top <= GetMinHeight() ) return; 210 | rc.bottom = rc.top + GetMinHeight(); 211 | } 212 | if( rc.bottom - rc.top >= GetMaxHeight() ) { 213 | if( m_rcNewPos.bottom - m_rcNewPos.top >= GetMaxHeight() ) return; 214 | rc.bottom = rc.top + GetMaxHeight(); 215 | } 216 | } 217 | else { 218 | if( cy > 0 && event.ptMouse.y < m_rcNewPos.top ) return; 219 | if( cy < 0 && event.ptMouse.y > m_rcNewPos.top + m_iSepHeight ) return; 220 | rc.top += cy; 221 | if( rc.bottom - rc.top <= GetMinHeight() ) { 222 | if( m_rcNewPos.bottom - m_rcNewPos.top <= GetMinHeight() ) return; 223 | rc.top = rc.bottom - GetMinHeight(); 224 | } 225 | if( rc.bottom - rc.top >= GetMaxHeight() ) { 226 | if( m_rcNewPos.bottom - m_rcNewPos.top >= GetMaxHeight() ) return; 227 | rc.top = rc.bottom - GetMaxHeight(); 228 | } 229 | } 230 | 231 | CDuiRect rcInvalidate = GetThumbRect(true); 232 | m_rcNewPos = rc; 233 | m_cxyFixed.cy = m_rcNewPos.bottom - m_rcNewPos.top; 234 | 235 | if( m_bImmMode ) { 236 | m_rcItem = m_rcNewPos; 237 | NeedParentUpdate(); 238 | } 239 | else { 240 | rcInvalidate.Join(GetThumbRect(true)); 241 | rcInvalidate.Join(GetThumbRect(false)); 242 | if( m_pManager ) m_pManager->Invalidate(rcInvalidate); 243 | } 244 | return; 245 | } 246 | } 247 | if( event.Type == UIEVENT_SETCURSOR ) 248 | { 249 | RECT rcSeparator = GetThumbRect(false); 250 | if( IsEnabled() && ::PtInRect(&rcSeparator, event.ptMouse) ) { 251 | ::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZENS))); 252 | return; 253 | } 254 | } 255 | } 256 | CContainerUI::DoEvent(event); 257 | } 258 | 259 | RECT CVerticalLayoutUI::GetThumbRect(bool bUseNew) const 260 | { 261 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 && bUseNew) { 262 | if( m_iSepHeight >= 0 ) 263 | return CDuiRect(m_rcNewPos.left, MAX(m_rcNewPos.bottom - m_iSepHeight, m_rcNewPos.top), 264 | m_rcNewPos.right, m_rcNewPos.bottom); 265 | else 266 | return CDuiRect(m_rcNewPos.left, m_rcNewPos.top, m_rcNewPos.right, 267 | MIN(m_rcNewPos.top - m_iSepHeight, m_rcNewPos.bottom)); 268 | } 269 | else { 270 | if( m_iSepHeight >= 0 ) 271 | return CDuiRect(m_rcItem.left, MAX(m_rcItem.bottom - m_iSepHeight, m_rcItem.top), m_rcItem.right, 272 | m_rcItem.bottom); 273 | else 274 | return CDuiRect(m_rcItem.left, m_rcItem.top, m_rcItem.right, 275 | MIN(m_rcItem.top - m_iSepHeight, m_rcItem.bottom)); 276 | 277 | } 278 | } 279 | } 280 | -------------------------------------------------------------------------------- /testtab/testtab/Layout/UIVerticalLayout.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIVERTICALLAYOUT_H__ 2 | #define __UIVERTICALLAYOUT_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | class UILIB_API CVerticalLayoutUI : public CContainerUI 9 | { 10 | public: 11 | CVerticalLayoutUI(); 12 | 13 | LPCTSTR GetClass() const; 14 | LPVOID GetInterface(LPCTSTR pstrName); 15 | UINT GetControlFlags() const; 16 | 17 | void SetSepHeight(int iHeight); 18 | int GetSepHeight() const; 19 | void SetSepImmMode(bool bImmediately); 20 | bool IsSepImmMode() const; 21 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 22 | void DoEvent(TEventUI& event); 23 | 24 | void SetPos(RECT rc); 25 | void DoPostPaint(HDC hDC, const RECT& rcPaint); 26 | 27 | RECT GetThumbRect(bool bUseNew = false) const; 28 | 29 | protected: 30 | int m_iSepHeight; 31 | UINT m_uButtonState; 32 | POINT ptLastMouse; 33 | RECT m_rcNewPos; 34 | bool m_bImmMode; 35 | }; 36 | } 37 | #endif // __UIVERTICALLAYOUT_H__ 38 | -------------------------------------------------------------------------------- /testtab/testtab/MainDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/MainDlg.cpp -------------------------------------------------------------------------------- /testtab/testtab/MainDlg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/MainDlg.h -------------------------------------------------------------------------------- /testtab/testtab/ProcessConsumption.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/ProcessConsumption.cpp -------------------------------------------------------------------------------- /testtab/testtab/ProcessConsumption.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/ProcessConsumption.h -------------------------------------------------------------------------------- /testtab/testtab/ReadMe.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/ReadMe.txt -------------------------------------------------------------------------------- /testtab/testtab/RegeDitDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/RegeDitDlg.cpp -------------------------------------------------------------------------------- /testtab/testtab/RegeDitDlg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/RegeDitDlg.h -------------------------------------------------------------------------------- /testtab/testtab/Settings.ini: -------------------------------------------------------------------------------- 1 | [Selections] 2 | Add=1 3 | Delete=1 4 | Modify=1 5 | Rename=1 6 | Other=1 7 | [Settings] 8 | WatchDir=C:\ 9 | AutoStart=1 10 | -------------------------------------------------------------------------------- /testtab/testtab/SkinPPWTL.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/SkinPPWTL.h -------------------------------------------------------------------------------- /testtab/testtab/StartMag.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/StartMag.cpp -------------------------------------------------------------------------------- /testtab/testtab/StartMag.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/StartMag.h -------------------------------------------------------------------------------- /testtab/testtab/SystemInfoDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/SystemInfoDlg.cpp -------------------------------------------------------------------------------- /testtab/testtab/SystemInfoDlg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/SystemInfoDlg.h -------------------------------------------------------------------------------- /testtab/testtab/UIlib.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010-2011, duilib develop team(www.duilib.com). 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or 5 | // without modification, are permitted provided that the 6 | // following conditions are met. 7 | // 8 | // Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // 11 | // Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following 13 | // disclaimer in the documentation and/or other materials 14 | // provided with the distribution. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 17 | // CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 23 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #if defined(UILIB_EXPORTS) 31 | #if defined(_MSC_VER) 32 | #define UILIB_API __declspec(dllexport) 33 | #else 34 | #define UILIB_API 35 | #endif 36 | #else 37 | #if defined(_MSC_VER) 38 | #define UILIB_API __declspec(dllimport) 39 | #else 40 | #define UILIB_API 41 | #endif 42 | #endif 43 | 44 | #define UILIB_COMDAT __declspec(selectany) 45 | 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | 56 | #include "Utils/Utils.h" 57 | #include "Utils/UIDelegate.h" 58 | #include "Core/UIDefine.h" 59 | #include "Core/UIManager.h" 60 | #include "Core/UIBase.h" 61 | #include "Core/UIControl.h" 62 | #include "Core/UIContainer.h" 63 | #include "Core/UIMarkup.h" 64 | #include "Core/UIDlgBuilder.h" 65 | #include "Core/UIRender.h" 66 | #include "Utils/WinImplBase.h" 67 | 68 | #include "Layout/UIVerticalLayout.h" 69 | #include "Layout/UIHorizontalLayout.h" 70 | #include "Layout/UITileLayout.h" 71 | #include "Layout/UITabLayout.h" 72 | #include "Layout/UIChildLayout.h" 73 | 74 | #include "Control/UIList.h" 75 | #include "Control/UICombo.h" 76 | #include "Control/UIScrollBar.h" 77 | #include "Control/UITreeView.h" 78 | 79 | #include "Control/UILabel.h" 80 | #include "Control/UIText.h" 81 | #include "Control/UIEdit.h" 82 | 83 | #include "Control/UIButton.h" 84 | #include "Control/UIOption.h" 85 | #include "Control/UICheckBox.h" 86 | 87 | #include "Control/UIProgress.h" 88 | #include "Control/UISlider.h" 89 | 90 | #include "Control/UIComboBox.h" 91 | #include "Control/UIRichEdit.h" 92 | #include "Control/UIDateTime.h" 93 | 94 | #include "Control/UIActiveX.h" 95 | #include "Control/UIWebBrowser.h" 96 | //#include "Control/UIFlash.h" 97 | 98 | -------------------------------------------------------------------------------- /testtab/testtab/UsbShaDuDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/UsbShaDuDlg.cpp -------------------------------------------------------------------------------- /testtab/testtab/UsbShaDuDlg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/UsbShaDuDlg.h -------------------------------------------------------------------------------- /testtab/testtab/Utils/FlashEventHandler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Utils/FlashEventHandler.h -------------------------------------------------------------------------------- /testtab/testtab/Utils/UIDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | 3 | namespace DuiLib { 4 | 5 | CDelegateBase::CDelegateBase(void* pObject, void* pFn) 6 | { 7 | m_pObject = pObject; 8 | m_pFn = pFn; 9 | } 10 | 11 | CDelegateBase::CDelegateBase(const CDelegateBase& rhs) 12 | { 13 | m_pObject = rhs.m_pObject; 14 | m_pFn = rhs.m_pFn; 15 | } 16 | 17 | CDelegateBase::~CDelegateBase() 18 | { 19 | 20 | } 21 | 22 | bool CDelegateBase::Equals(const CDelegateBase& rhs) const 23 | { 24 | return m_pObject == rhs.m_pObject && m_pFn == rhs.m_pFn; 25 | } 26 | 27 | bool CDelegateBase::operator() (void* param) 28 | { 29 | return Invoke(param); 30 | } 31 | 32 | void* CDelegateBase::GetFn() 33 | { 34 | return m_pFn; 35 | } 36 | 37 | void* CDelegateBase::GetObject() 38 | { 39 | return m_pObject; 40 | } 41 | 42 | CEventSource::~CEventSource() 43 | { 44 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 45 | CDelegateBase* pObject = static_cast(m_aDelegates[i]); 46 | if( pObject) delete pObject; 47 | } 48 | } 49 | 50 | CEventSource::operator bool() 51 | { 52 | return m_aDelegates.GetSize() > 0; 53 | } 54 | 55 | void CEventSource::operator+= (const CDelegateBase& d) 56 | { 57 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 58 | CDelegateBase* pObject = static_cast(m_aDelegates[i]); 59 | if( pObject && pObject->Equals(d) ) return; 60 | } 61 | 62 | m_aDelegates.Add(d.Copy()); 63 | } 64 | 65 | void CEventSource::operator+= (FnType pFn) 66 | { 67 | (*this) += MakeDelegate(pFn); 68 | } 69 | 70 | void CEventSource::operator-= (const CDelegateBase& d) 71 | { 72 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 73 | CDelegateBase* pObject = static_cast(m_aDelegates[i]); 74 | if( pObject && pObject->Equals(d) ) { 75 | delete pObject; 76 | m_aDelegates.Remove(i); 77 | return; 78 | } 79 | } 80 | } 81 | void CEventSource::operator-= (FnType pFn) 82 | { 83 | (*this) -= MakeDelegate(pFn); 84 | } 85 | 86 | bool CEventSource::operator() (void* param) 87 | { 88 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 89 | CDelegateBase* pObject = static_cast(m_aDelegates[i]); 90 | if( pObject && !(*pObject)(param) ) return false; 91 | } 92 | return true; 93 | } 94 | 95 | } // namespace DuiLib 96 | -------------------------------------------------------------------------------- /testtab/testtab/Utils/UIDelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIDELEGATE_H__ 2 | #define __UIDELEGATE_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib { 7 | 8 | class UILIB_API CDelegateBase 9 | { 10 | public: 11 | CDelegateBase(void* pObject, void* pFn); 12 | CDelegateBase(const CDelegateBase& rhs); 13 | virtual ~CDelegateBase(); 14 | bool Equals(const CDelegateBase& rhs) const; 15 | bool operator() (void* param); 16 | virtual CDelegateBase* Copy() const = 0; // add const for gcc 17 | 18 | protected: 19 | void* GetFn(); 20 | void* GetObject(); 21 | virtual bool Invoke(void* param) = 0; 22 | 23 | private: 24 | void* m_pObject; 25 | void* m_pFn; 26 | }; 27 | 28 | class CDelegateStatic: public CDelegateBase 29 | { 30 | typedef bool (*Fn)(void*); 31 | public: 32 | CDelegateStatic(Fn pFn) : CDelegateBase(NULL, pFn) { } 33 | CDelegateStatic(const CDelegateStatic& rhs) : CDelegateBase(rhs) { } 34 | virtual CDelegateBase* Copy() const { return new CDelegateStatic(*this); } 35 | 36 | protected: 37 | virtual bool Invoke(void* param) 38 | { 39 | Fn pFn = (Fn)GetFn(); 40 | return (*pFn)(param); 41 | } 42 | }; 43 | 44 | template 45 | class CDelegate : public CDelegateBase 46 | { 47 | typedef bool (T::* Fn)(void*); 48 | public: 49 | CDelegate(O* pObj, Fn pFn) : CDelegateBase(pObj, &pFn), m_pFn(pFn) { } 50 | CDelegate(const CDelegate& rhs) : CDelegateBase(rhs) { m_pFn = rhs.m_pFn; } 51 | virtual CDelegateBase* Copy() const { return new CDelegate(*this); } 52 | 53 | protected: 54 | virtual bool Invoke(void* param) 55 | { 56 | O* pObject = (O*) GetObject(); 57 | return (pObject->*m_pFn)(param); 58 | } 59 | 60 | private: 61 | Fn m_pFn; 62 | }; 63 | 64 | template 65 | CDelegate MakeDelegate(O* pObject, bool (T::* pFn)(void*)) 66 | { 67 | return CDelegate(pObject, pFn); 68 | } 69 | 70 | inline CDelegateStatic MakeDelegate(bool (*pFn)(void*)) 71 | { 72 | return CDelegateStatic(pFn); 73 | } 74 | 75 | class UILIB_API CEventSource 76 | { 77 | typedef bool (*FnType)(void*); 78 | public: 79 | ~CEventSource(); 80 | operator bool(); 81 | void operator+= (const CDelegateBase& d); // add const for gcc 82 | void operator+= (FnType pFn); 83 | void operator-= (const CDelegateBase& d); 84 | void operator-= (FnType pFn); 85 | bool operator() (void* param); 86 | 87 | protected: 88 | CStdPtrArray m_aDelegates; 89 | }; 90 | 91 | } // namespace DuiLib 92 | 93 | #endif // __UIDELEGATE_H__ -------------------------------------------------------------------------------- /testtab/testtab/Utils/Utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Utils/Utils.cpp -------------------------------------------------------------------------------- /testtab/testtab/Utils/Utils.h: -------------------------------------------------------------------------------- 1 | #ifndef __UTILS_H__ 2 | #define __UTILS_H__ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | ///////////////////////////////////////////////////////////////////////////////////// 9 | // 10 | 11 | class STRINGorID 12 | { 13 | public: 14 | STRINGorID(LPCTSTR lpString) : m_lpstr(lpString) 15 | { } 16 | STRINGorID(UINT nID) : m_lpstr(MAKEINTRESOURCE(nID)) 17 | { } 18 | LPCTSTR m_lpstr; 19 | }; 20 | 21 | ///////////////////////////////////////////////////////////////////////////////////// 22 | // 23 | 24 | class UILIB_API CPoint : public tagPOINT 25 | { 26 | public: 27 | CPoint(); 28 | CPoint(const POINT& src); 29 | CPoint(int x, int y); 30 | CPoint(LPARAM lParam); 31 | }; 32 | 33 | 34 | ///////////////////////////////////////////////////////////////////////////////////// 35 | // 36 | 37 | class UILIB_API CSize : public tagSIZE 38 | { 39 | public: 40 | CSize(); 41 | CSize(const SIZE& src); 42 | CSize(const RECT rc); 43 | CSize(int cx, int cy); 44 | }; 45 | 46 | 47 | ///////////////////////////////////////////////////////////////////////////////////// 48 | // 49 | 50 | class UILIB_API CDuiRect : public tagRECT 51 | { 52 | public: 53 | CDuiRect(); 54 | CDuiRect(const RECT& src); 55 | CDuiRect(int iLeft, int iTop, int iRight, int iBottom); 56 | 57 | int GetWidth() const; 58 | int GetHeight() const; 59 | void Empty(); 60 | bool IsNull() const; 61 | void Join(const RECT& rc); 62 | void ResetOffset(); 63 | void Normalize(); 64 | void Offset(int cx, int cy); 65 | void Inflate(int cx, int cy); 66 | void Deflate(int cx, int cy); 67 | void Union(CDuiRect& rc); 68 | }; 69 | 70 | ///////////////////////////////////////////////////////////////////////////////////// 71 | // 72 | 73 | class UILIB_API CStdPtrArray 74 | { 75 | public: 76 | CStdPtrArray(int iPreallocSize = 0); 77 | CStdPtrArray(const CStdPtrArray& src); 78 | ~CStdPtrArray(); 79 | 80 | void Empty(); 81 | void Resize(int iSize); 82 | bool IsEmpty() const; 83 | int Find(LPVOID iIndex) const; 84 | bool Add(LPVOID pData); 85 | bool SetAt(int iIndex, LPVOID pData); 86 | bool InsertAt(int iIndex, LPVOID pData); 87 | bool Remove(int iIndex); 88 | int GetSize() const; 89 | LPVOID* GetData(); 90 | 91 | LPVOID GetAt(int iIndex) const; 92 | LPVOID operator[] (int nIndex) const; 93 | 94 | protected: 95 | LPVOID* m_ppVoid; 96 | int m_nCount; 97 | int m_nAllocated; 98 | }; 99 | 100 | 101 | ///////////////////////////////////////////////////////////////////////////////////// 102 | // 103 | 104 | class UILIB_API CStdValArray 105 | { 106 | public: 107 | CStdValArray(int iElementSize, int iPreallocSize = 0); 108 | ~CStdValArray(); 109 | 110 | void Empty(); 111 | bool IsEmpty() const; 112 | bool Add(LPCVOID pData); 113 | bool Remove(int iIndex); 114 | int GetSize() const; 115 | LPVOID GetData(); 116 | 117 | LPVOID GetAt(int iIndex) const; 118 | LPVOID operator[] (int nIndex) const; 119 | 120 | protected: 121 | LPBYTE m_pVoid; 122 | int m_iElementSize; 123 | int m_nCount; 124 | int m_nAllocated; 125 | }; 126 | 127 | 128 | ///////////////////////////////////////////////////////////////////////////////////// 129 | // 130 | 131 | class UILIB_API CDuiString 132 | { 133 | public: 134 | enum { MAX_LOCAL_STRING_LEN = 63 }; 135 | 136 | CDuiString(); 137 | CDuiString(const TCHAR ch); 138 | CDuiString(const CDuiString& src); 139 | CDuiString(LPCTSTR lpsz, int nLen = -1); 140 | ~CDuiString(); 141 | 142 | void Empty(); 143 | int GetLength() const; 144 | bool IsEmpty() const; 145 | TCHAR GetAt(int nIndex) const; 146 | void Append(LPCTSTR pstr); 147 | void Assign(LPCTSTR pstr, int nLength = -1); 148 | LPCTSTR GetData() const; 149 | 150 | void SetAt(int nIndex, TCHAR ch); 151 | operator LPCTSTR() const; 152 | 153 | TCHAR operator[] (int nIndex) const; 154 | const CDuiString& operator=(const CDuiString& src); 155 | const CDuiString& operator=(const TCHAR ch); 156 | const CDuiString& operator=(LPCTSTR pstr); 157 | #ifdef _UNICODE 158 | const CDuiString& CDuiString::operator=(LPCSTR lpStr); 159 | const CDuiString& CDuiString::operator+=(LPCSTR lpStr); 160 | #else 161 | const CDuiString& CDuiString::operator=(LPCWSTR lpwStr); 162 | const CDuiString& CDuiString::operator+=(LPCWSTR lpwStr); 163 | #endif 164 | CDuiString operator+(const CDuiString& src) const; 165 | CDuiString operator+(LPCTSTR pstr) const; 166 | const CDuiString& operator+=(const CDuiString& src); 167 | const CDuiString& operator+=(LPCTSTR pstr); 168 | const CDuiString& operator+=(const TCHAR ch); 169 | 170 | bool operator == (LPCTSTR str) const; 171 | bool operator != (LPCTSTR str) const; 172 | bool operator <= (LPCTSTR str) const; 173 | bool operator < (LPCTSTR str) const; 174 | bool operator >= (LPCTSTR str) const; 175 | bool operator > (LPCTSTR str) const; 176 | 177 | int Compare(LPCTSTR pstr) const; 178 | int CompareNoCase(LPCTSTR pstr) const; 179 | 180 | void MakeUpper(); 181 | void MakeLower(); 182 | 183 | CDuiString Left(int nLength) const; 184 | CDuiString Mid(int iPos, int nLength = -1) const; 185 | CDuiString Right(int nLength) const; 186 | 187 | int Find(TCHAR ch, int iPos = 0) const; 188 | int Find(LPCTSTR pstr, int iPos = 0) const; 189 | int ReverseFind(TCHAR ch) const; 190 | int Replace(LPCTSTR pstrFrom, LPCTSTR pstrTo); 191 | 192 | int __cdecl Format(LPCTSTR pstrFormat, ...); 193 | int __cdecl SmallFormat(LPCTSTR pstrFormat, ...); 194 | 195 | protected: 196 | LPTSTR m_pstr; 197 | TCHAR m_szBuffer[MAX_LOCAL_STRING_LEN + 1]; 198 | }; 199 | 200 | 201 | ///////////////////////////////////////////////////////////////////////////////////// 202 | // 203 | 204 | struct TITEM 205 | { 206 | CDuiString Key; 207 | LPVOID Data; 208 | struct TITEM* pPrev; 209 | struct TITEM* pNext; 210 | }; 211 | 212 | class UILIB_API CStdStringPtrMap 213 | { 214 | public: 215 | CStdStringPtrMap(int nSize = 83); 216 | ~CStdStringPtrMap(); 217 | 218 | void Resize(int nSize = 83); 219 | LPVOID Find(LPCTSTR key, bool optimize = true) const; 220 | bool Insert(LPCTSTR key, LPVOID pData); 221 | LPVOID Set(LPCTSTR key, LPVOID pData); 222 | bool Remove(LPCTSTR key); 223 | void RemoveAll(); 224 | int GetSize() const; 225 | LPCTSTR GetAt(int iIndex) const; 226 | LPCTSTR operator[] (int nIndex) const; 227 | 228 | protected: 229 | TITEM** m_aT; 230 | int m_nBuckets; 231 | int m_nCount; 232 | }; 233 | 234 | ///////////////////////////////////////////////////////////////////////////////////// 235 | // 236 | 237 | class UILIB_API CWaitCursor 238 | { 239 | public: 240 | CWaitCursor(); 241 | ~CWaitCursor(); 242 | 243 | protected: 244 | HCURSOR m_hOrigCursor; 245 | }; 246 | 247 | ///////////////////////////////////////////////////////////////////////////////////// 248 | // 249 | 250 | class CVariant : public VARIANT 251 | { 252 | public: 253 | CVariant() 254 | { 255 | VariantInit(this); 256 | } 257 | CVariant(int i) 258 | { 259 | VariantInit(this); 260 | this->vt = VT_I4; 261 | this->intVal = i; 262 | } 263 | CVariant(float f) 264 | { 265 | VariantInit(this); 266 | this->vt = VT_R4; 267 | this->fltVal = f; 268 | } 269 | CVariant(LPOLESTR s) 270 | { 271 | VariantInit(this); 272 | this->vt = VT_BSTR; 273 | this->bstrVal = s; 274 | } 275 | CVariant(IDispatch *disp) 276 | { 277 | VariantInit(this); 278 | this->vt = VT_DISPATCH; 279 | this->pdispVal = disp; 280 | } 281 | 282 | ~CVariant() 283 | { 284 | VariantClear(this); 285 | } 286 | }; 287 | 288 | }// namespace DuiLib 289 | 290 | #endif // __UTILS_H__ -------------------------------------------------------------------------------- /testtab/testtab/Utils/WebBrowserEventHandler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Utils/WebBrowserEventHandler.h -------------------------------------------------------------------------------- /testtab/testtab/Utils/WinImplBase.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Utils/WinImplBase.cpp -------------------------------------------------------------------------------- /testtab/testtab/Utils/WinImplBase.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/Utils/WinImplBase.h -------------------------------------------------------------------------------- /testtab/testtab/Utils/downloadmgr.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma warning( disable: 4049 ) /* more than 64k source lines */ 3 | 4 | /* this ALWAYS GENERATED file contains the definitions for the interfaces */ 5 | 6 | 7 | /* File created by MIDL compiler version 5.03.0279 */ 8 | /* at Mon Jul 23 17:42:46 2001 9 | */ 10 | /* Compiler settings for downloadmgr.idl: 11 | Oicf (OptLev=i2), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext 12 | error checks: allocation ref bounds_check enum stub_data 13 | VC __declspec() decoration level: 14 | __declspec(uuid()), __declspec(selectany), __declspec(novtable) 15 | DECLSPEC_UUID(), MIDL_INTERFACE() 16 | */ 17 | //@@MIDL_FILE_HEADING( ) 18 | 19 | 20 | /* verify that the version is high enough to compile this file*/ 21 | #ifndef __REQUIRED_RPCNDR_H_VERSION__ 22 | #define __REQUIRED_RPCNDR_H_VERSION__ 440 23 | #endif 24 | 25 | #include "rpc.h" 26 | #include "rpcndr.h" 27 | 28 | #ifndef __RPCNDR_H_VERSION__ 29 | #error this stub requires an updated version of 30 | #endif // __RPCNDR_H_VERSION__ 31 | 32 | #ifndef COM_NO_WINDOWS_H 33 | #include "windows.h" 34 | #include "ole2.h" 35 | #endif /*COM_NO_WINDOWS_H*/ 36 | 37 | #ifndef __downloadmgr_h__ 38 | #define __downloadmgr_h__ 39 | 40 | /* Forward Declarations */ 41 | 42 | #ifndef __IDownloadManager_FWD_DEFINED__ 43 | #define __IDownloadManager_FWD_DEFINED__ 44 | typedef interface IDownloadManager IDownloadManager; 45 | #endif /* __IDownloadManager_FWD_DEFINED__ */ 46 | 47 | 48 | /* header files for imported files */ 49 | #include "unknwn.h" 50 | #include "ocidl.h" 51 | 52 | #ifdef __cplusplus 53 | extern "C"{ 54 | #endif 55 | 56 | void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t); 57 | void __RPC_USER MIDL_user_free( void __RPC_FAR * ); 58 | 59 | /* interface __MIDL_itf_downloadmgr_0000 */ 60 | /* [local] */ 61 | 62 | //=--------------------------------------------------------------------------= 63 | // downloadmgr.h 64 | //=--------------------------------------------------------------------------= 65 | // (C) Copyright 2000 Microsoft Corporation. All Rights Reserved. 66 | // 67 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 68 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 69 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 70 | // PARTICULAR PURPOSE. 71 | //=--------------------------------------------------------------------------= 72 | 73 | #pragma comment(lib,"uuid.lib") 74 | 75 | //---------------------------------------------------------------------------= 76 | // Internet Explorer Download Manager Interfaces 77 | 78 | // -------------------------------------------------------------------------------- 79 | // GUIDS 80 | // -------------------------------------------------------------------------------- 81 | // {988934A4-064B-11D3-BB80-00104B35E7F9} 82 | DEFINE_GUID(IID_IDownloadManager, 0x988934a4, 0x064b, 0x11d3, 0xbb, 0x80, 0x0, 0x10, 0x4b, 0x35, 0xe7, 0xf9); 83 | #define SID_SDownloadManager IID_IDownloadManager 84 | 85 | 86 | 87 | extern RPC_IF_HANDLE __MIDL_itf_downloadmgr_0000_v0_0_c_ifspec; 88 | extern RPC_IF_HANDLE __MIDL_itf_downloadmgr_0000_v0_0_s_ifspec; 89 | 90 | #ifndef __IDownloadManager_INTERFACE_DEFINED__ 91 | #define __IDownloadManager_INTERFACE_DEFINED__ 92 | 93 | /* interface IDownloadManager */ 94 | /* [local][unique][uuid][object][helpstring] */ 95 | 96 | 97 | EXTERN_C const IID IID_IDownloadManager; 98 | 99 | #if defined(__cplusplus) && !defined(CINTERFACE) 100 | 101 | MIDL_INTERFACE("988934A4-064B-11D3-BB80-00104B35E7F9") 102 | IDownloadManager : public IUnknown 103 | { 104 | public: 105 | virtual HRESULT STDMETHODCALLTYPE Download( 106 | /* [in] */ IMoniker __RPC_FAR *pmk, 107 | /* [in] */ IBindCtx __RPC_FAR *pbc, 108 | /* [in] */ DWORD dwBindVerb, 109 | /* [in] */ LONG grfBINDF, 110 | /* [in] */ BINDINFO __RPC_FAR *pBindInfo, 111 | /* [in] */ LPCOLESTR pszHeaders, 112 | /* [in] */ LPCOLESTR pszRedir, 113 | /* [in] */ UINT uiCP) = 0; 114 | 115 | }; 116 | 117 | #else /* C style interface */ 118 | 119 | typedef struct IDownloadManagerVtbl 120 | { 121 | BEGIN_INTERFACE 122 | 123 | HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( 124 | IDownloadManager __RPC_FAR * This, 125 | /* [in] */ REFIID riid, 126 | /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); 127 | 128 | ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( 129 | IDownloadManager __RPC_FAR * This); 130 | 131 | ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( 132 | IDownloadManager __RPC_FAR * This); 133 | 134 | HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Download )( 135 | IDownloadManager __RPC_FAR * This, 136 | /* [in] */ IMoniker __RPC_FAR *pmk, 137 | /* [in] */ IBindCtx __RPC_FAR *pbc, 138 | /* [in] */ DWORD dwBindVerb, 139 | /* [in] */ LONG grfBINDF, 140 | /* [in] */ BINDINFO __RPC_FAR *pBindInfo, 141 | /* [in] */ LPCOLESTR pszHeaders, 142 | /* [in] */ LPCOLESTR pszRedir, 143 | /* [in] */ UINT uiCP); 144 | 145 | END_INTERFACE 146 | } IDownloadManagerVtbl; 147 | 148 | interface IDownloadManager 149 | { 150 | CONST_VTBL struct IDownloadManagerVtbl __RPC_FAR *lpVtbl; 151 | }; 152 | 153 | 154 | 155 | #ifdef COBJMACROS 156 | 157 | 158 | #define IDownloadManager_QueryInterface(This,riid,ppvObject) \ 159 | (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) 160 | 161 | #define IDownloadManager_AddRef(This) \ 162 | (This)->lpVtbl -> AddRef(This) 163 | 164 | #define IDownloadManager_Release(This) \ 165 | (This)->lpVtbl -> Release(This) 166 | 167 | 168 | #define IDownloadManager_Download(This,pmk,pbc,dwBindVerb,grfBINDF,pBindInfo,pszHeaders,pszRedir,uiCP) \ 169 | (This)->lpVtbl -> Download(This,pmk,pbc,dwBindVerb,grfBINDF,pBindInfo,pszHeaders,pszRedir,uiCP) 170 | 171 | #endif /* COBJMACROS */ 172 | 173 | 174 | #endif /* C style interface */ 175 | 176 | 177 | 178 | HRESULT STDMETHODCALLTYPE IDownloadManager_Download_Proxy( 179 | IDownloadManager __RPC_FAR * This, 180 | /* [in] */ IMoniker __RPC_FAR *pmk, 181 | /* [in] */ IBindCtx __RPC_FAR *pbc, 182 | /* [in] */ DWORD dwBindVerb, 183 | /* [in] */ LONG grfBINDF, 184 | /* [in] */ BINDINFO __RPC_FAR *pBindInfo, 185 | /* [in] */ LPCOLESTR pszHeaders, 186 | /* [in] */ LPCOLESTR pszRedir, 187 | /* [in] */ UINT uiCP); 188 | 189 | 190 | void __RPC_STUB IDownloadManager_Download_Stub( 191 | IRpcStubBuffer *This, 192 | IRpcChannelBuffer *_pRpcChannelBuffer, 193 | PRPC_MESSAGE _pRpcMessage, 194 | DWORD *_pdwStubPhase); 195 | 196 | 197 | 198 | #endif /* __IDownloadManager_INTERFACE_DEFINED__ */ 199 | 200 | 201 | /* Additional Prototypes for ALL interfaces */ 202 | 203 | /* end of Additional Prototypes */ 204 | 205 | #ifdef __cplusplus 206 | } 207 | #endif 208 | 209 | #endif 210 | 211 | 212 | -------------------------------------------------------------------------------- /testtab/testtab/Utils/flash11.tlh: -------------------------------------------------------------------------------- 1 | // Created by Microsoft (R) C/C++ Compiler Version 15.00.30729.01 (e0a6a81a). 2 | // 3 | // d:\wdkj\workspace\mainclient\duilib\build\unicodedebug\flash11.tlh 4 | // 5 | // C++ source equivalent of Win32 type library C:\Program Files (x86)\DDBClient\Flash11.ocx 6 | // compiler-generated file created 11/14/12 at 14:19:41 - DO NOT EDIT! 7 | 8 | #pragma once 9 | #pragma pack(push, 8) 10 | 11 | #include 12 | 13 | // 14 | // Forward references and typedefs 15 | // 16 | 17 | struct __declspec(uuid("d27cdb6b-ae6d-11cf-96b8-444553540000")) 18 | /* LIBID */ __ShockwaveFlashObjects; 19 | struct __declspec(uuid("d27cdb6c-ae6d-11cf-96b8-444553540000")) 20 | /* dual interface */ IShockwaveFlash; 21 | struct __declspec(uuid("c5598e60-b307-11d1-b27d-006008c3fbfb")) 22 | /* interface */ ICanHandleException; 23 | struct __declspec(uuid("d27cdb6d-ae6d-11cf-96b8-444553540000")) 24 | /* dispinterface */ _IShockwaveFlashEvents; 25 | struct /* coclass */ ShockwaveFlash; 26 | struct __declspec(uuid("d27cdb70-ae6d-11cf-96b8-444553540000")) 27 | /* interface */ IFlashFactory; 28 | struct __declspec(uuid("d27cdb72-ae6d-11cf-96b8-444553540000")) 29 | /* interface */ IFlashObjectInterface; 30 | struct __declspec(uuid("a6ef9860-c720-11d0-9337-00a0c90dcaa9")) 31 | /* interface */ IDispatchEx; 32 | struct /* coclass */ FlashObjectInterface; 33 | struct __declspec(uuid("86230738-d762-4c50-a2de-a753e5b1686f")) 34 | /* dual interface */ IFlashObject; 35 | struct /* coclass */ FlashObject; 36 | 37 | // 38 | // Smart pointer typedef declarations 39 | // 40 | 41 | _COM_SMARTPTR_TYPEDEF(IShockwaveFlash, __uuidof(IShockwaveFlash)); 42 | _COM_SMARTPTR_TYPEDEF(ICanHandleException, __uuidof(ICanHandleException)); 43 | _COM_SMARTPTR_TYPEDEF(_IShockwaveFlashEvents, __uuidof(_IShockwaveFlashEvents)); 44 | _COM_SMARTPTR_TYPEDEF(IFlashFactory, __uuidof(IFlashFactory)); 45 | _COM_SMARTPTR_TYPEDEF(IDispatchEx, __uuidof(IDispatchEx)); 46 | _COM_SMARTPTR_TYPEDEF(IFlashObjectInterface, __uuidof(IFlashObjectInterface)); 47 | _COM_SMARTPTR_TYPEDEF(IFlashObject, __uuidof(IFlashObject)); 48 | 49 | // 50 | // Type library items 51 | // 52 | 53 | struct __declspec(uuid("d27cdb6c-ae6d-11cf-96b8-444553540000")) 54 | IShockwaveFlash : IDispatch 55 | { 56 | // 57 | // Raw methods provided by interface 58 | // 59 | 60 | virtual HRESULT __stdcall get_ReadyState ( 61 | /*[out,retval]*/ long * pVal ) = 0; 62 | virtual HRESULT __stdcall get_TotalFrames ( 63 | /*[out,retval]*/ long * pVal ) = 0; 64 | virtual HRESULT __stdcall get_Playing ( 65 | /*[out,retval]*/ VARIANT_BOOL * pVal ) = 0; 66 | virtual HRESULT __stdcall put_Playing ( 67 | /*[in]*/ VARIANT_BOOL pVal ) = 0; 68 | virtual HRESULT __stdcall get_Quality ( 69 | /*[out,retval]*/ int * pVal ) = 0; 70 | virtual HRESULT __stdcall put_Quality ( 71 | /*[in]*/ int pVal ) = 0; 72 | virtual HRESULT __stdcall get_ScaleMode ( 73 | /*[out,retval]*/ int * pVal ) = 0; 74 | virtual HRESULT __stdcall put_ScaleMode ( 75 | /*[in]*/ int pVal ) = 0; 76 | virtual HRESULT __stdcall get_AlignMode ( 77 | /*[out,retval]*/ int * pVal ) = 0; 78 | virtual HRESULT __stdcall put_AlignMode ( 79 | /*[in]*/ int pVal ) = 0; 80 | virtual HRESULT __stdcall get_BackgroundColor ( 81 | /*[out,retval]*/ long * pVal ) = 0; 82 | virtual HRESULT __stdcall put_BackgroundColor ( 83 | /*[in]*/ long pVal ) = 0; 84 | virtual HRESULT __stdcall get_Loop ( 85 | /*[out,retval]*/ VARIANT_BOOL * pVal ) = 0; 86 | virtual HRESULT __stdcall put_Loop ( 87 | /*[in]*/ VARIANT_BOOL pVal ) = 0; 88 | virtual HRESULT __stdcall get_Movie ( 89 | /*[out,retval]*/ BSTR * pVal ) = 0; 90 | virtual HRESULT __stdcall put_Movie ( 91 | /*[in]*/ BSTR pVal ) = 0; 92 | virtual HRESULT __stdcall get_FrameNum ( 93 | /*[out,retval]*/ long * pVal ) = 0; 94 | virtual HRESULT __stdcall put_FrameNum ( 95 | /*[in]*/ long pVal ) = 0; 96 | virtual HRESULT __stdcall SetZoomRect ( 97 | /*[in]*/ long left, 98 | /*[in]*/ long top, 99 | /*[in]*/ long right, 100 | /*[in]*/ long bottom ) = 0; 101 | virtual HRESULT __stdcall Zoom ( 102 | /*[in]*/ int factor ) = 0; 103 | virtual HRESULT __stdcall Pan ( 104 | /*[in]*/ long x, 105 | /*[in]*/ long y, 106 | /*[in]*/ int mode ) = 0; 107 | virtual HRESULT __stdcall Play ( ) = 0; 108 | virtual HRESULT __stdcall Stop ( ) = 0; 109 | virtual HRESULT __stdcall Back ( ) = 0; 110 | virtual HRESULT __stdcall Forward ( ) = 0; 111 | virtual HRESULT __stdcall Rewind ( ) = 0; 112 | virtual HRESULT __stdcall StopPlay ( ) = 0; 113 | virtual HRESULT __stdcall GotoFrame ( 114 | /*[in]*/ long FrameNum ) = 0; 115 | virtual HRESULT __stdcall CurrentFrame ( 116 | /*[out,retval]*/ long * FrameNum ) = 0; 117 | virtual HRESULT __stdcall IsPlaying ( 118 | /*[out,retval]*/ VARIANT_BOOL * Playing ) = 0; 119 | virtual HRESULT __stdcall PercentLoaded ( 120 | /*[out,retval]*/ long * percent ) = 0; 121 | virtual HRESULT __stdcall FrameLoaded ( 122 | /*[in]*/ long FrameNum, 123 | /*[out,retval]*/ VARIANT_BOOL * loaded ) = 0; 124 | virtual HRESULT __stdcall FlashVersion ( 125 | /*[out,retval]*/ long * version ) = 0; 126 | virtual HRESULT __stdcall get_WMode ( 127 | /*[out,retval]*/ BSTR * pVal ) = 0; 128 | virtual HRESULT __stdcall put_WMode ( 129 | /*[in]*/ BSTR pVal ) = 0; 130 | virtual HRESULT __stdcall get_SAlign ( 131 | /*[out,retval]*/ BSTR * pVal ) = 0; 132 | virtual HRESULT __stdcall put_SAlign ( 133 | /*[in]*/ BSTR pVal ) = 0; 134 | virtual HRESULT __stdcall get_Menu ( 135 | /*[out,retval]*/ VARIANT_BOOL * pVal ) = 0; 136 | virtual HRESULT __stdcall put_Menu ( 137 | /*[in]*/ VARIANT_BOOL pVal ) = 0; 138 | virtual HRESULT __stdcall get_Base ( 139 | /*[out,retval]*/ BSTR * pVal ) = 0; 140 | virtual HRESULT __stdcall put_Base ( 141 | /*[in]*/ BSTR pVal ) = 0; 142 | virtual HRESULT __stdcall get_Scale ( 143 | /*[out,retval]*/ BSTR * pVal ) = 0; 144 | virtual HRESULT __stdcall put_Scale ( 145 | /*[in]*/ BSTR pVal ) = 0; 146 | virtual HRESULT __stdcall get_DeviceFont ( 147 | /*[out,retval]*/ VARIANT_BOOL * pVal ) = 0; 148 | virtual HRESULT __stdcall put_DeviceFont ( 149 | /*[in]*/ VARIANT_BOOL pVal ) = 0; 150 | virtual HRESULT __stdcall get_EmbedMovie ( 151 | /*[out,retval]*/ VARIANT_BOOL * pVal ) = 0; 152 | virtual HRESULT __stdcall put_EmbedMovie ( 153 | /*[in]*/ VARIANT_BOOL pVal ) = 0; 154 | virtual HRESULT __stdcall get_BGColor ( 155 | /*[out,retval]*/ BSTR * pVal ) = 0; 156 | virtual HRESULT __stdcall put_BGColor ( 157 | /*[in]*/ BSTR pVal ) = 0; 158 | virtual HRESULT __stdcall get_Quality2 ( 159 | /*[out,retval]*/ BSTR * pVal ) = 0; 160 | virtual HRESULT __stdcall put_Quality2 ( 161 | /*[in]*/ BSTR pVal ) = 0; 162 | virtual HRESULT __stdcall LoadMovie ( 163 | /*[in]*/ int layer, 164 | /*[in]*/ BSTR url ) = 0; 165 | virtual HRESULT __stdcall TGotoFrame ( 166 | /*[in]*/ BSTR target, 167 | /*[in]*/ long FrameNum ) = 0; 168 | virtual HRESULT __stdcall TGotoLabel ( 169 | /*[in]*/ BSTR target, 170 | /*[in]*/ BSTR label ) = 0; 171 | virtual HRESULT __stdcall TCurrentFrame ( 172 | /*[in]*/ BSTR target, 173 | /*[out,retval]*/ long * FrameNum ) = 0; 174 | virtual HRESULT __stdcall TCurrentLabel ( 175 | /*[in]*/ BSTR target, 176 | /*[out,retval]*/ BSTR * pVal ) = 0; 177 | virtual HRESULT __stdcall TPlay ( 178 | /*[in]*/ BSTR target ) = 0; 179 | virtual HRESULT __stdcall TStopPlay ( 180 | /*[in]*/ BSTR target ) = 0; 181 | virtual HRESULT __stdcall SetVariable ( 182 | /*[in]*/ BSTR name, 183 | /*[in]*/ BSTR value ) = 0; 184 | virtual HRESULT __stdcall GetVariable ( 185 | /*[in]*/ BSTR name, 186 | /*[out,retval]*/ BSTR * pVal ) = 0; 187 | virtual HRESULT __stdcall TSetProperty ( 188 | /*[in]*/ BSTR target, 189 | /*[in]*/ int property, 190 | /*[in]*/ BSTR value ) = 0; 191 | virtual HRESULT __stdcall TGetProperty ( 192 | /*[in]*/ BSTR target, 193 | /*[in]*/ int property, 194 | /*[out,retval]*/ BSTR * pVal ) = 0; 195 | virtual HRESULT __stdcall TCallFrame ( 196 | /*[in]*/ BSTR target, 197 | /*[in]*/ int FrameNum ) = 0; 198 | virtual HRESULT __stdcall TCallLabel ( 199 | /*[in]*/ BSTR target, 200 | /*[in]*/ BSTR label ) = 0; 201 | virtual HRESULT __stdcall TSetPropertyNum ( 202 | /*[in]*/ BSTR target, 203 | /*[in]*/ int property, 204 | /*[in]*/ double value ) = 0; 205 | virtual HRESULT __stdcall TGetPropertyNum ( 206 | /*[in]*/ BSTR target, 207 | /*[in]*/ int property, 208 | /*[out,retval]*/ double * pVal ) = 0; 209 | virtual HRESULT __stdcall TGetPropertyAsNumber ( 210 | /*[in]*/ BSTR target, 211 | /*[in]*/ int property, 212 | /*[out,retval]*/ double * pVal ) = 0; 213 | virtual HRESULT __stdcall get_SWRemote ( 214 | /*[out,retval]*/ BSTR * pVal ) = 0; 215 | virtual HRESULT __stdcall put_SWRemote ( 216 | /*[in]*/ BSTR pVal ) = 0; 217 | virtual HRESULT __stdcall get_FlashVars ( 218 | /*[out,retval]*/ BSTR * pVal ) = 0; 219 | virtual HRESULT __stdcall put_FlashVars ( 220 | /*[in]*/ BSTR pVal ) = 0; 221 | virtual HRESULT __stdcall get_AllowScriptAccess ( 222 | /*[out,retval]*/ BSTR * pVal ) = 0; 223 | virtual HRESULT __stdcall put_AllowScriptAccess ( 224 | /*[in]*/ BSTR pVal ) = 0; 225 | virtual HRESULT __stdcall get_MovieData ( 226 | /*[out,retval]*/ BSTR * pVal ) = 0; 227 | virtual HRESULT __stdcall put_MovieData ( 228 | /*[in]*/ BSTR pVal ) = 0; 229 | virtual HRESULT __stdcall get_InlineData ( 230 | /*[out,retval]*/ IUnknown * * ppIUnknown ) = 0; 231 | virtual HRESULT __stdcall put_InlineData ( 232 | /*[in]*/ IUnknown * ppIUnknown ) = 0; 233 | virtual HRESULT __stdcall get_SeamlessTabbing ( 234 | /*[out,retval]*/ VARIANT_BOOL * pVal ) = 0; 235 | virtual HRESULT __stdcall put_SeamlessTabbing ( 236 | /*[in]*/ VARIANT_BOOL pVal ) = 0; 237 | virtual HRESULT __stdcall EnforceLocalSecurity ( ) = 0; 238 | virtual HRESULT __stdcall get_Profile ( 239 | /*[out,retval]*/ VARIANT_BOOL * pVal ) = 0; 240 | virtual HRESULT __stdcall put_Profile ( 241 | /*[in]*/ VARIANT_BOOL pVal ) = 0; 242 | virtual HRESULT __stdcall get_ProfileAddress ( 243 | /*[out,retval]*/ BSTR * pVal ) = 0; 244 | virtual HRESULT __stdcall put_ProfileAddress ( 245 | /*[in]*/ BSTR pVal ) = 0; 246 | virtual HRESULT __stdcall get_ProfilePort ( 247 | /*[out,retval]*/ long * pVal ) = 0; 248 | virtual HRESULT __stdcall put_ProfilePort ( 249 | /*[in]*/ long pVal ) = 0; 250 | virtual HRESULT __stdcall CallFunction ( 251 | /*[in]*/ BSTR request, 252 | /*[out,retval]*/ BSTR * response ) = 0; 253 | virtual HRESULT __stdcall SetReturnValue ( 254 | /*[in]*/ BSTR returnValue ) = 0; 255 | virtual HRESULT __stdcall DisableLocalSecurity ( ) = 0; 256 | virtual HRESULT __stdcall get_AllowNetworking ( 257 | /*[out,retval]*/ BSTR * pVal ) = 0; 258 | virtual HRESULT __stdcall put_AllowNetworking ( 259 | /*[in]*/ BSTR pVal ) = 0; 260 | virtual HRESULT __stdcall get_AllowFullScreen ( 261 | /*[out,retval]*/ BSTR * pVal ) = 0; 262 | virtual HRESULT __stdcall put_AllowFullScreen ( 263 | /*[in]*/ BSTR pVal ) = 0; 264 | }; 265 | 266 | struct __declspec(uuid("c5598e60-b307-11d1-b27d-006008c3fbfb")) 267 | ICanHandleException : IUnknown 268 | { 269 | // 270 | // Raw methods provided by interface 271 | // 272 | 273 | virtual HRESULT __stdcall CanHandleException ( 274 | /*[in]*/ EXCEPINFO * pExcepInfo, 275 | /*[in]*/ VARIANT * pvar ) = 0; 276 | }; 277 | 278 | struct __declspec(uuid("d27cdb6d-ae6d-11cf-96b8-444553540000")) 279 | _IShockwaveFlashEvents : IDispatch 280 | {}; 281 | 282 | struct __declspec(uuid("d27cdb6e-ae6d-11cf-96b8-444553540000")) 283 | ShockwaveFlash; 284 | // [ default ] interface IShockwaveFlash 285 | // [ default, source ] dispinterface _IShockwaveFlashEvents 286 | 287 | struct __declspec(uuid("d27cdb70-ae6d-11cf-96b8-444553540000")) 288 | IFlashFactory : IUnknown 289 | {}; 290 | 291 | struct __declspec(uuid("a6ef9860-c720-11d0-9337-00a0c90dcaa9")) 292 | IDispatchEx : IDispatch 293 | { 294 | // 295 | // Raw methods provided by interface 296 | // 297 | 298 | virtual HRESULT __stdcall GetDispID ( 299 | /*[in]*/ BSTR bstrName, 300 | /*[in]*/ unsigned long grfdex, 301 | /*[out]*/ long * pid ) = 0; 302 | virtual HRESULT __stdcall RemoteInvokeEx ( 303 | /*[in]*/ long id, 304 | /*[in]*/ unsigned long lcid, 305 | /*[in]*/ unsigned long dwFlags, 306 | /*[in]*/ DISPPARAMS * pdp, 307 | /*[out]*/ VARIANT * pvarRes, 308 | /*[out]*/ EXCEPINFO * pei, 309 | /*[in]*/ struct IServiceProvider * pspCaller, 310 | /*[in]*/ unsigned int cvarRefArg, 311 | /*[in]*/ unsigned int * rgiRefArg, 312 | /*[in,out]*/ VARIANT * rgvarRefArg ) = 0; 313 | virtual HRESULT __stdcall DeleteMemberByName ( 314 | /*[in]*/ BSTR bstrName, 315 | /*[in]*/ unsigned long grfdex ) = 0; 316 | virtual HRESULT __stdcall DeleteMemberByDispID ( 317 | /*[in]*/ long id ) = 0; 318 | virtual HRESULT __stdcall GetMemberProperties ( 319 | /*[in]*/ long id, 320 | /*[in]*/ unsigned long grfdexFetch, 321 | /*[out]*/ unsigned long * pgrfdex ) = 0; 322 | virtual HRESULT __stdcall GetMemberName ( 323 | /*[in]*/ long id, 324 | /*[out]*/ BSTR * pbstrName ) = 0; 325 | virtual HRESULT __stdcall GetNextDispID ( 326 | /*[in]*/ unsigned long grfdex, 327 | /*[in]*/ long id, 328 | /*[out]*/ long * pid ) = 0; 329 | virtual HRESULT __stdcall GetNameSpaceParent ( 330 | /*[out]*/ IUnknown * * ppunk ) = 0; 331 | }; 332 | 333 | struct __declspec(uuid("d27cdb72-ae6d-11cf-96b8-444553540000")) 334 | IFlashObjectInterface : IDispatchEx 335 | {}; 336 | 337 | struct __declspec(uuid("d27cdb71-ae6d-11cf-96b8-444553540000")) 338 | FlashObjectInterface; 339 | // [ default ] interface IFlashObjectInterface 340 | 341 | struct __declspec(uuid("86230738-d762-4c50-a2de-a753e5b1686f")) 342 | IFlashObject : IDispatchEx 343 | {}; 344 | 345 | struct __declspec(uuid("e0920e11-6b65-4d5d-9c58-b1fc5c07dc43")) 346 | FlashObject; 347 | // [ default ] interface IFlashObject 348 | 349 | #pragma pack(pop) 350 | -------------------------------------------------------------------------------- /testtab/testtab/lib/DuiLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/lib/DuiLib.lib -------------------------------------------------------------------------------- /testtab/testtab/lib/DuiLib_d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/lib/DuiLib_d.lib -------------------------------------------------------------------------------- /testtab/testtab/lib/DuiLib_u.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/lib/DuiLib_u.lib -------------------------------------------------------------------------------- /testtab/testtab/lib/DuiLib_ud.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/lib/DuiLib_ud.lib -------------------------------------------------------------------------------- /testtab/testtab/res/360SafeRes.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/res/360SafeRes.zip -------------------------------------------------------------------------------- /testtab/testtab/res/FILE.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/res/FILE.ico -------------------------------------------------------------------------------- /testtab/testtab/res/INFO.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/res/INFO.ico -------------------------------------------------------------------------------- /testtab/testtab/res/PORT.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/res/PORT.ico -------------------------------------------------------------------------------- /testtab/testtab/res/PROCESS.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/res/PROCESS.ICO -------------------------------------------------------------------------------- /testtab/testtab/res/SRV.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/res/SRV.ico -------------------------------------------------------------------------------- /testtab/testtab/res/icon1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/res/icon1.ico -------------------------------------------------------------------------------- /testtab/testtab/res/systeminfo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/res/systeminfo.bmp -------------------------------------------------------------------------------- /testtab/testtab/res/testtab.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/res/testtab.ico -------------------------------------------------------------------------------- /testtab/testtab/res/testtab.rc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/res/testtab.rc2 -------------------------------------------------------------------------------- /testtab/testtab/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by testtab.rc 4 | // 5 | #define IDM_ABOUTBOX 0x0010 6 | #define IDD_ABOUTBOX 100 7 | #define IDS_ABOUTBOX 101 8 | #define IDD_TESTTAB_DIALOG 102 9 | #define IDD_YOUHUA_DIALOG 102 10 | #define IDR_HTML_SYSTEMINFODLG 103 11 | #define IDR_HTML_DLGCLEANRUBBISH 104 12 | #define IDR_HTML_BEAUMASTER 105 13 | #define IDR_HTML_DDDD 106 14 | #define IDR_MAINFRAME 128 15 | #define IDD_NETWORK 130 16 | #define IDD_TASKMGR 133 17 | #define IDR_MENUTASKMGR 134 18 | #define IDD_REGEDIT 135 19 | #define IDD_FILEEXPLORER 136 20 | #define IDD_STARTMANGE 137 21 | #define IDD_SELECT 139 22 | #define IDI_ICON1 145 23 | #define IDI_ICON2 146 24 | #define IDI_ICON3 147 25 | #define IDI_ICON4 148 26 | #define IDI_ICON5 149 27 | #define IDI_ICON6 150 28 | #define IDR_MENU1 151 29 | #define IDD_DIALOG1 153 30 | #define IDB_BITMAP1 154 31 | #define IDD_DIALOGMAIN 156 32 | #define IDD_CLEARMASTER_DIALOG 157 33 | #define IDD_MEIHUA_DIALOG 158 34 | #define IDD_DIALOG_CLEARHISTORY 159 35 | #define IDR_360SAFEZIP 163 36 | #define IDR_MENU2 165 37 | #define IDD_DIALOGCLEANRUBBISH 166 38 | #define IDD_DIALOG_USBSHADU 169 39 | #define IDD_DIALOG2 170 40 | #define IDD_DIALOGSYSTEMINFO 170 41 | #define IDD_DIALOG3 171 42 | #define IDC_TAB1 1000 43 | #define IDC_LIST2 1004 44 | #define IDC_LIST1 1007 45 | #define IDC_CHECK1 1009 46 | #define IDC_CHECKRCLICK 1010 47 | #define IDC_CHECK2 1010 48 | #define IDC_TREE1 1011 49 | #define IDC_CHECKSOFTINFO 1011 50 | #define IDC_CHECK_RENAME 1011 51 | #define IDC_CHECK_CLEANGID 1011 52 | #define IDC_CHECK_CLEARCOOKIES 1011 53 | #define IDC_BUTTON1 1012 54 | #define IDC_CHECK_MODIFY 1012 55 | #define IDC_BUTTONSTOP 1012 56 | #define IDC_CHECK_CLEAN_OLD 1012 57 | #define IDC_CHECK_CLEARBWOSER 1012 58 | #define IDC_CLEARMEM 1013 59 | #define IDC_CHECK_OTHERS 1013 60 | #define IDC_CHECKBIGFILE 1013 61 | #define IDC_BUTTON_YOUHUA 1013 62 | #define IDC_CHECK5 1013 63 | #define IDC_BUTTON_MEIHUA 1014 64 | #define IDC_CHECK6 1014 65 | #define IDC_PROGRESS1 1018 66 | #define IDC_CLEARREG 1019 67 | #define IDC_OPENREG 1020 68 | #define IDC_CHECKNOSTARTMENU 1021 69 | #define IDC_STARTMONITOR 1023 70 | #define IDC_BUTTON_CHOICEPATH 1024 71 | #define IDC_BUTTON_CLEARALL 1025 72 | #define IDC_CHECK7 1025 73 | #define IDC_LISTEN 1026 74 | #define IDC_CHECK8 1026 75 | #define IDC_BUTTON_STOP 1027 76 | #define IDC_BUTTON_OPTION 1028 77 | #define IDC_BUTTON_EXPORT 1029 78 | #define IDC_STATIC_PATH 1030 79 | #define IDC_BUTTON_SELECTALL 1032 80 | #define IDC_BUTTON_REVERSELECT 1033 81 | #define IDC_CHECK_ADDNEW 1034 82 | #define IDC_CHECK__DELFILE 1035 83 | #define IDC_BUTTON_SCAN 1039 84 | #define IDC_STATIC_STATE 1040 85 | #define IDC_STATIC_USBSTATE 1040 86 | #define IDC_STATIC_SCANPATH 1041 87 | #define IDC_STATIC_SCANREGPATH 1042 88 | #define IDC_BUTTON_STOPSCAN 1043 89 | #define IDC_BUTTON2 1044 90 | #define IDC_BUTTONSTARTSCAN 1044 91 | #define IDC_BUTTON_STARTCLEAR 1044 92 | #define IDC_CHECK_DLL 1044 93 | #define IDC_BUTTON3 1045 94 | #define IDC_STATIC_VAILDSTARTMENU 1045 95 | #define IDC_BUTTON_ENDCLEAR 1045 96 | #define IDC_CHECK_CLEAN_TEMP 1054 97 | #define IDC_CHECK_CELANLOG 1055 98 | #define IDC_TREE2 1056 99 | #define IDC_BUTTON_CLEAR 1057 100 | #define IDC_CHECK_CLEARINTERNET 1058 101 | #define DC_EDSELDIR 1062 102 | #define IDC_LISTVIRUS 1065 103 | #define IDC_NUM_PROC 1067 104 | #define IDC_MEM_USE 1068 105 | #define IDC_BUTTONCLEAN 1070 106 | #define IDC_BUTTONCLearMaster 1071 107 | #define ID_POPUP_32771 32771 108 | #define ID_POPUP_32772 32772 109 | #define ID_POPUP_32773 32773 110 | #define ID_LocatePro 32774 111 | #define ID_KILLPRO 32775 112 | #define ID_REFERSHLIST 32776 113 | #define ID_DDDD_32777 32777 114 | #define ID_DDDD_32778 32778 115 | #define ID_DLETEITEM 32779 116 | #define ID_OPENITEM 32780 117 | #define sda 32781 118 | #define sdaddsa 32782 119 | #define ID_POPUP_32783 32783 120 | #define ID_BAIDUSEARCH 32784 121 | #define ID_POPUP_32785 32785 122 | #define ID_POPUP_KILLAKK 32786 123 | #define ID_POPUP_KILLALL 32787 124 | #define ID_32788 32788 125 | #define ID_32789 32789 126 | #define ID_32790 32790 127 | #define ID_YOUHUA 32791 128 | #define ID_MEIHUA 32792 129 | #define ID_QINGLI 32793 130 | #define ID_CLEAR 32794 131 | #define ID_DDDD_32795 32795 132 | 133 | // Next default values for new objects 134 | // 135 | #ifdef APSTUDIO_INVOKED 136 | #ifndef APSTUDIO_READONLY_SYMBOLS 137 | #define _APS_NEXT_RESOURCE_VALUE 172 138 | #define _APS_NEXT_COMMAND_VALUE 32796 139 | #define _APS_NEXT_CONTROL_VALUE 1072 140 | #define _APS_NEXT_SYMED_VALUE 107 141 | #endif 142 | #endif 143 | -------------------------------------------------------------------------------- /testtab/testtab/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/stdafx.cpp -------------------------------------------------------------------------------- /testtab/testtab/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/stdafx.h -------------------------------------------------------------------------------- /testtab/testtab/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/targetver.h -------------------------------------------------------------------------------- /testtab/testtab/testtab.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/testtab.cpp -------------------------------------------------------------------------------- /testtab/testtab/testtab.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/testtab.h -------------------------------------------------------------------------------- /testtab/testtab/testtab.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/testtab.rc -------------------------------------------------------------------------------- /testtab/testtab/testtab.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/testtab.vcproj -------------------------------------------------------------------------------- /testtab/testtab/testtab.vcproj.2011-20130128NZ.Administrator.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /testtab/testtab/testtab.vcproj.CPP.abc.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /testtab/testtab/testtab.vcproj.GDCPP.abc.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /testtab/testtab/testtab.vcproj.MICROSOF-B47D37.Administrator.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /testtab/testtab/testtabDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/testtabDlg.cpp -------------------------------------------------------------------------------- /testtab/testtab/testtabDlg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/testtab/testtabDlg.h -------------------------------------------------------------------------------- /testtab/windows.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testtab", "testtab\testtab.vcproj", "{DA975A89-3AFA-4FDC-B127-AA3D7DD77DF4}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {DA975A89-3AFA-4FDC-B127-AA3D7DD77DF4}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {DA975A89-3AFA-4FDC-B127-AA3D7DD77DF4}.Debug|Win32.Build.0 = Debug|Win32 14 | {DA975A89-3AFA-4FDC-B127-AA3D7DD77DF4}.Release|Win32.ActiveCfg = Release|Win32 15 | {DA975A89-3AFA-4FDC-B127-AA3D7DD77DF4}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /testtab/windows.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/6520874/windows-Wopti-/ab401322afbdc0aabaaa4c845383f961a65f3163/testtab/windows.suo --------------------------------------------------------------------------------