Skip to content

Commit

Permalink
Merge fd450ba into f706330
Browse files Browse the repository at this point in the history
  • Loading branch information
Kohki Akikaze authored Sep 21, 2021
2 parents f706330 + fd450ba commit e98b341
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sakura_core/uiparts/CVisualProgress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void CVisualProgress::_Begin()
//プログレスバー
HWND hwndProgress = CEditWnd::getInstance()->m_cStatusBar.GetProgressHwnd();
if( hwndProgress ){
::ShowWindow( hwndProgress, SW_SHOW );
CEditWnd::getInstance()->m_cStatusBar.ShowProgressBar();
//範囲設定・リセット
Progress_SetRange( hwndProgress, 0, 101 );
Progress_SetPos( hwndProgress, 0);
Expand All @@ -121,7 +121,7 @@ void CVisualProgress::_End()
HWND hwndProgress = CEditWnd::getInstance()->m_cStatusBar.GetProgressHwnd();
if( hwndProgress ){
Progress_SetPos( hwndProgress, 0);
::ShowWindow( hwndProgress, SW_HIDE );
CEditWnd::getInstance()->m_cStatusBar.HideProgressBar();
}

//砂時計
Expand Down
22 changes: 22 additions & 0 deletions sakura_core/window/CMainStatusBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,25 @@ bool CMainStatusBar::SetStatusText(int nIndex, int nOption, const WCHAR* pszText
}
return bDraw;
}

void CMainStatusBar::ShowProgressBar() 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);
::InvalidateRect(m_hwndStatusBar, &rcProgressArea, TRUE);
::UpdateWindow(m_hwndStatusBar);
}
}
2 changes: 2 additions & 0 deletions sakura_core/window/CMainStatusBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class CMainStatusBar : public CDocListenerEx{

//設定
bool SetStatusText(int nIndex, int nOption, const WCHAR* pszText, size_t textLen = SIZE_MAX);
void ShowProgressBar() const;
void HideProgressBar() const;
private:
CEditWnd* m_pOwner;
HWND m_hwndStatusBar;
Expand Down

0 comments on commit e98b341

Please sign in to comment.