本文整理汇总了C++中SWindow类的典型用法代码示例。如果您正苦于以下问题:C++ SWindow类的具体用法?C++ SWindow怎么用?C++ SWindow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SWindow类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsViewportFullscreen
bool FSlateRenderer::IsViewportFullscreen( const SWindow& Window ) const
{
check( IsThreadSafeForSlateRendering() );
bool bFullscreen = false;
if (FPlatformProperties::SupportsWindowedMode())
{
if( GIsEditor)
{
bFullscreen = false;
}
else
{
bFullscreen = Window.GetWindowMode() == EWindowMode::Fullscreen;
}
}
else
{
bFullscreen = true;
}
return bFullscreen;
}
示例2: SetMsgHandled
void CMainDlg::OnSize(UINT nType, CSize size)
{
SetMsgHandled(FALSE);
SWindow *pBtnMax = FindChildByName(L"btn_max");
SWindow *pBtnRestore = FindChildByName(L"btn_restore");
if(!pBtnMax || !pBtnRestore) return;
if (nType == SIZE_MAXIMIZED)
{
pBtnRestore->SetVisible(TRUE);
pBtnMax->SetVisible(FALSE);
}
else if (nType == SIZE_RESTORED)
{
pBtnRestore->SetVisible(FALSE);
pBtnMax->SetVisible(TRUE);
}
}
示例3: SetMsgHandled
void CMainDlg::OnSize(UINT nType, CSize size)
{
SetMsgHandled(FALSE);
if (!m_bLayoutInited) return;
SWindow *pBtnMax = FindChildByName(L"btn_max");
SWindow *pBtnRestore = FindChildByName(L"btn_restore");
if(!pBtnMax || !pBtnRestore) return;
if (nType == SIZE_MAXIMIZED)
{
pBtnRestore->SetVisible(TRUE);
pBtnMax->SetVisible(FALSE);
}
else if (nType == SIZE_RESTORED)
{
pBtnRestore->SetVisible(FALSE);
pBtnMax->SetVisible(TRUE);
}
SWindow *pWnd = FindChildByName(L"windname");
if (pWnd)
::MessageBox(0,NULL,NULL,0);
}
示例4: windowAtEventCallback
void SWindow::windowAtEventCallback (s_window_t *window, s_event_t *event)
{
SWindow *win;
win = (SWindow *) window->data;
win->windowAtEvent(window, event);
}
示例5: windowAtExitCallback
void SWindow::windowAtExitCallback (s_window_t *window)
{
SWindow *win;
win = (SWindow *) window->data;
win->windowAtExit(window);
}
示例6: _T
bool CMainDlg::EditsHasEmpty()
{
LPCTSTR names[] = {
L"typeEdit",
L"factoryEdit",
L"weightEdit",
L"speedEdit",
L"powerEdit",
L"lengthEdit",
L"widthEdit",
L"heightEdit",
L"absPEdit",
L"maxPEdit",
L"minPEdit"
L"maxQEdit"
};
LPCTSTR errorMsgs[] = {
_T("型号为空!"),
_T("生产厂家为空!"),
_T("泵重为空!"),
_T("转速为空!"),
_T("电机功率为空!"),
_T("长度为空!"),
_T("宽度为空!"),
_T("高度为空!"),
_T("吸入绝压为空!"),
_T("极限压力为空!"),
_T("最低吸入绝压为空!"),
_T("最大气量为空!")
};
LPCTSTR errorMsgs2[] = {
_T("型号非法!"),
_T("生产厂家非法!"),
_T("泵重非法[请输入整数]!"),
_T("转速非法[请输入整数]!"),
_T("电机功率非法[请输入整数]!"),
_T("长度非法[请输入整数]!"),
_T("宽度非法[请输入整数]!"),
_T("高度非法[请输入整数]!"),
_T("吸入绝压非法[请输入整数]!"),
_T("极限压力非法[请输入整数]!"),
_T("最低吸入绝压非法[请输入整数]!"),
_T("最大气量非法[请输入整数]!")
};
const int typeFlags[] = {
-1,
-1,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
1
};
bool ret = true;
int n = sizeof(names)/sizeof(names[0]);
for(int i=0;i<n;i++)
{
SWindow *pWnd = FindChildByName(names[i]);
if(pWnd == 0) continue;
if(pWnd->GetWindowText().IsEmpty())
{
AfxMessageBox(errorMsgs[i]);
ret = false; break;
}
}
if(!ret) return false;
for(int i=0;i<n;i++)
{
SWindow *pWnd = FindChildByName(names[i]);
CString str = pWnd->GetWindowText();
if(typeFlags[i] == -1)
{
continue;
}
else if(typeFlags[i] == 0)
{
ret = IsInt(str);
}
else
{
ret = IsNum(str);
}
if(!ret)
{
AfxMessageBox(errorMsgs2[i]);
break;
}
//.........这里部分代码省略.........
示例7: GetOwner
void SListBoxEx::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
SWindow *pOwner = GetOwner();
if (pOwner)
pOwner->SSendMessage(WM_CHAR, nChar, MAKELONG(nFlags, nRepCnt));
}
示例8: SMessageBox
void CCodeLineCounterHandler::OnBtnGo()
{
if(m_strDir.IsEmpty())
{
SMessageBox(m_pPageRoot->GetContainer()->GetHostHwnd(),_T("没有指定扫描目录"),_T("错误"),MB_OK|MB_ICONSTOP);
return;
}
SStringT strTypes = m_pPageRoot->FindChildByName(L"edit_filetypes")->GetWindowText();
SStringWList lstTypes;
SplitString(S_CT2W(strTypes),L';',lstTypes);
CODECFGMAP cfg;
for(UINT i=0;i<lstTypes.GetCount();i++)
{
CODECFGMAP::CPair *pPair = m_mapCodeCfg.Lookup(lstTypes[i]);
if(!pPair) continue;
cfg[lstTypes[i]] = pPair->m_value;
}
if(cfg.IsEmpty())
{
SMessageBox(m_pPageRoot->GetContainer()->GetHostHwnd(),_T("没有指定文件类型或者类型无效"),_T("错误"),MB_OK|MB_ICONSTOP);
return;
}
//获得文件列表,计每个目标文件的文件大小
HSTREEITEM hRoot = m_pDirTree->GetRootItem();
SList<FILEINFO> lstFileInfo;
int nDirs = 1;
DWORD szAll = EnumFileInfo(cfg,m_strDir,hRoot,lstFileInfo,nDirs);
if(lstFileInfo.GetCount() == 0)
{
SMessageBox(m_pPageRoot->GetContainer()->GetHostHwnd(),_T("指定的目录下没有找到满足条件的文件类型"),_T("提示"),MB_OK|MB_ICONINFORMATION);
return;
}
//SWindow *pPageResult = m_pPageRoot->FindChildByName(L"page_dir");
SSplitWnd_Row *pSplitTree = m_pPageRoot->FindChildByName2<SSplitWnd_Row>(L"split_tree");
pSplitTree->ShowPane(1);
SProgress *pProgBar = pSplitTree->FindChildByName2<SProgress>(L"prog_run");
pProgBar->SetRange(0,szAll);
pProgBar->SetValue(0);
CLineInfo lineInfoAll;
SMap<SStringW,CLineInfo> mapLineInfo;
for(UINT i=0;i<lstTypes.GetCount();i++)
{
mapLineInfo[lstTypes[i]] = CLineInfo();
}
//统计代码行
DWORD dwProg = 0;
SPOSITION pos = lstFileInfo.GetHeadPosition();
while(pos)
{
FILEINFO fi = lstFileInfo.GetNext(pos);
CLineInfo lineInfo;
CountCodeLines(S_CW2T(fi.strFileName),fi.cfg,lineInfo.nCodeLines,lineInfo.nRemarkLines,lineInfo.nBlankLines);
lineInfoAll += lineInfo;
mapLineInfo[fi.cfg.strExt] += lineInfo;
dwProg += fi.dwSize;
pProgBar->SetValue(dwProg);
pProgBar->UpdateWindow();
}
pSplitTree->HidePane(1);
STabCtrl *pTab = m_pPageRoot->FindChildByName2<STabCtrl>(L"tab_codeline");
pTab->SetCurSel(1);
SWindow *pWndRes = pTab->GetPage(_T("page_result"),FALSE);
pWndRes->FindChildByName(L"txt_folders")->SetWindowText(SStringT().Format(_T("%d"),nDirs));
pWndRes->FindChildByName(L"txt_files")->SetWindowText(SStringT().Format(_T("%d"),lstFileInfo.GetCount()));
pWndRes->FindChildByName(L"txt_codelines")->SetWindowText(SStringT().Format(_T("%d"),lineInfoAll.nCodeLines));
pWndRes->FindChildByName(L"txt_blanklines")->SetWindowText(SStringT().Format(_T("%d"),lineInfoAll.nBlankLines));
pWndRes->FindChildByName(L"txt_remarklines")->SetWindowText(SStringT().Format(_T("%d"),lineInfoAll.nRemarkLines));
SListCtrl *plstReport = pWndRes->FindChildByName2<SListCtrl>(L"lst_linecounter_report");
plstReport->DeleteAllItems();
for(UINT i=0;i<lstTypes.GetCount();i++)
{
CCodeConfig codeCfg = cfg[lstTypes[i]];
CLineInfo lineInfo = mapLineInfo[lstTypes[i]];
plstReport->InsertItem(i,S_CW2T(codeCfg.strType));
plstReport->SetSubItemText(i,1,S_CW2T(codeCfg.strExt));
plstReport->SetSubItemText(i,2,SStringT().Format(_T("%d"),lineInfo.nCodeLines));
plstReport->SetSubItemText(i,3,SStringT().Format(_T("%d"),lineInfo.nBlankLines));
plstReport->SetSubItemText(i,4,SStringT().Format(_T("%d"),lineInfo.nRemarkLines));
}
}
示例9: FindChildByName
//响应菜单事件
void CMainWnd::OnCommand( UINT uNotifyCode, int nID, HWND wndCtl )
{
if(uNotifyCode==0)
{
if(nID==1101)
{//nID==1101对应menu_playlist_sortord菜单的第一项
SWindow* pBtn = FindChildByName(L"btn_sortord");
// if(pBtn) pBtn->SetWindowText (L"观众");
pBtn = FindChildByName(L"sortord_down");
if(pBtn) pBtn->SetVisible(FALSE,TRUE);
pBtn = FindChildByName(L"sortord_up");
if(pBtn) pBtn->SetVisible(FALSE,TRUE);
up_or_down = -1;
popularity_up_or_down = TRUE;
::CheckMenuItem(menu_sortord.m_hMenu,1101,MF_CHECKED);
::CheckMenuItem(menu_sortord.m_hMenu,1102,MF_UNCHECKED);
::CheckMenuItem(menu_sortord.m_hMenu,1103,MF_UNCHECKED);
::CheckMenuItem(menu_sortord.m_hMenu,1104,MF_UNCHECKED);
}
else if(nID==1102)
{//nID==1101对应menu_playlist_sortord菜单的第二项
SWindow* pBtn = FindChildByName(L"btn_sortord");
// if(pBtn) pBtn->SetWindowText (L"名称");
pBtn = FindChildByName(L"sortord_down");
if(pBtn) pBtn->SetVisible(TRUE,TRUE);
pBtn = FindChildByName(L"sortord_up");
if(pBtn) pBtn->SetVisible(FALSE,TRUE);
up_or_down = 0;
popularity_up_or_down = FALSE;
::CheckMenuItem(menu_sortord.m_hMenu,1101,MF_UNCHECKED);
::CheckMenuItem(menu_sortord.m_hMenu,1102,MF_CHECKED);
::CheckMenuItem(menu_sortord.m_hMenu,1103,MF_UNCHECKED);
::CheckMenuItem(menu_sortord.m_hMenu,1104,MF_UNCHECKED);
}
else if(nID==1103)
{//nID==1103对应menu_playlist_sortord菜单的第三项
SWindow* pBtn = FindChildByName(L"btn_sortord");
// if(pBtn) pBtn->SetWindowText (L"评分");
pBtn = FindChildByName(L"sortord_down");
if(pBtn) pBtn->SetVisible(TRUE,TRUE);
pBtn = FindChildByName(L"sortord_up");
if(pBtn) pBtn->SetVisible(FALSE,TRUE);
up_or_down = 0;
popularity_up_or_down = FALSE;
::CheckMenuItem(menu_sortord.m_hMenu,1101,MF_UNCHECKED);
::CheckMenuItem(menu_sortord.m_hMenu,1102,MF_UNCHECKED);
::CheckMenuItem(menu_sortord.m_hMenu,1103,MF_CHECKED);
::CheckMenuItem(menu_sortord.m_hMenu,1104,MF_UNCHECKED);
}
else if(nID==1104)
{//nID==1104对应menu_playlist_sortord菜单的第四项
SWindow* pBtn = FindChildByName(L"btn_sortord");
// if(pBtn) pBtn->SetWindowText (L"评论");
pBtn = FindChildByName(L"sortord_down");
if(pBtn) pBtn->SetVisible(TRUE,TRUE);
pBtn = FindChildByName(L"sortord_up");
if(pBtn) pBtn->SetVisible(FALSE,TRUE);
up_or_down = 0;
popularity_up_or_down = FALSE;
::CheckMenuItem(menu_sortord.m_hMenu,1101,MF_UNCHECKED);
::CheckMenuItem(menu_sortord.m_hMenu,1102,MF_UNCHECKED);
::CheckMenuItem(menu_sortord.m_hMenu,1103,MF_UNCHECKED);
::CheckMenuItem(menu_sortord.m_hMenu,1104,MF_CHECKED);
}
else if(nID==11101)
{//nID==11101对应menu_PlayMode菜单的第一项
SWindow* pBtn = FindChildByName(L"btn_OrderPlay");
if(pBtn) pBtn->SetVisible(TRUE,TRUE);
pBtn = FindChildByName(L"btn_SinglePlay");
if(pBtn) pBtn->SetVisible(FALSE,TRUE);
pBtn = FindChildByName(L"btn_RandomPlay");
if(pBtn) pBtn->SetVisible(FALSE,TRUE);
pBtn = FindChildByName(L"btn_SingleCycle");
if(pBtn) pBtn->SetVisible(FALSE,TRUE);
pBtn = FindChildByName(L"btn_ListCycle");
if(pBtn) pBtn->SetVisible(FALSE,TRUE);
//.........这里部分代码省略.........
示例10: if
void SwndContainerImpl::OnFrameMouseMove(UINT uFlag,CPoint pt)
{
SWindow *pCapture=SWindowMgr::GetWindow(m_hCapture);
if(pCapture)
{//有窗口设置了鼠标捕获,不需要判断是否有TrackMouseEvent属性,也不需要判断客户区与非客户区的变化
SWindow * pHover=pCapture->IsContainPoint(pt,FALSE)?pCapture:NULL;
SWND hHover=pHover?pHover->GetSwnd():NULL;
if(hHover!=m_hHover)
{//检测鼠标是否在捕获窗口间移动
SWindow *pOldHover=SWindowMgr::GetWindow(m_hHover);
m_hHover=hHover;
if(pOldHover)
{
if(m_bNcHover) pOldHover->SSendMessage(WM_NCMOUSELEAVE);
pOldHover->SSendMessage(WM_MOUSELEAVE);
}
if(pHover && !(pHover->GetState()&WndState_Hover))
{
if(m_bNcHover) pHover->SSendMessage(WM_NCMOUSEHOVER,uFlag,MAKELPARAM(pt.x,pt.y));
pHover->SSendMessage(WM_MOUSEHOVER,uFlag,MAKELPARAM(pt.x,pt.y));
}
}
pCapture->SSendMessage(m_bNcHover?WM_NCMOUSEMOVE:WM_MOUSEMOVE,uFlag,MAKELPARAM(pt.x,pt.y));
}
else
{//没有设置鼠标捕获
SWND hHover=SwndFromPoint(pt,FALSE);
SWindow * pHover=SWindowMgr::GetWindow(hHover);
if(m_hHover!=hHover)
{//hover窗口发生了变化
SWindow *pOldHover=SWindowMgr::GetWindow(m_hHover);
m_hHover=hHover;
if(pOldHover)
{
BOOL bLeave=TRUE;
if(pOldHover->GetStyle().m_bTrackMouseEvent)
{//对于有监视鼠标事件的窗口做特殊处理
bLeave = !pOldHover->IsContainPoint(pt,FALSE);
}
if(bLeave)
{
if(m_bNcHover) pOldHover->SSendMessage(WM_NCMOUSELEAVE);
pOldHover->SSendMessage(WM_MOUSELEAVE);
}
}
if(pHover && !pHover->IsDisabled(TRUE) && !(pHover->GetState() & WndState_Hover))
{
m_bNcHover=pHover->OnNcHitTest(pt);
if(m_bNcHover) pHover->SSendMessage(WM_NCMOUSEHOVER,uFlag,MAKELPARAM(pt.x,pt.y));
pHover->SSendMessage(WM_MOUSEHOVER,uFlag,MAKELPARAM(pt.x,pt.y));
}
}
else if(pHover && !pHover->IsDisabled(TRUE))
{//窗口内移动,检测客户区和非客户区的变化
BOOL bNcHover=pHover->OnNcHitTest(pt);
if(bNcHover!=m_bNcHover)
{
m_bNcHover=bNcHover;
if(m_bNcHover)
{
pHover->SSendMessage(WM_NCMOUSEHOVER,uFlag,MAKELPARAM(pt.x,pt.y));
}
else
{
pHover->SSendMessage(WM_NCMOUSELEAVE);
}
}
}
if(pHover && !pHover->IsDisabled(TRUE))
pHover->SSendMessage(m_bNcHover?WM_NCMOUSEMOVE:WM_MOUSEMOVE,uFlag,MAKELPARAM(pt.x,pt.y));
}
//处理trackMouseEvent属性
SPOSITION pos = m_lstTrackMouseEvtWnd.GetHeadPosition();
while(pos)
{
SWND swnd = m_lstTrackMouseEvtWnd.GetNext(pos);
SWindow *pWnd = SWindowMgr::GetWindow(swnd);
if(!pWnd)
{
UnregisterTrackMouseEvent(swnd);
}else if(pWnd->IsVisible(TRUE))
{
BOOL bInWnd = pWnd->IsContainPoint(pt,FALSE);
if(bInWnd && !(pWnd->GetState() & WndState_Hover))
{
pWnd->SSendMessage(WM_MOUSEHOVER);
}else if(!bInWnd && (pWnd->GetState() & WndState_Hover))
{
pWnd->SSendMessage(WM_MOUSELEAVE);
}
}
}
}
示例11: OnGo
void CFolderScanHandler::OnGo(EventArgs *pEvt)
{
SWindow *pEditDir = m_pPageRoot->FindChildByName(L"edit_dir");
InitDir(pEditDir->GetWindowText());
}
示例12: MeasureChildren
//nWidth,nHeight == -1:wrap_content
CSize SLinearLayout::MeasureChildren(SWindow * pParent,int nWidth,int nHeight) const
{
CSize *pSize = new CSize [pParent->GetChildrenCount()];
ILayoutParam * pParentLayoutParam = pParent->GetLayoutParam();
int iChild = 0;
SWindow *pChild = pParent->GetNextLayoutChild(NULL);
while(pChild)
{
SLinearLayoutParam *pLinearLayoutParam = pChild->GetLayoutParamT<SLinearLayoutParam>();
int nScale = pChild->GetScale();
CSize szChild(SIZE_WRAP_CONTENT,SIZE_WRAP_CONTENT);
if(pLinearLayoutParam->IsMatchParent(Horz))
{
if(!pParentLayoutParam->IsWrapContent(Horz))
szChild.cx = nWidth;
}
else if(pLinearLayoutParam->IsSpecifiedSize(Horz))
{
szChild.cx = pLinearLayoutParam->GetSpecifiedSize(Horz).toPixelSize(nScale);
szChild.cx += pLinearLayoutParam->extend_left.toPixelSize(nScale) + pLinearLayoutParam->extend_right.toPixelSize(nScale);
}
if(pLinearLayoutParam->IsMatchParent(Vert))
{
if(!pParentLayoutParam->IsWrapContent(Vert))
szChild.cy = nHeight;
}
else if(pLinearLayoutParam->IsSpecifiedSize(Vert))
{
szChild.cy = pLinearLayoutParam->GetSpecifiedSize(Vert).toPixelSize(nScale);
szChild.cy += pLinearLayoutParam->extend_top.toPixelSize(nScale) + pLinearLayoutParam->extend_bottom.toPixelSize(nScale);
}
if(szChild.cx == SIZE_WRAP_CONTENT || szChild.cy == SIZE_WRAP_CONTENT)
{
int nWid = szChild.cx, nHei = szChild.cy;
if(nWid == SIZE_WRAP_CONTENT)
nWid = nWidth * pParentLayoutParam->IsWrapContent(Horz)?-1:1; //把父窗口的WrapContent属性通过-1标志传递给GetDesiredSize
if(nHei == SIZE_WRAP_CONTENT)
nHei = nHeight * pParentLayoutParam->IsWrapContent(Vert)?-1:1;//把父窗口的WrapContent属性通过-1标志传递给GetDesiredSize
CSize szCalc = pChild->GetDesiredSize(nWid,nHei);
if(szChild.cx == SIZE_WRAP_CONTENT)
{
szChild.cx = szCalc.cx;
szChild.cx += pLinearLayoutParam->extend_left.toPixelSize(nScale) + pLinearLayoutParam->extend_right.toPixelSize(nScale);
}
if(szChild.cy == SIZE_WRAP_CONTENT)
{
szChild.cy = szCalc.cy;
szChild.cy += pLinearLayoutParam->extend_top.toPixelSize(nScale) + pLinearLayoutParam->extend_bottom.toPixelSize(nScale);
}
}
pSize [iChild++] = szChild;
pChild = pParent->GetNextLayoutChild(pChild);
}
CSize szRet;
for(int i=0;i<iChild;i++)
{
if(m_orientation == Horz)
{
szRet.cx += pSize[i].cx;
szRet.cy = (std::max)(szRet.cy,pSize[i].cy);
}else
{
szRet.cx = (std::max)(szRet.cx,pSize[i].cx);
szRet.cy += pSize[i].cy;
}
}
delete []pSize;
return szRet;
}
示例13: while
void SLinearLayout::LayoutChildren(SWindow * pParent)
{
CRect rcParent = pParent->GetChildrenLayoutRect();
CSize *pSize = new CSize [pParent->GetChildrenCount()];
SWindow ** pChilds = new SWindow * [pParent->GetChildrenCount()];
int nChilds = 0;
int offset = 0;
float fWeight= 0.0f;
{//assign width or height
int iChild = 0;
SWindow *pChild=pParent->GetNextLayoutChild(NULL);
while(pChild)
{
SLinearLayoutParam *pLinearLayoutParam = pChild->GetLayoutParamT<SLinearLayoutParam>();
int nScale = pChild->GetScale();
CSize szChild(SIZE_WRAP_CONTENT,SIZE_WRAP_CONTENT);
if(pLinearLayoutParam->IsMatchParent(Horz))
szChild.cx = rcParent.Width();
else if(pLinearLayoutParam->IsSpecifiedSize(Horz))
{
szChild.cx = pLinearLayoutParam->GetSpecifiedSize(Horz).toPixelSize(nScale);
szChild.cx += pLinearLayoutParam->extend_left.toPixelSize(nScale) + pLinearLayoutParam->extend_right.toPixelSize(nScale);
}
if(pLinearLayoutParam->IsMatchParent(Vert))
szChild.cy = rcParent.Height();
else if(pLinearLayoutParam->IsSpecifiedSize(Vert))
{
szChild.cy = pLinearLayoutParam->GetSpecifiedSize(Vert).toPixelSize(nScale);
szChild.cy += pLinearLayoutParam->extend_top.toPixelSize(nScale) + pLinearLayoutParam->extend_bottom.toPixelSize(nScale);
}
if(pLinearLayoutParam->weight > 0.0f)
{
fWeight += pLinearLayoutParam->weight;
}
if(szChild.cx == SIZE_WRAP_CONTENT || szChild.cy == SIZE_WRAP_CONTENT)
{
CSize szCalc = pChild->GetDesiredSize(szChild.cx,szChild.cy);
if(szChild.cx == SIZE_WRAP_CONTENT)
{
szChild.cx = szCalc.cx;
szChild.cx += pLinearLayoutParam->extend_left.toPixelSize(nScale) + pLinearLayoutParam->extend_right.toPixelSize(nScale);
}
if(szChild.cy == SIZE_WRAP_CONTENT)
{
szChild.cy = szCalc.cy;
szChild.cy += pLinearLayoutParam->extend_top.toPixelSize(nScale) + pLinearLayoutParam->extend_bottom.toPixelSize(nScale);
}
}
pChilds[iChild] = pChild;
pSize [iChild] = szChild;
offset += m_orientation == Vert ? szChild.cy:szChild.cx;
iChild++;
pChild=pParent->GetNextLayoutChild(pChild);
}
nChilds = iChild;
}
int size = m_orientation == Vert? rcParent.Height():rcParent.Width();
if(fWeight > 0.0f && size > offset)
{//assign size by weight
int nRemain = size - offset;
for(int iChild = 0;iChild < nChilds;iChild ++)
{
SWindow *pChild = pChilds[iChild];
SLinearLayoutParam *pLinearLayoutParam = pChild->GetLayoutParamT<SLinearLayoutParam>();
if(pLinearLayoutParam->weight > 0.0f)
{
LONG & szChild = m_orientation == Vert? pSize[iChild].cy:pSize[iChild].cx;
szChild += (int)(nRemain*pLinearLayoutParam->weight/fWeight);
}
}
}
{//assign position
offset = 0;
for(int iChild = 0;iChild < nChilds;iChild ++)
{
SWindow *pChild = pChilds[iChild];
SLinearLayoutParam *pLinearLayoutParam = pChild->GetLayoutParamT<SLinearLayoutParam>();
int nScale = pChild->GetScale();
Gravity gravity = pLinearLayoutParam->gravity == G_Undefined? m_gravity:pLinearLayoutParam->gravity;
if(gravity == G_Undefined) gravity = G_Left;
if(m_orientation == Vert)
//.........这里部分代码省略.........