Commit 06a2c92c authored by devill.tamachan's avatar devill.tamachan

[バグ修正] ウィンドウサイズ自動調整を調整

parent 0c6e6cf9
......@@ -680,8 +680,11 @@ BOOL CMainFrame::ResetSplitter()
if(m_nSplitView==ID_VIEW_SPLIT_V)paneW*=2;
else if(m_nSplitView==ID_VIEW_SPLIT_H)paneH=2;
ATLTRACE("RecalcPaneSize: w=%d, h=%d\n", paneW, paneH);
m_pWndSplitter->m_paneW = paneW;
m_pWndSplitter->m_paneH = paneH;
if(m_pWndSplitter!=NULL)
{
m_pWndSplitter->m_paneW = paneW;
m_pWndSplitter->m_paneH = paneH;
}
paneCnt = paneW*paneH;
}
......@@ -696,7 +699,7 @@ BOOL CMainFrame::ResetSplitter()
ATLASSERT(m_pWndSplitter);
if(m_pWndSplitter!=NULL)
{
m_pWndSplitter->SetHeaderMode(options.bMiniToolbar, GetHeaderMode(), bSubView ? 2 : 1);
m_pWndSplitter->SetHeaderMode(options.bMiniToolbar, GetHeaderMode(), bSubView ? 2 : 1);
int iBZX = 0, iBZY = 0;
int iBZShiftX = 0;
if(m_nSplitView==ID_VIEW_SPLIT_V)
......@@ -732,7 +735,12 @@ BOOL CMainFrame::ResetSplitter()
} else {
if(bSubView)m_pWndSplitter->SetSplitterPosX(1, 200);
else if(m_nSplitView==ID_VIEW_SPLIT_V)m_pWndSplitter->SetSplitterPosX(1, 620);
if(m_nSplitView==ID_VIEW_SPLIT_H)m_pWndSplitter->SetSplitterPosY(1, 200);
if(m_nSplitView==ID_VIEW_SPLIT_H)
{
WTL::CRect r;
if(m_pWndSplitter->GetWindowRect(&r))m_pWndSplitter->SetSplitterPosY(1, r.Height()/2);
else m_pWndSplitter->SetSplitterPosY(1, 200);
}
}
}
m_pWndSplitter->InitSplitLayout();
......
......@@ -93,6 +93,7 @@ public:
MSG_WM_SHOWWINDOW(OnShowWindow)
MSG_WM_INITMENUPOPUP(OnInitMenuPopup)
//MSG_WM_SETMESSAGESTRING(WM_SETMESSAGESTRING, OnSetMessageString)MFCの独自メッセージ
MSG_WM_SIZE(OnSize)
COMMAND_ID_HANDLER_EX(ID_APP_EXIT, OnFileExit)
COMMAND_ID_HANDLER_EX(ID_JUMP_FIND, OnJumpFind)
......@@ -278,6 +279,23 @@ public:
SetMsgHandled(FALSE);
}
void OnShowWindow(BOOL bShow, UINT nStatus);
void OnSize(UINT nType, WTL::CSize size)
{
static UINT lastType = 0;
//SetMsgHandled(FALSE);
if(nType != SIZE_MINIMIZED)
{
UpdateLayout();
}
if(m_pWndSplitter!=NULL && (nType==SIZE_MAXIMIZED || (lastType==SIZE_MAXIMIZED && nType==SIZE_RESTORED)))
{
ResetSplitter();
ResetWindowWidth();
}
lastType = nType;
}
void OnFileExit(UINT uNotifyCode, int nID, CWindow wndCtl) { PostMessage(WM_CLOSE); }
void OnJumpFind(UINT uNotifyCode, int nID, CWindow wndCtl)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment