├── .gitignore ├── 3rd └── DuiLib │ ├── Control │ ├── UIActiveX.cpp │ ├── UIActiveX.h │ ├── UIAnimation.cpp │ ├── UIAnimation.h │ ├── UIButton.cpp │ ├── UIButton.h │ ├── UICheckBox.cpp │ ├── UICheckBox.h │ ├── UIColorPalette.cpp │ ├── UIColorPalette.h │ ├── UICombo.cpp │ ├── UICombo.h │ ├── UIComboBox.cpp │ ├── UIComboBox.h │ ├── UIDateTime.cpp │ ├── UIDateTime.h │ ├── UIEdit.cpp │ ├── UIEdit.h │ ├── UIFadeButton.cpp │ ├── UIFadeButton.h │ ├── UIFlash.cpp │ ├── UIFlash.h │ ├── UIHyperlink.cpp │ ├── UIHyperlink.h │ ├── UIIpAddress.cpp │ ├── UIIpAddress.h │ ├── UILabel.cpp │ ├── UILabel.h │ ├── UIList.cpp │ ├── UIList.h │ ├── UIMediaPlayer.cpp │ ├── UIMediaPlayer.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 │ ├── Core │ ├── UIBase.cpp │ ├── UIBase.h │ ├── UIContainer.cpp │ ├── UIContainer.h │ ├── UIControl.cpp │ ├── UIControl.h │ ├── UIDefine.h │ ├── UIDlgBuilder.cpp │ ├── UIDlgBuilder.h │ ├── UIManager.cpp │ ├── UIManager.h │ ├── UIMarkup.cpp │ ├── UIMarkup.h │ ├── UIRender.cpp │ └── UIRender.h │ ├── DuiLib.vcproj │ ├── DuiLib.vcxproj │ ├── DuiLib.vcxproj.filters │ ├── DuiLib.vcxproj.user │ ├── Ex │ └── ShadowWindow.h │ ├── Layout │ ├── UIChildLayout.cpp │ ├── UIChildLayout.h │ ├── UIHorizontalLayout.cpp │ ├── UIHorizontalLayout.h │ ├── UITabLayout.cpp │ ├── UITabLayout.h │ ├── UITileLayout.cpp │ ├── UITileLayout.h │ ├── UIVerticalLayout.cpp │ └── UIVerticalLayout.h │ ├── StdAfx.cpp │ ├── StdAfx.h │ ├── UIlib.cpp │ ├── UIlib.h │ └── Utils │ ├── Flash11.tlb │ ├── FlashEventHandler.h │ ├── UIDelegate.cpp │ ├── UIDelegate.h │ ├── UnCompression.h │ ├── Utils.cpp │ ├── Utils.h │ ├── WebBrowserEventHandler.h │ ├── WinImplBase.cpp │ ├── WinImplBase.h │ ├── Zip │ ├── XUnZip.cpp │ ├── XUnZip.h │ └── XUnZipBase.h │ ├── downloadmgr.h │ ├── stb_image.c │ ├── stb_image.h │ ├── wmp.tlh │ └── wmp.tli ├── AutoToast ├── HookMSG.rc ├── HookMSG.vcxproj ├── HookMSG.vcxproj.filters ├── HookMSG.vcxproj.user ├── main.cpp └── resource.h ├── Entry.cpp ├── LICENSE ├── README.md ├── bin ├── AutoToast.dll ├── AutoToast_d.dll ├── DuiLib_u.dll ├── DuiLib_ud.dll ├── Skin │ ├── DuiDesigner_u.exe │ ├── DuiLib_u.dll │ ├── button_set.png │ ├── skin-num.xml │ ├── skin.xml │ ├── title_close.png │ ├── title_max.png │ ├── title_min.png │ └── title_restore.png ├── virtualkeyboard.exe └── virtualkeyboard_d.exe ├── lib ├── DuiLib_u.lib └── DuiLib_ud.lib ├── res └── Skin.zip ├── resource.h ├── small.ico ├── stdafx.cpp ├── stdafx.h ├── targetver.h ├── virtualkeyboard.aps ├── virtualkeyboard.cpp ├── virtualkeyboard.h ├── virtualkeyboard.ico ├── virtualkeyboard.png ├── virtualkeyboard.rc ├── virtualkeyboard.sln ├── virtualkeyboard.vcxproj ├── virtualkeyboard.vcxproj.filters └── virtualkeyboard.vcxproj.user /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | *.smod 19 | 20 | # Compiled Static libraries 21 | *.lai 22 | *.la 23 | *.a 24 | *.lib 25 | 26 | # Executables 27 | *.exe 28 | *.out 29 | *.app 30 | -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIActiveX.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIActiveX.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/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 | virtual void SetDelayCreate(bool bDelayCreate = true); 42 | 43 | virtual bool CreateControl(const CLSID clsid); 44 | virtual 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 SetInnerVisible(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 | -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIAnimation.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | #include "UIAnimation.h" 3 | #include 4 | 5 | namespace DuiLib { 6 | 7 | CUIAnimation::CUIAnimation(CControlUI* pOwner) 8 | { 9 | ASSERT(pOwner != NULL); 10 | m_pControl = pOwner; 11 | } 12 | 13 | BOOL CUIAnimation::StartAnimation(int nElapse, int nTotalFrame, int nAnimationID /*= 0*/, BOOL bLoop/* = FALSE*/) 14 | { 15 | CAnimationData* pData = GetAnimationDataByID(nAnimationID); 16 | if( NULL != pData 17 | || nElapse <= 0 18 | || nTotalFrame <= 0 19 | || NULL == m_pControl ) 20 | { 21 | ASSERT(FALSE); 22 | return FALSE; 23 | } 24 | 25 | CAnimationData* pAnimation = new CAnimationData(nElapse, nTotalFrame, nAnimationID, bLoop); 26 | if( NULL == pAnimation ) return FALSE; 27 | 28 | if(m_pControl->GetManager()->SetTimer( m_pControl, nAnimationID, nElapse )) 29 | { 30 | m_arAnimations.Add(pAnimation); 31 | return TRUE; 32 | } 33 | return FALSE; 34 | } 35 | 36 | VOID CUIAnimation::StopAnimation(int nAnimationID /*= 0*/) 37 | { 38 | if(m_pControl == NULL) return; 39 | 40 | if(nAnimationID != 0) 41 | { 42 | CAnimationData* pData = GetAnimationDataByID(nAnimationID); 43 | if( NULL != pData ) 44 | { 45 | m_pControl->GetManager()->KillTimer( m_pControl, nAnimationID ); 46 | m_arAnimations.Remove(m_arAnimations.Find(pData),true); 47 | return; 48 | } 49 | } 50 | else 51 | { 52 | int nCount = m_arAnimations.GetSize(); 53 | for(int i=0; iGetManager()->KillTimer( m_pControl, m_arAnimations[i]->m_nAnimationID ); 56 | } 57 | m_arAnimations.Empty(); 58 | } 59 | } 60 | 61 | BOOL CUIAnimation::IsAnimationRunning(int nAnimationID) 62 | { 63 | CAnimationData* pData = GetAnimationDataByID(nAnimationID); 64 | return NULL != pData; 65 | } 66 | 67 | int CUIAnimation::GetCurrentFrame(int nAnimationID/* = 0*/) 68 | { 69 | CAnimationData* pData = GetAnimationDataByID(nAnimationID); 70 | if( NULL == pData ) 71 | { 72 | ASSERT(FALSE); 73 | return -1; 74 | } 75 | return pData->m_nCurFrame; 76 | } 77 | 78 | BOOL CUIAnimation::SetCurrentFrame(int nFrame, int nAnimationID/* = 0*/) 79 | { 80 | CAnimationData* pData = GetAnimationDataByID(nAnimationID); 81 | if( NULL == pData) 82 | { 83 | ASSERT(FALSE); 84 | return FALSE; 85 | } 86 | 87 | if(nFrame >= 0 && nFrame <= pData->m_nTotalFrame) 88 | { 89 | pData->m_nCurFrame = nFrame; 90 | return TRUE; 91 | } 92 | else 93 | { 94 | ASSERT(FALSE); 95 | } 96 | return FALSE; 97 | } 98 | 99 | VOID CUIAnimation::OnAnimationElapse(int nAnimationID) 100 | { 101 | if(m_pControl == NULL) return; 102 | 103 | CAnimationData* pData = GetAnimationDataByID(nAnimationID); 104 | if( NULL == pData ) return; 105 | 106 | int nCurFrame = pData->m_nCurFrame; 107 | if(nCurFrame == 0) 108 | { 109 | OnAnimationStart(nAnimationID, pData->m_bFirstLoop); 110 | pData->m_bFirstLoop = FALSE; 111 | } 112 | 113 | OnAnimationStep(pData->m_nTotalFrame, nCurFrame, nAnimationID); 114 | 115 | if(nCurFrame >= pData->m_nTotalFrame) 116 | { 117 | OnAnimationStop(nAnimationID); 118 | if(pData->m_bLoop) 119 | { 120 | pData->m_nCurFrame = 0; 121 | } 122 | else 123 | { 124 | m_pControl->GetManager()->KillTimer( m_pControl, nAnimationID ); 125 | m_arAnimations.Remove(m_arAnimations.Find(pData),true); 126 | pData = NULL; 127 | } 128 | } 129 | 130 | if( NULL != pData ) 131 | { 132 | ++(pData->m_nCurFrame); 133 | } 134 | } 135 | 136 | CAnimationData* CUIAnimation::GetAnimationDataByID(int nAnimationID) 137 | { 138 | CAnimationData* pRet = NULL; 139 | int nCount = m_arAnimations.GetSize(); 140 | for(int i=0; im_nAnimationID == nAnimationID) 143 | { 144 | pRet = m_arAnimations[i]; 145 | break; 146 | } 147 | } 148 | 149 | return pRet; 150 | } 151 | 152 | } // namespace DuiLib -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIAnimation.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIANIMATION_H__ 2 | #define __UIANIMATION_H__ 3 | 4 | #include 5 | #include "UIButton.h" 6 | #pragma once 7 | 8 | namespace DuiLib { 9 | 10 | class UILIB_API IUIAnimation 11 | { 12 | public: 13 | virtual ~IUIAnimation() { } 14 | 15 | virtual BOOL StartAnimation(int nElapse, int nTotalFrame, int nAnimationID = 0, BOOL bLoop = FALSE) = 0; 16 | virtual VOID StopAnimation(int nAnimationID = 0) = 0; 17 | virtual BOOL IsAnimationRunning(int nAnimationID) = 0; 18 | virtual int GetCurrentFrame(int nAnimationID = 0) = 0; 19 | virtual BOOL SetCurrentFrame(int nFrame, int nAnimationID = 0) = 0; 20 | 21 | virtual VOID OnAnimationStep(int nTotalFrame, int nCurFrame, int nAnimationID) = 0; 22 | virtual VOID OnAnimationStart(int nAnimationID, BOOL bFirstLoop) = 0; 23 | virtual VOID OnAnimationStop(int nAnimationID) = 0; 24 | 25 | virtual VOID OnAnimationElapse(int nAnimationID) = 0; 26 | }; 27 | 28 | class UILIB_API CAnimationData 29 | { 30 | public: 31 | CAnimationData(int nElipse, int nFrame, int nID, BOOL bLoop) 32 | { 33 | m_bFirstLoop = TRUE; 34 | m_nCurFrame = 0; 35 | m_nElapse = nElipse; 36 | m_nTotalFrame = nFrame; 37 | m_bLoop = bLoop; 38 | m_nAnimationID = nID; 39 | } 40 | 41 | //protected: 42 | public: 43 | friend class CDUIAnimation; 44 | 45 | int m_nAnimationID; 46 | int m_nElapse; 47 | 48 | int m_nTotalFrame; 49 | int m_nCurFrame; 50 | 51 | BOOL m_bLoop; 52 | BOOL m_bFirstLoop; 53 | }; 54 | 55 | class UILIB_API CUIAnimation: public IUIAnimation 56 | { 57 | public: 58 | CUIAnimation(CControlUI* pOwner); 59 | 60 | virtual BOOL StartAnimation(int nElapse, int nTotalFrame, int nAnimationID = 0, BOOL bLoop = FALSE); 61 | virtual VOID StopAnimation(int nAnimationID = 0); 62 | virtual BOOL IsAnimationRunning(int nAnimationID); 63 | virtual int GetCurrentFrame(int nAnimationID = 0); 64 | virtual BOOL SetCurrentFrame(int nFrame, int nAnimationID = 0); 65 | 66 | virtual VOID OnAnimationStart(int nAnimationID, BOOL bFirstLoop) {}; 67 | virtual VOID OnAnimationStep(int nTotalFrame, int nCurFrame, int nAnimationID) {}; 68 | virtual VOID OnAnimationStop(int nAnimationID) {}; 69 | 70 | virtual VOID OnAnimationElapse(int nAnimationID); 71 | 72 | protected: 73 | CAnimationData* GetAnimationDataByID(int nAnimationID); 74 | 75 | protected: 76 | CControlUI* m_pControl; 77 | TStdPtrArray m_arAnimations; 78 | }; 79 | 80 | } // namespace DuiLib 81 | 82 | #endif // __UIANIMATION_H__ -------------------------------------------------------------------------------- /3rd/DuiLib/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 | ,m_dwPushedBKColor(0) 13 | ,m_bDBClickState(false) 14 | { 15 | m_uTextStyle = DT_SINGLELINE | DT_VCENTER | DT_CENTER; 16 | } 17 | 18 | LPCTSTR CButtonUI::GetClass() const 19 | { 20 | return _T("ButtonUI"); 21 | } 22 | 23 | LPVOID CButtonUI::GetInterface(LPCTSTR pstrName) 24 | { 25 | if( _tcscmp(pstrName, DUI_CTR_BUTTON) == 0 ) return static_cast(this); 26 | return CLabelUI::GetInterface(pstrName); 27 | } 28 | 29 | UINT CButtonUI::GetControlFlags() const 30 | { 31 | return (IsKeyboardEnabled() ? UIFLAG_TABSTOP : 0) | (IsEnabled() ? UIFLAG_SETCURSOR : 0); 32 | } 33 | 34 | void CButtonUI::DoEvent(TEventUI& event) 35 | { 36 | if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) { 37 | if( m_pParent != NULL ) m_pParent->DoEvent(event); 38 | else CLabelUI::DoEvent(event); 39 | return; 40 | } 41 | 42 | if( event.Type == UIEVENT_SETFOCUS ) 43 | { 44 | Invalidate(); 45 | } 46 | if( event.Type == UIEVENT_KILLFOCUS ) 47 | { 48 | Invalidate(); 49 | } 50 | if( event.Type == UIEVENT_KEYDOWN ) 51 | { 52 | if (IsKeyboardEnabled()) { 53 | if( event.chKey == VK_SPACE || event.chKey == VK_RETURN ) { 54 | Activate(); 55 | return; 56 | } 57 | } 58 | } 59 | if( event.Type == UIEVENT_BUTTONDOWN) 60 | { 61 | if( ::PtInRect(&m_rcItem, event.ptMouse) && IsEnabled() ) { 62 | m_uButtonState |= UISTATE_PUSHED | UISTATE_CAPTURED; 63 | Invalidate(); 64 | } 65 | return; 66 | } 67 | if( event.Type == UIEVENT_DBLCLICK) 68 | { 69 | if( ::PtInRect(&m_rcItem, event.ptMouse) && IsEnabled() ) { 70 | m_bDBClickState = TRUE ; 71 | m_uButtonState |= UISTATE_PUSHED | UISTATE_CAPTURED; 72 | Invalidate(); 73 | } 74 | return; 75 | } 76 | if( event.Type == UIEVENT_MOUSEMOVE ) 77 | { 78 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) { 79 | if( ::PtInRect(&m_rcItem, event.ptMouse) ) m_uButtonState |= UISTATE_PUSHED; 80 | else m_uButtonState &= ~UISTATE_PUSHED; 81 | Invalidate(); 82 | } 83 | return; 84 | } 85 | if( event.Type == UIEVENT_BUTTONUP ) 86 | { 87 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) { 88 | if( ::PtInRect(&m_rcItem, event.ptMouse) ) Activate(); 89 | m_uButtonState &= ~(UISTATE_PUSHED | UISTATE_CAPTURED); 90 | Invalidate(); 91 | } 92 | return; 93 | } 94 | if( event.Type == UIEVENT_CONTEXTMENU ) 95 | { 96 | if( IsContextMenuUsed() ) { 97 | m_pManager->SendNotify(this, DUI_MSGTYPE_MENU, event.wParam, event.lParam); 98 | } 99 | return; 100 | } 101 | if( event.Type == UIEVENT_MOUSEENTER ) 102 | { 103 | if( IsEnabled() ) { 104 | m_uButtonState |= UISTATE_HOT; 105 | Invalidate(); 106 | } 107 | // return; 108 | } 109 | if( event.Type == UIEVENT_MOUSELEAVE ) 110 | { 111 | if( IsEnabled() ) { 112 | m_uButtonState &= ~UISTATE_HOT; 113 | Invalidate(); 114 | } 115 | // return; 116 | } 117 | if( event.Type == UIEVENT_SETCURSOR ) { 118 | ::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND))); 119 | return; 120 | } 121 | CLabelUI::DoEvent(event); 122 | } 123 | 124 | bool CButtonUI::Activate() 125 | { 126 | if( !CControlUI::Activate() ) return false; 127 | if( m_pManager != NULL ) 128 | { 129 | if (m_bDBClickState == FALSE ) 130 | { 131 | m_pManager->SendNotify(this, DUI_MSGTYPE_CLICK); 132 | } 133 | else 134 | { 135 | m_bDBClickState = FALSE ; 136 | m_pManager->SendNotify(this, DUI_MSGTYPE_DBCLICK); 137 | } 138 | } 139 | 140 | return true; 141 | } 142 | 143 | void CButtonUI::SetEnabled(bool bEnable) 144 | { 145 | CControlUI::SetEnabled(bEnable); 146 | if( !IsEnabled() ) { 147 | m_uButtonState = 0; 148 | } 149 | } 150 | 151 | void CButtonUI::SetHotBkColor( DWORD dwColor ) 152 | { 153 | m_dwHotBkColor = dwColor; 154 | } 155 | 156 | DWORD CButtonUI::GetHotBkColor() const 157 | { 158 | return m_dwHotBkColor; 159 | } 160 | 161 | void CButtonUI::SetHotTextColor(DWORD dwColor) 162 | { 163 | m_dwHotTextColor = dwColor; 164 | } 165 | 166 | DWORD CButtonUI::GetHotTextColor() const 167 | { 168 | return m_dwHotTextColor; 169 | } 170 | 171 | void CButtonUI::SetPushedTextColor(DWORD dwColor) 172 | { 173 | m_dwPushedTextColor = dwColor; 174 | } 175 | 176 | DWORD CButtonUI::GetPushedTextColor() const 177 | { 178 | return m_dwPushedTextColor; 179 | } 180 | 181 | void CButtonUI::SetPushedBKColor(DWORD dwColor) 182 | { 183 | m_dwPushedBKColor=dwColor; 184 | } 185 | 186 | DWORD CButtonUI::GetPushedBKColor() 187 | { 188 | return m_dwPushedBKColor; 189 | } 190 | 191 | void CButtonUI::SetFocusedTextColor(DWORD dwColor) 192 | { 193 | m_dwFocusedTextColor = dwColor; 194 | } 195 | 196 | DWORD CButtonUI::GetFocusedTextColor() const 197 | { 198 | return m_dwFocusedTextColor; 199 | } 200 | 201 | LPCTSTR CButtonUI::GetNormalImage() 202 | { 203 | return m_sNormalImage; 204 | } 205 | 206 | void CButtonUI::SetNormalImage(LPCTSTR pStrImage) 207 | { 208 | m_sNormalImage = pStrImage; 209 | Invalidate(); 210 | } 211 | 212 | LPCTSTR CButtonUI::GetHotImage() 213 | { 214 | return m_sHotImage; 215 | } 216 | 217 | void CButtonUI::SetHotImage(LPCTSTR pStrImage) 218 | { 219 | m_sHotImage = pStrImage; 220 | Invalidate(); 221 | } 222 | 223 | LPCTSTR CButtonUI::GetPushedImage() 224 | { 225 | return m_sPushedImage; 226 | } 227 | 228 | void CButtonUI::SetPushedImage(LPCTSTR pStrImage) 229 | { 230 | m_sPushedImage = pStrImage; 231 | Invalidate(); 232 | } 233 | 234 | LPCTSTR CButtonUI::GetFocusedImage() 235 | { 236 | return m_sFocusedImage; 237 | } 238 | 239 | void CButtonUI::SetFocusedImage(LPCTSTR pStrImage) 240 | { 241 | m_sFocusedImage = pStrImage; 242 | Invalidate(); 243 | } 244 | 245 | LPCTSTR CButtonUI::GetDisabledImage() 246 | { 247 | return m_sDisabledImage; 248 | } 249 | 250 | void CButtonUI::SetDisabledImage(LPCTSTR pStrImage) 251 | { 252 | m_sDisabledImage = pStrImage; 253 | Invalidate(); 254 | } 255 | 256 | //************************************ 257 | // Method: GetForeImage 258 | // FullName: CButtonUI::GetForeImage 259 | // Access: public 260 | // Returns: LPCTSTR 261 | // Qualifier: 262 | // Note: 263 | //************************************ 264 | LPCTSTR CButtonUI::GetForeImage() 265 | { 266 | return m_sForeImage; 267 | } 268 | 269 | //************************************ 270 | // Method: SetForeImage 271 | // FullName: CButtonUI::SetForeImage 272 | // Access: public 273 | // Returns: void 274 | // Qualifier: 275 | // Parameter: LPCTSTR pStrImage 276 | // Note: 277 | //************************************ 278 | void CButtonUI::SetForeImage( LPCTSTR pStrImage ) 279 | { 280 | m_sForeImage = pStrImage; 281 | Invalidate(); 282 | } 283 | 284 | //************************************ 285 | // Method: GetHotForeImage 286 | // FullName: CButtonUI::GetHotForeImage 287 | // Access: public 288 | // Returns: LPCTSTR 289 | // Qualifier: 290 | // Note: 291 | //************************************ 292 | LPCTSTR CButtonUI::GetHotForeImage() 293 | { 294 | return m_sHotForeImage; 295 | } 296 | 297 | //************************************ 298 | // Method: SetHotForeImage 299 | // FullName: CButtonUI::SetHotForeImage 300 | // Access: public 301 | // Returns: void 302 | // Qualifier: 303 | // Parameter: LPCTSTR pStrImage 304 | // Note: 305 | //************************************ 306 | void CButtonUI::SetHotForeImage( LPCTSTR pStrImage ) 307 | { 308 | m_sHotForeImage = pStrImage; 309 | Invalidate(); 310 | } 311 | 312 | SIZE CButtonUI::EstimateSize(SIZE szAvailable) 313 | { 314 | if( m_cxyFixed.cy == 0 ) return CSize(m_cxyFixed.cx, m_pManager->GetFontInfo(GetFont())->tm.tmHeight + 8); 315 | return CControlUI::EstimateSize(szAvailable); 316 | } 317 | 318 | void CButtonUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 319 | { 320 | if( _tcscmp(pstrName, _T("normalimage")) == 0 ) SetNormalImage(pstrValue); 321 | else if( _tcscmp(pstrName, _T("hotimage")) == 0 ) SetHotImage(pstrValue); 322 | else if( _tcscmp(pstrName, _T("pushedimage")) == 0 ) SetPushedImage(pstrValue); 323 | else if( _tcscmp(pstrName, _T("focusedimage")) == 0 ) SetFocusedImage(pstrValue); 324 | else if( _tcscmp(pstrName, _T("disabledimage")) == 0 ) SetDisabledImage(pstrValue); 325 | else if( _tcscmp(pstrName, _T("foreimage")) == 0 ) SetForeImage(pstrValue); 326 | else if( _tcscmp(pstrName, _T("hotforeimage")) == 0 ) SetHotForeImage(pstrValue); 327 | else if( _tcscmp(pstrName, _T("hotbkcolor")) == 0 ) 328 | { 329 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); 330 | LPTSTR pstr = NULL; 331 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); 332 | SetHotBkColor(clrColor); 333 | } 334 | else if( _tcscmp(pstrName, _T("hottextcolor")) == 0 ) 335 | { 336 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); 337 | LPTSTR pstr = NULL; 338 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); 339 | SetHotTextColor(clrColor); 340 | } 341 | else if( _tcscmp(pstrName, _T("pushedtextcolor")) == 0 ) 342 | { 343 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); 344 | LPTSTR pstr = NULL; 345 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); 346 | SetPushedTextColor(clrColor); 347 | } 348 | else if ( _tcscmp(pstrName, _T("pushedbkcolor")) == 0) 349 | { 350 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); 351 | LPTSTR pstr = NULL; 352 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); 353 | SetPushedBKColor(clrColor); 354 | } 355 | else if( _tcscmp(pstrName, _T("focusedtextcolor")) == 0 ) 356 | { 357 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); 358 | LPTSTR pstr = NULL; 359 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); 360 | SetFocusedTextColor(clrColor); 361 | } 362 | 363 | else CLabelUI::SetAttribute(pstrName, pstrValue); 364 | } 365 | 366 | void CButtonUI::PaintText(HDC hDC) 367 | { 368 | if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED; 369 | else m_uButtonState &= ~ UISTATE_FOCUSED; 370 | if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED; 371 | else m_uButtonState &= ~ UISTATE_DISABLED; 372 | 373 | if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor(); 374 | if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor(); 375 | 376 | if( m_sText.IsEmpty() ) return; 377 | int nLinks = 0; 378 | RECT rc = m_rcItem; 379 | rc.left += m_rcTextPadding.left; 380 | rc.right -= m_rcTextPadding.right; 381 | rc.top += m_rcTextPadding.top; 382 | rc.bottom -= m_rcTextPadding.bottom; 383 | 384 | DWORD clrColor = IsEnabled()?m_dwTextColor:m_dwDisabledTextColor; 385 | 386 | if( ((m_uButtonState & UISTATE_PUSHED) != 0) && (GetPushedTextColor() != 0) ) 387 | clrColor = GetPushedTextColor(); 388 | else if( ((m_uButtonState & UISTATE_HOT) != 0) && (GetHotTextColor() != 0) ) 389 | clrColor = GetHotTextColor(); 390 | else if( ((m_uButtonState & UISTATE_FOCUSED) != 0) && (GetFocusedTextColor() != 0) ) 391 | clrColor = GetFocusedTextColor(); 392 | 393 | if( m_bShowHtml ) 394 | CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, m_sText, clrColor, \ 395 | NULL, NULL, nLinks, m_uTextStyle); 396 | else 397 | CRenderEngine::DrawText(hDC, m_pManager, rc, m_sText, clrColor, \ 398 | m_iFont, m_uTextStyle); 399 | } 400 | 401 | void CButtonUI::PaintStatusImage(HDC hDC) 402 | { 403 | if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED; 404 | else m_uButtonState &= ~ UISTATE_FOCUSED; 405 | if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED; 406 | else m_uButtonState &= ~ UISTATE_DISABLED; 407 | 408 | if( (m_uButtonState & UISTATE_DISABLED) != 0 ) { 409 | if( !m_sDisabledImage.IsEmpty() ) 410 | { 411 | if( !DrawImage(hDC, (LPCTSTR)m_sDisabledImage) ) m_sDisabledImage.Empty(); 412 | else goto Label_ForeImage; 413 | } 414 | } 415 | else if( (m_uButtonState & UISTATE_PUSHED) != 0 ) 416 | { 417 | if( !m_sPushedImage.IsEmpty() ) 418 | { 419 | if( !DrawImage(hDC, (LPCTSTR)m_sPushedImage) ){ 420 | m_sPushedImage.Empty(); 421 | } 422 | if( !m_sPushedForeImage.IsEmpty() ) 423 | { 424 | if( !DrawImage(hDC, (LPCTSTR)m_sPushedForeImage) ) 425 | m_sPushedForeImage.Empty(); 426 | return; 427 | } 428 | 429 | else goto Label_ForeImage; 430 | } 431 | else if(m_dwPushedBKColor != 0) 432 | { 433 | CRenderEngine::DrawColor(hDC, m_rcPaint, GetAdjustColor(m_dwPushedBKColor)); 434 | return; 435 | } 436 | } 437 | else if( (m_uButtonState & UISTATE_HOT) != 0 ) { 438 | if( !m_sHotImage.IsEmpty() ) 439 | { 440 | if( !DrawImage(hDC, (LPCTSTR)m_sHotImage) ) 441 | { 442 | m_sHotImage.Empty(); 443 | } 444 | if( !m_sHotForeImage.IsEmpty() ) 445 | { 446 | if( !DrawImage(hDC, (LPCTSTR)m_sHotForeImage) ) 447 | m_sHotForeImage.Empty(); 448 | return; 449 | } 450 | else goto Label_ForeImage; 451 | } 452 | else if(m_dwHotBkColor != 0) { 453 | CRenderEngine::DrawColor(hDC, m_rcPaint, GetAdjustColor(m_dwHotBkColor)); 454 | return; 455 | } 456 | } 457 | else if( (m_uButtonState & UISTATE_FOCUSED) != 0 ) { 458 | if( !m_sFocusedImage.IsEmpty() ) { 459 | if( !DrawImage(hDC, (LPCTSTR)m_sFocusedImage) ) m_sFocusedImage.Empty(); 460 | else goto Label_ForeImage; 461 | } 462 | } 463 | 464 | if( !m_sNormalImage.IsEmpty() ) { 465 | if( !DrawImage(hDC, (LPCTSTR)m_sNormalImage) ) m_sNormalImage.Empty(); 466 | else goto Label_ForeImage; 467 | } 468 | 469 | if(!m_sForeImage.IsEmpty() ) 470 | goto Label_ForeImage; 471 | 472 | return; 473 | 474 | Label_ForeImage: 475 | if(!m_sForeImage.IsEmpty() ) { 476 | if( !DrawImage(hDC, (LPCTSTR)m_sForeImage) ) m_sForeImage.Empty(); 477 | } 478 | } 479 | } -------------------------------------------------------------------------------- /3rd/DuiLib/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 SetPushedBKColor(DWORD dwColor); 43 | DWORD GetPushedBKColor(); 44 | void SetFocusedTextColor(DWORD dwColor); 45 | DWORD GetFocusedTextColor() const; 46 | SIZE EstimateSize(SIZE szAvailable); 47 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 48 | 49 | void PaintText(HDC hDC); 50 | void PaintStatusImage(HDC hDC); 51 | 52 | protected: 53 | UINT m_uButtonState; 54 | BOOL m_bDBClickState; 55 | DWORD m_dwHotBkColor; 56 | DWORD m_dwPushedBKColor; 57 | DWORD m_dwHotTextColor; 58 | DWORD m_dwPushedTextColor; 59 | DWORD m_dwFocusedTextColor; 60 | 61 | CDuiString m_sNormalImage; 62 | CDuiString m_sHotImage; 63 | CDuiString m_sHotForeImage; 64 | CDuiString m_sPushedImage; 65 | CDuiString m_sPushedForeImage; 66 | CDuiString m_sFocusedImage; 67 | CDuiString m_sDisabledImage; 68 | }; 69 | 70 | } // namespace DuiLib 71 | 72 | #endif // __UIBUTTON_H__ -------------------------------------------------------------------------------- /3rd/DuiLib/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 | LPVOID CCheckBoxUI::GetInterface(LPCTSTR pstrName) 12 | { 13 | if (_tcscmp(pstrName, DUI_CTR_CHECKBOX) == 0) return static_cast(this); 14 | return COptionUI::GetInterface(pstrName); 15 | } 16 | 17 | void CCheckBoxUI::SetCheck(bool bCheck) 18 | { 19 | Selected(bCheck); 20 | } 21 | 22 | bool CCheckBoxUI::GetCheck() const 23 | { 24 | return IsSelected(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UICheckBox.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UICheckBox.h -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIColorPalette.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIColorPalette.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIColorPalette.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIColorPalette.h -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UICombo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UICombo.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/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 | -------------------------------------------------------------------------------- /3rd/DuiLib/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 | -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIComboBox.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIComboBox.h -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIDateTime.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIDateTime.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIDateTime.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIDateTime.h -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIEdit.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIEdit.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIEdit.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIEDIT_H__ 2 | #define __UIEDIT_H__ 3 | #include "stdafx.h" 4 | 5 | #pragma once 6 | 7 | namespace DuiLib 8 | { 9 | class CEditWnd; 10 | 11 | class UILIB_API CEditUI : public CLabelUI 12 | { 13 | friend class CEditWnd; 14 | public: 15 | CEditUI(); 16 | 17 | LPCTSTR GetClass() const; 18 | LPVOID GetInterface(LPCTSTR pstrName); 19 | UINT GetControlFlags() const; 20 | 21 | void SetEnabled(bool bEnable = true); 22 | void SetText(LPCTSTR pstrText); 23 | void SetMaxChar(UINT uMax); 24 | UINT GetMaxChar(); 25 | void SetReadOnly(bool bReadOnly); 26 | bool IsReadOnly() const; 27 | void SetPasswordMode(bool bPasswordMode); 28 | bool IsPasswordMode() const; 29 | void SetPasswordChar(TCHAR cPasswordChar); 30 | TCHAR GetPasswordChar() const; 31 | void SetNumberOnly(bool bNumberOnly); 32 | bool IsNumberOnly() const; 33 | void SetFloatPointOnly(bool bFloatOnly); 34 | bool IsFloatPointOnly( ) const; 35 | int GetWindowStyls() const; 36 | 37 | LPCTSTR GetNormalImage(); 38 | void SetNormalImage(LPCTSTR pStrImage); 39 | LPCTSTR GetHotImage(); 40 | void SetHotImage(LPCTSTR pStrImage); 41 | LPCTSTR GetFocusedImage(); 42 | void SetFocusedImage(LPCTSTR pStrImage); 43 | LPCTSTR GetDisabledImage(); 44 | void SetDisabledImage(LPCTSTR pStrImage); 45 | void SetNativeEditBkColor(DWORD dwBkColor); 46 | DWORD GetNativeEditBkColor() const; 47 | 48 | void SetSel(long nStartChar, long nEndChar); 49 | void SetSelAll(); 50 | void SetReplaceSel(LPCTSTR lpszReplace); 51 | 52 | void SetPos(RECT rc); 53 | void SetVisible(bool bVisible = true); 54 | void SetInnerVisible(bool bVisible = true); 55 | SIZE EstimateSize(SIZE szAvailable); 56 | void DoEvent(TEventUI& event); 57 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 58 | 59 | void PaintStatusImage(HDC hDC); 60 | void PaintText(HDC hDC); 61 | 62 | protected: 63 | CEditWnd* m_pWindow; 64 | 65 | UINT m_uMaxChar; 66 | bool m_bReadOnly; 67 | bool m_bFloatPointOnly; 68 | bool m_bPasswordMode; 69 | TCHAR m_cPasswordChar; 70 | UINT m_uButtonState; 71 | CDuiString m_sNormalImage; 72 | CDuiString m_sHotImage; 73 | CDuiString m_sFocusedImage; 74 | CDuiString m_sDisabledImage; 75 | DWORD m_dwEditbkColor; 76 | unsigned int m_iWindowStyls; 77 | }; 78 | } 79 | #endif // __UIEDIT_H__ -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIFadeButton.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | #include "UIFadeButton.h" 3 | 4 | namespace DuiLib { 5 | 6 | //REGIST_DUICLASS(CFadeButtonUI); 7 | 8 | CFadeButtonUI::CFadeButtonUI() : CUIAnimation( &(*this) ), m_bMouseHove( FALSE ), m_bMouseLeave( FALSE ) 9 | { 10 | } 11 | 12 | CFadeButtonUI::~CFadeButtonUI() 13 | { 14 | StopAnimation(); 15 | } 16 | 17 | LPCTSTR CFadeButtonUI::GetClass() const 18 | { 19 | return _T("FadeButtonUI"); 20 | } 21 | 22 | LPVOID CFadeButtonUI::GetInterface(LPCTSTR pstrName) 23 | { 24 | if( _tcscmp(pstrName, _T("FadeButton")) == 0 ) 25 | return static_cast(this); 26 | return CButtonUI::GetInterface(pstrName); 27 | } 28 | 29 | void CFadeButtonUI::SetNormalImage(LPCTSTR pStrImage) 30 | { 31 | m_sNormalImage = pStrImage; 32 | m_sLastImage = m_sNormalImage; 33 | } 34 | 35 | void CFadeButtonUI::DoEvent(TEventUI& event) 36 | { 37 | if( event.Type == UIEVENT_MOUSEENTER && !IsAnimationRunning( FADE_IN_ID ) ) 38 | { 39 | m_bFadeAlpha = 0; 40 | m_bMouseHove = TRUE; 41 | StopAnimation( FADE_OUT_ID ); 42 | StartAnimation( FADE_ELLAPSE, FADE_FRAME_COUNT, FADE_IN_ID ); 43 | Invalidate(); 44 | return; 45 | } 46 | if( event.Type == UIEVENT_MOUSELEAVE && !IsAnimationRunning( FADE_OUT_ID ) ) 47 | { 48 | m_bFadeAlpha = 0; 49 | m_bMouseLeave = TRUE; 50 | StopAnimation(FADE_IN_ID); 51 | StartAnimation(FADE_ELLAPSE, FADE_FRAME_COUNT, FADE_OUT_ID); 52 | Invalidate(); 53 | return; 54 | } 55 | if( event.Type == UIEVENT_TIMER ) 56 | { 57 | OnTimer( event.wParam ); 58 | } 59 | CButtonUI::DoEvent( event ); 60 | } 61 | 62 | void CFadeButtonUI::OnTimer( int nTimerID ) 63 | { 64 | OnAnimationElapse( nTimerID ); 65 | } 66 | 67 | void CFadeButtonUI::PaintStatusImage(HDC hDC) 68 | { 69 | if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED; 70 | else m_uButtonState &= ~ UISTATE_FOCUSED; 71 | if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED; 72 | else m_uButtonState &= ~ UISTATE_DISABLED; 73 | 74 | if( (m_uButtonState & UISTATE_DISABLED) != 0 ) { 75 | if( !m_sDisabledImage.IsEmpty() ) { 76 | if( !DrawImage(hDC, (LPCTSTR)m_sDisabledImage) ) m_sDisabledImage.Empty(); 77 | else return; 78 | } 79 | } 80 | else if( (m_uButtonState & UISTATE_PUSHED) != 0 ) { 81 | if( !m_sPushedImage.IsEmpty() ) { 82 | if( !DrawImage(hDC, (LPCTSTR)m_sPushedImage) ) m_sPushedImage.Empty(); 83 | else return; 84 | } 85 | } 86 | else if( (m_uButtonState & UISTATE_FOCUSED) != 0 ) { 87 | if( !m_sFocusedImage.IsEmpty() ) { 88 | if( !DrawImage(hDC, (LPCTSTR)m_sFocusedImage) ) m_sFocusedImage.Empty(); 89 | else return; 90 | } 91 | } 92 | 93 | if( !m_sNormalImage.IsEmpty() ) { 94 | if( IsAnimationRunning(FADE_IN_ID) || IsAnimationRunning(FADE_OUT_ID)) 95 | { 96 | if( m_bMouseHove ) 97 | { 98 | m_bMouseHove = FALSE; 99 | m_sLastImage = m_sHotImage; 100 | if( !DrawImage(hDC, (LPCTSTR)m_sNormalImage) ) 101 | m_sNormalImage.Empty(); 102 | return; 103 | } 104 | 105 | if( m_bMouseLeave ) 106 | { 107 | m_bMouseLeave = FALSE; 108 | m_sLastImage = m_sNormalImage; 109 | if( !DrawImage(hDC, (LPCTSTR)m_sHotImage) ) 110 | m_sHotImage.Empty(); 111 | return; 112 | } 113 | 114 | m_sOldImage = m_sNormalImage; 115 | m_sNewImage = m_sHotImage; 116 | if( IsAnimationRunning(FADE_OUT_ID) ) 117 | { 118 | m_sOldImage = m_sHotImage; 119 | m_sNewImage = m_sNormalImage; 120 | } 121 | 122 | if( !DrawImage(hDC, (LPCTSTR)m_sOldImage, NULL, true, 255 - m_bFadeAlpha ) ) 123 | m_sOldImage.Empty(); 124 | if( !DrawImage(hDC, (LPCTSTR)m_sNewImage, NULL, true, m_bFadeAlpha ) ) 125 | m_sNewImage.Empty(); 126 | return; 127 | } 128 | else 129 | { 130 | if( !DrawImage(hDC, (LPCTSTR)m_sLastImage) ) 131 | m_sLastImage.Empty(); 132 | return; 133 | } 134 | } 135 | } 136 | 137 | void CFadeButtonUI::OnAnimationStep(INT nTotalFrame, INT nCurFrame, INT nAnimationID) 138 | { 139 | m_bFadeAlpha = (BYTE)((nCurFrame / (double)nTotalFrame) * 255); 140 | m_bFadeAlpha = m_bFadeAlpha == 0?10:m_bFadeAlpha; 141 | Invalidate(); 142 | } 143 | 144 | } // namespace DuiLib -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIFadeButton.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIFADEBUTTON_H__ 2 | #define __UIFADEBUTTON_H__ 3 | 4 | #include "UIAnimation.h" 5 | #include "UIButton.h" 6 | 7 | #pragma once 8 | 9 | namespace DuiLib { 10 | 11 | class UILIB_API CFadeButtonUI : public CButtonUI, public CUIAnimation 12 | { 13 | public: 14 | CFadeButtonUI(); 15 | virtual ~CFadeButtonUI(); 16 | 17 | LPCTSTR GetClass() const; 18 | LPVOID GetInterface(LPCTSTR pstrName); 19 | void SetNormalImage(LPCTSTR pStrImage); 20 | 21 | void DoEvent(TEventUI& event); 22 | void OnTimer( int nTimerID ); 23 | void PaintStatusImage(HDC hDC); 24 | 25 | virtual void OnAnimationStart(INT nAnimationID, BOOL bFirstLoop) {} 26 | virtual void OnAnimationStep(INT nTotalFrame, INT nCurFrame, INT nAnimationID); 27 | virtual void OnAnimationStop(INT nAnimationID) {} 28 | 29 | protected: 30 | CDuiString m_sOldImage; 31 | CDuiString m_sNewImage; 32 | CDuiString m_sLastImage; 33 | BYTE m_bFadeAlpha; 34 | BOOL m_bMouseHove; 35 | BOOL m_bMouseLeave; 36 | enum{ 37 | FADE_IN_ID = 8, 38 | FADE_OUT_ID = 9, 39 | 40 | FADE_ELLAPSE = 10, 41 | FADE_FRAME_COUNT = 30, 42 | }; 43 | }; 44 | 45 | } // namespace UiLib 46 | 47 | #endif // __UIFADEBUTTON_H__ -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIFlash.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIFlash.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIFlash.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIFlash.h -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIHyperlink.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | #include "UIHyperlink.h" 3 | 4 | 5 | namespace DuiLib{ 6 | 7 | CHyperLinkUI::CHyperLinkUI() 8 | { 9 | } 10 | 11 | CHyperLinkUI::~CHyperLinkUI() 12 | { 13 | 14 | } 15 | LPCTSTR CHyperLinkUI::GetClass() const 16 | { 17 | return _T("HyperLinkUI"); 18 | } 19 | LPVOID CHyperLinkUI::GetInterface(LPCTSTR pstrName) 20 | { 21 | if (_tcscmp(pstrName, DUI_CTR_HYPERLINK) == 0) return static_cast(this); 22 | return CButtonUI::GetInterface(pstrName); 23 | 24 | } 25 | void CHyperLinkUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 26 | { 27 | } 28 | 29 | void CHyperLinkUI::SetPos(RECT rc) 30 | { 31 | 32 | } 33 | void CHyperLinkUI::DoInit() 34 | { 35 | 36 | } 37 | void CHyperLinkUI::DoEvent(TEventUI& event) 38 | { 39 | 40 | } 41 | void CHyperLinkUI::DoPaint(HDC hDC, const RECT& rcPaint) 42 | { 43 | 44 | } 45 | 46 | 47 | } -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIHyperlink.h: -------------------------------------------------------------------------------- 1 | #ifndef UI_HYPERLINK_H 2 | #define UI_HYPERLINK_H 3 | #pragma once 4 | 5 | 6 | namespace DuiLib{ 7 | 8 | 9 | class UILIB_API CHyperLinkUI : public CButtonUI 10 | { 11 | public: 12 | CHyperLinkUI(); 13 | virtual ~CHyperLinkUI(); 14 | 15 | 16 | virtual LPCTSTR GetClass() const; 17 | virtual LPVOID GetInterface(LPCTSTR pstrName); 18 | virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 19 | 20 | virtual void SetPos(RECT rc); 21 | virtual void DoInit(); 22 | virtual void DoEvent(TEventUI& event); 23 | virtual void DoPaint(HDC hDC, const RECT& rcPaint); 24 | 25 | 26 | 27 | 28 | 29 | 30 | }; 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | } 52 | 53 | 54 | #endif -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIIpAddress.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIIpAddress.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIIpAddress.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIIpAddress.h -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UILabel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UILabel.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UILabel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UILabel.h -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIList.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIList.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIList.h -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIMediaPlayer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIMediaPlayer.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIMediaPlayer.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIMEDIAPLAYER_H_ 2 | #define __UIMEDIAPLAYER_H_ 3 | 4 | #pragma once 5 | #include 6 | //class CActiveXCtrl; 7 | //class CActiveXUI; 8 | #include "../Utils/wmp.tlh" 9 | 10 | namespace DuiLib 11 | { 12 | class UILIB_API CMediaPlayerUI :public CActiveXUI 13 | { 14 | public: 15 | CMediaPlayerUI( ); 16 | virtual ~CMediaPlayerUI( ); 17 | 18 | 19 | virtual LPCTSTR GetClass( ) const; 20 | virtual LPVOID GetInterface(LPCTSTR pstrName); 21 | virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 22 | 23 | virtual void SetVisible(bool bVisible = true); 24 | virtual void SetInnerVisible(bool bVisible = true); 25 | virtual bool DoCreateControl( ); 26 | virtual void ReleaseControl( ); 27 | 28 | virtual bool CreateControl(const CLSID clsid); 29 | virtual void SetDelayCreate(bool bDelayCreate); 30 | 31 | public: 32 | bool Play(LPCWSTR pszUrl); 33 | void SetVolume(long value); 34 | long GetVolume( ); 35 | protected: 36 | 37 | CDuiString m_strUrl; 38 | CComQIPtr wmp_; 39 | private: 40 | long m_volume; 41 | }; 42 | 43 | 44 | } 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /3rd/DuiLib/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), m_dwSelectedBkColor(0xFFE6E6E6) 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 | LPCTSTR COptionUI::GetSelectedHotImage() 124 | { 125 | return m_sSelectedHotImage; 126 | } 127 | 128 | void COptionUI::SetSelectedHotImage( LPCTSTR pStrImage ) 129 | { 130 | m_sSelectedHotImage = pStrImage; 131 | Invalidate(); 132 | } 133 | LPCTSTR COptionUI::GetSelectedPushedImage() 134 | { 135 | return m_sSelectedPushedImage; 136 | } 137 | 138 | void COptionUI::SetSelectedPushedImage(LPCTSTR pStrImage) 139 | { 140 | m_sSelectedPushedImage = pStrImage; 141 | Invalidate(); 142 | } 143 | void COptionUI::SetSelectedTextColor(DWORD dwTextColor) 144 | { 145 | m_dwSelectedTextColor = dwTextColor; 146 | } 147 | 148 | DWORD COptionUI::GetSelectedTextColor() 149 | { 150 | if (m_dwSelectedTextColor == 0) m_dwSelectedTextColor = m_pManager->GetDefaultFontColor(); 151 | return m_dwSelectedTextColor; 152 | } 153 | 154 | void COptionUI::SetSelectedBkColor( DWORD dwBkColor ) 155 | { 156 | m_dwSelectedBkColor = dwBkColor; 157 | } 158 | 159 | DWORD COptionUI::GetSelectBkColor() 160 | { 161 | return m_dwSelectedBkColor; 162 | } 163 | 164 | LPCTSTR COptionUI::GetForeImage() 165 | { 166 | return m_sForeImage; 167 | } 168 | 169 | void COptionUI::SetForeImage(LPCTSTR pStrImage) 170 | { 171 | m_sForeImage = pStrImage; 172 | Invalidate(); 173 | } 174 | 175 | SIZE COptionUI::EstimateSize(SIZE szAvailable) 176 | { 177 | if( m_cxyFixed.cy == 0 ) return CSize(m_cxyFixed.cx, m_pManager->GetFontInfo(GetFont())->tm.tmHeight + 8); 178 | return CControlUI::EstimateSize(szAvailable); 179 | } 180 | 181 | void COptionUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 182 | { 183 | if( _tcscmp(pstrName, _T("group")) == 0 ) SetGroup(pstrValue); 184 | else if( _tcscmp(pstrName, _T("selected")) == 0 ) Selected(_tcscmp(pstrValue, _T("true")) == 0); 185 | else if( _tcscmp(pstrName, _T("selectedimage")) == 0 ) SetSelectedImage(pstrValue); 186 | else if( _tcscmp(pstrName, _T("selectedhotimage")) == 0 ) SetSelectedHotImage(pstrValue); 187 | else if( _tcscmp(pstrName, _T("selectedpushedimage")) == 0 ) SetSelectedPushedImage(pstrValue); 188 | // else if( _tcscmp(pstrName, _T("foreimage")) == 0 ) SetForeImage(pstrValue); 189 | else if( _tcscmp(pstrName, _T("selectedbkcolor")) == 0 ) { 190 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); 191 | LPTSTR pstr = NULL; 192 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); 193 | SetSelectedBkColor(clrColor); 194 | } 195 | else if( _tcscmp(pstrName, _T("selectedtextcolor")) == 0 ) { 196 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); 197 | LPTSTR pstr = NULL; 198 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); 199 | SetSelectedTextColor(clrColor); 200 | } 201 | else CButtonUI::SetAttribute(pstrName, pstrValue); 202 | } 203 | 204 | void COptionUI::PaintStatusImage(HDC hDC) 205 | { 206 | 207 | if (IsSelected()) 208 | { 209 | 210 | if( (m_uButtonState & UISTATE_PUSHED) != 0 && !m_sSelectedPushedImage.IsEmpty()) { 211 | if( !DrawImage(hDC, (LPCTSTR)m_sSelectedPushedImage) ) 212 | m_sSelectedPushedImage.Empty(); 213 | else goto Label_ForeImage; 214 | } 215 | else if( (m_uButtonState & UISTATE_HOT) != 0 && !m_sSelectedHotImage.IsEmpty()) { 216 | if( !DrawImage(hDC, (LPCTSTR)m_sSelectedHotImage) ) 217 | m_sSelectedHotImage.Empty(); 218 | else goto Label_ForeImage; 219 | } 220 | else if( (m_uButtonState & UISTATE_SELECTED) != 0 ) 221 | { 222 | if( !m_sSelectedImage.IsEmpty() ) 223 | { 224 | if( !DrawImage(hDC, (LPCTSTR)m_sSelectedImage) ) m_sSelectedImage.Empty(); 225 | else goto Label_ForeImage; 226 | } 227 | else if(m_dwSelectedBkColor != 0) 228 | { 229 | CRenderEngine::DrawColor(hDC, m_rcPaint, GetAdjustColor(m_dwSelectedBkColor)); 230 | return; 231 | } 232 | } 233 | 234 | } 235 | 236 | 237 | CButtonUI::PaintStatusImage(hDC); 238 | 239 | Label_ForeImage: 240 | if( !m_sForeImage.IsEmpty() ) { 241 | if( !DrawImage(hDC, (LPCTSTR)m_sForeImage) ) m_sForeImage.Empty(); 242 | } 243 | } 244 | 245 | void COptionUI::PaintText(HDC hDC) 246 | { 247 | if( (m_uButtonState & UISTATE_SELECTED) != 0 ) 248 | { 249 | DWORD oldTextColor = m_dwTextColor; 250 | if( m_dwSelectedTextColor != 0 ) m_dwTextColor = m_dwSelectedTextColor; 251 | 252 | if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor(); 253 | if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor(); 254 | 255 | if( m_sText.IsEmpty() ) return; 256 | int nLinks = 0; 257 | RECT rc = m_rcItem; 258 | rc.left += m_rcTextPadding.left; 259 | rc.right -= m_rcTextPadding.right; 260 | rc.top += m_rcTextPadding.top; 261 | rc.bottom -= m_rcTextPadding.bottom; 262 | 263 | if( m_bShowHtml ) 264 | CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, m_sText, IsEnabled()?m_dwTextColor:m_dwDisabledTextColor, \ 265 | NULL, NULL, nLinks, m_uTextStyle); 266 | else 267 | CRenderEngine::DrawText(hDC, m_pManager, rc, m_sText, IsEnabled()?m_dwTextColor:m_dwDisabledTextColor, \ 268 | m_iFont, m_uTextStyle); 269 | 270 | m_dwTextColor = oldTextColor; 271 | } 272 | else 273 | CButtonUI::PaintText(hDC); 274 | } 275 | } -------------------------------------------------------------------------------- /3rd/DuiLib/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 | LPCTSTR GetSelectedPushedImage(); 32 | void SetSelectedPushedImage(LPCTSTR pStrImage); 33 | 34 | void SetSelectedBkColor(DWORD dwBkColor); 35 | DWORD GetSelectBkColor(); 36 | 37 | LPCTSTR GetForeImage(); 38 | void SetForeImage(LPCTSTR pStrImage); 39 | 40 | LPCTSTR GetGroup() const; 41 | void SetGroup(LPCTSTR pStrGroupName = NULL); 42 | bool IsSelected() const; 43 | virtual void Selected(bool bSelected); 44 | 45 | SIZE EstimateSize(SIZE szAvailable); 46 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 47 | 48 | void PaintStatusImage(HDC hDC); 49 | void PaintText(HDC hDC); 50 | 51 | protected: 52 | bool m_bSelected; 53 | CDuiString m_sGroupName; 54 | 55 | DWORD m_dwSelectedBkColor; 56 | DWORD m_dwSelectedTextColor; 57 | 58 | CDuiString m_sSelectedImage; 59 | CDuiString m_sSelectedHotImage; 60 | CDuiString m_sSelectedPushedImage; 61 | CDuiString m_sForeImage; 62 | }; 63 | 64 | } // namespace DuiLib 65 | 66 | #endif // __UIOPTION_H__ -------------------------------------------------------------------------------- /3rd/DuiLib/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 | if(nValue == m_nValue || nValue m_nMax) 66 | { 67 | return; 68 | } 69 | m_nValue = nValue; 70 | Invalidate(); 71 | } 72 | 73 | LPCTSTR CProgressUI::GetForeImage() const 74 | { 75 | return m_sForeImage; 76 | } 77 | 78 | void CProgressUI::SetForeImage(LPCTSTR pStrImage) 79 | { 80 | if( m_sForeImage == pStrImage ) return; 81 | 82 | m_sForeImage = pStrImage; 83 | Invalidate(); 84 | } 85 | 86 | void CProgressUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 87 | { 88 | if( _tcscmp(pstrName, _T("foreimage")) == 0 ) SetForeImage(pstrValue); 89 | else if( _tcscmp(pstrName, _T("hor")) == 0 ) SetHorizontal(_tcscmp(pstrValue, _T("true")) == 0); 90 | else if( _tcscmp(pstrName, _T("min")) == 0 ) SetMinValue(_ttoi(pstrValue)); 91 | else if( _tcscmp(pstrName, _T("max")) == 0 ) SetMaxValue(_ttoi(pstrValue)); 92 | else if( _tcscmp(pstrName, _T("value")) == 0 ) SetValue(_ttoi(pstrValue)); 93 | else if( _tcscmp(pstrName, _T("isstretchfore"))==0) SetStretchForeImage(_tcscmp(pstrValue, _T("true")) == 0? true : false); 94 | else CLabelUI::SetAttribute(pstrName, pstrValue); 95 | } 96 | 97 | void CProgressUI::PaintStatusImage(HDC hDC) 98 | { 99 | if( m_nMax <= m_nMin ) m_nMax = m_nMin + 1; 100 | if( m_nValue > m_nMax ) m_nValue = m_nMax; 101 | if( m_nValue < m_nMin ) m_nValue = m_nMin; 102 | 103 | RECT rc = {0}; 104 | if( m_bHorizontal ) { 105 | rc.right = (m_nValue - m_nMin) * (m_rcItem.right - m_rcItem.left) / (m_nMax - m_nMin); 106 | rc.bottom = m_rcItem.bottom - m_rcItem.top; 107 | } 108 | else { 109 | rc.top = (m_rcItem.bottom - m_rcItem.top) * (m_nMax - m_nValue) / (m_nMax - m_nMin); 110 | rc.right = m_rcItem.right - m_rcItem.left; 111 | rc.bottom = m_rcItem.bottom - m_rcItem.top; 112 | } 113 | 114 | if( !m_sForeImage.IsEmpty() ) { 115 | m_sForeImageModify.Empty(); 116 | if (m_bStretchForeImage) 117 | m_sForeImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rc.left, rc.top, rc.right, rc.bottom); 118 | else 119 | m_sForeImageModify.SmallFormat(_T("dest='%d,%d,%d,%d' source='%d,%d,%d,%d'") 120 | , rc.left, rc.top, rc.right, rc.bottom 121 | , rc.left, rc.top, rc.right, rc.bottom); 122 | 123 | if( !DrawImage(hDC, (LPCTSTR)m_sForeImage, (LPCTSTR)m_sForeImageModify) ) m_sForeImage.Empty(); 124 | else return; 125 | } 126 | } 127 | 128 | bool CProgressUI::IsStretchForeImage() 129 | { 130 | return m_bStretchForeImage; 131 | } 132 | 133 | void CProgressUI::SetStretchForeImage( bool bStretchForeImage /*= true*/ ) 134 | { 135 | if (m_bStretchForeImage==bStretchForeImage) return; 136 | m_bStretchForeImage=bStretchForeImage; 137 | Invalidate(); 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /3rd/DuiLib/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 | -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIRichEdit.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIRichEdit.h -------------------------------------------------------------------------------- /3rd/DuiLib/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 | void SetScrollBarSize(int nScrollBarSize); 32 | int GetScrollBarSize( ) const; 33 | 34 | bool GetShowButton1(); 35 | void SetShowButton1(bool bShow); 36 | LPCTSTR GetButton1NormalImage(); 37 | void SetButton1NormalImage(LPCTSTR pStrImage); 38 | LPCTSTR GetButton1HotImage(); 39 | void SetButton1HotImage(LPCTSTR pStrImage); 40 | LPCTSTR GetButton1PushedImage(); 41 | void SetButton1PushedImage(LPCTSTR pStrImage); 42 | LPCTSTR GetButton1DisabledImage(); 43 | void SetButton1DisabledImage(LPCTSTR pStrImage); 44 | 45 | bool GetShowButton2(); 46 | void SetShowButton2(bool bShow); 47 | LPCTSTR GetButton2NormalImage(); 48 | void SetButton2NormalImage(LPCTSTR pStrImage); 49 | LPCTSTR GetButton2HotImage(); 50 | void SetButton2HotImage(LPCTSTR pStrImage); 51 | LPCTSTR GetButton2PushedImage(); 52 | void SetButton2PushedImage(LPCTSTR pStrImage); 53 | LPCTSTR GetButton2DisabledImage(); 54 | void SetButton2DisabledImage(LPCTSTR pStrImage); 55 | 56 | LPCTSTR GetThumbNormalImage(); 57 | void SetThumbNormalImage(LPCTSTR pStrImage); 58 | LPCTSTR GetThumbHotImage(); 59 | void SetThumbHotImage(LPCTSTR pStrImage); 60 | LPCTSTR GetThumbPushedImage(); 61 | void SetThumbPushedImage(LPCTSTR pStrImage); 62 | LPCTSTR GetThumbDisabledImage(); 63 | void SetThumbDisabledImage(LPCTSTR pStrImage); 64 | 65 | LPCTSTR GetRailNormalImage(); 66 | void SetRailNormalImage(LPCTSTR pStrImage); 67 | LPCTSTR GetRailHotImage(); 68 | void SetRailHotImage(LPCTSTR pStrImage); 69 | LPCTSTR GetRailPushedImage(); 70 | void SetRailPushedImage(LPCTSTR pStrImage); 71 | LPCTSTR GetRailDisabledImage(); 72 | void SetRailDisabledImage(LPCTSTR pStrImage); 73 | 74 | LPCTSTR GetBkNormalImage(); 75 | void SetBkNormalImage(LPCTSTR pStrImage); 76 | LPCTSTR GetBkHotImage(); 77 | void SetBkHotImage(LPCTSTR pStrImage); 78 | LPCTSTR GetBkPushedImage(); 79 | void SetBkPushedImage(LPCTSTR pStrImage); 80 | LPCTSTR GetBkDisabledImage(); 81 | void SetBkDisabledImage(LPCTSTR pStrImage); 82 | 83 | void SetPos(RECT rc); 84 | void DoEvent(TEventUI& event); 85 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 86 | 87 | void DoPaint(HDC hDC, const RECT& rcPaint); 88 | 89 | void PaintBk(HDC hDC); 90 | void PaintButton1(HDC hDC); 91 | void PaintButton2(HDC hDC); 92 | void PaintThumb(HDC hDC); 93 | void PaintRail(HDC hDC); 94 | 95 | protected: 96 | 97 | enum 98 | { 99 | DEFAULT_SCROLLBAR_SIZE = 16, 100 | DEFAULT_TIMERID = 10, 101 | }; 102 | 103 | bool m_bHorizontal; 104 | int m_nRange; 105 | int m_nScrollPos; 106 | int m_nLineSize; 107 | int m_nScrollBarSize; 108 | CContainerUI* m_pOwner; 109 | POINT ptLastMouse; 110 | int m_nLastScrollPos; 111 | int m_nLastScrollOffset; 112 | int m_nScrollRepeatDelay; 113 | 114 | CDuiString m_sBkNormalImage; 115 | CDuiString m_sBkHotImage; 116 | CDuiString m_sBkPushedImage; 117 | CDuiString m_sBkDisabledImage; 118 | 119 | bool m_bShowButton1; 120 | RECT m_rcButton1; 121 | UINT m_uButton1State; 122 | CDuiString m_sButton1NormalImage; 123 | CDuiString m_sButton1HotImage; 124 | CDuiString m_sButton1PushedImage; 125 | CDuiString m_sButton1DisabledImage; 126 | 127 | bool m_bShowButton2; 128 | RECT m_rcButton2; 129 | UINT m_uButton2State; 130 | CDuiString m_sButton2NormalImage; 131 | CDuiString m_sButton2HotImage; 132 | CDuiString m_sButton2PushedImage; 133 | CDuiString m_sButton2DisabledImage; 134 | 135 | RECT m_rcThumb; 136 | UINT m_uThumbState; 137 | CDuiString m_sThumbNormalImage; 138 | CDuiString m_sThumbHotImage; 139 | CDuiString m_sThumbPushedImage; 140 | CDuiString m_sThumbDisabledImage; 141 | 142 | CDuiString m_sRailNormalImage; 143 | CDuiString m_sRailHotImage; 144 | CDuiString m_sRailPushedImage; 145 | CDuiString m_sRailDisabledImage; 146 | 147 | CDuiString m_sImageModify; 148 | }; 149 | } 150 | 151 | #endif // __UISCROLLBAR_H__ -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UISlider.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UISlider.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/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 | void SetValue(int nValue); 35 | void SetSendMoveNotify(bool bCanSend); 36 | bool GetSendMoveNotify() const; 37 | protected: 38 | SIZE m_szThumb; 39 | UINT m_uButtonState; 40 | int m_nStep; 41 | 42 | CDuiString m_sThumbImage; 43 | CDuiString m_sThumbHotImage; 44 | CDuiString m_sThumbPushedImage; 45 | 46 | CDuiString m_sImageModify; 47 | bool m_bSendMoveNotify; 48 | }; 49 | } 50 | 51 | #endif // __UISLIDER_H__ -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIText.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIText.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/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__ -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UITreeView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UITreeView.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/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 | public: 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 | -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIWebBrowser.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIWebBrowser.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Control/UIWebBrowser.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Control/UIWebBrowser.h -------------------------------------------------------------------------------- /3rd/DuiLib/Core/UIBase.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Core/UIBase.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Core/UIBase.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Core/UIBase.h -------------------------------------------------------------------------------- /3rd/DuiLib/Core/UIContainer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Core/UIContainer.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Core/UIContainer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Core/UIContainer.h -------------------------------------------------------------------------------- /3rd/DuiLib/Core/UIControl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Core/UIControl.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Core/UIControl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Core/UIControl.h -------------------------------------------------------------------------------- /3rd/DuiLib/Core/UIDefine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Core/UIDefine.h -------------------------------------------------------------------------------- /3rd/DuiLib/Core/UIDlgBuilder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Core/UIDlgBuilder.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/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 | -------------------------------------------------------------------------------- /3rd/DuiLib/Core/UIManager.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Core/UIManager.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Core/UIManager.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Core/UIManager.h -------------------------------------------------------------------------------- /3rd/DuiLib/Core/UIMarkup.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Core/UIMarkup.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/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 | -------------------------------------------------------------------------------- /3rd/DuiLib/Core/UIRender.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Core/UIRender.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Core/UIRender.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Core/UIRender.h -------------------------------------------------------------------------------- /3rd/DuiLib/DuiLib.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {232caa65-5221-4dde-aa8e-9862603c7d36} 6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 7 | 8 | 9 | {6c3a96cf-d302-478e-9e48-20c5eae9aa58} 10 | 11 | 12 | {727448b4-96a0-4ec1-ab77-6c526cc765ae} 13 | 14 | 15 | {712affb0-7fb0-42c4-9b32-dad40622bb71} 16 | 17 | 18 | {b5e5b016-2160-43a3-9e2f-c800551b5cdb} 19 | 20 | 21 | {0bc8d500-59a9-48f4-b0f9-da5a7a403519} 22 | h;hpp;hxx;hm;inl 23 | 24 | 25 | {4c34ae14-e140-4a40-8d93-ff4a437975b5} 26 | 27 | 28 | {8299d41f-a73e-446a-8e63-510771cc9238} 29 | 30 | 31 | {e89aa122-b91d-4fe9-ad7c-e133e3d68661} 32 | 33 | 34 | {767d5bd7-b5a5-4906-8540-b4f58bc00d0a} 35 | 36 | 37 | {f594f485-57c2-4ab3-8fef-368387bf3e38} 38 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 39 | 40 | 41 | {0f7b3766-91c9-434c-8178-a1dc3f8db247} 42 | 43 | 44 | {2bb8fe18-a99e-47ab-b40a-a34f0c8a5ec9} 45 | 46 | 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files\Utils 59 | 60 | 61 | Source Files\Utils 62 | 63 | 64 | Source Files\Utils 65 | 66 | 67 | Source Files\Core 68 | 69 | 70 | Source Files\Core 71 | 72 | 73 | Source Files\Core 74 | 75 | 76 | Source Files\Core 77 | 78 | 79 | Source Files\Core 80 | 81 | 82 | Source Files\Core 83 | 84 | 85 | Source Files\Core 86 | 87 | 88 | Source Files\Layout 89 | 90 | 91 | Source Files\Layout 92 | 93 | 94 | Source Files\Layout 95 | 96 | 97 | Source Files\Layout 98 | 99 | 100 | Source Files\Layout 101 | 102 | 103 | Source Files\Control 104 | 105 | 106 | Source Files\Control 107 | 108 | 109 | Source Files\Control 110 | 111 | 112 | Source Files\Control 113 | 114 | 115 | Source Files\Control 116 | 117 | 118 | Source Files\Control 119 | 120 | 121 | Source Files\Control 122 | 123 | 124 | Source Files\Control 125 | 126 | 127 | Source Files\Control 128 | 129 | 130 | Source Files\Control 131 | 132 | 133 | Source Files\Control 134 | 135 | 136 | Source Files\Control 137 | 138 | 139 | Source Files\Control 140 | 141 | 142 | Source Files\Control 143 | 144 | 145 | Source Files\Control 146 | 147 | 148 | Source Files\Control 149 | 150 | 151 | Source Files\Control 152 | 153 | 154 | Source Files\Control 155 | 156 | 157 | Source Files\Control 158 | 159 | 160 | Source Files\Utils\Zip 161 | 162 | 163 | Source Files\Control 164 | 165 | 166 | Source Files\Control 167 | 168 | 169 | Source Files\Control 170 | 171 | 172 | Source Files\Control 173 | 174 | 175 | Source Files\Control 176 | 177 | 178 | 179 | 180 | Header Files 181 | 182 | 183 | Header Files 184 | 185 | 186 | Header Files\Utils 187 | 188 | 189 | Header Files\Utils 190 | 191 | 192 | Header Files\Utils 193 | 194 | 195 | Header Files\Utils 196 | 197 | 198 | Header Files\Utils 199 | 200 | 201 | Header Files\Utils 202 | 203 | 204 | Header Files\Core 205 | 206 | 207 | Header Files\Core 208 | 209 | 210 | Header Files\Core 211 | 212 | 213 | Header Files\Core 214 | 215 | 216 | Header Files\Core 217 | 218 | 219 | Header Files\Core 220 | 221 | 222 | Header Files\Core 223 | 224 | 225 | Header Files\Core 226 | 227 | 228 | Header Files\Layout 229 | 230 | 231 | Header Files\Layout 232 | 233 | 234 | Header Files\Layout 235 | 236 | 237 | Header Files\Layout 238 | 239 | 240 | Header Files\Layout 241 | 242 | 243 | Header Files\Control 244 | 245 | 246 | Header Files\Control 247 | 248 | 249 | Header Files\Control 250 | 251 | 252 | Header Files\Control 253 | 254 | 255 | Header Files\Control 256 | 257 | 258 | Header Files\Control 259 | 260 | 261 | Header Files\Control 262 | 263 | 264 | Header Files\Control 265 | 266 | 267 | Header Files\Control 268 | 269 | 270 | Header Files\Control 271 | 272 | 273 | Header Files\Control 274 | 275 | 276 | Header Files\Control 277 | 278 | 279 | Header Files\Control 280 | 281 | 282 | Header Files\Control 283 | 284 | 285 | Header Files\Control 286 | 287 | 288 | Header Files\Control 289 | 290 | 291 | Header Files\Control 292 | 293 | 294 | Header Files\Control 295 | 296 | 297 | Header Files\Control 298 | 299 | 300 | Header Files\Utils 301 | 302 | 303 | Header Files\Utils\zip 304 | 305 | 306 | Header Files\Utils\zip 307 | 308 | 309 | Header Files\Control 310 | 311 | 312 | Header Files\Control 313 | 314 | 315 | Header Files\Control 316 | 317 | 318 | Header Files\Control 319 | 320 | 321 | Header Files\Control 322 | 323 | 324 | Source Files\Utils 325 | 326 | 327 | -------------------------------------------------------------------------------- /3rd/DuiLib/DuiLib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /3rd/DuiLib/Ex/ShadowWindow.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Ex/ShadowWindow.h -------------------------------------------------------------------------------- /3rd/DuiLib/Layout/UIChildLayout.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "UIChildLayout.h" 3 | 4 | namespace DuiLib 5 | { 6 | CChildLayoutUI::CChildLayoutUI() 7 | { 8 | 9 | } 10 | 11 | LPCTSTR CChildLayoutUI::GetClass() const 12 | { 13 | return _T("ChildLayoutUI"); 14 | } 15 | 16 | LPVOID CChildLayoutUI::GetInterface( LPCTSTR pstrName ) 17 | { 18 | if( _tcscmp(pstrName, DUI_CTR_CHILDLAYOUT) == 0 ) return static_cast(this); 19 | return CControlUI::GetInterface(pstrName); 20 | } 21 | 22 | void CChildLayoutUI::Init() 23 | { 24 | if (!m_pstrXMLFile.IsEmpty()) 25 | { 26 | CDialogBuilder builder; 27 | CContainerUI* pChildWindow = dynamic_cast(builder.Create(m_pstrXMLFile.GetData(), (UINT)0, NULL, m_pManager)); 28 | if (pChildWindow) 29 | { 30 | this->Add(pChildWindow); 31 | } 32 | else 33 | { 34 | this->RemoveAll(); 35 | } 36 | } 37 | } 38 | 39 | void CChildLayoutUI::SetAttribute( LPCTSTR pstrName, LPCTSTR pstrValue ) 40 | { 41 | if( _tcscmp(pstrName, _T("xmlfile")) == 0 ) 42 | SetChildLayoutXML(pstrValue); 43 | else 44 | CContainerUI::SetAttribute(pstrName,pstrValue); 45 | } 46 | 47 | void CChildLayoutUI::SetChildLayoutXML( DuiLib::CDuiString pXML ) 48 | { 49 | m_pstrXMLFile=pXML; 50 | } 51 | 52 | DuiLib::CDuiString CChildLayoutUI::GetChildLayoutXML() 53 | { 54 | return m_pstrXMLFile; 55 | } 56 | 57 | } // namespace DuiLib 58 | -------------------------------------------------------------------------------- /3rd/DuiLib/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 | -------------------------------------------------------------------------------- /3rd/DuiLib/Layout/UIHorizontalLayout.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Layout/UIHorizontalLayout.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/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 | -------------------------------------------------------------------------------- /3rd/DuiLib/Layout/UITabLayout.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Layout/UITabLayout.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/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 | 13 | LPCTSTR GetClass() const; 14 | LPVOID GetInterface(LPCTSTR pstrName); 15 | 16 | bool Add(CControlUI* pControl); 17 | bool AddAt(CControlUI* pControl, int iIndex); 18 | bool Remove(CControlUI* pControl); 19 | void RemoveAll(); 20 | int GetCurSel() const; 21 | bool SelectItem(int iIndex); 22 | bool SelectItem(CControlUI* pControl); 23 | 24 | void SetPos(RECT rc); 25 | 26 | void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); 27 | 28 | protected: 29 | int m_iCurSel; 30 | }; 31 | } 32 | #endif // __UITABLAYOUT_H__ 33 | -------------------------------------------------------------------------------- /3rd/DuiLib/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 | -------------------------------------------------------------------------------- /3rd/DuiLib/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 | -------------------------------------------------------------------------------- /3rd/DuiLib/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 | ////////////////////////////////////////////////////////////////////////// 105 | ///corrected by gechunping on 2014_3_27 106 | ///deleted origin /// sz.cy = MAX(0, szRemaining.cy - rcPadding.bottom - cyFixedRemaining); 107 | ///corrected by gechunping on 2014_3_27 108 | ////////////////////////////////////////////////////////////////////////// 109 | } 110 | if( sz.cy < pControl->GetMinHeight() ) sz.cy = pControl->GetMinHeight(); 111 | if( sz.cy > pControl->GetMaxHeight() ) sz.cy = pControl->GetMaxHeight(); 112 | } 113 | else { 114 | if( sz.cy < pControl->GetMinHeight() ) sz.cy = pControl->GetMinHeight(); 115 | if( sz.cy > pControl->GetMaxHeight() ) sz.cy = pControl->GetMaxHeight(); 116 | cyFixedRemaining -= sz.cy + rcPadding.top + rcPadding.bottom; 117 | } 118 | 119 | cyFixedRemaining -= m_iChildPadding; 120 | 121 | sz.cx = pControl->GetFixedWidth(); 122 | if( sz.cx == 0 ) sz.cx = szAvailable.cx - rcPadding.left - rcPadding.right; 123 | if( sz.cx < 0 ) sz.cx = 0; 124 | if( sz.cx < pControl->GetMinWidth() ) sz.cx = pControl->GetMinWidth(); 125 | if( sz.cx > pControl->GetMaxWidth() ) sz.cx = pControl->GetMaxWidth(); 126 | 127 | 128 | ////////////////////////////////////////////////////////////////////////// 129 | ///corrected by gechunping on 2014_3_27 130 | ///origin/// RECT rcCtrl = { iPosX + rcPadding.left, iPosY + rcPadding.top, iPosX + rcPadding.left + sz.cx, iPosY + sz.cy + rcPadding.top + rcPadding.bottom }; 131 | //err RECT rcCtrl = { iPosX + rcPadding.left, iPosY + rcPadding.top, iPosX + rcPadding.left + sz.cx, iPosY + sz.cy + rcPadding.bottom }; 132 | RECT rcCtrl = { iPosX + rcPadding.left, iPosY + rcPadding.top, iPosX + rcPadding.left + sz.cx, iPosY + sz.cy + rcPadding.top }; 133 | ///corrected by gechunping on 2014_3_27 134 | ////////////////////////////////////////////////////////////////////////// 135 | pControl->SetPos(rcCtrl); 136 | 137 | iPosY += sz.cy + m_iChildPadding + rcPadding.top + rcPadding.bottom; 138 | cyNeeded += sz.cy + rcPadding.top + rcPadding.bottom; 139 | szRemaining.cy -= sz.cy + m_iChildPadding + rcPadding.bottom; 140 | } 141 | cyNeeded += (nEstimateNum - 1) * m_iChildPadding; 142 | 143 | // Process the scrollbar 144 | ProcessScrollBar(rc, 0, cyNeeded); 145 | } 146 | 147 | void CVerticalLayoutUI::DoPostPaint(HDC hDC, const RECT& rcPaint) 148 | { 149 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 && !m_bImmMode ) { 150 | RECT rcSeparator = GetThumbRect(true); 151 | CRenderEngine::DrawColor(hDC, rcSeparator, 0xAA000000); 152 | } 153 | } 154 | 155 | void CVerticalLayoutUI::SetSepHeight(int iHeight) 156 | { 157 | m_iSepHeight = iHeight; 158 | } 159 | 160 | int CVerticalLayoutUI::GetSepHeight() const 161 | { 162 | return m_iSepHeight; 163 | } 164 | 165 | void CVerticalLayoutUI::SetSepImmMode(bool bImmediately) 166 | { 167 | if( m_bImmMode == bImmediately ) return; 168 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 && !m_bImmMode && m_pManager != NULL ) { 169 | m_pManager->RemovePostPaint(this); 170 | } 171 | 172 | m_bImmMode = bImmediately; 173 | } 174 | 175 | bool CVerticalLayoutUI::IsSepImmMode() const 176 | { 177 | return m_bImmMode; 178 | } 179 | 180 | void CVerticalLayoutUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) 181 | { 182 | if( _tcscmp(pstrName, _T("sepheight")) == 0 ) SetSepHeight(_ttoi(pstrValue)); 183 | else if( _tcscmp(pstrName, _T("sepimm")) == 0 ) SetSepImmMode(_tcscmp(pstrValue, _T("true")) == 0); 184 | else CContainerUI::SetAttribute(pstrName, pstrValue); 185 | } 186 | 187 | void CVerticalLayoutUI::DoEvent(TEventUI& event) 188 | { 189 | if( m_iSepHeight != 0 ) { 190 | if( event.Type == UIEVENT_BUTTONDOWN && IsEnabled() ) 191 | { 192 | RECT rcSeparator = GetThumbRect(false); 193 | if( ::PtInRect(&rcSeparator, event.ptMouse) ) { 194 | m_uButtonState |= UISTATE_CAPTURED; 195 | ptLastMouse = event.ptMouse; 196 | m_rcNewPos = m_rcItem; 197 | if( !m_bImmMode && m_pManager ) m_pManager->AddPostPaint(this); 198 | return; 199 | } 200 | } 201 | if( event.Type == UIEVENT_BUTTONUP ) 202 | { 203 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) { 204 | m_uButtonState &= ~UISTATE_CAPTURED; 205 | m_rcItem = m_rcNewPos; 206 | if( !m_bImmMode && m_pManager ) m_pManager->RemovePostPaint(this); 207 | NeedParentUpdate(); 208 | return; 209 | } 210 | } 211 | if( event.Type == UIEVENT_MOUSEMOVE ) 212 | { 213 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) { 214 | LONG cy = event.ptMouse.y - ptLastMouse.y; 215 | ptLastMouse = event.ptMouse; 216 | RECT rc = m_rcNewPos; 217 | if( m_iSepHeight >= 0 ) { 218 | if( cy > 0 && event.ptMouse.y < m_rcNewPos.bottom + m_iSepHeight ) return; 219 | if( cy < 0 && event.ptMouse.y > m_rcNewPos.bottom ) return; 220 | rc.bottom += cy; 221 | if( rc.bottom - rc.top <= GetMinHeight() ) { 222 | if( m_rcNewPos.bottom - m_rcNewPos.top <= GetMinHeight() ) return; 223 | rc.bottom = rc.top + GetMinHeight(); 224 | } 225 | if( rc.bottom - rc.top >= GetMaxHeight() ) { 226 | if( m_rcNewPos.bottom - m_rcNewPos.top >= GetMaxHeight() ) return; 227 | rc.bottom = rc.top + GetMaxHeight(); 228 | } 229 | } 230 | else { 231 | if( cy > 0 && event.ptMouse.y < m_rcNewPos.top ) return; 232 | if( cy < 0 && event.ptMouse.y > m_rcNewPos.top + m_iSepHeight ) return; 233 | rc.top += cy; 234 | if( rc.bottom - rc.top <= GetMinHeight() ) { 235 | if( m_rcNewPos.bottom - m_rcNewPos.top <= GetMinHeight() ) return; 236 | rc.top = rc.bottom - GetMinHeight(); 237 | } 238 | if( rc.bottom - rc.top >= GetMaxHeight() ) { 239 | if( m_rcNewPos.bottom - m_rcNewPos.top >= GetMaxHeight() ) return; 240 | rc.top = rc.bottom - GetMaxHeight(); 241 | } 242 | } 243 | 244 | CDuiRect rcInvalidate = GetThumbRect(true); 245 | m_rcNewPos = rc; 246 | m_cxyFixed.cy = m_rcNewPos.bottom - m_rcNewPos.top; 247 | 248 | if( m_bImmMode ) { 249 | m_rcItem = m_rcNewPos; 250 | NeedParentUpdate(); 251 | } 252 | else { 253 | rcInvalidate.Join(GetThumbRect(true)); 254 | rcInvalidate.Join(GetThumbRect(false)); 255 | if( m_pManager ) m_pManager->Invalidate(rcInvalidate); 256 | } 257 | return; 258 | } 259 | } 260 | if( event.Type == UIEVENT_SETCURSOR ) 261 | { 262 | RECT rcSeparator = GetThumbRect(false); 263 | if( IsEnabled() && ::PtInRect(&rcSeparator, event.ptMouse) ) { 264 | ::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZENS))); 265 | return; 266 | } 267 | } 268 | } 269 | CContainerUI::DoEvent(event); 270 | } 271 | 272 | RECT CVerticalLayoutUI::GetThumbRect(bool bUseNew) const 273 | { 274 | if( (m_uButtonState & UISTATE_CAPTURED) != 0 && bUseNew) { 275 | if( m_iSepHeight >= 0 ) 276 | return CDuiRect(m_rcNewPos.left, MAX(m_rcNewPos.bottom - m_iSepHeight, m_rcNewPos.top), 277 | m_rcNewPos.right, m_rcNewPos.bottom); 278 | else 279 | return CDuiRect(m_rcNewPos.left, m_rcNewPos.top, m_rcNewPos.right, 280 | MIN(m_rcNewPos.top - m_iSepHeight, m_rcNewPos.bottom)); 281 | } 282 | else { 283 | if( m_iSepHeight >= 0 ) 284 | return CDuiRect(m_rcItem.left, MAX(m_rcItem.bottom - m_iSepHeight, m_rcItem.top), m_rcItem.right, 285 | m_rcItem.bottom); 286 | else 287 | return CDuiRect(m_rcItem.left, m_rcItem.top, m_rcItem.right, 288 | MIN(m_rcItem.top - m_iSepHeight, m_rcItem.bottom)); 289 | 290 | } 291 | } 292 | } 293 | -------------------------------------------------------------------------------- /3rd/DuiLib/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 | -------------------------------------------------------------------------------- /3rd/DuiLib/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // UIlib.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "StdAfx.h" 6 | 7 | 8 | #pragma comment( lib, "winmm.lib" ) 9 | #pragma comment( lib, "comctl32.lib" ) 10 | -------------------------------------------------------------------------------- /3rd/DuiLib/StdAfx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/StdAfx.h -------------------------------------------------------------------------------- /3rd/DuiLib/UIlib.cpp: -------------------------------------------------------------------------------- 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 | // 31 | // DirectUI - UI Library 32 | // 33 | // Written by Bjarke Viksoe (bjarke@viksoe.dk) 34 | // Copyright (c) 2006-2007 Bjarke Viksoe. 35 | // 36 | // This code may be used in compiled form in any way you desire. These 37 | // source files may be redistributed by any means PROVIDING it is 38 | // not sold for profit without the authors written consent, and 39 | // providing that this notice and the authors name is included. 40 | // 41 | // This file is provided "as is" with no expressed or implied warranty. 42 | // The author accepts no liability if it causes any damage to you or your 43 | // computer whatsoever. It's free, so don't hassle me about it. 44 | // 45 | // Beware of bugs. 46 | // 47 | // 48 | 49 | 50 | #include "stdafx.h" 51 | #include "UIlib.h" 52 | 53 | 54 | BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID /*lpReserved*/) 55 | { 56 | switch( dwReason ) { 57 | case DLL_PROCESS_ATTACH: 58 | case DLL_THREAD_ATTACH: 59 | case DLL_THREAD_DETACH: 60 | case DLL_PROCESS_DETACH: 61 | ::DisableThreadLibraryCalls((HMODULE)hModule); 62 | break; 63 | } 64 | return TRUE; 65 | } 66 | 67 | -------------------------------------------------------------------------------- /3rd/DuiLib/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 | #if defined _M_IX86 47 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") 48 | #elif defined _M_IA64 49 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") 50 | #elif defined _M_X64 51 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") 52 | #else 53 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 54 | #endif 55 | 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | 66 | #include "Utils/Utils.h" 67 | #include "Utils/UIDelegate.h" 68 | #include "Core/UIDefine.h" 69 | #include "Core/UIManager.h" 70 | #include "Core/UIBase.h" 71 | #include "Core/UIControl.h" 72 | #include "Core/UIContainer.h" 73 | #include "Core/UIMarkup.h" 74 | #include "Core/UIDlgBuilder.h" 75 | #include "Core/UIRender.h" 76 | #include "Utils/WinImplBase.h" 77 | #include "Utils/UnCompression.h" 78 | 79 | #include "Layout/UIVerticalLayout.h" 80 | #include "Layout/UIHorizontalLayout.h" 81 | #include "Layout/UITileLayout.h" 82 | #include "Layout/UITabLayout.h" 83 | #include "Layout/UIChildLayout.h" 84 | 85 | #include "Control/UIList.h" 86 | #include "Control/UICombo.h" 87 | #include "Control/UIScrollBar.h" 88 | #include "Control/UITreeView.h" 89 | 90 | #include "Control/UILabel.h" 91 | #include "Control/UIText.h" 92 | #include "Control/UIEdit.h" 93 | 94 | #include "Control/UIButton.h" 95 | #include "Control/UIFadeButton.h" 96 | #include "Control/UIOption.h" 97 | #include "Control/UICheckBox.h" 98 | 99 | #include "Control/UIProgress.h" 100 | #include "Control/UISlider.h" 101 | 102 | #include "Control/UIComboBox.h" 103 | #include "Control/UIRichEdit.h" 104 | #include "Control/UIDateTime.h" 105 | 106 | #include "Control/UIActiveX.h" 107 | #include "Control/UIWebBrowser.h" 108 | #include "Control/UIFlash.h" 109 | 110 | #include "Control/UIColorPalette.h" 111 | #include "Control/UIHyperlink.h" 112 | #include "Control/UIMediaPlayer.h" 113 | #include "Control/UIIpAddress.h" -------------------------------------------------------------------------------- /3rd/DuiLib/Utils/Flash11.tlb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Utils/Flash11.tlb -------------------------------------------------------------------------------- /3rd/DuiLib/Utils/FlashEventHandler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Utils/FlashEventHandler.h -------------------------------------------------------------------------------- /3rd/DuiLib/Utils/UIDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | #include "UIDelegate.h" 3 | 4 | namespace DuiLib { 5 | 6 | CDelegateBase::CDelegateBase( void* pObject, FunVoid pFn ) 7 | { 8 | m_pObject = pObject; 9 | m_unionFnType.pFunVoid = pFn; 10 | m_iEventType = UIEVENT__ALL; 11 | m_sNotifyTypeName.Empty(); 12 | } 13 | 14 | CDelegateBase::CDelegateBase( void* pObject, FunTEvent pFn,UINT _iEventType /*= UIEVENT__ALL*/ ) 15 | { 16 | m_pObject = pObject; 17 | m_unionFnType.pFunTEvent = pFn; 18 | m_iEventType = _iEventType; 19 | m_sNotifyTypeName.Empty(); 20 | } 21 | 22 | CDelegateBase::CDelegateBase( void* pObject, FunTNotify pFn,LPCTSTR _sNotifyTypeName /*= NULL*/) 23 | { 24 | m_pObject = pObject; 25 | m_unionFnType.pFunTNotify = pFn; 26 | m_iEventType = UIEVENT__ALL; 27 | 28 | if(NULL != _sNotifyTypeName) 29 | m_sNotifyTypeName = _sNotifyTypeName; 30 | } 31 | 32 | 33 | CDelegateBase::CDelegateBase( const CDelegateBase& rhs ) 34 | { 35 | m_pObject = rhs.m_pObject; 36 | m_unionFnType.pFunVoid = rhs.m_unionFnType.pFunVoid; 37 | m_iEventType = rhs.m_iEventType; 38 | m_sNotifyTypeName = rhs.m_sNotifyTypeName.GetData(); 39 | } 40 | 41 | CDelegateBase::~CDelegateBase() 42 | { 43 | if(!m_sNotifyTypeName.IsEmpty()) 44 | m_sNotifyTypeName.Empty(); 45 | } 46 | 47 | bool CDelegateBase::Equals(const CDelegateBase& rhs) const 48 | { 49 | return m_pObject == rhs.m_pObject && m_unionFnType.pFunVoid == rhs.m_unionFnType.pFunVoid && m_iEventType == rhs.m_iEventType && m_sNotifyTypeName == rhs.m_sNotifyTypeName.GetData(); 50 | } 51 | 52 | // 53 | 54 | CEventSource::CEventSource() 55 | { 56 | m_aDelegates.Empty(); 57 | } 58 | 59 | CEventSource::~CEventSource() 60 | { 61 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 62 | CDelegateBase* pObject = m_aDelegates.GetAt(i); 63 | if( pObject) delete pObject; 64 | pObject = NULL; 65 | } 66 | } 67 | 68 | CEventSource::operator bool() 69 | { 70 | return m_aDelegates.GetSize() > 0; 71 | } 72 | 73 | void CEventSource::operator+= (const CDelegateBase& d) 74 | { 75 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 76 | CDelegateBase* pObject = m_aDelegates.GetAt(i); 77 | if( pObject && pObject->Equals(d) ) return; 78 | } 79 | 80 | m_aDelegates.Add(d.Copy()); 81 | } 82 | 83 | void CEventSource::operator-= (const CDelegateBase& d) 84 | { 85 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 86 | CDelegateBase* pObject = m_aDelegates.GetAt(i); 87 | if( pObject && pObject->Equals(d) ) { 88 | delete pObject; 89 | m_aDelegates.Remove(i); 90 | return; 91 | } 92 | } 93 | } 94 | 95 | bool CEventSource::operator() (void* param) 96 | { 97 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 98 | CDelegateBase* pObject = m_aDelegates.GetAt(i); 99 | if( pObject && !pObject->Invoke(param) ) return false; 100 | } 101 | return true; 102 | } 103 | 104 | bool CEventSource::operator() (TEventUI* pTEventUI) 105 | { 106 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 107 | CDelegateBase* pObject = m_aDelegates.GetAt(i); 108 | if( pObject && !pObject->Invoke(pTEventUI) ) return false; 109 | } 110 | return true; 111 | } 112 | 113 | bool CEventSource::operator() (TNotifyUI* pTNotifyUI) 114 | { 115 | for( int i = 0; i < m_aDelegates.GetSize(); i++ ) { 116 | CDelegateBase* pObject = m_aDelegates.GetAt(i); 117 | 118 | if( pObject && !pObject->Invoke(pTNotifyUI) ) return false; 119 | } 120 | return true; 121 | } 122 | 123 | 124 | 125 | } -------------------------------------------------------------------------------- /3rd/DuiLib/Utils/UIDelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef __UIDELEGATE_H__ 2 | #define __UIDELEGATE_H__ 3 | 4 | #pragma once 5 | 6 | //#include "StdAfx.h" 7 | 8 | namespace DuiLib { 9 | 10 | typedef struct tagTEventUI TEventUI; 11 | typedef struct tagTNotifyUI TNotifyUI; 12 | 13 | typedef bool (*FunVoid)(void* pParam); 14 | typedef bool (*FunTEvent)(TEventUI* pTEventUI); 15 | typedef bool (*FunTNotify)(TNotifyUI* pTNotifyUI); 16 | 17 | class CDelegateBase; 18 | 19 | class UILIB_API IDelegate 20 | { 21 | public: 22 | typedef union { 23 | FunVoid pFunVoid; 24 | FunTEvent pFunTEvent; 25 | FunTNotify pFunTNotify; 26 | }FnType; 27 | 28 | public: 29 | virtual FunVoid GetFunVoid() const = 0; 30 | virtual FunTEvent GetFunTEvent() const = 0; 31 | virtual FunTNotify GetFunTNotify() const = 0; 32 | 33 | public: 34 | virtual CDelegateBase* Copy() const = 0; 35 | virtual bool Invoke(void* pParam) = 0; 36 | virtual bool Invoke(TEventUI* pTEventUI) = 0; 37 | virtual bool Invoke(TNotifyUI* pTNotifyUI) = 0; 38 | }; 39 | 40 | class UILIB_API CDelegateBase : public IDelegate 41 | { 42 | public: 43 | CDelegateBase(void* pObject, FunVoid pFn); 44 | CDelegateBase(void* pObject, FunTEvent pFn,UINT _iEventType); 45 | CDelegateBase(void* pObject, FunTNotify pFn,LPCTSTR _sNotifyTypeName); 46 | CDelegateBase(const CDelegateBase& rhs); 47 | 48 | virtual ~CDelegateBase(); 49 | FunVoid GetFunVoid() const{return m_unionFnType.pFunVoid;}; 50 | FunTEvent GetFunTEvent() const{return m_unionFnType.pFunTEvent;}; 51 | FunTNotify GetFunTNotify() const{return m_unionFnType.pFunTNotify;}; 52 | 53 | bool Equals(const CDelegateBase& rhs) const; 54 | bool operator() (void* param){return Invoke(param);}; 55 | bool operator() (TEventUI* pTEventUI,UINT _iEventType){return Invoke(pTEventUI);}; 56 | bool operator() (TNotifyUI* pTNotifyUI,LPCTSTR _sNotifyTypeName){return Invoke(pTNotifyUI);}; 57 | 58 | void* GetObj() const {return m_pObject;}; 59 | protected: 60 | void SetEventType(UINT _iEventType){m_iEventType = _iEventType;}; 61 | void SetNotifyTypeName(CDuiString& _sNotifyTypeName){m_sNotifyTypeName = _sNotifyTypeName.GetData();}; 62 | UINT GetEventType(){return m_iEventType;}; 63 | CDuiString GetNotifyTypeName(){return m_sNotifyTypeName.GetData();}; 64 | 65 | private: 66 | void* m_pObject; 67 | FnType m_unionFnType; 68 | protected: 69 | UINT m_iEventType; 70 | CDuiString m_sNotifyTypeName; 71 | }; 72 | 73 | 74 | class UILIB_API CDelegateStatic: public CDelegateBase 75 | { 76 | public: 77 | CDelegateStatic(FunVoid pFunVoid) : CDelegateBase(NULL, pFunVoid) { } 78 | CDelegateStatic(FunTEvent pFunTEvent,UINT _iEventType) : CDelegateBase(NULL, pFunTEvent,_iEventType) { } 79 | CDelegateStatic(FunTNotify pFunTNotify,LPCTSTR _sNotifyTypeName) : CDelegateBase(NULL, pFunTNotify,_sNotifyTypeName) { } 80 | CDelegateStatic(const CDelegateStatic& rhs) : CDelegateBase(rhs) { } 81 | virtual CDelegateBase* Copy() const { return new CDelegateStatic(*this); } 82 | 83 | protected: 84 | virtual bool Invoke(void* param) 85 | { 86 | FunVoid pFunVoid = GetFunVoid(); 87 | return pFunVoid(param); 88 | } 89 | 90 | virtual bool Invoke(TEventUI* pTEventUI) 91 | { 92 | FunTEvent pFunTEvent = GetFunTEvent(); 93 | return !pFunTEvent(pTEventUI); 94 | }; 95 | 96 | virtual bool Invoke(TNotifyUI* pTNotifyUI) 97 | { 98 | FunTNotify pFunTNotify = GetFunTNotify(); 99 | return pFunTNotify(pTNotifyUI); 100 | }; 101 | }; 102 | 103 | template 104 | class CDelegate : public CDelegateBase 105 | { 106 | typedef bool (T::*CMFunVoid)(void* pParam); 107 | typedef bool (T::*CMFunTEvent)(TEventUI* pTEventUI); 108 | typedef bool (T::*CMFunTNotify)(TNotifyUI* pTNotifyUI); 109 | public: 110 | CDelegate(O* pObj, CMFunVoid pCMFunVoid) : CDelegateBase(pObj, *(FunVoid*)&pCMFunVoid), m_pCMFunVoid(pCMFunVoid),m_pCMFunTEvent(NULL),m_pCMFunTNotify(NULL){ 111 | 112 | } 113 | CDelegate(O* pObj, CMFunTEvent pCMFunTEvent,UINT _iEventType) : CDelegateBase(pObj, *(FunTEvent*)&pCMFunTEvent,_iEventType), m_pCMFunVoid(NULL),m_pCMFunTEvent(pCMFunTEvent),m_pCMFunTNotify(NULL){ 114 | } 115 | CDelegate(O* pObj, CMFunTNotify pCMFunTNotify,LPCTSTR _sNotifyTypeName ) : CDelegateBase(pObj, *(FunTNotify*)&pCMFunTNotify,_sNotifyTypeName), m_pCMFunVoid(NULL),m_pCMFunTEvent(NULL),m_pCMFunTNotify(pCMFunTNotify){ 116 | } 117 | CDelegate(const CDelegate& rhs) : CDelegateBase(rhs) { 118 | m_pCMFunVoid = rhs.m_pCMFunVoid;m_pCMFunTEvent = rhs.m_pCMFunTEvent;m_pCMFunTNotify = rhs.m_pCMFunTNotify;} 119 | virtual CDelegateBase* Copy() const { return new CDelegate(*this); } 120 | virtual ~CDelegate(){ 121 | 122 | } 123 | 124 | protected: 125 | virtual bool Invoke(void* param) 126 | { 127 | O* pObject = (O*) GetObj(); 128 | if(pObject && m_pCMFunVoid) 129 | return (pObject->*m_pCMFunVoid)(param); 130 | else if(pObject && m_pCMFunTEvent) 131 | return Invoke((TEventUI*)param); 132 | else if(pObject && m_pCMFunTNotify) 133 | return Invoke((TNotifyUI*)param); 134 | 135 | return true; 136 | } 137 | 138 | virtual bool Invoke(TEventUI* pTEventUI) 139 | { 140 | O* pObject = (O*) GetObj(); 141 | if(pObject && pTEventUI && GetEventType() == 0) 142 | return (pObject->*m_pCMFunTEvent)(pTEventUI); 143 | else if(pObject && pTEventUI && pTEventUI->Type == GetEventType()) 144 | return (pObject->*m_pCMFunTEvent)(pTEventUI); 145 | 146 | return true; 147 | }; 148 | 149 | virtual bool Invoke(TNotifyUI* pTNotifyUI) 150 | { 151 | O* pObject = (O*) GetObj(); 152 | if(pObject && GetNotifyTypeName().IsEmpty()) 153 | return (pObject->*m_pCMFunTNotify)(pTNotifyUI); 154 | else if(pObject && pTNotifyUI && pTNotifyUI->sType == GetNotifyTypeName()) 155 | return (pObject->*m_pCMFunTNotify)(pTNotifyUI); 156 | 157 | return true; 158 | }; 159 | 160 | private: 161 | CMFunVoid m_pCMFunVoid; 162 | CMFunTEvent m_pCMFunTEvent; 163 | CMFunTNotify m_pCMFunTNotify; 164 | }; 165 | 166 | 167 | template 168 | CDelegate MakeDelegate(O* pObject, bool (T::* pFn)(void*)) 169 | { 170 | return CDelegate(pObject, pFn); 171 | } 172 | 173 | template 174 | CDelegate MakeDelegate(O* pObject, bool (T::* pFn)(TEventUI*),UINT _iEventType) 175 | { 176 | return CDelegate(pObject, pFn,_iEventType); 177 | } 178 | 179 | template 180 | CDelegate MakeDelegate(O* pObject, bool (T::* pFn)(TNotifyUI*),LPCTSTR _sNotifyTypeName) 181 | { 182 | return CDelegate(pObject, pFn,(LPCTSTR)_sNotifyTypeName); 183 | } 184 | 185 | inline CDelegateStatic MakeDelegate(FunVoid pFunVoid) 186 | { 187 | return CDelegateStatic(pFunVoid); 188 | } 189 | 190 | inline CDelegateStatic MakeDelegate(FunTEvent pFunTEvent,UINT _iEventType) 191 | { 192 | return CDelegateStatic(pFunTEvent,_iEventType); 193 | } 194 | 195 | inline CDelegateStatic MakeDelegate(FunTNotify pFunTNotify,LPCTSTR _sNotifyTypeName) 196 | { 197 | return CDelegateStatic(pFunTNotify,_sNotifyTypeName); 198 | } 199 | 200 | class UILIB_API CEventSource 201 | { 202 | public: 203 | CEventSource(); 204 | ~CEventSource(); 205 | operator bool(); 206 | void operator+= (const CDelegateBase& d); // add const for gcc 207 | void operator+= (FunVoid pFunVoid){ 208 | (*this) += MakeDelegate(pFunVoid); 209 | }; 210 | void operator-= (const CDelegateBase& d); 211 | void operator-= (FunVoid pFunVoid){(*this) -= MakeDelegate(pFunVoid);}; 212 | bool operator() (void* param); 213 | bool operator() (TEventUI* pTEventUI); 214 | bool operator() (TNotifyUI* pTNotifyUI); 215 | 216 | protected: 217 | TStdPtrArray m_aDelegates; 218 | }; 219 | 220 | } 221 | 222 | 223 | #endif // __UIDELEGATE_H__ 224 | 225 | -------------------------------------------------------------------------------- /3rd/DuiLib/Utils/UnCompression.h: -------------------------------------------------------------------------------- 1 | #ifndef DUILIB_CUNCOMPRESSION_H_ 2 | #define DUILIB_CUNCOMPRESSION_H_ 3 | 4 | #pragma once 5 | 6 | namespace DuiLib 7 | { 8 | 9 | class CUnCompression 10 | { 11 | public: 12 | virtual BOOL Open(const TCHAR *filepath) = 0; 13 | virtual BOOL Open(void *z, unsigned int len) = 0; 14 | virtual BOOL IsOpen( ) = 0; 15 | virtual BOOL Close( ) = 0; 16 | 17 | virtual BOOL Find(const TCHAR *name, int* index, DWORD64 *size) = 0; 18 | virtual BOOL Get(int index, void *dst, DWORD64 len) = 0; 19 | }; 20 | 21 | } 22 | #endif -------------------------------------------------------------------------------- /3rd/DuiLib/Utils/Utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Utils/Utils.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Utils/Utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Utils/Utils.h -------------------------------------------------------------------------------- /3rd/DuiLib/Utils/WebBrowserEventHandler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Utils/WebBrowserEventHandler.h -------------------------------------------------------------------------------- /3rd/DuiLib/Utils/WinImplBase.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Utils/WinImplBase.cpp -------------------------------------------------------------------------------- /3rd/DuiLib/Utils/WinImplBase.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/3rd/DuiLib/Utils/WinImplBase.h -------------------------------------------------------------------------------- /3rd/DuiLib/Utils/Zip/XUnZip.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | #include "XUnZip.h" 3 | #include "XUnZipBase.h" 4 | 5 | 6 | BOOL CDUIUnZip::Open(const TCHAR *filepath) 7 | { 8 | 9 | if (filepath == NULL) 10 | { 11 | return FALSE; 12 | } 13 | 14 | TUnzip *pHandle = new TUnzip( ); 15 | ASSERT(pHandle != NULL); 16 | if (ZR_OK != pHandle->Open((void*)(filepath), 0, ZIP_FILENAME)) 17 | { 18 | delete pHandle; 19 | pHandle = NULL; 20 | return FALSE; 21 | } 22 | 23 | m_db = (HANDLE)pHandle; 24 | 25 | return TRUE; 26 | } 27 | 28 | BOOL CDUIUnZip::Open(void *z, unsigned int len) 29 | { 30 | TUnzip *pHandle = new TUnzip( ); 31 | ASSERT(pHandle != NULL); 32 | if (ZR_OK != pHandle->Open(z, len, ZIP_MEMORY)) 33 | { 34 | delete pHandle; 35 | pHandle = NULL; 36 | return FALSE; 37 | } 38 | m_db = (HANDLE)pHandle; 39 | 40 | return TRUE; 41 | } 42 | 43 | BOOL CDUIUnZip::IsOpen( ) 44 | { 45 | return m_db == NULL; 46 | } 47 | 48 | BOOL CDUIUnZip::Close( ) 49 | { 50 | if (m_db == NULL) 51 | return TRUE; 52 | 53 | TUnzip *pHandle = (TUnzip *)m_db; 54 | if (ZR_OK == pHandle->Close( )) 55 | { 56 | delete pHandle; 57 | pHandle = NULL; 58 | m_db = NULL; 59 | return TRUE; 60 | } 61 | 62 | return FALSE; 63 | } 64 | 65 | BOOL CDUIUnZip::Find(const TCHAR *name, int* index, DWORD64 *size) 66 | { 67 | ZIPENTRY ze; 68 | TUnzip *pHandle = (TUnzip *)m_db; 69 | ASSERT(pHandle != NULL); 70 | if (pHandle == NULL) 71 | { 72 | return FALSE; 73 | } 74 | if (ZR_OK == pHandle->Find(name, false, index, &ze)) 75 | { 76 | *size = ze.unc_size; 77 | return TRUE; 78 | } 79 | return FALSE; 80 | } 81 | 82 | BOOL CDUIUnZip::Get(int index, void *dst, DWORD64 len) 83 | { 84 | TUnzip *pHandle = (TUnzip *)m_db; 85 | ASSERT(pHandle != NULL); 86 | ZRESULT res = pHandle->Unzip(index, dst, len, ZIP_MEMORY); 87 | if (ZR_OK != res && ZR_MORE != res) 88 | { 89 | return FALSE; 90 | } 91 | return TRUE; 92 | } -------------------------------------------------------------------------------- /3rd/DuiLib/Utils/Zip/XUnZip.h: -------------------------------------------------------------------------------- 1 | #ifndef XUNZIP_HPP 2 | #define XUNZIP_HPP 3 | 4 | #include "..\UnCompression.h" 5 | 6 | class CDUIUnZip : public DuiLib::CUnCompression 7 | { 8 | public: 9 | CDUIUnZip() : m_db(NULL){} 10 | virtual BOOL Open(const TCHAR *filepath); 11 | virtual BOOL Open(void *z, unsigned int len); 12 | virtual BOOL IsOpen(); 13 | virtual BOOL Close(); 14 | 15 | virtual BOOL Find(const TCHAR *name, int* index, DWORD64 *size); 16 | virtual BOOL Get(int index, void *dst, DWORD64 len); 17 | private: 18 | HANDLE m_db; 19 | }; 20 | #endif -------------------------------------------------------------------------------- /3rd/DuiLib/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 | -------------------------------------------------------------------------------- /3rd/DuiLib/Utils/stb_image.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef STBI_INCLUDE_STB_IMAGE_H 3 | #define STBI_INCLUDE_STB_IMAGE_H 4 | 5 | #define STB_IMAGE_IMPLEMENTATION 6 | #define STBI_NO_STDIO 7 | #define STBI_NO_WRITE 8 | #define STBI_NO_HDR 9 | 10 | 11 | // DOCUMENTATION 12 | // 13 | // Limitations: 14 | // - no 16-bit-per-channel PNG 15 | // - no 12-bit-per-channel JPEG 16 | // - no JPEGs with arithmetic coding 17 | // - no 1-bit BMP 18 | // - GIF always returns *comp=4 19 | // 20 | // Basic usage (see HDR discussion below for HDR usage): 21 | // int x,y,n; 22 | // unsigned char *data = stbi_load(filename, &x, &y, &n, 0); 23 | // // ... process data if not NULL ... 24 | // // ... x = width, y = height, n = # 8-bit components per pixel ... 25 | // // ... replace '0' with '1'..'4' to force that many components per pixel 26 | // // ... but 'n' will always be the number that it would have been if you said 0 27 | // stbi_image_free(data) 28 | // 29 | // Standard parameters: 30 | // int *x -- outputs image width in pixels 31 | // int *y -- outputs image height in pixels 32 | // int *comp -- outputs # of image components in image file 33 | // int req_comp -- if non-zero, # of image components requested in result 34 | // 35 | // The return value from an image loader is an 'unsigned char *' which points 36 | // to the pixel data, or NULL on an allocation failure or if the image is 37 | // corrupt or invalid. The pixel data consists of *y scanlines of *x pixels, 38 | // with each pixel consisting of N interleaved 8-bit components; the first 39 | // pixel pointed to is top-left-most in the image. There is no padding between 40 | // image scanlines or between pixels, regardless of format. The number of 41 | // components N is 'req_comp' if req_comp is non-zero, or *comp otherwise. 42 | // If req_comp is non-zero, *comp has the number of components that _would_ 43 | // have been output otherwise. E.g. if you set req_comp to 4, you will always 44 | // get RGBA output, but you can check *comp to see if it's trivially opaque 45 | // because e.g. there were only 3 channels in the source image. 46 | // 47 | // An output image with N components has the following components interleaved 48 | // in this order in each pixel: 49 | // 50 | // N=#comp components 51 | // 1 grey 52 | // 2 grey, alpha 53 | // 3 red, green, blue 54 | // 4 red, green, blue, alpha 55 | // 56 | // If image loading fails for any reason, the return value will be NULL, 57 | // and *x, *y, *comp will be unchanged. The function stbi_failure_reason() 58 | // can be queried for an extremely brief, end-user unfriendly explanation 59 | // of why the load failed. Define STBI_NO_FAILURE_STRINGS to avoid 60 | // compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly 61 | // more user-friendly ones. 62 | // 63 | // Paletted PNG, BMP, GIF, and PIC images are automatically depalettized. 64 | // 65 | // =========================================================================== 66 | // 67 | // Philosophy 68 | // 69 | // stb libraries are designed with the following priorities: 70 | // 71 | // 1. easy to use 72 | // 2. easy to maintain 73 | // 3. good performance 74 | // 75 | // Sometimes I let "good performance" creep up in priority over "easy to maintain", 76 | // and for best performance I may provide less-easy-to-use APIs that give higher 77 | // performance, in addition to the easy to use ones. Nevertheless, it's important 78 | // to keep in mind that from the standpoint of you, a client of this library, 79 | // all you care about is #1 and #3, and stb libraries do not emphasize #3 above all. 80 | // 81 | // Some secondary priorities arise directly from the first two, some of which 82 | // make more explicit reasons why performance can't be emphasized. 83 | // 84 | // - Portable ("ease of use") 85 | // - Small footprint ("easy to maintain") 86 | // - No dependencies ("ease of use") 87 | // 88 | // =========================================================================== 89 | // 90 | // I/O callbacks 91 | // 92 | // I/O callbacks allow you to read from arbitrary sources, like packaged 93 | // files or some other source. Data read from callbacks are processed 94 | // through a small internal buffer (currently 128 bytes) to try to reduce 95 | // overhead. 96 | // 97 | // The three functions you must define are "read" (reads some bytes of data), 98 | // "skip" (skips some bytes of data), "eof" (reports if the stream is at the end). 99 | // 100 | // =========================================================================== 101 | // 102 | // SIMD support 103 | // 104 | // The JPEG decoder will try to automatically use SIMD kernels on x86 when 105 | // supported by the compiler. For ARM Neon support, you must explicitly 106 | // request it. 107 | // 108 | // (The old do-it-yourself SIMD API is no longer supported in the current 109 | // code.) 110 | // 111 | // On x86, SSE2 will automatically be used when available based on a run-time 112 | // test; if not, the generic C versions are used as a fall-back. On ARM targets, 113 | // the typical path is to have separate builds for NEON and non-NEON devices 114 | // (at least this is true for iOS and Android). Therefore, the NEON support is 115 | // toggled by a build flag: define STBI_NEON to get NEON loops. 116 | // 117 | // The output of the JPEG decoder is slightly different from versions where 118 | // SIMD support was introduced (that is, for versions before 1.49). The 119 | // difference is only +-1 in the 8-bit RGB channels, and only on a small 120 | // fraction of pixels. You can force the pre-1.49 behavior by defining 121 | // STBI_JPEG_OLD, but this will disable some of the SIMD decoding path 122 | // and hence cost some performance. 123 | // 124 | // If for some reason you do not want to use any of SIMD code, or if 125 | // you have issues compiling it, you can disable it entirely by 126 | // defining STBI_NO_SIMD. 127 | // 128 | // =========================================================================== 129 | // 130 | // HDR image support (disable by defining STBI_NO_HDR) 131 | // 132 | // stb_image now supports loading HDR images in general, and currently 133 | // the Radiance .HDR file format, although the support is provided 134 | // generically. You can still load any file through the existing interface; 135 | // if you attempt to load an HDR file, it will be automatically remapped to 136 | // LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1; 137 | // both of these constants can be reconfigured through this interface: 138 | // 139 | // stbi_hdr_to_ldr_gamma(2.2f); 140 | // stbi_hdr_to_ldr_scale(1.0f); 141 | // 142 | // (note, do not use _inverse_ constants; stbi_image will invert them 143 | // appropriately). 144 | // 145 | // Additionally, there is a new, parallel interface for loading files as 146 | // (linear) floats to preserve the full dynamic range: 147 | // 148 | // float *data = stbi_loadf(filename, &x, &y, &n, 0); 149 | // 150 | // If you load LDR images through this interface, those images will 151 | // be promoted to floating point values, run through the inverse of 152 | // constants corresponding to the above: 153 | // 154 | // stbi_ldr_to_hdr_scale(1.0f); 155 | // stbi_ldr_to_hdr_gamma(2.2f); 156 | // 157 | // Finally, given a filename (or an open file or memory block--see header 158 | // file for details) containing image data, you can query for the "most 159 | // appropriate" interface to use (that is, whether the image is HDR or 160 | // not), using: 161 | // 162 | // stbi_is_hdr(char *filename); 163 | // 164 | // =========================================================================== 165 | // 166 | // iPhone PNG support: 167 | // 168 | // By default we convert iphone-formatted PNGs back to RGB, even though 169 | // they are internally encoded differently. You can disable this conversion 170 | // by by calling stbi_convert_iphone_png_to_rgb(0), in which case 171 | // you will always just get the native iphone "format" through (which 172 | // is BGR stored in RGB). 173 | // 174 | // Call stbi_set_unpremultiply_on_load(1) as well to force a divide per 175 | // pixel to remove any premultiplied alpha *only* if the image file explicitly 176 | // says there's premultiplied data (currently only happens in iPhone images, 177 | // and only if iPhone convert-to-rgb processing is on). 178 | // 179 | 180 | 181 | #ifndef STBI_NO_STDIO 182 | #include 183 | #endif // STBI_NO_STDIO 184 | 185 | #define STBI_VERSION 1 186 | 187 | enum 188 | { 189 | STBI_default = 0, // only used for req_comp 190 | 191 | STBI_grey = 1, 192 | STBI_grey_alpha = 2, 193 | STBI_rgb = 3, 194 | STBI_rgb_alpha = 4 195 | }; 196 | 197 | typedef unsigned char stbi_uc; 198 | 199 | #ifdef __cplusplus 200 | extern "C" { 201 | #endif 202 | 203 | #ifdef STB_IMAGE_STATIC 204 | #define STBIDEF static 205 | #else 206 | #define STBIDEF extern 207 | #endif 208 | 209 | ////////////////////////////////////////////////////////////////////////////// 210 | // 211 | // PRIMARY API - works on images of any type 212 | // 213 | 214 | // 215 | // load image by filename, open file, or memory buffer 216 | // 217 | 218 | typedef struct 219 | { 220 | int (*read) (void *user,char *data,int size); // fill 'data' with 'size' bytes. return number of bytes actually read 221 | void (*skip) (void *user,int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative 222 | int (*eof) (void *user); // returns nonzero if we are at end of file/data 223 | } stbi_io_callbacks; 224 | 225 | STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp); 226 | STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *comp, int req_comp); 227 | STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *comp, int req_comp); 228 | 229 | #ifndef STBI_NO_STDIO 230 | STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); 231 | // for stbi_load_from_file, file pointer is left pointing immediately after image 232 | #endif 233 | 234 | #ifndef STBI_NO_LINEAR 235 | STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp); 236 | STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); 237 | STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp); 238 | 239 | #ifndef STBI_NO_STDIO 240 | STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); 241 | #endif 242 | #endif 243 | 244 | #ifndef STBI_NO_HDR 245 | STBIDEF void stbi_hdr_to_ldr_gamma(float gamma); 246 | STBIDEF void stbi_hdr_to_ldr_scale(float scale); 247 | #endif 248 | 249 | #ifndef STBI_NO_LINEAR 250 | STBIDEF void stbi_ldr_to_hdr_gamma(float gamma); 251 | STBIDEF void stbi_ldr_to_hdr_scale(float scale); 252 | #endif // STBI_NO_HDR 253 | 254 | // stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR 255 | STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user); 256 | STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len); 257 | #ifndef STBI_NO_STDIO 258 | STBIDEF int stbi_is_hdr (char const *filename); 259 | STBIDEF int stbi_is_hdr_from_file(FILE *f); 260 | #endif // STBI_NO_STDIO 261 | 262 | 263 | // get a VERY brief reason for failure 264 | // NOT THREADSAFE 265 | STBIDEF const char *stbi_failure_reason (void); 266 | 267 | // free the loaded image -- this is just free() 268 | STBIDEF void stbi_image_free (void *retval_from_stbi_load); 269 | 270 | // get image dimensions & components without fully decoding 271 | STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp); 272 | STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp); 273 | 274 | #ifndef STBI_NO_STDIO 275 | STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp); 276 | STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp); 277 | 278 | #endif 279 | 280 | 281 | 282 | // for image formats that explicitly notate that they have premultiplied alpha, 283 | // we just return the colors as stored in the file. set this flag to force 284 | // unpremultiplication. results are undefined if the unpremultiply overflow. 285 | STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply); 286 | 287 | // indicate whether we should process iphone images back to canonical format, 288 | // or just pass them through "as-is" 289 | STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert); 290 | 291 | // flip the image vertically, so the first pixel in the output array is the bottom left 292 | STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip); 293 | 294 | // ZLIB client - used by PNG, available for other purposes 295 | 296 | STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen); 297 | STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header); 298 | STBIDEF char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen); 299 | STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); 300 | 301 | STBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen); 302 | STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); 303 | 304 | 305 | #ifdef __cplusplus 306 | } 307 | #endif 308 | 309 | // 310 | // 311 | //// end header file ///////////////////////////////////////////////////// 312 | #endif // STBI_INCLUDE_STB_IMAGE_H -------------------------------------------------------------------------------- /AutoToast/HookMSG.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/AutoToast/HookMSG.rc -------------------------------------------------------------------------------- /AutoToast/HookMSG.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {A83E5FC2-008A-47A0-8364-B36A21854FDF} 15 | Win32Proj 16 | HookMSG 17 | 8.1 18 | 19 | 20 | 21 | DynamicLibrary 22 | true 23 | v140_xp 24 | Unicode 25 | 26 | 27 | DynamicLibrary 28 | false 29 | v140_xp 30 | true 31 | Unicode 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | true 45 | $(SolutionDir)Build\$(Configuration)\ 46 | $(SolutionDir)Build\$(Configuration)\ 47 | 48 | 49 | false 50 | $(SolutionDir)Build\$(Configuration)\ 51 | $(SolutionDir)Build\$(Configuration)\ 52 | 53 | 54 | 55 | 56 | 57 | Level3 58 | Disabled 59 | WIN32;_DEBUG;_WINDOWS;_USRDLL;HOOKMSG_EXPORTS;%(PreprocessorDefinitions) 60 | true 61 | 62 | 63 | Windows 64 | true 65 | $(solutionDir)bin\AutoToast_d.dll 66 | 67 | 68 | 69 | 70 | Level3 71 | 72 | 73 | MaxSpeed 74 | true 75 | true 76 | WIN32;NDEBUG;_WINDOWS;_USRDLL;HOOKMSG_EXPORTS;%(PreprocessorDefinitions) 77 | true 78 | MultiThreaded 79 | 80 | 81 | Windows 82 | true 83 | true 84 | true 85 | $(solutionDir)bin\AutoToast.dll 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /AutoToast/HookMSG.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 23 | 24 | 头文件 25 | 26 | 27 | 28 | 29 | 资源文件 30 | 31 | 32 | -------------------------------------------------------------------------------- /AutoToast/HookMSG.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | false 5 | NativeOnly 6 | WindowsLocalDebugger 7 | $(solutiondir)bin\virtualkeyboard_d.exe 8 | 9 | -------------------------------------------------------------------------------- /AutoToast/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/AutoToast/main.cpp -------------------------------------------------------------------------------- /AutoToast/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/AutoToast/resource.h -------------------------------------------------------------------------------- /Entry.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/Entry.cpp -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `virtualkeyboard` 2 | 用duilib写的一个 `虚拟键盘` ,可以参考学习 `duilib` 的一些用法和鼠标消息的 `hook` ,今天开源出来供学习。 3 | 功能难免不够完善,欢迎修正bug和添加功能,本人比较忙,有可能没时间后期维护,谨慎直接用于 `商业项目` 4 | ![image](https://github.com/CodeBees/virtualkeyboard/blob/master/virtualkeyboard.png) 5 | 6 | 7 | [duilib链接地址](https://github.com/CodeBees/duilib-Ex-Debug) 8 | -------------------------------------------------------------------------------- /bin/AutoToast.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/bin/AutoToast.dll -------------------------------------------------------------------------------- /bin/AutoToast_d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/bin/AutoToast_d.dll -------------------------------------------------------------------------------- /bin/DuiLib_u.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/bin/DuiLib_u.dll -------------------------------------------------------------------------------- /bin/DuiLib_ud.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/bin/DuiLib_ud.dll -------------------------------------------------------------------------------- /bin/Skin/DuiDesigner_u.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/bin/Skin/DuiDesigner_u.exe -------------------------------------------------------------------------------- /bin/Skin/DuiLib_u.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/bin/Skin/DuiLib_u.dll -------------------------------------------------------------------------------- /bin/Skin/button_set.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeBees/virtualkeyboard/192bedb392a654e2bfc8b9062e09c77b8de512fb/bin/Skin/button_set.png -------------------------------------------------------------------------------- /bin/Skin/skin-num.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 13 |