 |
|
 |
Thanks
I want to use the progressbar to indicate a progress of the file opening
I was doubled-I do not know how to interact with the progress of file opening
Can you help me
Thanks
wzh
|
|
|
|
 |
|
 |
Hi, this class is very cool. I just added a GetSize() function, so that I can get the size quickly without creating dummy integers for the 'lower bond'. As in most of the case , the lower bond is 0 anyway.
Mat
|
|
|
|
 |
|
 |
Hello,
I d like to add the possibility of displaying the control as a snake control while keeping the current windows visual style. This means it is required to overload the redrawing (presumably the OnDraw method). For the time being, I did not find any resource on how to do that. First, is it simply possible to do that without adding skin files ? Then does anybody have an idea on how to do that ?
Thanks in advance
Jong
|
|
|
|
 |
|
 |
Looks like this CProgressBar does nothing if I try to use in a dialog app status bar. I wonder what needs to be done to get it to work with a dialog app.
|
|
|
|
 |
|
 |
Chris,
As a newer programmer I would like to thank you and all the others at Code Project for the help you extend to others. I needed to put a progress control on the status bar and this control is perfect for our application. With just the inclusion of three lines of code the progress bar behaves exactly as I need. We use your CGridCtrl and the Popup Progress window and I personally am delighted with the results. I certainly have learned a great deal from this site and the examples that you and others post.
Thanks again.
|
|
|
|
 |
|
 |
A pleasure.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
 |
|
 |
Hi,
1) If you run the demo program and initiate a progress bar run from the menu then quickly click the menu and initiate another progress bar run it will work unless one of them was the "changing text" style and the other was also in the same pane. In that case the progress bar goes into a crazy flashing, infinite loop or something.
2) The test in pane 2 uses only half of the pane.
--
Synetech
|
|
|
|
 |
|
 |
Instead of creating and destroying a Progress Bar (as needed), you can also do the following:
1. Add a WM_ACTIVATEAPP handler to MainFrm
2. Add "CProgressBar m_wndProgressBar" to MainFrm.h
2. Use the following code in MainFrm::OnActivateApp()
CFrameWnd::OnActivateApp(bActive, hTask);
if(!IsWindow(m_wndProgressBar.GetSafeHwnd()))
m_wndProgressBar.Create("", 100, 100, TRUE, 1, &m_wndStatusBar);
and the Status Bar Progress Bar will be available at all times.
the Progress Bar cannot be created in the MainFrm OnCreate because the rectangles of the Panes in the Status Bar are not available yet.
Steve
|
|
|
|
 |
|
 |
No, it doesn't show up with VS2005.How come?
Did you modify the code, 'cos I notice you create() routine takes 6 parameters instead of 5.
|
|
|
|
 |
|
 |
Oh, It shows up when nPanel = 0.
How to put it elsewhere? Thanks?
|
|
|
|
 |
|
 |
Hello,
First of all, let me say this is a great tool, and thanks!
Now, I am using the progress bar in a dialog based application and have the progress bar working fine. However, I have to setup the instantiation of the class based on the number of messages on a given pop spool, i.e.,
CProgressBar bar(_T("Downloading Email"), num_msgs, num_msgs,FALSE,0);
My problem is, if num_msgs is large (say 150), the progress bar wants to be larger than my status bar. It works okay, but the status bar fills with the 'progress boxes' before all the messages have been downloaded.
How can I tweek the code to make the size of the blue 'progress boxes' a proportional amount relative to the number of messages?
That is, is there any way to resize these 'progress boxes' at runtime?
Thanks,
Murrah Boswell
|
|
|
|
 |
|
 |
I'm trying to use your class in a CMDIChildWnd making the "necessary" modifications on your function GetStatusBar but I can't make it works. I even try to pass the CStatusBar object of the frame as a parameter but even though it dosen't works.
Can you help me with the modifications that I need to do to ?
Thanks in advance,
Rafael Melo
|
|
|
|
 |
|
 |
