shapes.tbl
来自「一个不错的做图软件」· TBL 代码 · 共 775 行 · 第 1/2 页
TBL
775 行
<!--
private function OnResize(Sender)
a = 72 * 3.14159265359 / 180
y = Width / 2 / tan( a )
r = y / cos( a )
x = Width / 2 - r * sin( a / 2 )
if Width < 0.00001 then
y = 0
else
y = ( r - y ) * Height / Width
end if
Line1.PointCount = 5
Line1.X[0] = Left + Width / 2; Line1.Y[0] = Top
Line1.X[1] = Left; Line1.Y[1] = Top + y
Line1.X[2] = Left + x; Line1.Y[2] = Bottom
Line1.X[3] = Right - x; Line1.Y[3] = Bottom
Line1.X[4] = Right; Line1.Y[4] = Top + y
Line1.Bytes[4] = 3
end function
-->
</programe>
</sheet>
<sheet name="hexagon" visible="false" Offset="50">
<line name="line1" origin="-88,-88" points="0,48,6 24,96,2 72,96,2 96,48,2 72,0,2 24,0,3">
<programe>
<!--
published function OnNodeChange(Sender)
n = Sender.PointCount - 1
if Width > 0.00001 then
if Sender.X[n] >= Left and Sender.X[n] <= Left + Width / 2 then
Offset = CStr( ( Sender.X[n] - Left ) * 200 / Width )
OnResize( this )
return
end if
end if
Sender.X[n] = Sender.X[1]
Sender.Y[n] = Top
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
x = Val( Offset ) * Width / 200
Line1.PointCount = 6
Line1.X[0] = Left; Line1.Y[0] = Top + Height / 2
Line1.X[1] = Left + x; Line1.Y[1] = Bottom
Line1.X[2] = Right - x; Line1.Y[2] = Bottom
Line1.X[3] = Right; Line1.Y[3] = Top + Height / 2
Line1.X[4] = Right - x; Line1.Y[4] = Top
Line1.X[5] = Left + x; Line1.Y[5] = Top
Line1.Bytes[5] = 3
end function
-->
</programe>
</sheet>
<sheet name="octagon" visible="false" Offset="50">
<line name="line1" origin="-168,-72" points="0,24,6 0,72,2 24,96,2 72,96,2 96,72,2 96,24,2 72,0,2 24,0,3">
<programe>
<!--
published function OnNodeChange(Sender)
if Width > 0.00001 then
n = Sender.PointCount - 1
if Sender.X[n] >= Left and Sender.X[n] <= Left + Width / 2 then
Offset = CStr( ( Sender.X[n] - Left ) * 200 / Width )
OnResize( this )
return
end if
end if
Sender.X[n] = Sender.X[2]
Sender.Y[n] = Top
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
x = Val( Offset ) * Width / 200
if x > Height / 2 then
x = Height / 2
end if
Line1.PointCount = 8
Line1.X[0] = Left; Line1.Y[0] = Top + x
Line1.X[1] = Left; Line1.Y[1] = Bottom - x
Line1.X[2] = Left + x; Line1.Y[2] = Bottom
Line1.X[3] = Right - x; Line1.Y[3] = Bottom
Line1.X[4] = Right; Line1.Y[4] = Bottom - x
Line1.X[5] = Right; Line1.Y[5] = Top + x
Line1.X[6] = Right - x; Line1.Y[6] = Top
Line1.X[7] = Left + x; Line1.Y[7] = Top
Line1.Bytes[7] = 3
end function
-->
</programe>
</sheet>
<sheet name="larrow" visible="false" XOffset="25" YOffset="50">
<line name="line1" origin="-88,-184" pattern="1" points="24,0,6 0,24,2 24,48,2 24,36,2 96,36,2 96,12,2 24,12,3">
<programe>
<!--
published function OnNodeChange(Sender)
b = false
n = Sender.PointCount - 1
if Width > 0.00001 then
if Sender.X[n] >= Left and Sender.X[n] <= Right then
XOffset = CStr( ( Sender.X[n] - Left ) * 100 / Width )
b = true
end if
end if
if Height > 0.00001 then
if Sender.Y[n] >= Top and Sender.Y[n] <= Top + Height / 2 then
YOffset = CStr( ( Sender.Y[n] - Top ) * 200 / Height )
b = true
end if
end if
if b then
OnResize( this )
else
Sender.X[n] = Sender.X[0]
Sender.Y[n] = Sender.Y[n-1]
end if
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
x = Val( XOffset ) * Width / 100
y = Val( YOffset ) * Height / 200
Line1.PointCount = 7
Line1.X[0] = Left + x; Line1.Y[0] = Top
Line1.X[1] = Left; Line1.Y[1] = Top + Height / 2
Line1.X[2] = Left + x; Line1.Y[2] = Bottom
Line1.X[3] = Left + x; Line1.Y[3] = Bottom - y
Line1.X[4] = Right; Line1.Y[4] = Bottom - y
Line1.X[5] = Right; Line1.Y[5] = Top + y
Line1.X[6] = Left + x; Line1.Y[6] = Top + y
Line1.Bytes[6] = 3
end function
-->
</programe>
</sheet>
<sheet name="tarrow" visible="false" XOffset="50" YOffset="25">
<line name="line1" origin="-96,-128" pattern="1" points="0,24,6 24,0,2 48,24,2 36,24,2 36,96,2 12,96,2 12,24,3">
<programe>
<!--
published function OnNodeChange(Sender)
b = false
n = Sender.PointCount - 1
if Width > 0.00001 then
if Sender.X[n] >= Left and Sender.X[n] <= Left + Width / 2 then
XOffset = CStr( ( Sender.X[n] - Left ) * 200 / Width )
b = true
end if
end if
if Height > 0.00001 then
if Sender.Y[n] >= Top and Sender.Y[n] <= Bottom then
YOffset = CStr( ( Sender.Y[n] - Top ) * 100 / Height )
b = true
end if
end if
if b then
OnResize( this )
else
Sender.X[n] = Sender.X[n-1]
Sender.Y[n] = Sender.Y[0]
end if
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
x = Val( XOffset ) * Width / 200
y = Val( YOffset ) * Height / 100
Line1.PointCount = 7
Line1.X[0] = Left; Line1.Y[0] = Top + y
Line1.X[1] = Left + Width / 2; Line1.Y[1] = Top
Line1.X[2] = Right; Line1.Y[2] = Top + y
Line1.X[3] = Right - x; Line1.Y[3] = Top + y
Line1.X[4] = Right - x; Line1.Y[4] = Bottom
Line1.X[5] = Left + x; Line1.Y[5] = Bottom
Line1.X[6] = Left + x; Line1.Y[6] = Top + y
Line1.Bytes[6] = 3
end function
-->
</programe>
</sheet>
<sheet name="rarrow" visible="false" XOffset="25" YOffset="50">
<line name="line1" origin="-88,-72" pattern="1" points="72,0,6 96,24,2 72,48,2 72,36,2 0,36,2 0,12,2 72,12,3">
<programe>
<!--
published function OnNodeChange(Sender)
b = false
n = Sender.PointCount - 1
if Width > 0.00001 then
if Sender.X[n] >= Left and Sender.X[n] <= Right then
XOffset = CStr( ( Right - Sender.X[n] ) * 100 / Width )
b = true
end if
end if
if Height > 0.00001 then
if Sender.Y[n] >= Top and Sender.Y[n] <= Top + Height / 2 then
YOffset = CStr( ( Sender.Y[n] - Top ) * 200 / Height )
b = true
end if
end if
if b then
OnResize( this )
else
Sender.X[n] = Sender.X[0]
Sender.Y[n] = Sender.Y[n-1]
end if
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
x = Val( XOffset ) * Width / 100
y = Val( YOffset ) * Height / 200
Line1.PointCount = 7
Line1.X[0] = Right - x; Line1.Y[0] = Top
Line1.X[1] = Right; Line1.Y[1] = Top + Height / 2
Line1.X[2] = Right - x; Line1.Y[2] = Bottom
Line1.X[3] = Right - x; Line1.Y[3] = Bottom - y
Line1.X[4] = Left; Line1.Y[4] = Bottom - y
Line1.X[5] = Left; Line1.Y[5] = Top + y
Line1.X[6] = Right - x; Line1.Y[6] = Top + y
Line1.Bytes[6] = 3
end function
-->
</programe>
</sheet>
<sheet name="barrow" visible="false" XOffset="50" YOffset="25">
<line name="line1" origin="-120,-56" pattern="1" points="0,72,6 24,96,2 48,72,2 36,72,2 36,0,2 12,0,2 12,72,3">
<programe>
<!--
published function OnNodeChange(Sender)
b = false
n = Sender.PointCount - 1
if Width > 0.00001 then
if Sender.X[n] >= Left and Sender.X[n] <= Left + Width / 2 then
XOffset = CStr( ( Sender.X[n] - Left ) * 200 / Width )
b = true
end if
end if
if Height > 0.00001 then
if Sender.Y[n] >= Top and Sender.Y[n] <= Bottom then
YOffset = CStr( ( Bottom - Sender.Y[n] ) * 100 / Height )
b = true
end if
end if
if b then
OnResize( this )
else
Sender.X[n] = Sender.X[n-1]
Sender.Y[n] = Sender.Y[0]
end if
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
x = Val( XOffset ) * Width / 200
y = Val( YOffset ) * Height / 100
Line1.PointCount = 7
Line1.X[0] = Left; Line1.Y[0] = Bottom - y
Line1.X[1] = Left + Width / 2; Line1.Y[1] = Bottom
Line1.X[2] = Right; Line1.Y[2] = Bottom - y
Line1.X[3] = Right - x; Line1.Y[3] = Bottom - y
Line1.X[4] = Right - x; Line1.Y[4] = Top
Line1.X[5] = Left + x; Line1.Y[5] = Top
Line1.X[6] = Left + x; Line1.Y[6] = Bottom - y
Line1.Bytes[6] = 3
end function
-->
</programe>
</sheet>
<sheet name="harrow" visible="false" XOffset="50" YOffset="50">
<line name="line1" origin="-88,-184" pattern="1" points="24,0,6 0,24,2 24,48,2 24,36,2 76.8,36,2 76.8,48,2 100.4,24,2 76.8,0,2 76.8,12,2 24,12,3">
<programe>
<!--
published function OnNodeChange(Sender)
b = false
n = Sender.PointCount - 1
if Width > 0.00001 then
if Sender.X[n] >= Left and Sender.X[n] <= Left + Width / 2 then
XOffset = CStr( ( Sender.X[n] - Left ) * 200 / Width )
b = true
end if
end if
if Height > 0.00001 then
if Sender.Y[n] >= Top and Sender.Y[n] <= Top + Height / 2 then
YOffset = CStr( ( Sender.Y[n] - Top ) * 200 / Height )
b = true
end if
end if
if b then
OnResize( this )
else
Sender.X[n] = Sender.X[0]
Sender.Y[n] = Sender.Y[n-1]
end if
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
x = Val( XOffset ) * Width / 200
y = Val( YOffset ) * Height / 200
Line1.PointCount = 10
Line1.X[0] = Left + x; Line1.Y[0] = Top
Line1.X[1] = Left; Line1.Y[1] = Top + Height / 2
Line1.X[2] = Left + x; Line1.Y[2] = Bottom
Line1.X[3] = Left + x; Line1.Y[3] = Bottom - y
Line1.X[4] = Right - x; Line1.Y[4] = Bottom - y
Line1.X[5] = Right - x; Line1.Y[5] = Bottom
Line1.X[6] = Right; Line1.Y[6] = Top + Height / 2
Line1.X[7] = Right - x; Line1.Y[7] = Top
Line1.X[8] = Right - x; Line1.Y[8] = Top + y
Line1.X[9] = Left + x; Line1.Y[9] = Top + y
Line1.Bytes[9] = 3
end function
-->
</programe>
</sheet>
<sheet name="varrow" visible="false" XOffset="50" YOffset="50">
<line name="line1" origin="-96,-128" pattern="1" points="0,24,6 24,0,2 48,24,2 36,24,2 36,78.4,2 48,78.4,2 25.6,96,2 0,78.4,2 12,78.4,2 12,24,3">
<programe>
<!--
published function OnNodeChange(Sender)
b = false
n = Sender.PointCount - 1
if Width > 0.00001 then
if Sender.X[n] >= Left and Sender.X[n] <= Left + Width / 2 then
XOffset = CStr( ( Sender.X[n] - Left ) * 200 / Width )
b = true
end if
end if
if Height > 0.00001 then
if Sender.Y[n] >= Top and Sender.Y[n] <= Top + Height / 2 then
YOffset = CStr( ( Sender.Y[n] - Top ) * 200 / Height )
b = true
end if
end if
if b then
OnResize( this )
else
Sender.X[n] = Sender.X[n-1]
Sender.Y[n] = Sender.Y[0]
end if
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
x = Val( XOffset ) * Width / 200
y = Val( YOffset ) * Height / 200
Line1.PointCount = 10
Line1.X[0] = Left; Line1.Y[0] = Top + y
Line1.X[1] = Left + Width / 2; Line1.Y[1] = Top
Line1.X[2] = Right; Line1.Y[2] = Top + y
Line1.X[3] = Right - x; Line1.Y[3] = Top + y
Line1.X[4] = Right - x; Line1.Y[4] = Bottom - y
Line1.X[5] = Right; Line1.Y[5] = Bottom - y
Line1.X[6] = Left + Width / 2; Line1.Y[6] = Bottom
Line1.X[7] = Left; Line1.Y[7] = Bottom - y
Line1.X[8] = Left + x; Line1.Y[8] = Bottom - y
Line1.X[9] = Left + x; Line1.Y[9] = Top + y
Line1.Bytes[9] = 3
end function
-->
</programe>
</sheet>
</vg>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?