cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Mon Sep 23, 2002 4:15 pm Post subject: New Dialog Element --> Embossed Progess Bars |
|
|
Code: |
rem begin application sector
DIALOG CREATE,New Dialog,-1,0,420,200
DIALOG ADD,STYLE,progressstyle,,10,B,GRAY,SILVER
DIALOG ADD,BUTTON,BUTTON1,36,6,64,24,Begin
DIALOG ADD,LIST,LIST1,8,206,180,144,,sorted
DIALOG ADD,BUTTON,BUTTON2,134,8,102,24,Begin Bottom
DIALOG SHOW
%%addprogress = progress1|10|10|180|19
gosub addprogress
%%addprogress = progress2|175|10|400|19
gosub addprogress
:evloop
wait event
goto @event()
:button1button
list filelist,list1,c:\windows\*.*
%%progresscount = 0
%%progressitems = @count(list1)
%%progresscountItems = 0
%%progress = progress1
gosub readyprogress
:thisloop
if @equal(%%progresscountItems,%%progressitems)
gosub finalizeprogress
goto evloop
else
list seek,list1,%%progresscountItems
%%progresscountItems = @succ(%%progresscountItems)
gosub progress
end
goto thisloop
:button2button
list filelist,list1,c:\windows\system\*.*
%%progresscount = 0
%%progressitems = @count(list1)
%%progresscountItems = 0
%%progress = progress2
gosub readyprogress
:thisloop2
if @equal(%%progresscountItems,%%progressitems)
gosub finalizeprogress
goto evloop
else
list seek,list1,%%progresscountItems
%%progresscountItems = @succ(%%progresscountItems)
gosub progress
end
goto thisloop2
:close
exit
rem BEGIN BLACK BOX SECTOR, should never be modified unless developing the actual control
:progress
%A = @sendmsg(@win(~%%progress"button"),$0F4,10,1)
%%progresscount = @fadd(%%progresscount,%%increment)
dialog setpos,%%progress"button",,,@name(%%progresscount)
if @equal(%%spacesconfiged,true)
else
gosub configspaces
end
dialog set,%%progress"edit",%%spaces@name(@fdiv(%%progresscount,%%tenth))"%"
dialog set,%%progress"button",%%spaces@name(@fdiv(%%progresscount,%%tenth))"%"
exit
:addprogress
parse "%%a;%%b;%%c;%%d;%%e", %%addprogress
DIALOG ADD,EDIT,%%a"EDIT",%%b,%%c,%%d,%%e,,tabs,progressstyle
DIALOG ADD,button,%%a"button",@succ(%%b),@succ(%%c),@diff(%%d,2),@diff(%%e,2)," ",progressstyle
dialog disable,%%a"button"
%A = @sendmsg(@win(%%a"button"),$0A,0,0)
%A = @sendmsg(@win(~%%a"button"),$0F4,10,1)
%A = @SENDMSG(@win(~%%a"edit"),$0CF,1,0)
exit
:readyprogress
%%buttonwidth = @winpos(@win(~%%progress"button"),W)
%%tenth = @fdiv(%%buttonwidth,100)
dialog focus,%%progress"edit"
%A = @sendmsg(@win(~%%progress"button"),$0F4,10,1)
rem here
if @greater(%%buttonwidth,%%progressitems)
%%increment = @fdiv(%%buttonwidth,%%progressitems)
%%increment = @fdiv(%%increment,%%tenth)
%%increment = @fmul(%%increment,%%tenth)
else
end
if @greater(%%progressitems,%%buttonwidth)
%%increment = @fdiv(%%buttonwidth,%%progressitems)
%%increment = @fdiv(%%increment,%%tenth)
%%increment = @fmul(%%increment,%%tenth)
else
end
rem here
exit
:finalizeprogress
dialog set,%%progress"button",%%spaces"100%"
%%spacesconfiged = false
exit
:configspaces
%%spacesconfiged = true
%%buttonwidth = @winpos(@win(~%%progress"edit"),W)
%%spacescount = @name(@fdiv(%%buttonwidth,10))
%%spacesindex = 0
%%spaces = ""
repeat
%%spaces = %%spaces" "
%%spacesindex = @succ(%%spacesindex)
until @greater(%%spacesindex,%%spacescount)
exit
|
|
|