Skip to content

Commit

Permalink
1、Edit获取焦点后默认选择全部
Browse files Browse the repository at this point in the history
2、WebBrowserEventHandler增加浏览器指针参数(用于区分那个浏览器控件)
  • Loading branch information
qdtroy committed Dec 22, 2015
1 parent 53d2e5f commit 18b0b3b
Show file tree
Hide file tree
Showing 19 changed files with 1,731 additions and 1,674 deletions.
Binary file not shown.
Binary file not shown.
Binary file removed Demos/ADMonSetup/Debug/ADMonSetup.res
Binary file not shown.
Binary file removed Demos/ADMonSetup/Debug/ADMonSetup_manifest.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion Demos/duidemo/MainWnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CDemoFrame : public WindowImplBase, public CWebBrowserEventHandler, public
// 初始化资源管理器
void InitResource()
{
if (GetResourceType()==UILIB_RESOURCE)
if (GetResourceType() == UILIB_RESOURCE)
{
// 加载资源管理器
CResourceManager::GetInstance()->LoadResource(_T("IDR_RES"), _T("xml"));
Expand Down
766 changes: 411 additions & 355 deletions DuiLib.sln

Large diffs are not rendered by default.

Binary file modified DuiLib.suo
Binary file not shown.
6 changes: 5 additions & 1 deletion DuiLib/Control/UIEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ namespace DuiLib
styleValue |= pOwner->GetWindowStyls();
::SetWindowLong(GetHWND(), GWL_STYLE, styleValue);
::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE);
::SetFocus(m_hWnd);

int cchLen = ::GetWindowTextLength(m_hWnd);
if(cchLen <= 0) cchLen = 1;
::SetFocus(m_hWnd);
::SendMessage(m_hWnd, EM_SETSEL, 0, cchLen);
m_bInit = true;
}

Expand Down
1 change: 0 additions & 1 deletion DuiLib/Control/UIOption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ namespace DuiLib

