filebar.tbl

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

TBL
502
字号
<?xml version="1.0" encoding="utf-8"?>
<vg version="723" range="0,0,2000,2000" bordericons="0" borderstyle="1" scrollbars="0" backcolor="$8000000F" paperbounds="0,0,793.700787,1122.141732" papervisible="false">
<sheet name="sheet1" bounds="0,0,576,21">
<element name="TabSet1" origin="108.652003,-132.014977" bounds="0,0,576,21" FirstCol="0" TabIndex="-1">
<rect name="rect1" origin="206,12" bounds="0,0,576,21" linetype="0" backcolor="$8000000F" frontcolor="$FFFFFF" pattern="1"/>
<element name="element1" origin="42,12" bounds="18,0,44,18" visible="false" Caption="" Selected="false">
<line name="line1" origin="70,2" visible="false" linetype="0" backcolor="$8000000F" pattern="1" points="44,18,6 44,1,2 43,0,2 19,0,2 18,1,2 18,18,2"/>
<line name="line3" origin="70,2" visible="false" backcolor="$8000000F" points="44,18,6 44,1,2 43,0,2 19,0,2 18,1,2 18,18,2"/>
<line name="line2" origin="34.32334,9.591006" visible="false" linecolor="$80000010" points="43,1,6 43,18,2"/>
<text name="text1" origin="23.991266,6" bounds="27,4,27,16" autosize="true" border="0" fontname="瀹嬩綋" fontsize="12" fontcolor="$80000011" textalign="1" borderinterval="0"/>
<line name="line4" origin="43,9.5" linecolor="$80000010" points="42,18,6 42,0,2"/>
<line name="line5" origin="30.5,9.298143" visible="false" linecolor="$80000014" points="43,1,6 19,1,2 19,18,2"/>
<programe>
<!--
property Caption read GetCaption write SetCaption
private function GetCaption()
return Text1.Text
end function
private function Initialize(Sender)
FSelected = false
end function
property Selected read FSelected write SetSelected editor Bool
private function SetCaption(AValue)
i=text1.Width
Text1.Text = AValue
j=text1.Width
line1.x[0]=line1.x[0]+(j-i)
line1.x[1]=line1.x[1]+(j-i)
line1.x[2]=line1.x[2]+(j-i)
line1.Refresh()
line2.x[0] = Line1.x[0] - 1
line2.x[1] = Line1.x[0] - 1
line2.Refresh()
line3.x[0] = Line1.x[0]
line3.x[1] = Line1.x[1]
line3.x[2] = Line1.x[2]
line3.Refresh()
line4.x[0] = Line3.x[0] - 2
line4.x[1] = Line3.x[1] - 2
line4.Refresh()
line5.x[0] = Line2.x[0]
line5.Refresh()
Refresh()
end function
private function SetSelected(AValue)
if AValue then
  Line1.Visible = true
  Line2.Visible = true
  Line3.Visible = true
  Line4.Visible = false
  Line5.Visible = true
  Text1.FontColor = $80000012
else
  Line1.Visible = false
  Line2.Visible = false
  Line3.Visible = false
  Line4.Visible = true
  Line5.Visible = false
  Text1.FontColor = $80000011
end if
FSelected = AValue
end function
-->
</programe>
</element>
<element name="UpBtn" origin="536,9" bounds="543,0,559,16" visible="false">
<rect name="Rect2" origin="549,7" bounds="543,0,559,16" linecolor="$8000000F" backcolor="$8000000F" pattern="1"/>
<line name="Line5" origin="551,8" linecolor="$80000014" points="543,16,6 543,0,2 559,0,2"/>
<line name="Line6" origin="551,8" linecolor="$80000010" points="543,16,6 559,16,2 559,0,2"/>
<line name="Line9" origin="549.5,10" linecolor="$80000012" backcolor="$0" pattern="1" points="549.5,8,6 552.5,5,2 552.5,11,3"/>
<programe>
<!--
private function Initialize(Sender)
FTimerInterval = 300
end function
published function OnClick(Sender)
FirstCol = FirstCol - 1
end function
private function OnLButtonDown(Sender,X,Y)
Line5.LineColor = $80000010
Line6.LineColor = $80000014
Line9.Left = Line9.Left + 1
Line9.Top = Line9.Top + 1
FTimerInterval = 300
SetTimer( FTimerInterval )
end function
private function OnLButtonUp(Sender,X,Y)
Line5.LineColor = $80000014
Line6.LineColor = $80000010
Line9.Left = Line9.Left - 1
Line9.Top = Line9.Top - 1
SetTimer( 0 )
end function
private function OnTimer(Sender)
OnClick( Sender )
if FTimerInterval = 300 then
	FTimerInterval = 100
	SetTimer( FTimerInterval )
