//------------------------------------------------------------------------------
void CIwLayoutElementToolbar::Load(std::vector<wxString>& argv)
{
    if (argv.size()==0) return;

    m_FileName=argv[0];

    LoadBar();
}
Esempio n. 2
0
File: hget.cpp Progetto: Pastor/iv
    HRESULT STDMETHODCALLTYPE
        OnProgress(ULONG   ulProgress,
            ULONG   ulProgressMax,
            ULONG   ulStatusCode,
            LPCWSTR /*szStatusText*/) override
    {
        switch (ulStatusCode) {
        case BINDSTATUS_FINDINGRESOURCE:
            std::cout << "Finding resource..." << std::endl;
            break;
        case BINDSTATUS_CONNECTING:
            std::cout << "Connecting..." << std::endl;
            break;
        case BINDSTATUS_SENDINGREQUEST:
            std::cout << "Sending request..." << std::endl;
            break;
        case BINDSTATUS_MIMETYPEAVAILABLE:
            std::cout << "Mime type available" << std::endl;
            break;
        case BINDSTATUS_CACHEFILENAMEAVAILABLE:
            std::cout << "Cache filename available" << std::endl;
            break;
        case BINDSTATUS_BEGINDOWNLOADDATA:
            std::cout << "Begin download" << std::endl;
            break;
        case BINDSTATUS_DOWNLOADINGDATA:
        case BINDSTATUS_ENDDOWNLOADDATA:
        {
            auto percent = static_cast<int>(100.0 * static_cast<double>(ulProgress)
                / static_cast<double>(ulProgressMax));
            if (m_percentLast < percent) {
                LoadBar(percent, 100);
                m_percentLast = percent;
            }
            if (ulStatusCode == BINDSTATUS_ENDDOWNLOADDATA) {
                std::cout << std::endl << "End download" << std::endl;
            }
        }
        break;

        default:
        {
            std::cout << "Status code : " << ulStatusCode << std::endl;
        }
        }
        // The download can be cancelled by returning E_ABORT here
        // of from any other of the methods.
        return S_OK;
    }