Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Nov 24, 2002 11:17 am Post subject: Paint in your VDS App -- No DLL needed! |
|
|
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
 |
|