Announcement

Collapse
No announcement yet.

Progress bar troubles...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fred Oxenby
    replied
    Are you trying to make your PROGRESSBAR into a TreeWiew,StatusBar, or a ToolBar?
    Just kidding, you are using 2 Progressbars ontop of eatch other
    AND using style %CCS_BOTTOM equal to 3&
    That WindowStyle does not exist.


    ------------------
    Fred
    mailto:[email protected][email protected]</A>
    http://www.oxenby.se

    Leave a comment:


  • Chris Boss
    replied
    If I remember correctly, the progress bar "requires" the %WS_BORDER style.

    If its not that, make sure you have not forgotten any other necessary styles.


    ------------------

    Leave a comment:


  • Scott Turchin
    replied
    Strange, but it was the Or %WS_CLIPSIBLINGS piece....

    ------------------
    Scott
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Scott Turchin
    replied
    Actually YES, I did....
    Strange, at first I thought I had not...

    Hmmm perhaps I will just pull the status bars out for now and put them in another day...

    Scott

    [This message has been edited by Scott Turchin (edited February 29, 2000).]

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Did you ran Initcommoncontrol API?


    ------------------

    Leave a comment:


  • Scott Turchin
    started a topic Progress bar troubles...

    Progress bar troubles...

    I'm just not seeing the bug here, but my progress bar doesn't display....
    The progress bar is added in winmain to the main dialog, in fact two of them are...

    Code:
    %IDPROGRESS = %WM_USER + 902
    %IDTOTALPROGRESS = %WM_USER + 903
    
    
    'In Winmain
    Control Add "msctls_progress32",hDlg,%IDPROGRESS,"",10,80,235,10, %WS_CHILD Or %WS_VISIBLE Or %WS_CLIPSIBLINGS Or %CCS_BOTTOM
    Control Add Label, hDlg, %IDLABEL5, "Total bytes transferred",10,90,75,12
    Control Add Label, hDlg, %IDLABEL6, "12483292", 85,90,75,12
    Control Add "msctls_progress32",hDlg,%IDTOTALPROGRESS,"",10,80,235,10, %WS_CHILD Or %WS_VISIBLE Or %WS_CLIPSIBLINGS Or %CCS_BOTTOM
    
    Function SendFile(FileSpec As String) As Long 'Use array later for FileList(x)
    Local l_Result          As Long
    Local l_FileSize        As Long
    Local x                 As Long
    Static l_TotalBytes        As Long
    Static l_TotalBytesXferred As Long
    
    'Will need to know ALL file sizes before sending first file for second progress bar...
    
    l_FileSize = GetSizeOfFile(FileSpec) 'This works, returns 1237 on test file
    If l_FileSize > 0 Then g_Result = EnableMenuItem(g_hMenu,%IDM_SEND, %MF_ENABLED) else Exit Function
    l_TotalBytes = l_TotalBytes + l_FileSize
    Control Set Text hDlg, %IDTOTALBYTES, "of " + Trim$(Str$(l_FileSize)) + " bytes" 'Total bytes *TO* send
    
    Control Set Text hDlg, %IDLABEL1,FileSpec
    Control Send hDlg, %IDPROGRESS, %PBM_SETRANGE, 0 ,MakLng(0,l_FileSize)
    Control Send hDlg,  %IDPROGRESS,  %PBM_SETSTEP, 1, 0
    Control Send hDlg, %IDTOTALPROGRESS, %PBM_SETRANGE, 0 ,MakLng(0,l_TotalBytes)
    Control Send hDlg,  %IDTOTALPROGRESS,  %PBM_SETSTEP, 1, 0
    
    g_Result = EnableMenuItem(g_hMenu,%IDM_SEND, %MF_GRAYED)
    
    For x = 1 To l_FileSize
        'Add file xfer code here.
        Control Set Text hDlg, %IDBYTES, Ltrim$(Str$(x))  'This part works
        Control Send hDlg, %IDPROGRESS, %PBM_STEPIT , 1, 0 'But not this...
        Control Send hDlg, %IDTOTALPROGRESS, %PBM_STEPIT , 1, 0
    Next
    
    l_TotalBytesXferred = l_TotalBytesXferred + l_TotalBytes    'Total bytes *SENT*
    Control Set Text hDlg, %IDLABEL6,Trim$(Str$(l_TotalBytesXferred))
    End Function

    Preciate another set of eyes, buying this house has stressed me out some, I'm just keeping busy on this...


    -------------
    Scott
    mailto:[email protected][email protected]</A>
Working...
X