View Single Post
  #1  
Old 04-10-2007, 06:57 PM
middo middo is offline
VHE Monkey
middo's Avatar
Join Date: Aug 2002
Location: California
Posts: 327
middo is on a distinguished road
Send a message via AIM to middo
A Simple Download Dialog

Something I whipped up real quickly. It works.

It sits discretely in the bottom left corner. Takes up little space.

PHP Code:
//#CLIENTSIDE

function onCreated()
{
  new 
GuiBitmapBorderCtrl("progressWin") {
    
useownprofile true;
    
profile.bitmap "defalutborder.png"/* I have a own profile here since my server uses it's own images for the GUIS. I made it the default for here*/
    
profile.transparency=.8;
    
width 160;
    
height 100;
    
canmove=false;
    
canresize=false;
    
visible false;
    
10;
    
screenheight-height-40;
    
thiso.textFields={"filename","progress"};
    
thiso.textPos={20,45};

    new 
GuiProgressCtrl("fileProgress") {
      
profile GuiBlueProgressProfile;
      
10;
      
45;
      
width 140;
      
height 24;
      
progress 0;
      
layer=5;
    }    
    
    for (
;thiso.textFields.size();i++) //generate
    
{
      new 
GuiTextCtrl("text_"@thiso.textFields[i]) {
        
useownprofile=true;
        
profile.fontcolor={0,0,0};
        
profile.fontcolorhl={0,0,0};        
        
profile.fontsize=16;
        
profile.align="center";
        
profile.justify="center";
        
justify "center";
        
align "center";

        
width140;
        
height=20;
        
x=5;        
        
y=thiso.textPos[i];
        
text thiso.textFields[i];
        
layer=6;
      }
    }
  } 
}

function 
onTimeout()
{
  if (
downloadsize 1600
  {
    
progressWin.show();
    
text_filename.text   downloadfile;
    
text_progress.text   int((downloadpos/downloadsize)*100)@"%";
    
text_progress.bringtofront();
    
fileProgress.progress=(downloadpos/downloadsize); 
  } else {
  
progressWin.hide();
  }
}

setTimer(.05); 

Last edited by middo; 04-10-2007 at 07:12 PM..
Reply With Quote