Index: src/text/fmt/xp/fl_DocListener.cpp =================================================================== --- src/text/fmt/xp/fl_DocListener.cpp (revision 29714) +++ src/text/fmt/xp/fl_DocListener.cpp (working copy) @@ -293,6 +293,7 @@ UT_UTF8String_sprintf(msg2," %d",percentFilled); msg += msg2; msg += "%"; + m_pStatusBar->setFileLoad(percentFilled); m_pStatusBar->setStatusMessage(static_cast(msg.utf8_str())); } } Index: src/wp/ap/win/ap_Win32StatusBar.cpp =================================================================== --- src/wp/ap/win/ap_Win32StatusBar.cpp (revision 29714) +++ src/wp/ap/win/ap_Win32StatusBar.cpp (working copy) @@ -105,7 +105,8 @@ } // update - SendMessageW(hwnd, SB_SETPARTS, nParts, (LPARAM)pArOffsets); + SendMessageW(hwnd, SB_SETPARTS, nParts, (LPARAM)pArOffsets); + MoveWindow(*(pBar->getProgressBar()),*pArOffsets/2,2,*pArOffsets/2,20,true); delete [] pArWidths; delete [] pArOffsets; @@ -123,10 +124,10 @@ class ABI_EXPORT ap_usb_TextListener : public AP_StatusBarFieldListener { public: - ap_usb_TextListener(AP_StatusBarField *pStatusBarField, HWND hWnd, UINT nID, + ap_usb_TextListener(AP_StatusBarField *pStatusBarField, HWND hWnd, HWND hWndProgressWnd,UINT nID, const AP_Win32StatusBar * pSB) : AP_StatusBarFieldListener(pStatusBarField), - m_hWnd(hWnd), + m_hWnd(hWnd),m_progressWnd(hWndProgressWnd), m_nID(nID), m_pSB(pSB) {UT_ASSERT_HARMLESS( m_pSB );} @@ -135,19 +136,30 @@ private: HWND m_hWnd; + HWND m_progressWnd; UINT m_nID; const AP_Win32StatusBar * m_pSB; }; void ap_usb_TextListener::notify() { - UT_return_if_fail (m_hWnd && m_pSB); AP_StatusBarField_TextInfo * textInfo = ((AP_StatusBarField_TextInfo *)m_pStatusBarField); UT_Win32LocaleString str; str.fromUTF8 (textInfo->getBuf().utf8_str()); + SendMessageW(m_hWnd, SB_SETTEXTW, m_nID | m_pSB->getDir(), (LPARAM) str.c_str()); - + // get the number + int percent=textInfo->getApStatusBar()->getFileLoad(); + if(percent==99||percent==50) // 50 is because when open file produce 50% + { + ShowWindow(m_progressWnd,SW_HIDE); + } + else + { + ShowWindow(m_progressWnd,SW_SHOW); + SendMessage(m_progressWnd,PBM_SETPOS,percent,0); + } } @@ -202,6 +214,16 @@ WS_CHILD | WS_VISIBLE | SBS_SIZEGRIP, 0, 0, 0, 0, hwndFrame, NULL, app->getInstance(),NULL); + // add progress bar and hide it and set the color + m_hwndProgressBar= UT_CreateWindowEx(0, PROGRESS_CLASSW, NULL, + WS_CHILD | WS_VISIBLE, + 0, 0, 0, 0, + m_hwndStatusBar, NULL, app->getInstance(),NULL); + SendMessage(m_hwndProgressBar,PBM_SETBARCOLOR,0,(long)RGB(255,255,0)); + SendMessage(m_hwndProgressBar,PBM_SETBKCOLOR,0,(long)RGB(255,19,200)); + SendMessage(m_hwndProgressBar,PBM_SETRANGE,0,MAKELONG(0,100)); + + UT_return_val_if_fail (m_hwndStatusBar,0); // route messages through our handler first (to size the status panels). @@ -220,12 +242,11 @@ if (pf->getFillMethod() == REPRESENTATIVE_STRING || (pf->getFillMethod() == MAX_POSSIBLE)) { AP_StatusBarField_TextInfo *pf_TextInfo = static_cast(pf); - // Create a Text element if (pf_TextInfo) { - pf->setListener((AP_StatusBarFieldListener *)(new ap_usb_TextListener(pf_TextInfo, m_hwndStatusBar, + pf->setListener((AP_StatusBarFieldListener *)(new ap_usb_TextListener(pf_TextInfo, m_hwndStatusBar,m_hwndProgressBar, nID, this))); // size and place Index: src/wp/ap/win/ap_Win32StatusBar.h =================================================================== --- src/wp/ap/win/ap_Win32StatusBar.h (revision 29714) +++ src/wp/ap/win/ap_Win32StatusBar.h (working copy) @@ -49,12 +49,14 @@ void setPrevWidth (int n) { m_iPrevWidth = n; } UINT getDir() const {return m_iDIR;} + HWND* getProgressBar(){return &m_hwndProgressBar;} protected: virtual void show(); virtual void hide(); HWND m_hwndStatusBar; + HWND m_hwndProgressBar; WNDPROC m_pOrgStatusbarWndProc; int m_iPrevWidth; UINT m_iDIR; Index: src/wp/ap/xp/ap_StatusBar.h =================================================================== --- src/wp/ap/xp/ap_StatusBar.h (revision 29714) +++ src/wp/ap/xp/ap_StatusBar.h (working copy) @@ -91,6 +91,8 @@ /* used with AV_Listener */ virtual bool notify(AV_View * pView, const AV_ChangeMask mask); virtual AV_ListenerType getType(void) { return AV_LISTENER_STATUSBAR;} + void setFileLoad(int percent){percentLoad=percent;} + int getFileLoad(){return percentLoad;} UT_GenericVector * getFields() { return &m_vecFields; } protected: @@ -103,6 +105,7 @@ void * m_pStatusMessageField; /* actually 'AP_StatusBarField_StatusMessage *' */ AP_StatusBarField_ProgressBar * m_pStatusProgressField; UT_UTF8String m_sStatusMessage; + int percentLoad; }; // abstract class which "listens" for changes in the status bar fields in the base classes @@ -144,7 +147,7 @@ AP_StatusBarFieldListener * getListener() { return m_pStatusBarFieldListener; } _statusbar_element_fill_method getFillMethod() { return m_fillMethod; } - + AP_StatusBar * getApStatusBar(){return m_pSB;} protected: AP_StatusBar * m_pSB; AP_StatusBarFieldListener *m_pStatusBarFieldListener;