Skip to content

Commit

Permalink
警告:本次更新修改了结构,请勿直接覆盖老版本项目
Browse files Browse the repository at this point in the history
1.重构Dui结构
 1)分离控件为单独源码文件
 2)结构分类
2.重构CStdString为CDuiString
3.重构CRect为CDuiRect
4.调整了编译输出目录,lib和pdb不创建到bin目录
5.添加WinImplBase.hpp到Utils目录
  • Loading branch information
daviyang35@gmail.com committed Aug 11, 2012
1 parent b87da1c commit ce83b16
Show file tree
Hide file tree
Showing 107 changed files with 8,646 additions and 8,284 deletions.
6 changes: 3 additions & 3 deletions 360SafeDemo/360Safe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class C360SafeFrameWnd : public CWindowWnd, public INotifyUI
}
else if(msg.sType==_T("selectchanged"))
{
CStdString name = msg.pSender->GetName();
CDuiString name = msg.pSender->GetName();
CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
if(name==_T("examine"))
pControl->SelectItem(0);
Expand Down Expand Up @@ -148,7 +148,7 @@ class C360SafeFrameWnd : public CWindowWnd, public INotifyUI
{
SIZE szRoundCorner = m_pm.GetRoundCorner();
if( !::IsIconic(*this) && (szRoundCorner.cx != 0 || szRoundCorner.cy != 0) ) {
CRect rcWnd;
CDuiRect rcWnd;
::GetWindowRect(*this, &rcWnd);
rcWnd.Offset(-rcWnd.left, -rcWnd.top);
rcWnd.right++; rcWnd.bottom++;
Expand All @@ -166,7 +166,7 @@ class C360SafeFrameWnd : public CWindowWnd, public INotifyUI
MONITORINFO oMonitor = {};
oMonitor.cbSize = sizeof(oMonitor);
::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
CRect rcWork = oMonitor.rcWork;
CDuiRect rcWork = oMonitor.rcWork;
rcWork.Offset(-rcWork.left, -rcWork.top);

LPMINMAXINFO lpMMI = (LPMINMAXINFO) lParam;
Expand Down
8 changes: 4 additions & 4 deletions 360SafeDemo/StdAfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ using namespace DuiLib;

#ifdef _DEBUG
# ifdef _UNICODE
# pragma comment(lib, "..\\bin\\DuiLib_ud.lib")
# pragma comment(lib, "..\\Lib\\DuiLib_ud.lib")
# else
# pragma comment(lib, "..\\bin\\DuiLib_d.lib")
# pragma comment(lib, "..\\Lib\\DuiLib_d.lib")
# endif
#else
# ifdef _UNICODE
# pragma comment(lib, "..\\bin\\DuiLib_u.lib")
# pragma comment(lib, "..\\Lib\\DuiLib_u.lib")
# else
# pragma comment(lib, "..\\bin\\DuiLib.lib")
# pragma comment(lib, "..\\Lib\\DuiLib.lib")
# endif
#endif

Expand Down
2 changes: 2 additions & 0 deletions DuiDesigner/DuiDesigner.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
OutputFile="..\bin\DuiDesigner_d.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\$(ConfigurationName)\$(TargetName).pdb"
SubSystem="2"
TargetMachine="1"
/>
Expand Down Expand Up @@ -155,6 +156,7 @@
OutputFile="..\bin\DuiDesigner.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\$(ConfigurationName)\$(TargetName).pdb"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
Expand Down
4 changes: 2 additions & 2 deletions DuiDesigner/ImageDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ BOOL CImageDialog::OnInitDialog()

m_strImagePathName=m_strImageProperty;
LPCTSTR pStrImage=m_strImageProperty;
CStdString sItem;
CStdString sValue;
CDuiString sItem;
CDuiString sValue;
LPTSTR pstr = NULL;
while( *pStrImage != _T('\0') ) {
sItem.Empty();
Expand Down
2 changes: 1 addition & 1 deletion DuiDesigner/ImagePreview.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include "../DuiLib/UIRender.h"
#include "../DuiLib/Core/UIRender.h"

//////////////////////////////////////////////////////////////////////////
// CImagePreview
Expand Down
18 changes: 9 additions & 9 deletions DuiDesigner/LayoutManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,12 @@ class CUserDefineUI : public CControlUI
virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
{
TRACE(_T("%s:%s\n"),pstrName,pstrValue);
m_pAttributeList[CStdString(pstrName)]=CStdString(pstrValue);
m_pAttributeList[CDuiString(pstrName)]=CDuiString(pstrValue);
}

std::map<CStdString,CStdString> m_pAttributeList;
std::map<CDuiString,CDuiString> m_pAttributeList;
protected:
CStdString mClassName;
CDuiString mClassName;
};

CControlUI* CLayoutManager::CreateControl(LPCTSTR pstrClass)
Expand Down Expand Up @@ -1037,7 +1037,7 @@ CControlUI* CLayoutManager::CloneControl(CControlUI* pControl)
pCopyControl = new CContainerUI(*static_cast<CContainerUI*>(pControl->GetInterface(_T("Container"))));
break;
case classChildWindow:
pCopyControl = new CChildWindowUI(*static_cast<CChildWindowUI*>(pControl->GetInterface(_T("ChildWindow"))));
pCopyControl = new CChildLayoutUI(*static_cast<CChildLayoutUI*>(pControl->GetInterface(_T("ChildLayout"))));
break;
case classVerticalLayout:
pCopyControl = new CVerticalLayoutUI(*static_cast<CVerticalLayoutUI*>(pControl->GetInterface(_T("VerticalLayout"))));
Expand Down Expand Up @@ -2194,7 +2194,7 @@ void CLayoutManager::SaveProperties(CControlUI* pControl, TiXmlElement* pParentN
CUserDefineUI* pUserDefinedControl=static_cast<CUserDefineUI*>(pControl->GetInterface(_T("UserDefinedControl")));
if (pUserDefinedControl!=NULL)
{
std::map<CStdString,CStdString>::iterator iter=pUserDefinedControl->m_pAttributeList.begin();
std::map<CDuiString,CDuiString>::iterator iter=pUserDefinedControl->m_pAttributeList.begin();
for (;iter!=pUserDefinedControl->m_pAttributeList.end();iter++)
{
pNode->SetAttribute(StringConvertor::WideToUtf8(iter->first),StringConvertor::WideToUtf8(iter->second));
Expand Down Expand Up @@ -2676,7 +2676,7 @@ void CLayoutManager::SaveItemProperty( CControlUI* pControl, TiXmlElement* pNode
if(pListInfo->sDisabledImage && _tcslen(pListInfo->sDisabledImage) > 0)
pNode->SetAttribute("itemdisabledimage", StringConvertor::WideToUtf8(ConvertImageFileName(pListInfo->sDisabledImage)));

CStdString tstrAlgin;
CDuiString tstrAlgin;
UINT uTextStyle = pListInfo->uTextStyle;

if(uTextStyle == DT_LEFT)
Expand Down Expand Up @@ -2713,12 +2713,12 @@ void CLayoutManager::SaveChildWindowProperty( CControlUI* pControl, TiXmlElement
SaveControlProperty(pControl , pNode);

ASSERT(pControl);
CChildWindowUI* pChildWindow=static_cast<CChildWindowUI*>(pControl->GetInterface(_T("ChildWindow")));
CChildLayoutUI* pChildWindow=static_cast<CChildLayoutUI*>(pControl->GetInterface(_T("ChildLayout")));
ASSERT(pChildWindow);

if ( ! pChildWindow->GetChildWindowXML().IsEmpty())
if ( ! pChildWindow->GetChildLayoutXML().IsEmpty())
{
pNode->SetAttribute("xmlfile",StringConvertor::WideToUtf8(pChildWindow->GetChildWindowXML()));
pNode->SetAttribute("xmlfile",StringConvertor::WideToUtf8(pChildWindow->GetChildLayoutXML()));
}
}

Expand Down
12 changes: 6 additions & 6 deletions DuiDesigner/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@

#ifdef _DEBUG
# ifdef _UNICODE
# pragma comment(lib, "..\\bin\\DuiLib_ud.lib")
# pragma comment(lib, "..\\Lib\\DuiLib_ud.lib")
# else
# pragma comment(lib, "..\\bin\\DuiLib_d.lib")
# pragma comment(lib, "..\\Lib\\DuiLib_d.lib")
# endif
#else
# ifdef _UNICODE
# pragma comment(lib, "..\\bin\\DuiLib_u.lib")
# pragma comment(lib, "..\\Lib\\DuiLib_u.lib")
# else
# pragma comment(lib, "..\\bin\\DuiLib.lib")
# pragma comment(lib, "..\\Lib\\DuiLib.lib")
# endif
#endif

Expand Down Expand Up @@ -165,7 +165,7 @@ using DuiLib::IMessageFilterUI;
using DuiLib::CStdPtrArray;
using DuiLib::CStdValArray;
using DuiLib::CStdStringPtrMap;
using DuiLib::CStdString;
using DuiLib::CDuiString;
using DuiLib::TListInfoUI;
using DuiLib::CRenderEngine;
using DuiLib::CDialogBuilder;
Expand All @@ -181,7 +181,7 @@ using DuiLib::CSliderUI;
using DuiLib::CProgressUI;
using DuiLib::CActiveXUI;
using DuiLib::CContainerUI;
using DuiLib::CChildWindowUI;
using DuiLib::CChildLayoutUI;
using DuiLib::CVerticalLayoutUI;
using DuiLib::CHorizontalLayoutUI;
using DuiLib::CTabLayoutUI;
Expand Down
18 changes: 10 additions & 8 deletions DuiLib/UIActiveX.cpp → DuiLib/Control/UIActiveX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ STDMETHODIMP CActiveXCtrl::GetDC(LPCRECT pRect, DWORD grfFlags, HDC* phDC)
if( m_pOwner == NULL ) return E_UNEXPECTED;
*phDC = ::GetDC(m_pOwner->m_hwndHost);
if( (grfFlags & OLEDC_PAINTBKGND) != 0 ) {
CRect rcItem = m_pOwner->GetPos();
CDuiRect rcItem = m_pOwner->GetPos();
if( !m_bWindowless ) rcItem.ResetOffset();
::FillRect(*phDC, &rcItem, (HBRUSH) (COLOR_WINDOW + 1));
}
Expand Down Expand Up @@ -577,7 +577,7 @@ STDMETHODIMP CActiveXCtrl::OnInPlaceActivateEx(BOOL* pfNoRedraw, DWORD dwFlags)
Hr = m_pOwner->m_pUnk->QueryInterface(IID_IOleInPlaceObject, (LPVOID*) &m_pInPlaceObject);
}
if( m_pInPlaceObject != NULL ) {
CRect rcItem = m_pOwner->m_rcItem;
CDuiRect rcItem = m_pOwner->m_rcItem;
if( !m_bWindowless ) rcItem.ResetOffset();
m_pInPlaceObject->SetObjectRects(&rcItem, &rcItem);
}
Expand Down Expand Up @@ -958,10 +958,12 @@ HRESULT CActiveXCtrl::CreateActiveXWnd()
HRESULT CActiveXCtrl::RegisterEventHandler( BOOL inAdvise )
{
IWebBrowser2* pWebBrowser=NULL;
IConnectionPointContainer *pCPC;
IConnectionPoint *pCP;
m_pOwner->GetControl(IID_IWebBrowser2, (void**)&pWebBrowser);
HRESULT hr=pWebBrowser->QueryInterface(IID_IConnectionPointContainer,(void **)&pCPC);
IConnectionPointContainer *pCPC=NULL;
IConnectionPoint *pCP=NULL;
HRESULT hr=m_pOwner->GetControl(IID_IWebBrowser2, (void**)&pWebBrowser);
if (FAILED(hr))
return hr;
hr=pWebBrowser->QueryInterface(IID_IConnectionPointContainer,(void **)&pCPC);
if (FAILED(hr))
return hr;

Expand Down Expand Up @@ -1220,7 +1222,7 @@ void CActiveXUI::SetPos(RECT rc)
m_pUnk->SetExtent(DVASPECT_CONTENT, &hmSize);
}
if( m_pControl->m_pInPlaceObject != NULL ) {
CRect rcItem = m_rcItem;
CDuiRect rcItem = m_rcItem;
if( !m_pControl->m_bWindowless ) rcItem.ResetOffset();
m_pControl->m_pInPlaceObject->SetObjectRects(&rcItem, &rcItem);
}
Expand Down Expand Up @@ -1435,7 +1437,7 @@ CLSID CActiveXUI::GetClisd() const
return m_clsid;
}

CStdString CActiveXUI::GetModuleName() const
CDuiString CActiveXUI::GetModuleName() const
{
return m_sModuleName;
}
Expand Down
6 changes: 3 additions & 3 deletions DuiLib/UIActiveX.h → DuiLib/Control/UIActiveX.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once
#include <mshtmhst.h>
#include "downloadmgr.h"
#include "Utils/downloadmgr.h"
struct IOleObject;


Expand Down Expand Up @@ -45,7 +45,7 @@ class UILIB_API CActiveXUI : public CControlUI, public IMessageFilterUI
bool CreateControl(LPCTSTR pstrCLSID);
HRESULT GetControl(const IID iid, LPVOID* ppRet);
CLSID GetClisd() const;
CStdString GetModuleName() const;
CDuiString GetModuleName() const;
void SetModuleName(LPCTSTR pstrText);

void SetVisible(bool bVisible = true);
Expand All @@ -66,7 +66,7 @@ class UILIB_API CActiveXUI : public CControlUI, public IMessageFilterUI

protected:
CLSID m_clsid;
CStdString m_sModuleName;
CDuiString m_sModuleName;
bool m_bCreated;
bool m_bDelayCreate;
IOleObject* m_pUnk;
Expand Down
Loading

0 comments on commit ce83b16

Please sign in to comment.