Skip to content

Commit

Permalink
Sync class & file name DUIStatic --> DUILabel
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Jun 30, 2020
1 parent 09e4eb5 commit 58395c6
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 24 deletions.
2 changes: 1 addition & 1 deletion DmMain/inc/Widgets/DMWidgetDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace DM
{
// ----------------------------------------------------
// 内置窗口定义
#define DUINAME_Static L"label" // DUI Static
#define DUINAME_Label L"label" // DUI Label
#define DUINAME_Group L"group" // DUI Group
#define DUINAME_CheckBox L"checkbox" // DUI CheckBox
#define DUINAME_Link L"link" // DUI Link
Expand Down
25 changes: 14 additions & 11 deletions DmMain/inc/Widgets/DUIStatic.h → DmMain/inc/Widgets/DUILabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Copyright (c) DuiMagic
// All rights reserved.
//
// File Name: DUIStatic.h
// File Des: 内置static实现
// File Name: DUILabel.h
// File Des: 内置Label实现
// File Summary:
// Cur Version: 1.0
// Author:
Expand All @@ -17,27 +17,27 @@
namespace DMAttr
{
/// <summary>
/// <see cref="DM::DUIStatic"/>的xml属性定义
/// <see cref="DM::DUILabel"/>的xml属性定义
/// </summary>
class DUIStaticAttr:public DUIWindowAttr
class DUILabelAttr:public DUIWindowAttr
{
public:
static wchar_t* bool_bmultiLines; ///< 是否支持多行,示例:bmultiLines="1"
static wchar_t* INT_lineinter; ///< 行间距,默认为5,示例:lineinter="5"
};
DMAttrValueInit(DUIStaticAttr,bool_bmultiLines)DMAttrValueInit(DUIStaticAttr,INT_lineinter)
DMAttrValueInit(DUILabelAttr,bool_bmultiLines)DMAttrValueInit(DUILabelAttr,INT_lineinter)
}

namespace DM
{
/// <summary>
/// DUIStatic的内置实现
/// DUILabel的内置实现
/// </summary>
class DM_EXPORT DUIStatic:public DUIWindow
class DM_EXPORT DUILabel :public DUIWindow
{
DMDECLARE_CLASS_NAME(DUIStatic,DUINAME_Static,DMREG_Window);
DMDECLARE_CLASS_NAME(DUILabel,DUINAME_Label,DMREG_Window);
public:
DUIStatic();
DUILabel();

//---------------------------------------------------
// Function Des: 重载DUIWindow
Expand All @@ -46,12 +46,15 @@ namespace DM

public:
DM_BEGIN_ATTRIBUTES()
DM_bool_ATTRIBUTE(DMAttr::DUIStaticAttr::bool_bmultiLines, m_bMultiLines, DM_ECODE_OK)
DM_INT_ATTRIBUTE(DMAttr::DUIStaticAttr::INT_lineinter, m_nLineInter, DM_ECODE_OK)
DM_bool_ATTRIBUTE(DMAttr::DUILabelAttr::bool_bmultiLines, m_bMultiLines, DM_ECODE_OK)
DM_INT_ATTRIBUTE(DMAttr::DUILabelAttr::INT_lineinter, m_nLineInter, DM_ECODE_OK)
DM_END_ATTRIBUTES()
public:
bool m_bMultiLines;
int m_nLineInter;
};

// [deprecated]
typedef DUILabel DUIStatic;

}//namespace DM
4 changes: 2 additions & 2 deletions DmMain/src/Modules/DMPluginImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "DUIListBox.h"
#include "DUIListBoxEx.h"
#include "DUIEdit.h"
#include "DUIStatic.h"
#include "DUILabel.h"
#include "DUILink.h"
#include "DUIComboBox.h"
#include "DUIActiveX.h"
Expand Down Expand Up @@ -141,7 +141,7 @@ namespace DM
iErr = g_pDMApp->Register(DMRegHelperT<DUIRichEdit>(),true);
iErr = g_pDMApp->Register(DMRegHelperT<DUIEdit>(),true);
new DUIEditHelper;// 和edit相关
iErr = g_pDMApp->Register(DMRegHelperT<DUIStatic>(),true);
iErr = g_pDMApp->Register(DMRegHelperT<DUILabel>(),true);
iErr = g_pDMApp->Register(DMRegHelperT<DUILink>(),true);
iErr = g_pDMApp->Register(DMRegHelperT<DUIComboBox>(),true);
iErr = g_pDMApp->Register(DMRegHelperT<DUIGif>(),true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include "DmMainAfx.h"
#include "DUIStatic.h"
#include "DUILabel.h"

namespace DM
{
DUIStatic::DUIStatic()
DUILabel::DUILabel()
{
m_bMultiLines = false;
m_nLineInter = 5;
m_pDUIXmlInfo->m_bMsgNoHandle = true;
}

DMCode DUIStatic::DV_DrawText(IDMCanvas* pCanvas, LPCWSTR pszBuf,int cchText,LPRECT pRect,UINT uFormat)
DMCode DUILabel::DV_DrawText(IDMCanvas* pCanvas, LPCWSTR pszBuf,int cchText,LPRECT pRect,UINT uFormat)
{
do
{
Expand Down
4 changes: 2 additions & 2 deletions Docs/TestData/DesignerRes/DMAttr.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Docs/TestData/DesignerRes/DMCls.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<duistyleattr />
</window>
<label>
<duistaticattr />
<duilabelattr />
<duiwindowattr />
<duistyleattr />
</label>
Expand Down
2 changes: 1 addition & 1 deletion Samples/DMDesigner/inc/DMDesignerAfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "DUICheckBox.h"
#include "DUIEdit.h"
#include "DUIMenu.h"
#include "DUIStatic.h"
#include "DUILabel.h"
#include "DUITabCtrl.h"
#include "DUIFlowLayout.h"
#include "DUIListBoxEx.h"
Expand Down
2 changes: 1 addition & 1 deletion Samples/DMDesigner/src/Core/WidgetAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ void WidgetAttr::InitSpecialValue(CStringW& strValue, DMXmlInitAttrPtr pInitAttr
{
strInitValue = L"0";
}
if (0 == m_strList[0].CompareNoCase(L"DUIStaticAttr") && 0 == _wcsicmp(pInitAttr->m_pAttr->GetName(),L"bool_bmsgnohandle"))
if (0 == m_strList[0].CompareNoCase(L"DUILabelAttr") && 0 == _wcsicmp(pInitAttr->m_pAttr->GetName(),L"bool_bmsgnohandle"))
{
strInitValue = L"1";
}
Expand Down
2 changes: 1 addition & 1 deletion Samples/QQDemo/inc/QQDemoAfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ using namespace DM;
#include "DUITreeCtrl.h"
#include "DUIGif.h"
#include "DMResFolderImpl.h"
#include "DUIStatic.h"
#include "DUILabel.h"
#include "DMSpyTool.h"
2 changes: 1 addition & 1 deletion Samples/TGPDemo/inc/TGPDemoAfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ using namespace DM;
#include "DUITreeCtrl.h"
#include "DUIGif.h"
#include "DMResFolderImpl.h"
#include "DUIStatic.h"
#include "DUILabel.h"
#include "TGPMenu.h"

0 comments on commit 58395c6

Please sign in to comment.