forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Gradients in VDS3 (no DLL)...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Aug 09, 2002 6:33 pm    Post subject: Gradients in VDS3 (no DLL)... Reply with quote

Here's a color gradient for VDS3. This is a progress bar
example, accurate to 1%...

Requires %%percent var value (or it will clear).

Change the %%startcolor var to try different colors
(use no leading zeros, and no "$").

Change only the following vars to change the progress
bar's location and size when creating the Dialog:
%%pbx, %%pby, %%pbw, %%pbh

Check the remarks for more info. Have fun...
__________________________________________________________________________________________________________________________
Code:

OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac
DIALOG CREATE,Test Program,-1,0,300,70
  rem -- Use no leading zeros, and no "$" (CDCDCD is prolly max) --
  rem -- Black = 000000, Blue = FF0000, Red = 0000FF, DkGreen = 006600 --
  %%startcolor = FF0000

  rem -- Get RGB increments needed to fade color --
  %%inc1 = "0"@div(@diff($FF,$@substr(%%startcolor,1,2)),50)
  %%inc2 = "0"@div(@diff($FF,$@substr(%%startcolor,3,4)),50)
  %%inc3 = "0"@div(@diff($FF,$@substr(%%startcolor,5,6)),50)

  rem -- 100 colors - adjust %%pbx, %%pby, %%pbw, %%pbh --
  rem -- %%pbw is width of color slice (total width is approx 100 x %%pbw) --
  %%pbx = 50
  %%pby = 40
  %%pbw = 2
  %%pbh = 20
  DIALOG ADD,GROUP,PG1,%%pby,%%pbx,@sum(@prod(%%pbw,100),2),@sum(%%pbh,2)
  %%color = $00%%startcolor
  %x = 1
  %%x2 = @succ(%%pbx)
  %%pby = @succ(%%pby)
  REPEAT
    DIALOG ADD,STYLE,Style%x,,,,%%color
    DIALOG ADD,TEXT,Slice%x,%%pby,%%x2,%%pbw,%%pbh,,,Style%x
    DIALOG HIDE,Slice%x
    if @equal(@mod(%x, 2), 0)
       %%color = @sum(%%color, $00%%inc1%%inc2%%inc3)
    end
    %%x2 = @sum(%%x2, %%pbw)
    %x = @succ(%x)
  UNTIL @greater(%x, 100)

  DIALOG ADD,TEXT,T1,8,5,,,"Percentage"
  DIALOG ADD,EDIT,E1,5,65,30,20,"100"
  DIALOG ADD,BUTTON,Show,5,100,50,20
  DIALOG ADD,BUTTON,Clear,5,155,50,20
DIALOG SHOW

:EVLOOP
  WAIT EVENT
  goto @event()

:ShowBUTTON
  %%percent = @dlgtext(E1)
  GOSUB ShowProgress
  goto EVLOOP

:ClearBUTTON
  GOSUB ClearProgress
  goto EVLOOP

:CLOSE
  EXIT

rem ------------ GOSUB ------------

:ShowProgress
  rem -- Auto clear for multiple calls --
  GOSUB ClearProgress
  if @not(%%percent)@greater(1,%%percent)
     exit
  end
  %x = 1
  REPEAT
    DIALOG SHOW, Slice%x
    %x = @succ(%x)
  UNTIL @greater(%x, 100)@greater(%x, %%percent)
  exit

:ClearProgress
  rem -- Hide in reverse --
  %x = 100
  REPEAT
    DIALOG HIDE,Slice%x
    %x = @pred(%x)
  UNTIL @greater(1, %x)
  exit

Cheers, Mac

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Binary
Newbie


Joined: 02 Aug 2002
Posts: 13

PostPosted: Sat Aug 10, 2002 12:06 pm    Post subject: Reply with quote

It looks really good !
thats good stuff Smile
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Aug 10, 2002 12:47 pm    Post subject: Reply with quote

Thanks! Smile
_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group