📄 codeview.tbl
字号:
else
Rect3.BackColor = $80000005
Rect3.Text1.FontColor = $80000008
end if
end function
private function SetValue(AValue)
Rect3.Text1.Text = AValue
end function
property Value read GetValue write SetValue
-->
</programe>
</Item>
<programe>
<!--
public function AddItem(AValue,AType,ABold,AGray)
i=ar.Count
ar[i]=AValue
br[i]=AType
cr[i]=ABold
dr[i]=AGray
if FUpdate then
Reset()
end if
end function
public function BeginUpdate()
FUpdate = false
end function
public function Clear()
ar.Clear()
br.Clear()
cr.Clear()
dr.Clear()
if FUpdate then
Reset()
end if
end function
public function DeleteItem(AIndex)
if AIndex>=0 and AIndex<ar.Count then
if ItemIndex=(ar.Count-1) then
ItemIndex=ItemIndex-1
end if
ar.Delete( AIndex )
br.Delete( AIndex )
cr.Delete( AIndex )
dr.Delete( AIndex )
if FUpdate then
Reset()
end if
end if
end function
property Enable read GetEnable write SetEnable editor Bool
public function EndUpdate()
FUpdate = true
Reset()
end function
property Focused read FFocused write SetFocused editor Bool
public function GetCount()
return ar.Count
end function
private function GetEnable()
return Enabled
end function
public function GetItem(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)
ar=array(10)
br=array(10)
cr=array(10)
dr=array(10)
FItemIndex=-1
FUpdate = true
FFocused = false
FItemHeight = Item1.Height
end function
public function InvalidateLine(eventname,hastext)
n = IndexOf( eventname )
if n <> -1 then
cr[n] = hastext
n = n - VScrollBar1.Pos
if FUpdate and n >= 0 and n < UnitCount - 2 then
if hastext then
Units[n+2].Units[2].Text1.FontStyle = 1
else
Units[n+2].Units[2].Text1.FontStyle = 0
end if
end if
end if
end function
property ItemIndex read FItemIndex write SetItemIndex
published function OnChange(Sender)
if IsLoaded() then
IDE_ListBox1Click()
end if
end function
private function OnClick(Sender)
if Inspector <> 0 and Sender.ItemIndex > -1 then
s = Sender.GetItem( Sender.ItemIndex )
if GetFileAge( ExtractFilePath( FileName ) + "help\" + s + ".tbl" ) <> -1 then
Inspector.Help( s )
end if
end if
end function
published function OnDblClick(Sender)
IDE_ListBox1DblClick()
end function
published function OnDelete()
IDE_ListBox1Delete()
end function
private function OnDrawItem(AIndex)
d=Units[AIndex-VScrollBar1.Pos+2]
d.Units[2].Text1.Text = ar[AIndex]
if cr[AIndex] then
d.Units[2].Text1.FontStyle = 1
else
d.Units[2].Text1.FontStyle = 0
end if
s = ExtractFilePath( FileName ) + "icon\" + br[AIndex] + ".bmp"
d.Units[1].Picture = s
if dr[AIndex] then
d.Units[2].Text1.FontColor = $80000011
else
d.Units[2].Text1.FontColor = $80000008
end if
end function
public function OnKeyDown(Sender,Key)
if Key = 33 then
n = ItemIndex - UnitCount + 2
else if Key = 34 then
n = ItemIndex + UnitCount - 2
else if Key = 35 then
n = ar.Count - 1
else if Key = 36 then
n = 0
else if Key = 37 or Key = 38 then
n = ItemIndex - 1
else if Key = 39 or Key = 40 then
n = ItemIndex + 1
else if Key = 46 then
if ItemIndex >= 0 then
OnDelete()
end if
return
else if Key = 13 then
if ItemIndex >= 0 then
OnDblClick( Sender )
end if
return
else
return
end if
if n >= ar.Count then
n = ar.Count - 1
end if
if n < 0 then
n = 0
end if
if n >= 0 and n < ar.Count then
ItemIndex = n
Scroll()
end if
end function
private function OnLButtonDown(Sender,X,Y)
d=UnitAtPoint( X, Y, 0 )
if d <> 0 then
if d.Type = "Item" then
n = Int( ( Y - Rect1.Top - 2 ) / ( FItemHeight + 1 ) )
if n > -1 then
ItemIndex = n + VScrollBar1.Pos
Focused = true
end if
end if
end if
end function
private function OnMouseWheel(Sender,Forward)
if Forward then
VScrollBar1.Pos = VScrollBar1.Pos - UnitCount + 2
else
VScrollBar1.Pos = VScrollBar1.Pos + UnitCount - 2
end if
end function
published function OnRButtonDown(Sender,X,Y)
p=point(x,y)
GetCursorPos( p )
doc = Create( Handle, "popupmenu3.tbl", true, false )
doc.ActiveSheet.MenuItem1.Enable = IDE_CanAddNewFunction()
doc.ActiveSheet.MenuItem2.Enable = IDE_CanAddNewProperty()
doc.ActiveSheet.MenuItem3.Enable = IDE_CanModify()
doc.ActiveSheet.MenuItem4.Enable = IDE_CanDelete()
doc.ActiveSheet.MenuItem5.Enable = ListBox1.ItemIndex >= 0
AId = doc.Popup( p.x, p.y )
if AId = 1 then
if Inspector <> 0 then
Inspector.Help( "cmnewfunction" )
end if
IDE_DispatchCommand( 200 )
else if AId = 2 then
if Inspector <> 0 then
Inspector.Help( "cmnewproperty" )
end if
IDE_DispatchCommand( 201 )
else if AId = 3 then
if Inspector <> 0 then
Inspector.Help( "cmmodifyfunction" )
end if
IDE_DispatchCommand( 202 )
else if AId = 4 then
if Inspector <> 0 then
Inspector.Help( "cmdeletefunction" )
end if
IDE_DispatchCommand( 203 )
else if AId = 5 then
extern void = PostMessageW( int, int, int, int ) in User32.dll
WM_KEYDOWN = 256
VK_RETURN = $0D
PostMessageW( Handle, WM_KEYDOWN, VK_RETURN, 0 )
else if AId = 6 then
extern void = PostMessageW( int, int, int, int ) in User32.dll
WM_KEYDOWN = 256
VK_F11 = $7A
PostMessageW( Handle, WM_KEYDOWN, VK_F11, 0 )
end if
doc.Free()
end function
private function OnResize(Sender)
n=int( ( Height - 3 ) / ( FItemHeight + 1 ) )
if n < 1 then
n = 1
Height = FItemHeight + 4
end if
while n < UnitCount - 2
DeleteUnit( Units[3] )
wend
cb = Units[2]
while n > UnitCount - 2
CopyUnit( cb )
wend
Rect1.SetBounds( Left, Top, Width, Height )
VScrollBar1.SetBounds( Right - VScrollBar1.Width, Top + 1, VScrollBar1.Width, Height - 2 )
Reset()
end function
private function OnShow(Sender)
end function
private function Reset()
n = ar.Count - UnitCount + 2
VScrollBar1.Max = n
VScrollBar1.Page = UnitCount - 2
VScrollBar1.Visible = ( n > 0 )
i=2
y=Top+2
while i < UnitCount
d=Units[i]
w = Width - 4
if VScrollBar1.Visible then
w = w - VScrollbar1.Width
end if
d.SetBounds( Left + 2, y, w, FItemHeight )
y = y + FItemHeight + 1
i = i + 1
wend
VScrollBar1.OnChange( VScrollBar1 )
Refresh()
end function
public function Scroll()
if FItemIndex < VScrollBar1.Pos then
VScrollBar1.Pos = FItemIndex
else if FItemIndex - VScrollBar1.Pos >= UnitCount - 2 then
VScrollBar1.Pos = FItemIndex - UnitCount + 3
end if
end function
private function SetEnable(AValue)
i = 1
while i < UnitCount
Units[i].Enable = AValue
i = i + 1
wend
Enabled = AValue
end function
private function SetFocused(AValue)
if FFocused <> AValue then
FFocused = AValue
SetItemIndex( FItemIndex )
end if
end function
public function SetItem(AIndex,AValue,AType)
if AIndex >= 0 and AIndex < ar.Count then
ar[AIndex]=AValue
br[AIndex]=AType
if FUpdate then
VScrollBar1.OnChange( VScrollBar1 )
end if
end if
end function
private function SetItemIndex(AValue)
if ( AValue >= -1 ) and ( AValue < ar.Count ) then
i=2
while i < UnitCount
d = Units[i]
d.Selected = false
d.Focused = false
i=i+1
wend
FItemIndex = AValue
if FItemIndex < VScrollBar1.Pos then
VScrollBar1.Pos = FItemIndex
else if FItemIndex - VScrollBar1.Pos >= UnitCount - 2 then
VScrollBar1.Pos = FItemIndex - UnitCount + 3
end if
i=FItemIndex-VScrollBar1.Pos
if( i >= 0 ) and ( i < UnitCount - 2 ) then
d=Units[i+2]
d.Selected = true
if FFocused then
d.Focused = true
end if
end if
OnChange( this )
end if
end function
-->
</programe>
</ListBox>
<KeyManager name="KeyManager1" lib="controls.tbl" origin="140,188" bounds="128,176,152,200" visible="false" protect="12" hint="璇峰湪椤甸潰鐨凮nKeyDown浜嬩欢閲屽啓KeyManager1.OnKeyDown( Sender, Key )"/>
<programe>
<!--
private function OnKeyDown(Sender,Key)
if Key = 112 then
IDE_HelpContext( 9 )
else
KeyManager1.OnKeyDown( KeyManager1, Key )
end if
end function
private function OnRButtonDown(Sender,X,Y)
end function
private function OnResize(Sender)
ListBox1.SetBounds( 0, 0, ClientWidth - 1, ClientHeight - 1 )
end function
-->
</programe>
</sheet>
</vg>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -