S
Hi Martin,
mein Code soll einfach die Panes eines Splitters vergrößern oder verkleinern (SIZE_MAXIMIZED / SIZE_RESTORED) je nachdem ob das Fenster maximiert wird oder restored (nochmaliges klicken auf den maximize Button) wird. Das ganze proportional zur größe des Fensters eben, d.h. wenn ich ein kleines Fenster maximiere dann "wächst" der (die) Pane(s) des Splitters mit und wenn restored (die ursprüngliche Größe wieder hergestellt wird,) wird, dann "schrumpfen die Panes mit dem Fenster mit.
Hier die exe :
http://www.filehosting.org/file/details/285/n6s28J1URUVZzP85/Test_01.exe
Du kannst sehen was ich meine wenn Du vergrößerst, dann klappt das mit der 1. Zeile aber eben nur das vergrößern nicht das restoren !!!
Hier der geänderte Code :
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
int iCurRow_cy = 0, iMin_cy = 0;
static int iOldWnd_cy = 0, iOldWnd_cx = 0;
int iNewCurRow_cy = 0;
static int iZaehler = 0;
static CString a, b, c, d;
iZaehler++;
if (iZaehler == 1)
{
iOldWnd_cy = cy;
a.Format("%02d",iOldWnd_cy);
b.Format("%02d",cy);
c.Format("%02d",iCurRow_cy);
d.Format("%02d",iNewCurRow_cy);
MessageBox("iOldWnd_cy: "+ a + "\ncy: " + b + "\niCurRow_cy: " + c + "\niNewCurRow_cy: " + d,"in: iZaehler == 1 " ,MB_OK);
}
if ((nType == SIZE_MAXIMIZED)||(!m_Splitter_Main.m_hWnd && nType == SIZE_RESTORED))
{
m_Splitter_Main.GetRowInfo(0 ,iCurRow_cy, iMin_cy);
iNewCurRow_cy = (int)ResizeSplitter(cx, cy, iOldWnd_cx, iOldWnd_cy, iCurRow_cy, 1);
a.Format("%02d",iOldWnd_cy);
b.Format("%02d",cy);
c.Format("%02d",iCurRow_cy);
d.Format("%02d",iNewCurRow_cy);
MessageBox("iOldWnd_cy: "+ a + "\ncy: " + b + "\niCurRow_cy: " + c + "\niNewCurRow_cy: " + d,"in: SIZE_MAXIMIZED " ,MB_OK);
m_Splitter_Main.SetRowInfo(0, iNewCurRow_cy , 0);
// m_Splitter_Main.SetRowInfo(1, spRect.Height()/4, 0);
// m_Splitter_Main.SetRowInfo(2, spRect.Height()/4, 0);
// m_Splitter_Main.SetRowInfo(3, spRect.Height()/4, 0);
m_Splitter_Main.RecalcLayout();
}
CFrameWnd::OnSize(nType, cx, cy);
ResizeSplitter() ist unverändert s.o. !
Gruß
ShadowEater