popupmenu1.tbl
来自「一个不错的做图软件」· TBL 代码 · 共 260 行
TBL
260 行
<?xml version="1.0" encoding="utf-8"?>
<vg version="724" range="0,0,173,216" borderstyle="1" scrollbars="0" backcolor="$80000004" paperbounds="0,0,793.700787,1122.141732" papervisible="false">
<sheet name="sheet1" bounds="0,0,176,219" visible="false" groups="group1" group1="">
<MenuPanel name="borderG1" lib="Menu.tbl" origin="129,101" bounds="0,0,172,215"/>
<MenuItem name="MenuItem1" lib="Menu.tbl" origin="78.5,13" bounds="2,2,170,24" id="1" Caption="瑁佸壀(X) Ctrl+X" Checked="false" Enable="true" Focused="false" Picture="Icon\Cut.bmp" submenu="">
<programe>
<!--
published function OnClick(Sender)
Close( 0 )
if Inspector <> 0 then
Inspector.Help( "cmcut" )
end if
doc = FCurSheet.Owner
d = GetFocusedText()
if d <> 0 then
if d.SelLength > 0 then
d.CopyToClipboard()
d.DeleteSelection()
return
end if
end if
doc.CopyToClipboard()
doc.DeleteSelection()
end function
-->
</programe>
</MenuItem>
<MenuItem name="MenuItem2" lib="Menu.tbl" origin="78.5,35" bounds="2,24,170,46" id="2" Caption="鎷疯礉(C) Ctrl+C" Checked="false" Enable="true" Focused="false" Picture="Icon\Copy.bmp" submenu="">
<programe>
<!--
published function OnClick(Sender)
Close( 0 )
if Inspector <> 0 then
Inspector.Help( "cmcopy" )
end if
doc = FCurSheet.Owner
d = GetFocusedText()
if d <> 0 then
if d.SelLength > 0 then
d.CopyToClipboard()
return
end if
end if
doc.CopyToClipboard()
end function
-->
</programe>
</MenuItem>
<MenuItem name="MenuItem3" lib="Menu.tbl" origin="78.5,57" bounds="2,46,170,68" id="3" Caption="绮樿创(P) Ctrl+V" Checked="false" Enable="true" Focused="false" Picture="Icon\Paste.bmp" submenu="">
<programe>
<!--
published function OnClick(Sender)
Close( 0 )
if Inspector <> 0 then
Inspector.Help( "cmpaste" )
end if
doc = FCurSheet.Owner
d = GetFocusedText()
if d <> 0 then
if d.CanPaste() then
d.PasteFromClipboard()
return
end if
end if
doc.Paste()
end function
-->
</programe>
</MenuItem>
<MenuItem name="MenuItem4" lib="Menu.tbl" origin="78.5,84" bounds="2,73,170,95" id="4" Caption="娣诲姞鏂囧瓧(W)" Checked="false" Enable="true" Focused="false" Picture="" submenu="">
<programe>
<!--
published function OnClick(Sender)
Close( 0 )
doc = FCurSheet.Owner
d = FCurSheet.Selection.Units[0]
if ( not d.Locked ) then
if d.ClassId = 3 or d.ClassId = 6 then
d.Label = not d.Label
if d.Label then
d.text1.Focused = true
end if
end if
end if
end function
-->
</programe>
</MenuItem>
<MenuItem name="MenuItem6" lib="Menu.tbl" origin="78.5,110" bounds="2,99,170,121" Caption="瀵归綈(A)" Checked="false" Enable="true" Focused="false" Picture="" submenu="p4"/>
<MenuItem name="MenuItem7" lib="Menu.tbl" origin="78.5,132" bounds="2,121,170,143" Caption="鍙犳斁娆″簭(L)" Checked="false" Enable="true" Focused="false" Picture="" submenu="p3"/>
<MenuItem name="MenuItem8" lib="Menu.tbl" origin="78.5,158" bounds="2,147,170,169" id="7" Caption="缁勫悎(G) Ctrl+G" Checked="false" Enable="true" Focused="false" Picture="Icon\MergeElement.bmp" submenu="">
<programe>
<!--
published function OnClick(Sender)
Close( 0 )
if Inspector <> 0 then
Inspector.Help( "cmmergeelement" )
end if
FCurSheet.Owner.MergeElement()
end function
-->
</programe>
</MenuItem>
<MenuItem name="MenuItem9" lib="Menu.tbl" origin="78.5,180" bounds="2,169,170,191" id="184" Caption="鎷嗗垎(T) Shift+Ctrl+G" Checked="false" Enable="true" Focused="false" Picture="Icon\SplitElement.bmp" submenu="">
<programe>
<!--
published function OnClick(Sender)
Close( 0 )
if Inspector <> 0 then
Inspector.Help( "cmsplitelement" )
end if
if FIDE then
IDE_DispatchCommand( Sender.Id )
else
FCurSheet.Owner.SplitElement()
end if
end function
-->
</programe>
</MenuItem>
<MenuItem name="MenuItem10" lib="Menu.tbl" origin="78.5,202" bounds="2,191,170,213" id="9" Caption="杩涘叆缂栬緫鍏冧欢(E)" Checked="false" Enable="true" Focused="false" Picture="" submenu="">
<programe>
<!--
published function OnClick(Sender)
Close( 0 )
if Inspector <> 0 then
Inspector.Help( "cmeditelement" )
end if
if FIDE then
IDE_EditElement()
end if
end function
-->
</programe>
</MenuItem>
<Separator name="Separator2" lib="Menu.tbl" origin="80,70.5" bounds="4,70,168,71"/>
<Separator name="Separator3" lib="Menu.tbl" origin="78,97.5" bounds="4,97,168,98"/>
<Separator name="Separator4" lib="Menu.tbl" origin="78,145.5" bounds="4,145,168,146"/>
<KeyManager name="KeyManager1" lib="controls.tbl" origin="108,100" bounds="96,88,120,112" visible="false" protect="12" hint="璇峰湪椤甸潰鐨凮nKeyDown浜嬩欢閲屽啓KeyManager1.OnKeyDown( Sender, Key )"/>
<MenuItem name="ContextMenu" lib="Menu.tbl" origin="78.5,-21" bounds="2,-32,170,-10" id="4" Caption="Context Menu(C)" Checked="false" Enable="true" Focused="false" Picture="" submenu="">
<programe>
<!--
published function OnClick(Sender)
Close( 0 )
d = FCurSheet.Selection.Units[0]
n = FindUnit( Sender )
d.OnContextMenu( d, n )
end function
-->
</programe>
</MenuItem>
<programe>
<!--
property CurSheet read FCurSheet write FCurSheet
property IDE read FIDE write FIDE
private function Initialize(Sender)
FCurSheet = 0
FIDE = false
end function
private function OnKeyDown(Sender,Key)
KeyManager1.OnKeyDown( Sender, Key )
end function
private function OnLoad(Sender)
MenuItem9.Enable = false
end function
private function OnShow(Sender)
if Group1.UnitCount > 0 then
n = ( Group1.UnitCount - 1 ) * ContextMenu.Height + 4
while Group1.UnitCount > 0
DeleteUnit( Group1.Units[0] )
wend
i = 1
while i < UnitCount - 1
d = Units[i]
d.MoveBy( 0, -n )
i = i + 1
wend
end if
MenuItem1.Enable = ( FCurSheet.Selection.UnitCount > 0 )
if not MenuItem1.Enable then
d = GetFocusedText()
if d <> 0 then
if d.SelLength > 0 then
MenuItem1.Enable = true
end if
end if
end if
MenuItem2.Enable = MenuItem1.Enable
MenuItem3.Enable = FCurSheet.Owner.CanPaste()
MenuItem4.Enable = false
if FCurSheet.Selection.UnitCount = 1 then
d = FCurSheet.Selection.Units[0]
if ( not d.Locked ) then
if d.ClassId = 3 or d.ClassId = 6 then
MenuItem4.Enable = true
MenuItem4.Caption = "娣诲姞鏂囧瓧(W)"
if d.Label then
MenuItem4.Caption = "鍒犻櫎鏂囧瓧(W)"
end if
end if
if d.ClassId = 99 then
if d.IsCombined() and Len( d.Lib ) = 0 then
MenuItem9.Enable = true
end if
end if
end if
if d.HasProperty( "ContextMenu" ) then
ar = array( 10 )
ar.LoadFromBuffer( d.ContextMenu )
n = ar.Count * ContextMenu.Height + 4
i = 1
while i < UnitCount - 1
d = Units[i]
d.MoveBy( 0, n )
i = i + 1
wend
y = 2
i = 0
while i < ar.Count
d = CopyUnit( ContextMenu )
d.MoveTo( d.Left, y )
d.Caption = ar[i]
Group1.Add( d )
y = y + ContextMenu.Height
i = i + 1
wend
d = CopyUnit( Separator2 )
d.MoveTo( d.Left, y + 2 )
Group1.Add( d )
Group1.SendToBack( true )
borderG1.SendToBack( true )
end if
end if
MenuItem6.Enable = ( FCurSheet.Selection.UnitCount > 1 )
MenuItem7.Enable = ( MenuItem1.Enable and ( FCurSheet.UnitCount > FCurSheet.Selection.UnitCount ) )
MenuItem8.Enable = ( FCurSheet.Selection.UnitCount > 1 )
if FIDE then
MenuItem10.Visible = true
MenuItem10.Enable = false
borderG1.Height = MenuItem10.Bottom + 2
if FCurSheet.Selection.UnitCount = 1 then
d = FCurSheet.Selection.Units[0]
if d.ClassId = 99 then
if Len( d.Lib ) = 0 then
MenuItem10.Enable = true
end if
end if
end if
else
MenuItem10.Visible = false
borderG1.Height = MenuItem9.Bottom + 2
end if
RangeBottom = borderG1.Bottom + 1
end function
-->
</programe>
</sheet>
<sheet name="p3" bounds="-144,16,-16,112" visible="false">
<MenuPanel name="borderG1" lib="Menu.tbl" origin="-55,65" bounds="-144,16,-20,108"/>
<MenuItem name="MenuItem1" lib="Menu.tbl" origin="-65.5,51" bounds="-142,40,-22,62" id="602" Caption="涓婄Щ涓
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?