Skip to content

Commit

Permalink
修正二次菜单控件内存泄漏的问题;
Browse files Browse the repository at this point in the history
修正List可编辑模式Edit显示错位的问题;
  • Loading branch information
qdtroy committed Jun 16, 2017
1 parent 6c5e218 commit 822f994
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Demos/duidemo/MainWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ void CMainWnd::InitWindow()
pListItem->SetChildVAlign(DT_VCENTER);
pListItem->SetFixedHeight(30);
pListItem->SetManager(&m_pm, NULL, false);
pListItem->SetFixedWidth(100);
pList->Add(pListItem);
CButtonUI* pBtn1 = new CButtonUI();
pBtn1->SetManager(&m_pm, NULL, false);
Expand All @@ -142,6 +143,7 @@ void CMainWnd::InitWindow()

CDialogBuilder builder1;
CListContainerElementUI* pListItem1 = (CListContainerElementUI*)builder1.Create(_T("listitem.xml"), NULL, this, &m_pm, NULL);

pList->Add(pListItem1);
for(int i = 0; i < 20; i++)
{
Expand Down
3 changes: 2 additions & 1 deletion DuiLib/Control/UIList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ namespace DuiLib {
if( pListItem != NULL ) {
pListItem->SetOwner(this);
pListItem->SetIndex(GetCount());
return m_pList->Add(pControl);
}
return m_pList->Add(pControl);
return CVerticalLayoutUI::Add(pControl);
}

bool CListUI::AddAt(CControlUI* pControl, int iIndex)
Expand Down
1 change: 0 additions & 1 deletion DuiLib/Control/UIList.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ namespace DuiLib {

virtual BOOL CheckColumEditable(int nColum) { return FALSE; };
virtual CEditUI* GetEditUI() { return NULL; };

virtual BOOL CheckColumComboBoxable(int nColum) { return FALSE; };
virtual CComboBoxUI* GetComboBoxUI() { return NULL; };

Expand Down
2 changes: 1 addition & 1 deletion DuiLib/Control/UIMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ namespace DuiLib {
if( pDefaultAttributes ) {
m_pLayout->ApplyAttributeList(pDefaultAttributes);
}
m_pLayout->SetAutoDestroy(false);
m_pLayout->GetList()->SetAutoDestroy(false);

for( int i = 0; i < m_pOwner->GetCount(); i++ ) {
if(m_pOwner->GetItemAt(i)->GetInterface(_T("MenuElement")) != NULL ){
Expand Down
2 changes: 1 addition & 1 deletion bin/skin/duidemo/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
<ListHeaderItem text="成绩" width="160" hotimage="res='common/list_header_hot.png'" pushedimage="res='common/list_header_pushed.png'" sepimage="res='common/list_header_sep.png'" sepwidth="1"/>
<ListHeaderItem text="审核" width="160" hotimage="res='common/list_header_hot.png'" pushedimage="res='common/list_header_pushed.png'" sepimage="res='common/list_header_sep.png'" sepwidth="1"/>
</ListHeader>
<!--<Include source="listitem.xml"/>-->
<Include source="listitem.xml"/>
</List>
</VerticalLayout>
</HorizontalLayout>
Expand Down

0 comments on commit 822f994

Please sign in to comment.