⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 controls.xml

📁 cShap控制云台运动
💻 XML
📖 第 1 页 / 共 5 页
字号:
OnResize( this )
end function
private function SetItemIndex(AValue)
if ( AValue >= -1 ) and ( AValue < ar.Count ) then
	i=0
  while i < Group1.UnitCount
    d=Group1.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 >= Group1.UnitCount then
  	VScrollBar1.Pos = FItemIndex - Group1.UnitCount + 1
  end if
	i=FItemIndex-VScrollBar1.Pos
  if( i >= 0 ) and ( i < Group1.UnitCount ) then
    d=Group1.Units[i]
    d.Selected = true
    if FFocused then
      d.Focused = true
    end if
  end if
end if
end function
private function SetItems(AValue)
ar.Text=AValue
i=0
while i < ar.Count
	ck[i] = false
  i = i + 1
wend
if FUpdate then
  Reset()
end if
end function
</programe>
</sheet>
<sheet name="CheckBox" bounds="1.422402,2,74,18">
<rect name="Rect1" bounds="15,-1,73,15" origin="23,5" linetype="0" linewidth="0" frontcolor="$800000"/>
<text name="Text1" bounds="15,-1,73,15" origin="2,-0.6" autosize="true" border="$0" fontname="瀹嬩綋" fontsize="12" wordwrap="false" multiline="false" textalign="4" text="CheckBox1"/>
<line name="line1" origin="6.5,6.5" selectmode="0" linetype="0" pattern="1" picturedata="07TBitmap
424DDA0200000000000036000000280000000D0000000D0000000100200000000000A40200000000000000000000000000000000000080511C0080511C008051
1C0080511C0080511C0080511C0080511C0080511C0080511C0080511C0080511C0080511C0080511C0080511C00EFF1F100F1F3F300F4F5F500F6F7F700F8F9
F900FAFBFB00FCFDFD00FEFEFE00FFFFFF00FFFFFF00FFFFFF0080511C0080511C00ECEFEF00EFF1F100F1F3F300F4F5F500F6F7F700F8F9F900FAFBFB00FCFD
FD00FEFEFE00FFFFFF00FFFFFF0080511C0080511C00E9ECEC00ECEFEF00EFF1F100F1F3F300F4F5F500F6F7F700F8F9F900FAFBFB00FCFDFD00FEFEFE00FFFF
FF0080511C0080511C00E5E8E800E9ECEC00ECEFEF00EFF1F100F1F3F300F4F5F500F6F7F700F8F9F900FAFBFB00FCFDFD00FEFEFE0080511C0080511C00E2E5
E500E5E8E800E9ECEC00ECEFEF00EFF1F100F1F3F300F4F5F500F6F7F700F8F9F900FAFBFB00FCFDFD0080511C0080511C00DEE2E200E2E5E500E5E8E800E9EC
EC00ECEFEF00EFF1F100F1F3F300F4F5F500F6F7F700F8F9F900FAFBFB0080511C0080511C00DBE0E000DEE2E200E2E5E500E5E8E800E9ECEC00ECEFEF00EFF1
F100F1F3F300F4F5F500F6F7F700F8F9F90080511C0080511C00D9DEDE00DBE0E000DEE2E200E2E5E500E5E8E800E9ECEC00ECEFEF00EFF1F100F1F3F300F4F5
F500F6F7F70080511C0080511C00D7DCDC00D9DEDE00DBE0E000DEE2E200E2E5E500E5E8E800E9ECEC00ECEFEF00EFF1F100F1F3F300F4F5F50080511C008051
1C00D7DCDC00D7DCDC00D9DEDE00DBE0E000DEE2E200E2E5E500E5E8E800E9ECEC00ECEFEF00EFF1F100F1F3F30080511C0080511C00D7DCDC00D7DCDC00D7DC
DC00D9DEDE00DBE0E000DEE2E200E2E5E500E5E8E800E9ECEC00ECEFEF00EFF1F10080511C0080511C0080511C0080511C0080511C0080511C0080511C008051
1C0080511C0080511C0080511C0080511C0080511C0080511C00">
<points>
0,0,6
13,0,2
13,13,2
0,13,2
</points>
</line>
<line name="line2" origin="6.5,6.5" selectmode="0" visible="false" linetype="0" pattern="1" picturedata="07TBitmap
424D1A0200000000000036000000280000000B0000000B0000000100200000000000E40100000000000000000000000000000000000063C8FB005AC5FA0054C2
FA004EC0FA0048BDF90043BBF9003EB9F9003AB7F90036B6F80033B4F80030B3F8006BCCFB0063C8FB005AC5FA0054C2FA004EC0FA0048BDF90043BBF9003EB9
F9003AB7F90036B6F80033B4F80074D0FC006BCCFB00E3E7E700E3E7E700E3E7E700E3E7E700E3E7E700E3E7E700E3E7E7003AB7F90036B6F8007CD3FC0074D0
FC00E3E7E700E3E7E700E3E7E700E3E7E700E3E7E700E3E7E700E3E7E7003EB9F9003AB7F90084D6FD007CD3FC00E3E7E700E3E7E700E3E7E700E3E7E700E3E7
E700E3E7E700E3E7E70043BBF9003EB9F9008CD9FD0084D6FD00E3E7E700E3E7E700E3E7E700E3E7E700E3E7E700E3E7E700E3E7E70048BDF90043BBF9009CDF
FE008CD9FD00E3E7E700E3E7E700E3E7E700E3E7E700E3E7E700E3E7E700E3E7E7004EC0FA0048BDF900ACE4FE009CDFFE00E3E7E700E3E7E700E3E7E700E3E7
E700E3E7E700E3E7E700E3E7E70054C2FA004EC0FA00BAE9FF00ACE4FE00E3E7E700E3E7E700E3E7E700E3E7E700E3E7E700E3E7E700E3E7E7005AC5FA0054C2
FA00C6EDFF00BAE9FF00ACE4FE009CDFFE008CD9FD0084D6FD007CD3FC0074D0FC006BCCFB0063C8FB005AC5FA00CFF0FF00C6EDFF00BAE9FF00ACE4FE009CDF
FE008CD9FD0084D6FD007CD3FC0074D0FC006BCCFB0063C8FB00">
<points>
1,1,6
12,1,2
12,12,2
1,12,2
</points>
</line>
<line name="line3" origin="6.5,6.5" selectmode="0" visible="false" linetype="0" picturedata="07TBitmap
424D1A0200000000000036000000280000000B0000000B0000000100200000000000E401000000000000000000000000000000000000FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00008000000080000000800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00008000000080000000800000008000000080
0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000080000000800000FFFFFF00008000000080000000800000FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF0000800000FFFFFF00FFFFFF00FFFFFF00008000000080000000800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF000080000000800000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000800000FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00">
<points>
1,1,6
12,1,2
12,12,2
1,12,2
</points>
</line>
<programe>
property Caption read GetCaption write SetCaption
property Checked read GetChecked write SetChecked editor Bool
property Enable read GetEnable write SetEnable editor Bool
property Focused read GetFocused write SetFocused editor Bool
private function GetCaption()
return Text1.Text
end function
private function GetChecked()
return Line3.Visible
end function
private function GetEnable()
return Enabled
end function
private function GetFocused()
return ( Rect1.LineType = 15 )
end function
private function OnClick(Sender)
Checked = not Checked
end function
public function OnKeyDown(Sender,Key)
b = ( Key = 32 )
if not b then
  s = &apos;(&apos; + chr( Key ) + &apos;)&apos;
  if At( s, Caption ) &gt; 0 then
    b = true
  end if
end if
if b then
  OnClick( Sender )
end if
end function
private function OnLButtonDown(Sender,X,Y)
Focused = true
end function
private function OnMouseEnter(Sender)
Line2.Visible = true
end function
private function OnMouseExit(Sender)
Line2.Visible = false
end function
private function OnResize(Sender)
h = Text1.Height
if h &lt; Line1.Height then
  h = Line1.Height
end if
Line1.MoveTo( Left, Top + h / 2 - Line1.Height / 2 )
Line2.MoveTo( Line1.Left + 1, Line1.Top + 1 )
Line3.MoveTo( Line1.Left + 1, Line1.Top + 1 )
Text1.Top = Top + h / 2 - Text1.Height / 2
Text1.Width = Right - Text1.Left
Rect1.SetBounds( Text1.Left, Text1.Top, Text1.Width, Text1.Height )
end function
published function OnValueChanged(Sender)
end function
private function SetCaption(AValue)
Text1.Text = AValue
Refresh()
end function
private function SetChecked(AChecked)
if Line3.Visible &lt;&gt; AChecked then
  Line3.Visible = AChecked
  if IsLoaded() then
    OnValueChanged( this )
  end if
end if
end function
private function SetEnable(AValue)
Enabled = AValue
if Enabled then
  Text1.FontColor = $80000008