end if
end function
-->
</programe>
</element>
<element name="DownBtn" origin="560,-214.25" bounds="560,0,576,16" visible="false">
<rect name="Rect2" origin="566,7" bounds="560,0,576,16" linecolor="$8000000F" backcolor="$8000000F" pattern="1"/>
<line name="Line5" origin="568,8" linecolor="$80000014" points="560,16,6 560,0,2 576,0,2"/>
<line name="Line6" origin="568,8" linecolor="$80000010" points="560,16,6 576,16,2 576,0,2"/>
<line name="Line9" origin="566.5,13" linecolor="$80000012" backcolor="$0" pattern="1" points="569.5,8,6 566.5,5,2 566.5,11,3"/>
<programe>
<!--
private function Initialize(Sender)
FTimerInterval = 300
end function
published function OnClick(Sender)
FirstCol = FirstCol + 1
end function
private function OnLButtonDown(Sender,X,Y)
Line5.LineColor = $80000010
Line6.LineColor = $80000014
Line9.Left = Line9.Left + 1
Line9.Top = Line9.Top + 1
FTimerInterval = 300
SetTimer( FTimerInterval )
end function
private function OnLButtonUp(Sender,X,Y)
Line5.LineColor = $80000014
Line6.LineColor = $80000010
Line9.Left = Line9.Left - 1
Line9.Top = Line9.Top - 1
SetTimer( 0 )
end function
private function OnTimer(Sender)
OnClick( Sender )
if FTimerInterval = 300 then
  FTimerInterval = 100
  SetTimer( FTimerInterval )
end if
end function
-->
</programe>
</element>
<programe>
<!--
public function Add(AValue)
ar[ar.Count] = AValue
if FUpdate then
  Reset()
end if
end function
public function BeginUpdate()
FUpdate = false
end function
public function Clear()
ar.Clear()
FTabIndex = -1
if FUpdate then
  Reset()
end if
end function
public function Delete(AIndex)
ar.Delete( AIndex )
if FTabIndex >= ar.Count then
  FTabIndex = -1
end if
if FUpdate then
  Reset()
end if
end function
public function EndUpdate()
if not FUpdate then
  FUpdate = true
  Reset()
end if
end function
property FirstCol read FFirstCol write SetFirstCol
public function GetCount()
return ar.Count
end function
public function GetTabName(AIndex)
return ar[AIndex]
end function
public function IndexOf(s)
i = 0
while i < ar.Count
  if s = ar[i] then
    return i
  end if
  i = i + 1
wend
return -1
end function
private function Initialize(Sender)
FFirstCol = 0
FUpdate = true
FTabIndex = -1
ar=array(10)
Group1=array(10)
end function
public function Insert(AIndex,AValue)
ar.Insert( AIndex, AValue )
if FUpdate then
  Reset()
end if
end function
public function ItemAtCursor()
d = UnitAtCursor( 0 )
if d <> 0 then
  i = 0
  while i < Group1.Count
    if Group1[i] = d then
      return i + FFirstCol
    end if
    i = i + 1
  wend
end if
return -1
end function
private function OnClick(Sender)
d = UnitAtCursor( 0 )
if d = Rect1 then
  doc = Create( Handle, "filemenu.tbl", true, false )
  i = 0
  while i < ar.Count
    doc.ActiveSheet.AddItem( ar[i] )
    i = i + 1
  wend
  p = Point( 0, 0 )
  GetCursorPos( p )
  n = doc.Popup( p.x, p.y )
  if n > 0 then
    TabIndex = n - 1
    Reset()
  end if
  doc.Free()
end if
end function
published function OnDblClick(Sender)
IDE_DispatchCommand( 108 )
end function
private function OnLButtonDown(Sender,X,Y)
d = UnitAtCursor( Rect1 )
if d <> 0 then
  i = 0
  while i < Group1.Count
    if Group1[i] = d then
      TabIndex = i + FFirstCol
      Reset()
      return
    end if
    i = i + 1
  wend
end if
end function
published function OnRButtonDown(Sender,X,Y)
n = TabSet1.ItemAtCursor()
if n > -1 then
  TabSet1.TabIndex = n
end if
doc = Create( Handle, "popupmenu5.tbl", true, false )
p = Point( X, Y )
Sender.ViewToClient( p )
ClientToScreen( p )
ret = doc.Popup( p.x, p.y )
doc.Free()
if ret = 1 then
  IDE_DispatchCommand( 104 )
else if ret = 2 then
  IDE_DispatchCommand( 108 )
end if
end function
private function OnResize(Sender)
Rect1.SetBounds( Left, Top, Width, Height )
Reset()
end function
published function OnTabChanged(Sender)
if Sender.TabIndex >= 0 then
  IDE_SetActiveChild( ar[Sender.TabIndex] )
end if
end function
private function Reset()
i = 0
while i < Group1.Count
  DeleteUnit( Group1[i] )
  i = i + 1
wend
Group1.Clear()
i = FFirstCol
if FFirstCol > 0 then
  x = Left
  while ( i < ar.Count ) and ( x <= Right )
    x = x + 26 + Element1.UnitByName( "Text1" ).GetTextWidth( ar[i] )
    i = i + 1
  wend
  while FFirstCol > 0 and x < Right
    x = x + 26 + Element1.UnitByName( "Text1" ).GetTextWidth( ar[FFirstCol-1] )
    if x < Right then
      FFirstCol = FFirstCol - 1
    end if
  wend
end if
x = Left
d = Element1
i = FFirstCol
if i < ar.Count then
  d.Caption = ar[i]
end if
while ( i < ar.Count ) and ( x + d.Width <= Right )
  d = CopyUnit( element1 )
  d.Visible = true
  d.Caption = ar[i]
  d.Left = x
  d.Selected = false
  d.SendToBack( true )
  Group1.Add( d )
  x = x + d.Width - 4
  i = i + 1
  if i < ar.Count then
    d = Element1
    d.Caption = ar[i]
  end if
wend
Rect1.SendToBack( true )
UpBtn.Left = Rect1.Right - DownBtn.Width - UpBtn.Width - 1
DownBtn.Left = Rect1.Right - DownBtn.Width
if ( FFirstCol > 0 ) or ( i < ar.Count ) then
  UpBtn.Visible = true
  DownBtn.Visible = true
  i = Group1.Count - 1
  while i >= 0
    d = Group1[i]
    if d.Right > UpBtn.Left then
      DeleteUnit( d )
      Group1.Delete( i )
    else
      break
    end if
    i = i - 1
  wend
else
  UpBtn.Visible = false
  DownBtn.Visible = false
end if
if ( FTabIndex - FFirstCol >= 0 ) and ( FTabIndex - FFirstCol < Group1.Count ) then
  d = Group1[FTabIndex-FFirstCol]
  d.Selected = true
  d.BringToFront( true )
end if
Refresh()
end function
public function ScrollTo(ATabIndex)
SetTabIndex( ATabIndex )
if ATabIndex < FFirstCol then
  SetFirstCol( ATabIndex )
else if ATabIndex >= FFirstCol + Group1.Count then
  SetFirstCol( ATabIndex )
end if
end function
private function SetFirstCol(AValue)
if AValue >= 0 and AValue < ar.Count
  FFirstCol = AValue
  Reset()
