diff --git a/sakura_core/uiparts/CVisualProgress.cpp b/sakura_core/uiparts/CVisualProgress.cpp index dbee71daf5..9b252f90c6 100644 --- a/sakura_core/uiparts/CVisualProgress.cpp +++ b/sakura_core/uiparts/CVisualProgress.cpp @@ -95,7 +95,7 @@ void CVisualProgress::_Begin() //プログレスバー HWND hwndProgress = CEditWnd::getInstance()->m_cStatusBar.GetProgressHwnd(); if( hwndProgress ){ - CEditWnd::getInstance()->m_cStatusBar.ShowProgressBar(); + CEditWnd::getInstance()->m_cStatusBar.ShowProgressBar(true); //範囲設定・リセット Progress_SetRange( hwndProgress, 0, 101 ); Progress_SetPos( hwndProgress, 0); @@ -121,7 +121,7 @@ void CVisualProgress::_End() HWND hwndProgress = CEditWnd::getInstance()->m_cStatusBar.GetProgressHwnd(); if( hwndProgress ){ Progress_SetPos( hwndProgress, 0); - CEditWnd::getInstance()->m_cStatusBar.HideProgressBar(); + CEditWnd::getInstance()->m_cStatusBar.ShowProgressBar(false); } //砂時計 diff --git a/sakura_core/window/CMainStatusBar.cpp b/sakura_core/window/CMainStatusBar.cpp index a9245671a6..df6a6eff94 100644 --- a/sakura_core/window/CMainStatusBar.cpp +++ b/sakura_core/window/CMainStatusBar.cpp @@ -195,23 +195,18 @@ bool CMainStatusBar::SetStatusText(int nIndex, int nOption, const WCHAR* pszText return bDraw; } -void CMainStatusBar::ShowProgressBar() const { +//! プログレスバーの表示/非表示を切り替える +void CMainStatusBar::ShowProgressBar(bool bShow) const { if (m_hwndStatusBar && m_hwndProgressBar) { - RECT rcProgressArea = {}; // プログレスバーを表示するステータスバー上の領域を取得 - ApiWrap::StatusBar_GetRect(m_hwndStatusBar, 0, &rcProgressArea); - ::ShowWindow(m_hwndProgressBar, SW_SHOW); - ::InvalidateRect(m_hwndStatusBar, &rcProgressArea, TRUE); - ::UpdateWindow(m_hwndStatusBar); - } -} - -void CMainStatusBar::HideProgressBar() const { - if (m_hwndStatusBar && m_hwndProgressBar) { RECT rcProgressArea = {}; - // プログレスバーが表示されているステータスバー上の領域を取得 ApiWrap::StatusBar_GetRect(m_hwndStatusBar, 0, &rcProgressArea); - ::ShowWindow(m_hwndProgressBar, SW_HIDE); + if (bShow) { + ::ShowWindow(m_hwndProgressBar, SW_SHOW); + } else { + ::ShowWindow(m_hwndProgressBar, SW_HIDE); + } + // プログレスバー表示領域を再描画 ::InvalidateRect(m_hwndStatusBar, &rcProgressArea, TRUE); ::UpdateWindow(m_hwndStatusBar); } diff --git a/sakura_core/window/CMainStatusBar.h b/sakura_core/window/CMainStatusBar.h index e46a449aa0..4720b5d2cd 100644 --- a/sakura_core/window/CMainStatusBar.h +++ b/sakura_core/window/CMainStatusBar.h @@ -56,8 +56,7 @@ class CMainStatusBar : public CDocListenerEx{ //設定 bool SetStatusText(int nIndex, int nOption, const WCHAR* pszText, size_t textLen = SIZE_MAX); - void ShowProgressBar() const; - void HideProgressBar() const; + void ShowProgressBar(bool bShow) const; private: CEditWnd* m_pOwner; HWND m_hwndStatusBar;