ButtonPosInfo.cls
资源名称:IE_VB.rar [点击查看]
上传用户:davilee3
上传日期:2015-04-22
资源大小:986k
文件大小:4k
源码类别:
浏览器
开发平台:
Visual Basic
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- Persistable = 0 'NotPersistable
- DataBindingBehavior = 0 'vbNone
- DataSourceBehavior = 0 'vbNone
- MTSTransactionMode = 0 'NotAnMTSObject
- END
- Attribute VB_Name = "cButtonPosInfo"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = False
- '---------------------------------------------------------------------------------------
- ' Module : cButtonPosInfo
- ' DateTime : 2005-8-8 22:01
- ' Author : Lingll
- ' Purpose : 记录toolbar按钮信息,用作自定义toolbar按钮
- '---------------------------------------------------------------------------------------
- Option Explicit
- Public Description As String
- Public id As Long
- Public Pos As Long '当前位置
- Public vis As Boolean '是否显示按钮
- Public o_Pos& '原始位置
- Public Sub IniMe(vDesc$, vId&, vPos&)
- Description = vDesc
- id = vId
- vis = (vPos >= 0)
- If vis Then
- Pos = vPos
- Else
- Pos = Abs(vPos) - 1
- End If
- End Sub
- '---------------------------------------------------------------------------------------
- ' Procedure : GetSavePos
- ' DateTime : 2005-8-9 01:07
- ' Author : Lingll
- ' Purpose :
- '---------------------------------------------------------------------------------------
- Public Function GetSavePos() As String
- If vis Then
- GetSavePos = LTrim$(Str$(Pos))
- Else
- GetSavePos = "-" & LTrim$(Str$(Pos + 1))
- End If
- End Function
- 'Public Sub CopyMe(vNew As cButtonPosInfo)
- 'Description = vNew.Description
- 'Id = vNew.Id
- 'o_Pos = vNew.o_Pos
- 'End Sub
- '
- '
- 'Public Sub Swap(vNew As cButtonPosInfo)
- 'Dim tDes$, tId&, to_Pos&
- 'tDes = vNew.Description
- 'tId = vNew.Id
- 'to_Pos = vNew.o_Pos
- '
- 'vNew.CopyMe Me
- '
- 'Description = tDes
- 'Id = tId
- 'o_Pos = to_Pos
- 'End Sub
- '---------------------------------------------------------------------------------------
- ' Procedure : SortByPos
- ' DateTime : 2005-8-8 22:03
- ' Author : Lingll
- ' Purpose :
- '---------------------------------------------------------------------------------------
- Public Sub SortByPos(vObj() As cButtonPosInfo)
- Dim tLb&, tUb&, i&, j&
- Dim tObj As cButtonPosInfo
- tLb = LBound(vObj)
- tUb = UBound(vObj)
- For i = tUb To tLb + 1 Step -1
- For j = tLb To i - 1
- If vObj(j).Pos > vObj(j + 1).Pos Then
- Set tObj = vObj(j)
- Set vObj(j) = vObj(j + 1)
- Set vObj(j + 1) = tObj
- Set tObj = Nothing
- End If
- Next j
- Next i
- For i = tUb To tLb
- vObj(i).Pos = i
- Next i
- End Sub
- '---------------------------------------------------------------------------------------
- ' Procedure : SortByOOPos
- ' DateTime : 2005-8-8 22:03
- ' Author : Lingll
- ' Purpose :
- '---------------------------------------------------------------------------------------
- Public Sub SortByOOPos(vObj() As cButtonPosInfo)
- Dim tLb&, tUb&, i&, j&
- Dim tObj As cButtonPosInfo
- tLb = LBound(vObj)
- tUb = UBound(vObj)
- For i = tUb To tLb + 1 Step -1
- For j = tLb To i - 1
- If vObj(j).o_Pos > vObj(j + 1).o_Pos Then
- Set tObj = vObj(j)
- Set vObj(j) = vObj(j + 1)
- Set vObj(j + 1) = tObj
- Set tObj = Nothing
- End If
- Next j
- Next i
- For i = tUb To tLb
- vObj(i).o_Pos = i
- Next i
- End Sub
- '---------------------------------------------------------------------------------------
- ' Procedure : SetToDefault
- ' DateTime : 2005-8-9 23:04
- ' Author : Lingll
- ' Purpose :
- '---------------------------------------------------------------------------------------
- Public Sub SetToDefault(vObj() As cButtonPosInfo)
- Dim tLb&, tUb&, i&
- Call SortByOOPos(vObj)
- tLb = LBound(vObj)
- tUb = UBound(vObj)
- For i = tLb To tUb
- vObj(i).vis = True
- vObj(i).Pos = vObj(i).o_Pos
- Next i
- End Sub