📄 controls.xml
字号:
Text1.BackColor = $E7D7D6
Text1.FrontColor = $FDFDFD
Rect3.Visible = false
Rect2.LineType = 0
end if
Text1.SetBounds( Left + 1, Top + 1, Width - 1, Height - 1 )
FFocused=AValue
end function
</programe>
</sheet>
<sheet name="Edit" bounds="4,7,126,26" origin="182,126" Label="Text1">
<line name="Line1" origin="131,24">
<points>
4,26,6
4,7,2
126,7,2
</points>
</line>
<line name="Line2" origin="132,23" linecolor="$FFFFFF">
<points>
4,26,6
126,26,2
126,7,2
</points>
</line>
<rect name="Rect1" bounds="5,8,125,25" origin="132,27" linecolor="$8000000F" pattern="1"/>
<text name="Text1" cursor="15" bounds="5,8,125,25" origin="48,15" border="$0" fontname="瀹嬩綋" fontsize="12" wordwrap="false" multiline="false" readonly="false" textalign="4">
<programe>
published function OnChange(Sender)
OnValueChanged( this )
end function
published function OnLButtonDown(Sender,X,Y)
Focused = true
end function
</programe>
</text>
<programe>
property Enable read GetEnable write SetEnable editor Bool
property Focused read GetFocused write SetFocused editor Bool
private function GetEnable()
return Enabled
end function
private function GetFocused()
return Text1.Focused
end function
private function GetValue()
return Text1.Text
end function
private function Initialize(Sender)
doc = 0
end function
private function OnDestroy(Sender)
if doc <> 0 then
doc.Free()
end if
end function
public function OnKeyDown(Sender,Key)
end function
private function OnRButtonDown(Sender,X,Y)
p=Point(X,Y)
ViewToClient( p )
ClientToScreen( p )
if doc = 0 then
doc = Create( Handle, systemparams.DefaultPath + "editmenu.tbl", true, false )
end if
a = Text1.SelStart
b = Text1.SelLength
Text1.Focused = false
Text1.SelStart = a
Text1.SelLength = b
extern bool = IsClipboardFormatAvailable( int ) in User32.dll
doc.ActiveSheet.MenuItem1.Enable = ( b > 0 )
doc.ActiveSheet.MenuItem2.Enable = ( b > 0 )
doc.ActiveSheet.MenuItem3.Enable = IsClipboardFormatAvailable( 7 )
doc.ActiveSheet.MenuItem4.Enable = ( b > 0 )
doc.ActiveSheet.MenuItem5.Enable = Len( Text1.Text ) > 0
n = doc.Popup( p.x, p.y )
Text1.Focused = true
Text1.SelStart = a
Text1.SelLength = b
if n = 1 then
Text1.CopyToClipboard()
Text1.DeleteSelection()
else if n = 2 then
Text1.CopyToClipboard()
else if n = 3 then
Text1.PasteFromClipboard()
else if n = 4 then
Text1.DeleteSelection()
else if n = 5 then
Text1.SelectAll()
end if
end function
private function OnResize(Sender)
Line1.SetBounds( Left, Top, Width, Height )
Line2.SetBounds( Left, Top, Width, Height )
Rect1.SetBounds( Left + 1, Top + 1, Width - 2, Height - 2 )
Text1.SetBounds( Left + 1, Top + 1, Width - 2, Height - 2 )
end function
published function OnValueChanged(Sender)
end function
private function SetEnable(AValue)
Enabled = AValue
Text1.ReadOnly = ( not AValue )
if AValue then
Text1.FontColor = $80000008
else
Text1.FontColor = $80000011
end if
end function
private function SetFocused(AValue)
if AValue then
i=0
while i < Parent.UnitCount
d = Parent.Units[i]
if d <> this and d.HasProperty( 'Focused' ) then
if d.Focused then
d.Focused = false
end if
end if
i = i + 1
wend
end if
Text1.Focused = AValue
end function
public function SetNull()
Text1.Text = ""
end function
private function SetValue(AValue)
Text1.Text = AValue
OnValueChanged( this )
end function
property Value read GetValue write SetValue
</programe>
</sheet>
<sheet name="CheckListBox" bounds="0,0,385,20" origin="272.5,154">
<borderB name="Element1" bounds="0,0,385,20" origin="304,365">
<rect name="rect1" bounds="0,0,385,20" origin="132,48" linecolor="$80000006" pattern="1"/>
</borderB>
<VScrollBar name="VScrollBar1" bounds="367,1,384,18" origin="375.5,73" Enable="true" Max="100" Page="10" Pos="0">
<rect name="Line1" bounds="367,1,384,10" origin="415,29" linetype="0" backcolor="$80000000" frontcolor="$80000014" pattern="8">
<programe>
published function OnLButtonDown(Sender,X,Y)
if Y > Element3.Top then
Line2.SetBounds( Line1.Left, Element3.Top + Element3.Height, Line1.Width, Element1.Top - Element3.Top - Element3.Height )
Line1.Tag = 1
else
Line2.SetBounds( Line1.Left, Line1.Top, Line1.Width, Element3.Top - Line1.Top )
Line1.Tag = -1
end if
Line2.Visible = true
SetPos( FPos + Line1.Tag * FPage )
FTimerInterval = 300
FTimer=CreateTimer( this, "OnTimer", FTimerInterval )
end function
published function OnLButtonUp(Sender,X,Y)
Line2.Visible = false
OnDestroy( Sender )
end function
</programe>
</rect>
<rect name="Line2" bounds="367,1,384,1" origin="415,35" visible="false" linetype="0" backcolor="$80000010" pattern="1">
<programe>
published function OnLButtonDown(Sender,X,Y)
FTimer=CreateTimer(this,"OnTimer",100)
if Y > Element3.Top then
Sender.Id = FPage
else
Sender.Id = -FPage
end if
Sender.Tag=Y
end function
published function OnLButtonUp(Sender,X,Y)
if FTimer <> 0 then
DestroyTimer(FTimer)
FTimer = 0
end if
end function
</programe>
</rect>
<element name="Element3" bounds="367,1,383,17" origin="375,28" visible="false" protect="32">
<line name="Line5" origin="375,9" linecolor="$80000016">
<points>
367,17,6
367,1,2
383,1,2
</points>
</line>
<line name="Line6" origin="375,9" linecolor="$80000015">
<points>
367,17,6
383,17,2
383,1,2
</points>
</line>
<line name="Line7" origin="376,10" linecolor="$80000014">
<points>
368,16.111111,6
368,1.888889,2
382,1.888889,2
</points>
</line>
<line name="Line8" origin="376,10" linecolor="$80000010">
<points>
368,16.111111,6
382,16.111111,2
382,1.888889,2
</points>
</line>
<rect name="Rect2" bounds="369,2.777778,381,15.222222" origin="375,10" linecolor="$8000000F" backcolor="$8000000F" pattern="1"/>
<programe>
published function OnLButtonDown(Sender,X,Y)
Sender.Tag=Y-Sender.Top
end function
published function OnLButtonUp(Sender,X,Y)
Sender.Tag=0
end function
published function OnMouseMove(Sender,X,Y)
if Sender.Tag > 0 then
SetPos( ( Y - Sender.Tag - Line1.Top ) / ( Line1.Height - Sender.Height ) * FMax )
end if
end function
</programe>
</element>
<element name="Element1" bounds="367,10,383,18" origin="375,132" protect="32" Enable="true">
<line name="Line5" origin="375,18.5" linecolor="$80000016">
<points>
367,18,6
367,10,2
383,10,2
</points>
</line>
<line name="Line6" origin="375,18.5" linecolor="$80000015">
<points>
367,18,6
383,18,2
383,10,2
</points>
</line>
<line name="Line7" origin="376,19.5" linecolor="$80000014">
<points>
368,17.555556,6
368,10.444444,2
382,10.444444,2
</points>
</line>
<line name="Line8" origin="376,19.5" linecolor="$80000010">
<points>
368,17.555556,6
382,17.555556,2
382,10.444444,2
</points>
</line>
<rect name="Rect2" bounds="369,10.888889,381,17.111111" origin="375,19.5" linecolor="$8000000F" backcolor="$8000000F" pattern="1"/>
<line name="Line9" origin="375,21.5" linecolor="$80000012" backcolor="$80000012" pattern="1">
<points>
375,14.888889,6
378,13.555556,2
372,13.555556,3
</points>
</line>
<programe>
property Enable read GetEnable write SetEnable editor Bool
private function GetEnable()
return Enabled
end function
private function Initialize(Sender)
FTimer=0
FTimerInterval = 300
end function
published function OnClick(Sender)
SetPos( FPos + 1 )
end function
private function OnDestroy(Sender)
if FTimer <> 0 then
DestroyTimer( FTimer )
FTimer = 0
end if
end function
private function OnLButtonDown(Sender,X,Y)
Line7.LineColor = $80000010
Line8.LineColor = $80000014
FTimerInterval = 300
FTimer=CreateTimer( Sender, "OnTimer", FTimerInterval )
end function
private function OnLButtonUp(Sender,X,Y)
Line7.LineColor = $80000014
Line8.LineColor = $80000010
OnDestroy( Sender )
end function
private function OnTimer(Sender)
OnClick( Sender )
if FTimerInterval = 300 then
OnDestroy( Sender )
FTimerInterval = 100
FTimer=CreateTimer( Sender, "OnTimer", FTimerInterval )
end if
end function
private function SetEnable(AValue)
if AValue then
Line9.BackColor = $80000012
Line9.LineColor = $80000012
else
Line9.BackColor = $80000011
Line9.LineColor = $80000011
end if
Enabled = AValue
end function
</programe>
</element>
<element name="Element2" bounds="367,1,383,9" origin="375,18" protect="32" Enable="true">
<line name="Line5" origin="375,9.5" linecolor="$80000016">
<points>
367,9,6
367,1,2
383,1,2
</points>
</line>
<line name="Line6" origin="375,9.5" linecolor="$80000015">
<points>
367,9,6
383,9,2
383,1,2
</points>
</line>
<line name="Line7" origin="376,10.5" linecolor="$80000014">
<points>
368,8.555556,6
368,1.444444,2
382,1.444444,2
</points>
</line>
<line name="Line8" origin="376,10.5" linecolor="$80000010">
<points>
368,8.555556,6
382,8.555556,2
382,1.444444,2
</points>
</line>
<rect name="Rect2" bounds="369,1.888889,381,8.111111" origin="375,10.5" linecolor="$8000000F" backcolor="$8000000F" pattern="1"/>
<line name="Line9" origin="375,9.5" linecolor="$80000012" backcolor="$80000012" pattern="1">
<points>
375,4.555556,6
378,5.888889,2
372,5.888889,3
</points>
</line>
<programe>
property Enable read GetEnable write SetEnable editor Bool
private function GetEnable()
return Enabled
end function
private function Initialize(Sender)
FTimer=0
FTimerInterval = 300
end function
published function OnClick(Sender)
SetPos( FPos - 1 )
end function
private function OnDestroy(Sender)
if FTimer <> 0 then
DestroyTimer( FTimer )
FTimer = 0
end if
end function
private function OnLButtonDown(Sender,X,Y)
Line7.LineColor = $80000010
Line8.LineColor = $80000014
FTimerInterval = 300
FTimer=CreateTimer( Sender, "OnTimer", FTimerInterval )
end function
private function OnLButtonUp(Sender,X,Y)
Line7.LineColor = $80000014
Line8.LineColor = $80000010
OnDestroy( Sender )
end function
private function OnTimer(Sender)
OnClick( Sender )
if FTimerInterval = 300 then
OnDestroy( Sender )
FTimerInterval = 100
FTimer=CreateTimer( Sender, "OnTimer", FTimerInterval )
end if
end function
private function SetEnable(AValue)
if AValue then
Line9.BackColor = $80000012
Line9.LineColor = $80000012
else
Line9.BackColor = $80000011
Line9.LineColor = $80000011
end if
Enabled = AValue
end function
</programe>
</element>
<programe>
property Enable read GetEnable write SetEnable editor Bool
private function GetEnable()
return Enabled
end function
private function Initialize(Sender)
FPos=0
FPage=10
FMax=100
FTimer=0
FTimerInterval = 300
end function
property Max read FMax write SetMax
published function OnChange(Sender)
if IsLoaded() then
i=0
j=VScrollBar1.Pos
while i < Group1.UnitCount
AUnit = Group1.Units[i]
if i + j < ar.Count then
AUnit.Visible = true
AUnit.Checked = ck[i+j]
AUnit.Caption = ar[i + j]
else
AUnit.Visible = false
AUnit.Caption = ""
end if
AUnit.Selected = ( i + j = FItemIndex )
i = i + 1
wend
end if
end function
private function OnDestroy(Sender)
if FTimer <> 0 then
DestroyTimer( FTimer )
FTimer = 0
end if
end function
private function OnResize(Sender)
if Height <= 32 then
h = ( Height - 1 ) / 2
Element1.SetBounds( Left, Top+Height-h, Element1.Width, h )
Element2.SetBounds( Left, Top, Element2.Width, h )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -