Skip to content

Commit

Permalink
Merge efe00be 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 + efe00be commit ca69558
Show file tree
Hide file tree
Showing 3 changed files with 32 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
28 changes: 28 additions & 0 deletions sakura_core/window/CMainStatusBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,31 @@ bool CMainStatusBar::SetStatusText(int nIndex, int nOption, const WCHAR* pszText
}
return bDraw;
}

/*!
@breif プログレスバーを表示する
*/
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);
}
}

/*!
@breif プログレスバーを非表示にする
*/
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 ca69558

Please sign in to comment.