linewidth.tbl

来自「一个不错的做图软件」· TBL 代码 · 共 89 行

TBL
89 行
字号
<?xml version="1.0" encoding="utf-8"?>
<vg version="723" gridsize="22" activesheetIndex="1" range="0,0,137,132" 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.LineWidth )
end function
private function GetFocused()
return Rect1.BackColor = $8000000D
end function
public function HideSubMenu()
end function
private function OnClick(Sender)
ActiveSheet.HandleCommand( Line2.LineWidth )
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 = 1
Line2.LineWidth = Val( AValue )
Hint = "绾垮

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?