Re: Re: [modified]patch file_Implement progress bar in windows_chenxiajian

From: chenxiajian1985 <chenxiajian1985_at_gmail.com>
Date: Thu Apr 14 2011 - 06:13:55 CEST

Hi, Martin
the attachment is the modified patch file follows your instruction. I have tested in my computer, it works well.
I have modified as following:
1 the implementation of the virtual function
void AP_Win32StatusBar::showProgressBar(void)
{
   ShowWindow(m_hwndProgressBar,SW_SHOW);
}
void AP_Win32StatusBar::hideProgressBar(void)
{
   ShowWindow(m_hwndProgressBar,SW_HIDE);
   SendMessage(m_hwndProgressBar,PBM_SETPOS,0,0); //hide and set to zero
}

2 modify some member variable(no need pass by the paramter and just get from the "this" pointer)
  

We can use the progress bar: set the "percent" variable when set the status Bar text (m_sBuf)

If have some problem about the patch, and some other bug in Windows, pls tell me. I would like to fix it

Thanks
Chen Xiajian


发件人: Martin Sevior
发送时间: 2011-04-14 08:34:49
收件人: chenxiajian1985
抄送: abiword-dev
主题: Re: patch file_Implement progress bar in windows_chenxiajian
 
Hi Chen,
Thanks very much for this! Looking at your code, it appears that you
automatically hide the progress bar after it has reached either 50% or
100%.
Instead of that please implement the following virtual methods for
AP_Win32StatusBar.
virtual void showProgressBar(void) {}
virtual void hideProgressBar(void) {}
The implementation in the gtk build is really simple.
void AP_UnixStatusBar::showProgressBar(void)
{
  gtk_widget_show(m_wProgressFrame);
}
void AP_UnixStatusBar::hideProgressBar(void)
{
  gtk_widget_hide(m_wProgressFrame);
}
Where m_wProgressFrame is the container that holds the progress bar. I
imagine Win32 has similar functionality?
(I'm not a windows developer!)
The cross platform code will show and and hide the progress bars as
needed and has already been written.
Finally, we can indeed use these for other situations in abiword later :-)
Cheers
Martin
2011/4/14 chenxiajian1985 <chenxiajian1985@gmail.com>:
> Hi, all
> the attachment is the patch file that I implemant progress bar in windows. I have checked in my computer it works well.
> the image shows the progress bar in windows:
> http://hi.csdn.net/attachment/201104/13/65043_1302717024x1D4.png
>
> I care about some factors when coding:
> 1. when resize the status bar, the progress bar must resize too
> 2. the basic function
> 3. use the win32 common ctrls, the same as the source code
> 4. the position of the progress bar
> 5. the show and hide when operation finish
> ....
>
> Anyone who some suggestion, pls tell me. I will make the function more excellent.
>
>
> Thanks
> chen xiajian

Received on Thu Apr 14 06:14:33 2011

This archive was generated by hypermail 2.1.8 : Thu Apr 14 2011 - 06:14:33 CEST