else
  Text1.FontColor = $80000011
end if
end function
private function SetFocused(AValue)
if AValue then
  i=0
  while i &lt; Parent.UnitCount
    d = Parent.Units[i]
    if d &lt;&gt; this and d.HasProperty( &apos;Focused&apos; ) then
      if d.Focused then
        d.Focused = false
      end if
    end if
    i = i + 1
  wend
  Rect1.LineType = 15
else
  Rect1.LineType = 0
end if
end function
</programe>
</sheet>
<sheet name="RadioButton" bounds="16,19,104.25,35" origin="79,134">
<rect name="Rect1" bounds="15,-2,91,14" origin="23,4" linetype="0" linewidth="0" frontcolor="$800000"/>
<text name="Text1" bounds="15,-2,91,14" origin="0,-4" autosize="true" border="$0" fontname="瀹嬩綋" fontsize="12" fontcolor="$80000012" wordwrap="false" multiline="false" textalign="4" text="RadioButton1"/>
<rect name="rect2" bounds="0,0,13,13" origin="6.5,6.5" linetype="0" picturedata="07TBitmap
424D3E0200000000000036000000280000000D0000000D00000001001800000000000802000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFE5
E4DEC6B8A4A0805A835724A0805AC6B8A4E5E3DEFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFCFC3B5825521AC8F6ED5C8B9FFFFFFD8CBBCAF9170825521CEC3B5FF
FFFFFFFFFF00FFFFFFCFC3B4A1815BD0C4B5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9CCBCA68560CFC3B4FFFFFF00E5E3DE825521CDC1B2FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFD9CCBC825521E5E3DF00C6B8A4A68968FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAF9170C6B8A400A080
5AC6BAABFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD8CBBCA0805A00835724FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF83572400A0805AC1B7A7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD5C8B9A0805A00C6B7A4A18664FFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAC8F6EC6B7A400E5E3DF825521BFB5A6FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0C4B582
5521E5E4DF00FFFFFFCFC3B59A7A55BFB5A6FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCDC1B2A1815BCFC3B5FFFFFF00FFFFFFFFFFFFCFC4B5825521A18664C1B7A7
FFFFFFC6BAABA68968825521CFC4B4FFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFE5E4DFC6B8A4A0805A835724A0805AC6B8A4E5E4DFFFFFFFFFFFFFFFFFFF00"/>
<rect name="rect3" bounds="0,0,13,13" origin="6.5,6.5" visible="false" linetype="0" picturedata="07TBitmap
424D3E0200000000000036000000280000000D0000000D00000001001800000000000802000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFE5
E4DEC6B8A4A0805A835724A0805AC6B8A4E5E3DEFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFCFC3B58255216D7A6F589EB945B7F0519BB966776E825521CEC3B5FF
FFFFFFFFFF00FFFFFFCFC3B477745E65A3BA54C2FA4EC0FA48BDF943BBF93EB9F94E99B96A6F5ECFC3B4FFFFFF00E5E3DE82552171A8BA63C8FB6DCBF99CD9F5
D4EBF297D7F559C2F83EB9F94E99B9825521E5E3DF00C6B8A47F816F74D0FC7BD1FAD8EDF2DFEFF1DFEFF1DFEFF1D7ECF159C2F83EB9F966776EC6B8A400A080
5A83AFBC7CD3FCACE0F6DFEFF1DFEFF1DFEFF1DFEFF1DFEFF197D7F543BBF9519BB9A0805A008357248CD4F484D6FDD7EDF2DFEFF1DFEFF1DFEFF1DFEFF1DFEF
F1D4EBF248BDF945B7F083572400A0805A94B6BC8CD9FDB3E3F7DFEFF1DFEFF1DFEFF1DFEFF1DFEFF19CD9F54EC0FA589EB9A0805A00C6B7A49088709CDFFE98
DCFBDAEEF2DFEFF1DFEFF1DFEFF1D8EDF26DCBF954C2FA6D7A6FC6B7A400E5E3DF8255219FB9BC9CDFFE98DCFBB3E3F7D7EDF2ACE0F67BD1FA63C8FB65A3BA82
5521E5E4DF00FFFFFFCFC3B5917E609FB9BC9CDFFE8CD9FD84D6FD7CD3FC74D0FC71A8BA77745ECFC3B5FFFFFF00FFFFFFFFFFFFCFC4B582552190887094B6BC
8CD4F483AFBC7F816F825521CFC4B4FFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFE5E4DFC6B8A4A0805A835724A0805AC6B8A4E5E4DFFFFFFFFFFFFFFFFFFF00"/>
<rect name="rect4" bounds="4,4,9,9" origin="6.5,6.5" visible="false" linetype="0" pattern="1" picturedata="07TBitmap
424D86000000000000003600000028000000050000000500000001001800000000005000000000000000000000000000000000000000E6EEE898CC9A24962497
C998EDF3EE009ED2A027A82A20A22210921397C898004ABF4D3FC34235B93821A12123962600A6DCA951D5553FC34326A82998CC9A00DEE8E2A6DCA94ABF4D9E
D2A0E6EEE800"/>
<programe>
property Caption read GetCaption write SetCaption
property Checked read GetChecked write SetChecked editor Bool
property Enable read GetEnable write SetEnable editor Bool
property Focused read GetFocused write SetFocused editor Bool
private function GetCaption()
return Text1.Text
end function
private function GetChecked()
return Rect4.Visible
end function
private function GetEnable()
return Enabled
end function
private function GetFocused()
return ( Rect1.LineType = 15 )
end function
private function OnClick(Sender)
Checked = true
end function
public function OnKeyDown(Sender,Key)
if Key = 37 or Key = 38 then
  i=0
  prior = 0
  last = 0
  t = 0
  while i &lt; Parent.UnitCount
    d = Parent.Units[i]
    if d.Type = Type and d.Id = Id then
      if d.Enable then
        if d = this then
          prior = t
        else
          t = d
        end if
        last = d
      end if
    end if
    i = i + 1
  wend
  if prior &lt;&gt; 0 then
    prior.Focused = true
    prior.Checked = true
  else
    last.Focused = true
    last.Checked = true
  end if
