OSDN Git Service

20021009版ソース
[seraphyscrtools/SeraphyScriptTools.git] / TestScript / class1.vbs
1 '---------------------------------------------------
2 ' VBScript Ver5\82Ì\83N\83\89\83X\82ð\97\98\97p\82µ\82½
3\83C\83x\83\93\83g\82Ì\83n\83\93\83h\83\8b
4
5 '---------------------------------------------------
6\83N\83\89\83X\82ð\90\90¬\82·\82é
7 dim obj
8 set obj = new mainframe
9
10 '----------------------------------------------------
11\83\81\83C\83\93\83t\83\8c\81[\83\80\82Ì\90\90¬\82Æ\83C\83x\83\93\83g\82ð\82¤\82¯\82é\83N\83\89\83X\82Ì\92è\8b`
12 class mainframe
13         public instance
14
15         public sub class_initialize
16                 set instance = createobject("seraphyscripttools.instance")
17                 with instance.mainframe
18                         .classobject = me
19                         .domodal
20                 end with
21         end sub
22
23         public sub OnClick
24                 dim x,y
25                 with instance.mainframe
26                         with .event
27                                 x = .posx
28                                 y = .posy
29                         end with
30                         with .canvas.layer(0)
31                                 .fillcircle x,y,5
32                         end with
33                         .draw
34                 end with
35         end sub
36
37         public sub OnMouseMove
38                 dim x,y
39                 with instance.mainframe
40                         with .event
41                                 x = .posx
42                                 y = .posy
43                         end with
44                         with .canvas.layer(1)
45                                 .clear
46                                 .setmappingmode 1
47                                 .text 0,0,x & "/" & y
48                                 .setmappingmode 0
49                                 .line 0,y,999,y
50                                 .line x,0,x,999
51                         end with
52                         .draw
53                 end with
54         end sub
55 end class