linetype.tbl
来自「一个不错的做图软件」· TBL 代码 · 共 123 行
TBL
123 行
<?xml version="1.0" encoding="utf-8"?>
<vg version="723" gridsize="22" activesheetIndex="1" range="0,0,137,276" borderstyle="1" scrollbars="0" paperbounds="0,0,210,296" papervisible="false">
<sheet name="MenuItem">
<rect name="Rect1" origin="77,15.5" bounds="0,0,132,16" linetype="0" backcolor="$80000004" pattern="1"/>
<line name="Line2" origin="70,8.5" points="10,8,6 122,8,2"/>
<programe>
<!--
property Caption read GetCaption write SetCaption
property Focused read GetFocused write SetFocused editor Bool
private function GetCaption()
return CStr( Line2.LineType )
end function
private function GetFocused()
return Rect1.BackColor = $8000000D
end function
public function HideSubMenu()
'
end function
private function OnClick(Sender)
ActiveSheet.HandleCommand( Line2.LineType )
end function
public function OnKeyDown(Sender,Key)
if ( Key = 13 ) then
Parent.HandleCommand( Id )
else if Key = 27 then
Close( 0 )
else if Key = 38 then
i=0
prior = 0
last = 0
t = 0
while i < Parent.UnitCount
d = Parent.Units[i]
if d.Type = Type then
if d = this then
prior = t
else
t = d
end if
last = d
end if
i = i + 1
wend
if prior <> 0 then
prior.Focused = true
else
last.Focused = true
end if
else if Key = 40 then
i=0
first = 0
next = 0
t = 0
while i < Parent.UnitCount
d = Parent.Units[i]
if d.Type = Type then
if d = this then
t = d
else if t <> 0 then
next = d
t = 0
end if
if first = 0 then
first = d
end if
end if
i = i + 1
wend
if next <> 0 then
next.Focused = true
else
first.Focused = true
end if
end if
end function
private function OnMouseEnter(Sender)
Focused = true
end function
private function OnMouseExit(Sender)
Focused = false
end function
private function OnResize(Sender)
Height = Rect1.Height
Rect1.SetBounds( Left, Top, Width, Rect1.Height )
Line2.Width = Rect1.Width - 20
end function
private function SetCaption(AValue)
Line2.LineType = Val( AValue )
Hint = "绾垮瀷 " + AValue
end function
private function SetFocused(AValue)
if AValue then
Rect1.BackColor = $8000000D
Line2.LineColor = $8000000E
if Line2.HasProperty( "text1" ) then
Line2.Text1.FontColor = Line2.LineColor
end if
i = 0
while i < Parent.UnitCount
d = Parent.Units[i]
if LCase( d.Type ) = "menuitem" then
if d <> this then
d.Focused = false
end if
end if
i = i + 1
wend
else
Rect1.BackColor = $80000004
Line2.LineColor = $80000007
if Line2.HasProperty( "text1" ) then
Line2.Text1.FontColor = Line2.LineColor
end if
end if
UpdateWindow()
end function
-->
</programe>
</sheet>
<sheet name="sheet1" visible="false">
<MenuPanel name="MenuPanel1" lib="Menu.tbl" origin="86,107.5" bounds="0,0,136,275"/>
<KeyManager name="KeyManager1" lib="controls.tbl" origin="56,100" bounds="44,88,68,112" visible="false" protect="12" hint="璇峰湪椤甸潰鐨凮nKeyDown浜嬩欢閲屽啓KeyManager1.OnKeyDown( Sender, Key )"/>
<MenuItem name="MenuItem1" lib="Menu.tbl" origin="78.5,13" bounds="2,2,134,18" hint="绾垮瀷 1" Caption=" 鏃
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?