{
arrSCBars.RemoveAll();
int nFirstT, nLastT, nThisT;
GetRowInfo(nFirstT, nLastT, nThisT);
nThis = -1;
for (int i = nFirstT; i <= nLastT; i++)
{
CSizingControlBar* pBar =
(CSizingControlBar*) m_pDockBar->m_arrBars[i];
if (HIWORD(pBar) == 0) continue; // placeholder
if (!pBar->IsVisible()) continue;
if (pBar->IsKindOf(RUNTIME_CLASS(CSizingControlBar)))
{
if (pBar == this)
nThis = arrSCBars.GetSize();
arrSCBars.Add(pBar);
}
}
}
BOOL CSizingControlBar::NegotiateSpace(int nLengthTotal, BOOL bHorz)
{
ASSERT(bHorz == IsHorzDocked());
int nFirst, nLast, nThis;
GetRowInfo(nFirst, nLast, nThis);
int nLengthAvail = nLengthTotal;
int nLengthActual = 0;
int nLengthMin = 2;
int nWidthMax = 0;
CSizingControlBar* pBar;
for (int i = nFirst; i <= nLast; i++)
{
pBar = (CSizingControlBar*) m_pDockBar->m_arrBars[i];
if (HIWORD(pBar) == 0) continue; // placeholder
if (!pBar->IsVisible()) continue;
BOOL bIsSizingBar =
pBar->IsKindOf(RUNTIME_CLASS(CSizingControlBar));
int nLengthBar; // minimum length of the bar
if (bIsSizingBar)
nLengthBar = bHorz ? pBar->m_szMinHorz.cx - 2 :
pBar->m_szMinVert.cy - 2;
else
{
CRect rcBar;
pBar->GetWindowRect(&rcBar);
nLengthBar = bHorz ? rcBar.Width() - 2 : rcBar.Height() - 2;
}
nLengthMin += nLengthBar;
if (nLengthMin > nLengthTotal)
{
// split the row after fixed bar
if (i < nThis)
{
m_pDockBar->m_arrBars.InsertAt(i + 1,
(CControlBar*) NULL);
return FALSE;
}
// only this sizebar remains on the row, adjust it to minsize
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-36846-27.html
我看过了
你牛
请问