void COptionUI::PaintStatusImage(HDC hDC)
{

if( (m_uButtonState & UISTATE_PUSHED) != 0 && IsSelected() && !m_sSelectedPushedImage.IsEmpty()) {
if( !DrawImage(hDC, (LPCTSTR)m_sSelectedPushedImage) )
m_sSelectedPushedImage.Empty();
Expand Down
48 changes: 24 additions & 24 deletions DuiLib/Control/UIWebBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ void DuiLib::CWebBrowserUI::BeforeNavigate2( IDispatch *pDisp,VARIANT *&url,VARI
{
if (m_pWebBrowserEventHandler)
{
m_pWebBrowserEventHandler->BeforeNavigate2(pDisp,url,Flags,TargetFrameName,PostData,Headers,Cancel);
m_pWebBrowserEventHandler->BeforeNavigate2(this, pDisp,url,Flags,TargetFrameName,PostData,Headers,Cancel);
}
}

void DuiLib::CWebBrowserUI::NavigateError( IDispatch *pDisp,VARIANT * &url,VARIANT *&TargetFrameName,VARIANT *&StatusCode,VARIANT_BOOL *&Cancel )
{
if (m_pWebBrowserEventHandler)
{
m_pWebBrowserEventHandler->NavigateError(pDisp,url,TargetFrameName,StatusCode,Cancel);
m_pWebBrowserEventHandler->NavigateError(this, pDisp,url,TargetFrameName,StatusCode,Cancel);
}
}

Expand All @@ -221,46 +221,46 @@ void DuiLib::CWebBrowserUI::NavigateComplete2( IDispatch *pDisp,VARIANT *&url )

if (m_pWebBrowserEventHandler)
{
m_pWebBrowserEventHandler->NavigateComplete2(pDisp,url);
m_pWebBrowserEventHandler->NavigateComplete2(this, pDisp,url);
}
}

void DuiLib::CWebBrowserUI::ProgressChange( LONG nProgress, LONG nProgressMax )
{
if (m_pWebBrowserEventHandler)
{
m_pWebBrowserEventHandler->ProgressChange(nProgress,nProgressMax);
m_pWebBrowserEventHandler->ProgressChange(this, nProgress,nProgressMax);
}
}

void DuiLib::CWebBrowserUI::NewWindow3( IDispatch **pDisp, VARIANT_BOOL *&Cancel, DWORD dwFlags, BSTR bstrUrlContext, BSTR bstrUrl )
{
if (m_pWebBrowserEventHandler)
{
m_pWebBrowserEventHandler->NewWindow3(pDisp,Cancel,dwFlags,bstrUrlContext,bstrUrl);
m_pWebBrowserEventHandler->NewWindow3(this, pDisp,Cancel,dwFlags,bstrUrlContext,bstrUrl);
}
}
void DuiLib::CWebBrowserUI::CommandStateChange(long Command,VARIANT_BOOL Enable)
{
if (m_pWebBrowserEventHandler)
{
m_pWebBrowserEventHandler->CommandStateChange(Command,Enable);
m_pWebBrowserEventHandler->CommandStateChange(this, Command,Enable);
}
}

void DuiLib::CWebBrowserUI::TitleChange(BSTR bstrTitle)
{
if (m_pWebBrowserEventHandler)
{
m_pWebBrowserEventHandler->TitleChange(bstrTitle);
m_pWebBrowserEventHandler->TitleChange(this, bstrTitle);
}
}

void DuiLib::CWebBrowserUI::DocumentComplete(IDispatch *pDisp, VARIANT *&url)
{
if (m_pWebBrowserEventHandler)
{
m_pWebBrowserEventHandler->DocumentComplete(pDisp, url);
m_pWebBrowserEventHandler->DocumentComplete(this, pDisp, url);
}
}

Expand All @@ -269,7 +269,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::Download( /* [in] */ IMoniker *pmk, /* [in]
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->Download(pmk,pbc,dwBindVerb,grfBINDF,pBindInfo,pszHeaders,pszRedir,uiCP);
return m_pWebBrowserEventHandler->Download(this, pmk,pbc,dwBindVerb,grfBINDF,pBindInfo,pszHeaders,pszRedir,uiCP);
}
return S_OK;
}
Expand All @@ -279,7 +279,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::ShowContextMenu( DWORD dwID, POINT* pptPosit
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->ShowContextMenu(dwID,pptPosition,pCommandTarget,pDispatchObjectHit);
return m_pWebBrowserEventHandler->ShowContextMenu(this, dwID,pptPosition,pCommandTarget,pDispatchObjectHit);
}
return S_FALSE;
}
Expand All @@ -288,7 +288,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::GetHostInfo( DOCHOSTUIINFO* pInfo )
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->GetHostInfo(pInfo);
return m_pWebBrowserEventHandler->GetHostInfo(this, pInfo);
}
return E_NOTIMPL;
}
Expand All @@ -297,7 +297,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::ShowUI( DWORD dwID, IOleInPlaceActiveObject*
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->ShowUI(dwID,pActiveObject,pCommandTarget,pFrame,pDoc);
return m_pWebBrowserEventHandler->ShowUI(this, dwID,pActiveObject,pCommandTarget,pFrame,pDoc);
}
return S_OK;
}
Expand All @@ -306,7 +306,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::HideUI()
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->HideUI();
return m_pWebBrowserEventHandler->HideUI(this);
}
return S_OK;
}
Expand All @@ -315,7 +315,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::UpdateUI()
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->UpdateUI();
return m_pWebBrowserEventHandler->UpdateUI(this);
}
return S_OK;
}
Expand All @@ -324,7 +324,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::EnableModeless( BOOL fEnable )
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->EnableModeless(fEnable);
return m_pWebBrowserEventHandler->EnableModeless(this, fEnable);
}
return E_NOTIMPL;
}
Expand All @@ -333,7 +333,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::OnDocWindowActivate( BOOL fActivate )
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->OnDocWindowActivate(fActivate);
return m_pWebBrowserEventHandler->OnDocWindowActivate(this, fActivate);
}
return E_NOTIMPL;
}
Expand All @@ -342,7 +342,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::OnFrameWindowActivate( BOOL fActivate )
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->OnFrameWindowActivate(fActivate);
return m_pWebBrowserEventHandler->OnFrameWindowActivate(this, fActivate);
}
return E_NOTIMPL;
}
Expand All @@ -351,7 +351,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::ResizeBorder( LPCRECT prcBorder, IOleInPlace
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->ResizeBorder(prcBorder,pUIWindow,fFrameWindow);
return m_pWebBrowserEventHandler->ResizeBorder(this, prcBorder,pUIWindow,fFrameWindow);
}
return E_NOTIMPL;
}
Expand All @@ -360,7 +360,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::TranslateAccelerator( LPMSG lpMsg, const GUI
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->TranslateAccelerator(lpMsg,pguidCmdGroup,nCmdID);
return m_pWebBrowserEventHandler->TranslateAccelerator(this, lpMsg,pguidCmdGroup,nCmdID);
}
return S_FALSE;
}
Expand Down Expand Up @@ -404,7 +404,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::GetOptionKeyPath( LPOLESTR* pchKey, DWORD dw
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->GetOptionKeyPath(pchKey,dwReserved);
return m_pWebBrowserEventHandler->GetOptionKeyPath(this, pchKey,dwReserved);
}
return E_NOTIMPL;
}
Expand All @@ -413,7 +413,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::GetDropTarget( IDropTarget* pDropTarget, IDr
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->GetDropTarget(pDropTarget,ppDropTarget);
return m_pWebBrowserEventHandler->GetDropTarget(this, pDropTarget,ppDropTarget);
}
return S_FALSE; // 使用系统拖拽
}
Expand All @@ -422,7 +422,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::GetExternal( IDispatch** ppDispatch )
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->GetExternal(ppDispatch);
return m_pWebBrowserEventHandler->GetExternal(this, ppDispatch);
}
return S_FALSE;
}
Expand All @@ -431,7 +431,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::TranslateUrl( DWORD dwTranslate, OLECHAR* pc
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->TranslateUrl(dwTranslate,pchURLIn,ppchURLOut);
return m_pWebBrowserEventHandler->TranslateUrl(this, dwTranslate,pchURLIn,ppchURLOut);
}
else
{
Expand All @@ -444,7 +444,7 @@ STDMETHODIMP DuiLib::CWebBrowserUI::FilterDataObject( IDataObject* pDO, IDataObj
{
if (m_pWebBrowserEventHandler)
{
return m_pWebBrowserEventHandler->FilterDataObject(pDO,ppDORet);
return m_pWebBrowserEventHandler->FilterDataObject(this, pDO,ppDORet);
}
else
{
Expand Down
Loading

0 comments on commit 18b0b3b

Please sign in to comment.