Commit be756482 authored by devill.tamachan's avatar devill.tamachan

[バグ修正] 引数に2つ以上のファイルが指定されると開けないバグ / 2つまでなら開けるように改造

parent 2410da6d
......@@ -133,19 +133,23 @@ public:
}
CBZDoc2* GetBZDoc2(DWORD dwIndex)
{
return m_arrDoc[dwIndex];
if(m_arrDoc.GetSize() > dwIndex)return m_arrDoc[dwIndex];
return NULL;
}
CBZView* GetBZView(DWORD dwIndex)
{
return m_arrView[dwIndex];
if(m_arrView.GetSize() > dwIndex)return m_arrView[dwIndex];
return NULL;
}
CBZSubView* GetSubView(DWORD dwIndex)
{
return m_arrSubView[dwIndex];
if(m_arrSubView.GetSize() > dwIndex)return m_arrSubView[dwIndex];
return NULL;
}
CMiniToolbarView* GetMiniToolbar(DWORD dwIndex)
{
return m_arrMiniToolbarView[dwIndex];
if(m_arrMiniToolbarView.GetSize() > dwIndex)return m_arrMiniToolbarView[dwIndex];
return NULL;
}
CTamaSplitterWindow* GetSplitterWnd() { return m_pSplitter; }
......
......@@ -59,23 +59,34 @@ int Run(LPTSTR lpstrCmdLine = NULL, int nCmdShow = SW_SHOWDEFAULT)
}
wndMain.ShowWindow(nCmdShow);
if(_tcslen(lpstrCmdLine) > 0)
CBZCoreData *pCoreData = CBZCoreData::GetInstance();
int argc = 0;
LPWSTR *argv = CommandLineToArgvW(lpstrCmdLine, &argc);
if(argc>=2)
{
CBZCoreData *pCoreData = CBZCoreData::GetInstance();
CBZView *pBZView = pCoreData->GetActiveBZView();
if(pBZView)
CMainFrame *pMainFrame = pCoreData->GetMainFrame();
if(pMainFrame!=NULL)
{
CBZDoc2 *pDoc = pBZView->GetBZDoc();
CString filename = lpstrCmdLine;
LPTSTR pFilename = filename.GetBuffer();
PathUnquoteSpaces(pFilename);
filename.ReleaseBuffer();
if(pDoc)pDoc->OnFileOpen(filename, wndMain.m_hWnd);
pBZView->Update();
pMainFrame->_OnViewSplit(ID_VIEW_SPLIT_H);
}
wndMain.UpdateFrameTitle();
}
for(int i=0;i<argc;i++)
{
if(i>=2)break;
CBZView *pBZView = pCoreData->GetBZView(i);
if(pBZView==NULL)break;
CBZDoc2 *pDoc = pBZView->m_pDoc;
if(pDoc==NULL)break;
CString filename = argv[i];
LPTSTR pFilename = filename.GetBuffer();
PathUnquoteSpaces(pFilename);
filename.ReleaseBuffer();
pDoc->OnFileOpen(filename, wndMain.m_hWnd);
pBZView->Update();
}
wndMain.UpdateFrameTitle();
int nRet = theLoop.Run();
......
......@@ -411,6 +411,10 @@ void CMainFrame::OnViewMiniToolbar(UINT uNotifyCode, int nID, CWindow wndCtl)
}
void CMainFrame::OnViewSplit(UINT uNotifyCode, int nID, CWindow wndCtl)
{
_OnViewSplit(nID);
}
void CMainFrame::_OnViewSplit(int nID)
{
/* 最大化していると最大化状態のままウィンドウサイズが調整されて変なウィンドウ(最大化できない&サイズ変更不可)になってしまうバグの対策 */
options.nCmdShow=SW_SHOWNORMAL;
......
......@@ -319,6 +319,7 @@ public:
aboutDlg.DoModal();
}
void OnViewSplit(UINT uNotifyCode, int nID, CWindow wndCtl);
void _OnViewSplit(int nID);
void OnFilePageSetup(UINT uNotifyCode, int nID, CWindow wndCtl)
{
/* CPageSetupDialog dlg;
......
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