hi man,
i posted that message to nishant few days ago, but he doesn't seem to be able to aswer. Here is what i was saying him :
"first, don't care on my bad english, i do my best but i'm french... sorry
My problem is that one :
i'd like to display the associated text of a menu item in the status bar when the mouse is over it.
Do you know how i could do that, knowing that in MFC, there is no ON_MOUSE_OVER event or any event named like this."
if you or anybody else could help, that would be nice.
thanks
TOXCCT
|
|
|
|
 |
|
 |
Thanks!!
|
|
|
|
 |
|
 |
Hi!
Thanks for your prog & explanation.
Could you tell me how to connect progress bar with a process...?
Thanxs.
|
|
|
|
 |
|
 |
Small13
|
|
|
|
 |
|
 |
In the non-default constructor, m_Rect is not initialized (it is initialized in the default constructor). Because of this, you may experience the progress bar taking up the entire status bar. This happened to me when building in Release mode, but not Debug mode (the compiler must zero out member variables in Debug mode).
Add the following line to the non-default contructor to fix this bug:
m_Rect.SetRect(0,0,0,0);
How I discovered this bug:
I wrote an application to compute file checksums and used this class to display a progress bar for files greater than 100K in size. I am dynamically creating and destroying the progress bar using new and delete. The text of the progress bar displays the file name. When the width of the text does not change from one file to the next, the progress bar takes up the entire area of the progress bar. This is because the following expression in CProgressBar::Resize() is false:
if (rc != m_Rect)
The reason it is false is that m_Rect is uninitialized and takes on the value of the previous instance (in Release mode only).
This bug notwithstanding, the CProgressBar class is a great class--just what I was looking for. Thanks Chris.
|
|
|
|
 |
|
 |
Lifesaver! This was making me crazy... Thanks!
|
|
|
|
 |
|
 |
I have the progress bar being handled by a thread. If I resize the window while the thread is active, the lenght of the progress bar is increased to the full size of the window (to the right side, the left side stays the same). Does anyone know how I update the progress bar to readjust its size when the window is resized?
|
|
|
|
 |
|
 |
Hi Chris,
do you know any solution of that problem in C#?
Thanks for the help
Andreas Drauschke
|
|
|
|
 |
|
 |
Use the StatusStrip class.
I'd been called 'ugly', 'pug ugly', 'fugly', 'pug fugly' but never 'ugly ugly'. - Moe Szyslak
|
|
|
|
 |
|
 |
How can i call CPRogressBar Bar(..,..,..) for examble the CMainFrame::OnTestBar()
So that i can see the progress bar moving on the status from a child window.
In the demo project too the OnTestBar() method is not called .
Please let me know if my query is not clear.
Begineer: VC++
Thank u
-mathew
|
|
|
|
 |
|
 |
If I understand you correctly, I think the best way is to send a message from the child window to MainFrm (or wherever you have your code for the progress bar) and cause it to step.
Post the message using
AfxGetMainWnd()->PostMessage(UWM_STEP_PROGRESS);
where UWM_STEP_PROGRESS is a user defined message
In your message map put something like
ON_MESSAGE(UWM_STEP_PROGRESS, OnStepProgress)
and then
LRESULT CMainFrame::OnStepProgress(WPARAM, LPARAM)
{
if (pBar.m_hWnd != NULL)
{
pBar.StepIt();
}
return 0;
}
|
|
|
|
 |
|
 |
Hello,
I get the following warnings compiling with VC7 and /Wp64 switch set:
ProgressBar.cpp(190) : warning C4244: 'return' : conversion from 'LRESULT' to 'COLORREF', possible loss of data
ProgressBar.cpp(203) : warning C4244: 'return' : conversion from 'LRESULT' to 'COLORREF', possible loss of data
The function CProgressBar::SetBarColour and CProgressBar::SetBkColour
call SendMessage() which returns an LRESULT an not a COLORREF.
COLORREF is a DWORD which is a unsigned long and LRESULT is a LONG_PTR which is a
_W64 long or a __int64 if _WIN64 is defined.
Greetings,
Andreas.
|
|
|
|
 |
|
 |
why not inporporate the PeekAndPump() into the class CProgressBar to let it be a more stand-alone class?
Max
|
|
|
|
 |