end if
end function
private function SetTabIndex(AValue)
if AValue >= -1 and AValue < ar.Count then
  FTabIndex = AValue
  Reset()
  if FTabIndex < FFirstCol then
    FirstCol = FTabIndex
  else if FTabIndex - FFirstCol >= Group1.Count then
    FirstCol = FTabIndex
  end if
  OnTabChanged( this )
end if
end function
public function SetTabName(AIndex,AValue)
ar[AIndex] = AValue
if FUpdate then
  Reset()
end if
end function
property TabIndex read FTabIndex write SetTabIndex
-->
</programe>
</element>
<CheckButton name="btnClose" origin="606.5,7.5" bounds="576,0,592,16">
<Borderb name="BorderB1" origin="506,-30" bounds="576,0,592,16" visible="false" Down="false">
<line name="Line1" origin="508,-28" linecolor="$80000010" points="592,0,6 592,16,2 576,16,2"/>
<line name="Line2" origin="508,-28" linecolor="$80000014" points="592,0,6 576,0,2 576,16,2"/>
<programe>
<!--
property Down read FDown write SetDown editor Bool
private function Initialize(Sender)
FDown = false
end function
private function SetDown(AValue)
FDown = AValue
if FDown then
  Line2.LineColor = $80000014
  Line2.LineColor = $80000010
else
  Line2.LineColor = $80000010
  Line2.LineColor = $80000014
end if
end function
-->
</programe>
</Borderb>
<line name="Line1" origin="642,27" linetype="0" backcolor="$C0C0C0" picturedata="07TBitmap424DC60000000000000076000000280000000C0000000A000000010004000000000050000000C40E0000C40E0000000000000000000000000000000080000080000000808000800000008000800080800000C0C0C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF007777777777770000777777777777000077007777007700007770077007770000777700007777000077777007777700007777000077770000777007700777000077007777007700007777777777770000" points="578,3,6 578,13,2 590,13,2 590,3,3"/>
<programe>
<!--
published function OnClick(Sender)
IDE_DispatchCommand( 108 )
end function
private function OnLButtonDown(Sender,X,Y)
Borderb1.Down = true
line1.MoveBy( 1, 1 )
end function
private function OnLButtonUp(Sender,X,Y)
Borderb1.Down = false
line1.MoveBy( -1, -1 )
end function
private function OnMouseEnter(Sender)
BorderB1.Visible = true
end function
private function OnMouseExit(Sender)
BorderB1.Visible = false
end function
-->
</programe>
</CheckButton>
<programe>
<!--
public function Add(fname,cf)
TabSet1.Add( fname )
ar.Add( cf )
TabSet1.TabIndex = TabSet1.GetCount() - 1
end function
public function Delete(cf)
i = 0
while i < ar.Count
  if ar[i] = cf then
    TabSet1.Delete( i )
    ar.Delete( i )
    if ar.Count > 0 then
      if i > ar.Count - 1 then
        TabSet1.TabIndex = ar.Count - 1
      else
        TabSet1.TabIndex = i
      end if
    end if
    break
  end if
  i = i + 1
wend
end function
private function Initialize(Sender)
ar=array( 10 )
end function
public function NextTab()
if Tabset1.TabIndex = Tabset1.GetCount() - 1 then
  Tabset1.TabIndex = 0
else
  Tabset1.TabIndex = Tabset1.TabIndex + 1
end if
end function
private function OnResize(Sender)
btnClose.Left = ClientWidth - 1 - btnClose.Width
TabSet1.SetBounds( 0, 0, btnClose.Left - 1, 21 )
end function
public function PreviousTab()
if Tabset1.TabIndex = 0 then
  Tabset1.TabIndex = Tabset1.GetCount() - 1
else
  Tabset1.TabIndex = Tabset1.TabIndex - 1
end if
end function
public function SetTab(cf)
i = 0
while i < ar.Count
  if ar[i] = cf then
    Tabset1.TabIndex = i
    break
  end if
  i = i + 1
wend
end function
public function SetTabName(cf,s)
i = 0
while i < ar.Count
  if cf = ar[i] then
    Tabset1.SetTabName( i, s )
    break
  end if
  i = i + 1
wend
end function
-->
</programe>
</sheet>
</vg>

⌨️ 快捷键说明

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