~ubuntu-branches/ubuntu/wily/opencollada/wily-proposed

« back to all changes in this revision

Viewing changes to G3DWarehouseBrowser/src/G3DDownloadStatusCallback.cpp

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2015-05-14 17:23:27 UTC
  • Revision ID: package-import@ubuntu.com-20150514172327-f862u8envms01fra
Tags: upstream-0.1.0~20140703.ddf8f47+dfsg1
ImportĀ upstreamĀ versionĀ 0.1.0~20140703.ddf8f47+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2009 NetAllied Systems GmbH
 
3
 
 
4
          This file is part of G3DWarehouseBrowser.
 
5
 
 
6
    Licensed under the MIT Open Source License, 
 
7
    for details please see LICENSE file or the website
 
8
    http://www.opensource.org/licenses/mit-license.php
 
9
*/
 
10
 
 
11
#include "G3DStableHeaders.h"
 
12
#include "G3DDownloadStatusCallback.h"
 
13
#include <commctrl.h>
 
14
 
 
15
 
 
16
//---------------------------------------------------------------------
 
17
HRESULT STDMETHODCALLTYPE DownloadStatusCallback::OnProgress( ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR wszStatusText)
 
18
{
 
19
        if(ulStatusCode == BINDSTATUS_BEGINDOWNLOADDATA)
 
20
        {
 
21
                ShowWindow(hwndProgress, 1);
 
22
                stepFactor = 1000. / ulProgressMax;
 
23
                SendMessage(hwndProgress, PBM_SETRANGE, 0, MAKELPARAM (0, 1000));
 
24
        }
 
25
        else if(ulStatusCode == BINDSTATUS_DOWNLOADINGDATA)
 
26
        {
 
27
                SendMessage(hwndProgress, PBM_SETPOS, (WPARAM)(ulProgress * stepFactor), 0);
 
28
        }
 
29
        else if(ulStatusCode == BINDSTATUS_ENDDOWNLOADDATA)
 
30
        {
 
31
                ShowWindow(hwndProgress, 0);
 
32
                SendMessage(hwndProgress, PBM_SETRANGE, 0, MAKELPARAM (0, 0));
 
33
                SendMessage(hwndProgress, PBM_SETPOS, 0, 0);
 
34
        }
 
35
        
 
36
        return S_OK;
 
37
 
 
38
}
 
39
 
 
40