else if Key = 39 or Key = 40 then
  i=0
  first = 0
  next = 0
  t = 0
  while i &lt; Parent.UnitCount
    d = Parent.Units[i]
    if d.Type = Type and d.Id = Id then
      if d.Enable then
        if d = this then
          t = d
        else if t &lt;&gt; 0 then
          next = d
          t = 0
        end if
        if first = 0 then
          first = d
        end if
      end if
    end if
    i = i + 1
  wend
  if next &lt;&gt; 0 then
    next.Focused = true
    next.Checked = true
  else
    first.Focused = true
    first.Checked = true
  end if
end if
end function
private function OnLButtonDown(Sender,X,Y)
Focused = true
end function
private function OnMouseEnter(Sender)
Rect3.Visible = true
end function
private function OnMouseExit(Sender)
Rect3.Visible = false
end function
private function OnResize(Sender)
h = Text1.Height
if h &lt; Rect2.Height then
  h = Rect2.Height
end if
Rect2.MoveTo( Left, Top + h / 2 - Rect2.Height / 2 )
Rect3.MoveTo( Rect2.Left, Rect2.Top )
Rect4.MoveTo( Rect2.Left + 4, Rect2.Top + 4 )
Text1.Top = Top + h / 2 - Text1.Height / 2
Text1.Width = Right - Text1.Left
Rect1.SetBounds( Text1.Left, Text1.Top, Text1.Width, Text1.Height )
end function
published function OnValueChanged(Sender)
end function
private function SetCaption(AValue)
Text1.Text = AValue
Refresh()
end function
private function SetChecked(AChecked)
if AChecked &lt;&gt; Rect4.Visible then
  Rect4.Visible = AChecked
  if AChecked then
    i=0
    while i &lt; Parent.UnitCount
      d = Parent.Units[i]
      if d &lt;&gt; this and d.Type = Type and d.Id = Id then
        if d.Checked then
          d.Checked = false
        end if
      end if
      i = i + 1
    wend
  end if
  OnValueChanged( this )
end if
end function
private function SetEnable(AValue)
Enabled = AValue
if Enabled then
  Text1.FontColor = $80000008
else
  Text1.FontColor = $80000011
end if
end function
private function SetFocused(AValue)
if AValue then
  i=0
  while i &lt; Parent.UnitCount
    d = Parent.Units[i]
    if d &lt;&gt; this and d.HasProperty( &apos;Focused&apos; ) then
      if d.Focused then
        d.Focused = false
      end if
    end if
    i = i + 1
  wend
  Rect1.LineType = 15
  Checked = true
else
  Rect1.LineType = 0
end if
end function
</programe>
</sheet>
<sheet name="RadioGroup" bounds="16,16,188,104">
<line name="Line1" origin="128,64" linecolor="$80000010" backcolor="$8000000F">
<points>
16,104,6
16,24,2
188,24,2
</points>
</line>
<line name="Line2" origin="152,64" linecolor="$FFFFFF" backcolor="$8000000F">
<points>
16,104,6
188,104,2
188,24,2
</points>
</line>
<line name="Line3" origin="129,65" linecolor="$FFFFFF" backcolor="$8000000F">
<points>
17,103,6
17,25,2
187,25,2
</points>
</line>
<line name="Line4" origin="153,65" linecolor="$80000010" backcolor="$8000000F">
<points>
17,103,6
187,103,2
187,25,2
</points>
</line>
<text name="Text1" bounds="28,16,92,32" origin="12,-28" backcolor="$8000000F" pattern="1" autosize="true" border="$0" fontname="瀹嬩綋" fontsize="12" textalign="4" text="RadioGroup"/>
<programe>
property Caption read GetCaption write SetCaption
private function GetCaption()
return Text1.Text
end function
private function Initialize(Sender)
end function
private function OnResize(Sender)
Line1.SetBounds( Left, Top + Text1.Height/ 2, Width, Height - Text1.Height / 2 )
Line2.SetBounds( Left, Line1.Top, Line1.Width, Line1.Height )
Line3.SetBounds( Left + 1, Line1.Top + 1, Line1.Width - 2, Line1.Height - 2 )
Line4.SetBounds( Left + 1, Line1.Top + 1, Line1.Width - 2, Line1.Height - 2 )
Text1.Left = Left + 8
Text1.Top = Top
end function
private function SetCaption(AValue)
Text1.Text = AValue
end function
</programe>
</sheet>
<sheet name="HScrollBar" bounds="0,0,154,17" origin="216,96" protect="8">
<rect name="Line1" bounds="16,0,138,17" origin="64,10" linetype="0" backcolor="$80000000" frontcolor="$80000014" pattern="8">
<programe>
published function OnLButtonDown(Sender,X,Y)
if X &gt; Element3.Left then
  Line2.SetBounds( Element3.Left + Element3.Width, Line1.Top, Element1.Left - Element3.Left - Element3.Width, Line1.Height )
  Line1.Tag = 1
else
  Line2.SetBounds( Line1.Left, Line1.Top, Element3.Left - Line1.Left, Line1.Height )
  Line1.Tag = -1
end if
Line2.Visible = true
SetPos( FPos + Line1.Tag * FPage )
FTimerInterval = 300
FTimer=CreateTimer( this, &quot;OnTimer&quot;, FTimerInterval )
end function
published func

⌨️ 快捷键说明

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