📄 linetype.tbl
字号:
<?xml version="1.0" encoding="utf-8"?>
<vg version="702" gridsize="22" activesheetIndex="1" range="0,0,137,276" borderstyle="1" scrollbars="0" backcolor="$FFFFFF">
<page name="page" bounds="0,0,210,296" visible="false"/>
<sheet name="MenuItem">
<rect name="Rect1" bounds="0,0,132,16" origin="77,15.5" linetype="0" backcolor="$80000004" pattern="1"/>
<line name="Line2" origin="70,8.5">
<points>
10,8,6
122,8,2
</points>
</line>
<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
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">
<MenuPanel name="MenuPanel1" lib="Menu.tbl" bounds="0,0,136,275" origin="86,107.5"/>
<KeyManager name="KeyManager1" lib="controls.tbl" bounds="44,88,68,112" origin="56,100" visible="false" hint="璇峰湪椤甸潰鐨凮nKeyDown浜嬩欢閲屽啓KeyManager1.OnKeyDown( Sender, Key )"/>
<MenuItem name="MenuItem1" lib="" bounds="2,2,134,18" origin="-198,-182" hint="绾垮瀷 0" Caption="'0'" Default="false" Focused="false"/>
<MenuItem name="MenuItem2" lib="" bounds="2,19,134,35" origin="-198,-165" hint="绾垮瀷 1" Caption="'1'" Default="false" Focused="false"/>
<MenuItem name="MenuItem3" lib="" bounds="2,36,134,52" origin="-198,-148" hint="绾垮瀷 2" Caption="'2'" Default="false" Focused="false"/>
<MenuItem name="MenuItem4" lib="" bounds="2,53,134,69" origin="-198,-131" hint="绾垮瀷 3" Caption="'3'" Default="false" Focused="false"/>
<MenuItem name="MenuItem5" lib="" bounds="2,70,134,86" origin="-198,-114" hint="绾垮瀷 4" Caption="'4'" Default="false" Focused="false"/>
<MenuItem name="MenuItem6" lib="" bounds="2,87,134,103" origin="-198,-97" hint="绾垮瀷 5" Caption="'5'" Default="false" Focused="false"/>
<MenuItem name="MenuItem7" lib="" bounds="2,104,134,120" origin="-198,-80" hint="绾垮瀷 6" Caption="'6'" Default="false" Focused="false"/>
<MenuItem name="MenuItem8" lib="" bounds="2,121,134,137" origin="-198,-63" hint="绾垮瀷 7" Caption="'7'" Default="false" Focused="false"/>
<MenuItem name="MenuItem9" lib="" bounds="2,138,134,154" origin="-198,-46" hint="绾垮瀷 8" Caption="'8'" Default="false" Focused="false"/>
<MenuItem name="MenuItem10" lib="" bounds="2,155,134,171" origin="-198,-29" hint="绾垮瀷 9" Caption="'9'" Default="false" Focused="false"/>
<MenuItem name="MenuItem11" lib="" bounds="2,172,134,188" origin="-198,-12" hint="绾垮瀷 10" Caption="'10'" Default="false" Focused="false"/>
<MenuItem name="MenuItem12" lib="" bounds="2,189,134,205" origin="-198,5" hint="绾垮瀷 11" Caption="'11'" Default="false" Focused="false"/>
<MenuItem name="MenuItem13" lib="" bounds="2,206,134,222" origin="-198,22" hint="绾垮瀷 12" Caption="'12'" Default="false" Focused="false"/>
<MenuItem name="MenuItem14" lib="" bounds="2,223,134,239" origin="-198,39" hint="绾垮瀷 13" Caption="'13'" Default="false" Focused="false"/>
<MenuItem name="MenuItem15" lib="" bounds="2,240,134,256" origin="-198,56" hint="绾垮瀷 14" Caption="'14'" Default="false" Focused="false"/>
<MenuItem name="MenuItem16" lib="" bounds="2,257,134,273" origin="-198,73" hint="绾垮瀷 15" Caption="'15'" Default="false" Focused="false"/>
<rect name="rect1" bounds="2,44,134,60" origin="68,55" alpha="50" visible="false" backcolor="$60FF" pattern="1">
<programe>
published function OnClick(Sender)
HandleCommand( 0 )
end function
</programe>
</rect>
<programe>
public function HandleCommand(AId)
Close( AId + 1 )
end function
private function OnKeyDown(Sender,Key)
KeyManager1.OnKeyDown( Sender, Key )
end function
private function OnLoad(Sender)
l = MenuItem1.UnitByName( "line2" )
d = l.AddLabel()
d.Text = "鏃
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -