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 


Paint in your VDS App -- No DLL needed!

 
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: Sun Nov 24, 2002 11:17 am    Post subject: Paint in your VDS App -- No DLL needed! Reply with quote

Inspired by FreezingFire's example for VDS4,
so he gets the credit...

This should be VDS3 and VDS4 compatible. I tried
making it resizable, but it flickered too much.
_______________________________________________________________________________________________________________________________________________________________________________________
Code:

OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac
%%wintitle = "VDS Draw Program"
DIALOG CREATE,%%wintitle,-1,-1,600,400
  DIALOG ADD,STYLE,S1,,,,BLACK
  DIALOG ADD,STYLE,S2,,,,WHITE
  DIALOG ADD,MENU,&Options,&Erase All|CTRL+E,&Line Width 1,&Line Width 3,&Line Width 5
  DIALOG ADD,TEXT,BkGrnd,0,0,600,380,,,S2,CLICK
  DIALOG ADD,STATUS,Stat,"Click to draw..."
DIALOG SHOW

DIALOG CURSOR, CROSS
%%width = 3
%%xdiff = 4
%%ydiff = 42
%x = 0

:EVLOOP
  DIALOG SET, Stat, "Line width = "%%width     "Click to draw..."
  WAIT EVENT
  %e = @event()
  if @both(@equal(@substr(%e, 1, 3), "Dot"), @not(%%draw))
     goto BkGrndCLICK
  else
     goto %e
  end
  goto EVLOOP

:BkGrndCLICK
  %%draw = 1
  DIALOG SET, Stat, "Line width = "%%width     "Click to release..."
  REPEAT
    rem -- Make sure mouse has moved so we don't keep adding elements --
    if @not(@equal(@mousepos(X), %%x1))@not(@equal(@mousepos(Y), %%y1))
       %x = @succ(%x)
       PARSE "%%x1;%%y1", @mousepos(XY)
       DIALOG ADD,TEXT,Dot%x,@diff(%%y1,@sum(@winpos(%%wintitle,T),%%ydiff)),@diff(%%x1,@sum(@winpos(%%wintitle,L),%%xdiff)),%%width,%%width,,,S1,CLICK
    end
  UNTIL @event()
  %%draw = ""
  goto EVLOOP

:Erase AllMENU
  if @greater(%x, 0)
     REPEAT
       DIALOG REMOVE, Dot%x
       %x = @pred(%x)
     UNTIL @greater(1, %x)
  end
  goto EVLOOP

:Line Width 1MENU
  %%width = 1
  %%xdiff = 3
  %%ydiff = 41
  goto EVLOOP

:Line Width 3MENU
  %%width = 3
  %%xdiff = 4
  %%ydiff = 42
  goto EVLOOP

:Line Width 5MENU
  %%width = 5
  %%xdiff = 5
  %%ydiff = 43
  goto EVLOOP

:CLOSE
  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
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri Feb 21, 2003 5:04 am    Post subject: Reply with quote

Pretty cool Smile
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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