Logged In: NO

i found on amule source a bether method for ProgressBar:

case 5: // progress
{
    if (thePrefs::ShowProgBar())
    {
        int iWidth  = rect.GetWidth() - 2;
        int iHeight = rect.GetHeight() - 2;

        // DO NOT DRAW IT ALL THE TIME
        uint32 dwTicks = GetTickCount();

        wxMemoryDC cdcStatus;

        if ( item->dwUpdated < dwTicks || !item->status || iWidth != item->status->GetWidth() ) {
            if ( item->status == NULL) {
                item->status = new wxBitmap(iWidth, iHeight);
            } else if ( item->status->GetWidth() != iWidth ) {
                // Only recreate if the size has changed
                item->status->Create(iWidth, iHeight);
            }

            cdcStatus.SelectObject( *item->status );

            if ( thePrefs::UseFlatBar() ) {
                DrawFileStatusBar( file, &cdcStatus,
                    wxRect(0, 0, iWidth, iHeight), true);
            } else {
                DrawFileStatusBar( file, &cdcStatus,
                    wxRect(1, 1, iWidth - 2, iHeight - 2), false);

                // Draw black border
                cdcStatus.SetPen( *wxBLACK_PEN );
                cdcStatus.SetBrush( *wxTRANSPARENT_BRUSH );
                cdcStatus.DrawRectangle( 0, 0, iWidth, iHeight );
            }

            item->dwUpdated = dwTicks + 5000; // Plus five seconds
        } else {
            cdcStatus.SelectObject( *item->status );
        }

        dc->Blit( rect.GetX(), rect.GetY() + 1, iWidth, iHeight, &cdcStatus, 0, 0);
    }

    if (thePrefs::ShowPercent()) {
        // Percentage of completing
        // We strip anything below the first decimal point,
        // to avoid Format doing roundings
        float percent = floor( file->GetPercentCompleted() * 10.0f ) / 10.0f;

        wxString buffer = wxString::Format( wxT("%.1f%%"), percent );
        int middlex = (2*rect.GetX() + rect.GetWidth()) >> 1;
        int middley = (2*rect.GetY() + rect.GetHeight()) >> 1;

        wxCoord textwidth, textheight;

        dc->GetTextExtent(buffer, &textwidth, &textheight);
        wxColour AktColor = dc->GetTextForeground();
        if (thePrefs::ShowProgBar()) {
            dc->SetTextForeground(*wxWHITE);
        } else {
            dc->SetTextForeground(*wxBLACK);
        }
        dc->DrawText(buffer, middlex - (textwidth >> 1), middley - (textheight >> 1));
        dc->SetTextForeground(AktColor);
    }
}
break;