📄 propedit.tbl
字号:
Element1.SetBounds( Left, Top+Height-h, Element1.Width, h )
Element2.SetBounds( Left, Top, Element2.Width, h )
else
Element1.SetBounds( Left, Top + Height - 16, Element1.Width, 16 )
Element2.SetBounds( Left, Top, Element2.Width, 16 )
end if
Element3.Visible = Height >= 48
if Element3.Visible then
Element3.Top = Element2.Top + Element2.Height
else
Element3.Top = Element2.Top
end if
Line1.SetBounds( Left, Element3.Top, Line1.Width, Element1.Top - Element3.Top )
Line2.SetBounds( Line1.Left, Line1.Top, Line1.Width, Line1.Height )
SetPos( FPos )
end function
private function OnTimer(Sender)
SetPos( FPos + Line1.Tag * FPage )
p = Point( 0, 0 )
GetCursorPos( p )
ScreenToClient( p )
ClientToView( p )
stop = false
if Line1.Tag > 0 then
if p.y < Element3.Top + Element3.Height then
stop = true
end if
else
if p.y > Element3.Top then
stop = true
end if
end if
if stop then
OnDestroy( Sender )
Line2.Visible = false
else if FTimerInterval = 300 then
OnDestroy( Sender )
FTimerInterval = 100
FTimer = CreateTimer( Sender, "OnTimer", FTimerInterval )
end if
end function
property Page read FPage write SetPage
property Pos read FPos write SetPos
private function SetEnable(AValue)
Element1.Enable = AValue
Element2.Enable = AValue
Enabled = AValue
end function
private function SetMax(AValue)
n = int( AValue )
if ( n < 0 ) then
n = 0
end if
FMax = n
SetPage( FPage )
SetPos( FPos )
end function
private function SetPage(AValue)
FPage = int( AValue )
if( FPage > FMax )then
FPage = FMax
end if
if FPage < 1 then
FPage = 1
end if
end function
private function SetPos(AValue)
n=int( AValue )
if n < 0 then
n = 0
end if
if n > FMax then
n = FMax
end if
Element3.Visible = (Line1.Height > Element3.Height)
m = Element3.Top
if FMax <> 0 then
Element3.Top = Line1.Top + ( Line1.Height - Element3.Height ) * n / FMax
else
Element3.Top = Line1.Top
end if
if Line1.Tag > m then
Line2.SetBounds( Line1.Left, Element3.Top + Element3.Height, Line1.Width, Element1.Top - Element3.Top - Element3.Height )
else
Line2.SetBounds( Line1.Left, Line1.Top, Line1.Width, Element3.Top - Line1.Top )
end if
if FPos <> n then
FPos = n
OnChange( this )
end if
end function
</programe>
</VScrollBar>
<group name="Group1">
Item1
Item2
</group>
<programe>
public function AddItem(AValue,ACaption)
ar[ar.Count]=AValue
cp[ar.Count-1]=ACaption
if FUpdate then
VScrollBar1.BringToFront( true )
VScrollBar1.Max = ar.Count - Group1.UnitCount
VScrollBar1.Page = Group1.UnitCount - 1
VScrollBar1.OnChange( VScrollBar1 )
end if
end function
public function BeginUpdate()
FUpdate = false
end function
public function Clear()
ar.Clear()
cp.Clear()
FItemIndex=-1
if FUpdate then
VScrollBar1.Max = 0
VScrollBar1.Page = 0
VScrollBar1.OnChange( VScrollBar1 )
end if
end function
public function EndUpdate()
FUpdate = true
VScrollBar1.BringToFront( true )
VScrollBar1.Max = ar.Count - Group1.UnitCount
VScrollBar1.Page = Group1.UnitCount - 1
VScrollBar1.OnChange( VScrollBar1 )
end function
public function GetCount()
return ar.Count
end function
public function GetItem(AIndex)
return ar[AIndex]
end function
public function GetLineCount()
return Group1.UnitCount
end function
private function Initialize(Sender)
ar=array(10)
cp=Array(10)
FItemIndex=-1
FUpdate = true
FShowPropertyName = false
end function
property ItemIndex read FItemIndex write SetItemIndex
published function OnClick(Sender)
'
end function
public function OnLButtonDown(Sender,X,Y)
if X > Rect1.Left and X < Rect1.Left + Rect1.Width and Y > Rect1.Top and Y < Rect1.Top + Rect1.Height then
n = int( ( Y - Rect1.Top ) / ItemHeight )
if n > -1 then
ItemIndex = n + VScrollBar1.Pos
end if
end if
end function
private function OnResize(Sender)
if Height < 38 then
Height = 38
end if
n=int( ( Height - 2 ) / Item1.Height )
Height = n * Item1.Height + 2
while n < Group1.UnitCount
d = Group1.Units[Group1.UnitCount-1]
DeleteUnit( d )
wend
while n > Group1.UnitCount
d = Group1.Units[Group1.UnitCount - 1]
d = CopyUnit( d )
d.Top = d.Top + d.Height
Group1.Add( d )
wend
Rect1.SetBounds( Left, Top, Width - VScrollBar1.Width, Height )
i=0
y=Top
while i < Group1.UnitCount
d=Group1.Units[i]
d.Left = Left + 1
d.Top = y
d.Width = Rect1.Width - 2
y = d.Top + d.Height
i = i + 1
wend
Rect1.BringToFront( true )
VScrollBar1.BringToFront( true )
VScrollBar1.SetBounds( Left + Width - VScrollBar1.Width, Top, VScrollBar1.Width, Height )
VScrollBar1.Max = ar.Count - Group1.UnitCount
VScrollBar1.Page = Group1.UnitCount - 1
VScrollBar1.OnChange( VScrollBar1 )
end function
public function Scroll()
if FItemIndex < VScrollBar1.Pos then
VScrollBar1.Pos = FItemIndex
else if FItemIndex - VScrollBar1.Pos >= Group1.UnitCount then
VScrollBar1.Pos = FItemIndex - Group1.UnitCount + 1
end if
end function
private function SetItemIndex(AValue)
if AValue <> FItemIndex then
n=AValue
if n < 0 then
n = -1
end if
if n >= ar.Count then
n = ar.Count - 1
end if
i=0
while i < Group1.UnitCount
d = Group1.Units[i]
d.BackColor = $80000005
d.Pattern = 0
if( i + VScrollBar1.Pos < ar.Count ) then
s=ar[i+VScrollBar1.Pos]
else
s=""
end if
e = Parent.UnitByName( 'G' + s )
if e = 0 then
e = Parent.UnitByName( 'V' + s )
d.FontColor = $80000008
else
d.FontColor = $FF
end if
d.Alpha = 100
if e <> 0 then
e.Focused = false
end if
i=i+1
wend
FItemIndex = n
i=FItemIndex-VScrollBar1.Pos
if( i >= 0 ) and ( i < Group1.UnitCount ) then
d = Group1.Units[FItemIndex-VScrollBar1.Pos]
d.BackColor = $8000000D
d.Pattern = 1
if( FItemIndex < ar.Count ) then
s = ar[FItemIndex]
else
s=""
end if
e = Parent.UnitByName( 'G' + s )
if e = 0 then
e = Parent.UnitByName( 'V' + s )
d.FontColor = $8000000E
else
d.FontColor = $FF
end if
d.Alpha = 60
if e <> 0 then
e.Focused = true
end if
end if
end if
end function
private function SetShowPropertyName(AValue)
FShowPropertyName = AValue
VScrollBar1.OnChange( VScrollBar1 )
end function
property ShowPropertyName read FShowPropertyName write SetShowPropertyName editor Bool
</programe>
</listbox>
<edit name="VAngle" bounds="304,16,444,32" origin="474,37" hint="鏃嬭浆瑙掑害" Enable="true" Focused="false" label="Text1" Value="''">
<rect name="rect1" bounds="304,16,444,32" origin="344,48" linetype="0" linecolor="$80000005"/>
<text name="Text1" cursor="15" bounds="304,16,444,32" origin="347,23" backcolor="$80000005" border="$0" fontsize="12" fontcolor="$80000008" wordwrap="false" multiline="false" readonly="false" textalign="1">
<programe>
published function OnChange(Sender)
TextModified = true
end function
published function OnExit(Sender)
if TextModified then
OnValueChanged( this )
TextModified = false
end if
end function
published function OnKeyPress(Sender,Char)
if Char = Chr( 13 ) then
Sender.OnExit( Sender )
Char=""
end if
end function
</programe>
</text>
<programe>
published function AddToList(Sender)
ListBox1.AddItem( "Angle", "鏃嬭浆瑙掑害" )
s = ar[0].Angle
Sender.Value = str( s, -1 )
n = ar.Count
if n > 100 then
n = 100
end if
i = 1
while i < n
if s <> ar[i].Angle then
Sender.SetNull()
break
end if
i = i + 1
wend
Sender.ClearModify()
end function
public function ClearModify()
TextModified = false
end function
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)
TextModified = false
end function
private function OnResize(Sender)
Text1.SetBounds( Left, Top, Width, Height )
Rect1.SetBounds( Left, Top, Width, Height )
end function
published function OnValueChanged(Sender)
if CheckValid( Sender, 2 ) then
n = Val( Sender.Value )
if n >= 0 and n < 360 then
Update( Sender, 2 )
return
end if
p = Point( Sender.Left + Sender.Width / 2, Sender.Top + Sender.Height / 2 )
Sender.ViewToClient( p )
ClientToScreen( p )
DisplayHint( "瑙掑害搴旇
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -