home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Begin VB.UserControl pucEventList Alignable = -1 'True BackStyle = 0 'Transparent ClientHeight = 1980 ClientLeft = 0 ClientTop = 0 ClientWidth = 5790 BeginProperty Font Name = "Tahoma" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ScaleHeight = 132 ScaleMode = 3 'Pixel ScaleWidth = 386 ToolboxBitmap = "EventList.ctx":0000 Begin VB.CommandButton cmdAbout Caption = "&About..." Height = 330 Left = 2160 TabIndex = 3 Top = 1395 Visible = 0 'False Width = 1140 End Begin VB.CommandButton cmdExit Caption = "E&xit" Height = 330 Left = 4500 TabIndex = 5 Top = 1395 Visible = 0 'False Width = 1140 End Begin VB.CommandButton cmdClear Caption = "Clear" Height = 330 Left = 3330 TabIndex = 4 Top = 1395 Width = 1140 End Begin VB.CheckBox chkStandard Caption = "Standard Colours" Height = 285 Left = 0 TabIndex = 2 Top = 1530 Width = 1590 End Begin VB.ListBox lstItems Height = 1020 IntegralHeight = 0 'False Left = 0 TabIndex = 1 Top = 225 Width = 5640 End Begin VB.Label lblHdr AutoSize = -1 'True Caption = "E&vents:" Height = 195 Left = 0 TabIndex = 0 Top = 0 Width = 555 End End Attribute VB_Name = "pucEventList" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = False '-----------------------------------------' ' Ariad Development Components ' '-----------------------------------------' ' Event List Sample Control ' ' Version 1.0 ' '-----------------------------------------' 'Copyright ⌐ 1999 by Ariad Software. All Rights Reserved. 'Created : 30/08/1999 'Completed : 30/08/1999 'Last Updated : 23/12/1999 '23/09/1999 ' - Extended Add routine for use with multiple parameters ' - Added horizontal scrollbar to listbox ' - Added clear button '26/09/1999 ' - Added BackColor property ' - Added Standard Colours checkbox ' - Added StandardColoursVisible property ' - Added StandardColoursClicked event '21/11/1999 ' - Constant declares updated ' - Horizontal scrollbar now automatically sized to largest item '22/11/1999 ' - Added StandardColoursValue property '23/12/1999 ' - Exit and About buttons added ' - ExitVisible and AboutVisible properties added. ' - ExitClicked and AboutClicked events added Option Explicit DefInt A-Z Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Public Event StandardColoursClicked(ByVal IsStandard As Boolean) Public Event ExitClicked() Public Event AboutClicked() Private Const LB_SETHORIZONTALEXTENT = &H194 Private Const LB_GETHORIZONTALEXTENT = &H193 Private Count As Long Private pStandardColoursVisible As Boolean Private pExitVisible As Boolean Private pAboutVisible As Boolean '------------------------------------------------------------------- 'Name : AboutVisible 'Created : 23/12/1999 11:34 '------------------------------------------------------------------- 'Author : Richard Moss 'Organisation: Ariad Software '------------------------------------------------------------------- 'Description : Returns or sets if the About button is visible. '------------------------------------------------------------------- 'Returns : Returns True if the property is set, otherwise False '------------------------------------------------------------------- 'Updates : ' '------------------------------------------------------------------- ' Ariad Procedure Builder Add-In 1.00.0033 Public Property Get AboutVisible() As Boolean Attribute AboutVisible.VB_Description = "Returns or sets if the About button is visible." AboutVisible = pAboutVisible End Property '(Public) Property Get AboutVisible () As Boolean Property Let AboutVisible(ByVal AboutVisible As Boolean) pAboutVisible = AboutVisible cmdAbout.Visible = AboutVisible UserControl_Resize PropertyChanged "AboutVisible" End Property ' Property Let AboutVisible '------------------------------------------------------------------- 'Name : ExitVisible 'Created : 23/12/1999 11:33 '------------------------------------------------------------------- 'Author : Richard Moss 'Organisation: Ariad Software '------------------------------------------------------------------- 'Description : Returns or sets if the exit button is visible. '------------------------------------------------------------------- 'Returns : Returns True if the property is set, otherwise False '------------------------------------------------------------------- 'Updates : ' '------------------------------------------------------------------- ' Ariad Procedure Builder Add-In 1.00.0033 Public Property Get ExitVisible() As Boolean Attribute ExitVisible.VB_Description = "Returns or sets if the exit button is visible." ExitVisible = pExitVisible End Property '(Public) Property Get ExitVisible () As Boolean Property Let ExitVisible(ByVal ExitVisible As Boolean) pExitVisible = ExitVisible cmdExit.Visible = ExitVisible UserControl_Resize PropertyChanged "ExitVisible" End Property ' Property Let ExitVisible '---------------------------------------------------------------------- 'Name : StandardColoursValue 'Created : 22/11/1999 14:45 '---------------------------------------------------------------------- 'Author : Richard Moss 'Organisation: Ariad Software '---------------------------------------------------------------------- 'Description : Returns or sets the value of the Standard Colours ' checkbox. '---------------------------------------------------------------------- 'Returns : Returns True if the property is set, otherwise False '---------------------------------------------------------------------- 'Updates : ' '---------------------------------------------------------------------- ' Ariad Procedure Builder Add-In 1.00.0033 Public Property Get StandardColoursValue() As Boolean Attribute StandardColoursValue.VB_Description = "Returns or sets the value of the Standard Colours checkbox." StandardColoursValue = chkStandard End Property '(Public) Property Get StandardColoursValue () As Boolean Property Let StandardColoursValue(ByVal StandardColoursValue As Boolean) chkStandard = Abs(StandardColoursValue) PropertyChanged "StandardColoursValue" End Property ' Property Let StandardColoursValue '---------------------------------------------------------------------- 'Name : BackColor 'Created : 26/09/1999 17:03 '---------------------------------------------------------------------- 'Author : Richard James Moss 'Organisation: Ariad Software '---------------------------------------------------------------------- 'Description : Returns/sets the background colour of the UserControl ' and some child controls. '---------------------------------------------------------------------- 'Returns : Returns an OLE_COLOR Variable '---------------------------------------------------------------------- 'Updates : ' '---------------------------------------------------------------------- ' Ariad Procedure Builder Add-In 1.00.0027 Public Property Get BackColor() As OLE_COLOR BackColor = UserControl.BackColor End Property '(Public) Property Get BackColor () As OLE_COLOR Property Let BackColor(ByVal BackColor As OLE_COLOR) UserControl.BackColor = BackColor chkStandard.BackColor = BackColor lblHdr.BackColor = BackColor PropertyChanged "BackColor" End Property ' Property Let BackColor '---------------------------------------------------------------------- 'Name : StandardColoursVisible 'Created : 26/09/1999 16:54 '---------------------------------------------------------------------- 'Author : Richard James Moss 'Organisation: Ariad Software '---------------------------------------------------------------------- 'Description : Determines if the Standard Colours checkbox is visible. '---------------------------------------------------------------------- 'Returns : Returns True if the property is set, otherwise False '---------------------------------------------------------------------- 'Updates : ' '---------------------------------------------------------------------- ' Ariad Procedure Builder Add-In 1.00.0027 Public Property Get StandardColoursVisible() As Boolean StandardColoursVisible = pStandardColoursVisible End Property '(Public) Property Get StandardColoursVisible () As Boolean Property Let StandardColoursVisible(ByVal StandardColoursVisible As Boolean) pStandardColoursVisible = StandardColoursVisible chkStandard.Visible = StandardColoursVisible PropertyChanged "StandardColoursVisible" End Property ' Property Let StandardColoursVisible Sub Add(ByVal Method As String, ParamArray Parameters() As Variant) Dim Data As String Dim Value As String Dim IndexLoop As Integer Dim Width As Long 'determine parameter string If UBound(Parameters) >= 0 Then Data = "(" For IndexLoop = LBound(Parameters) To UBound(Parameters) If IsObject(Parameters(IndexLoop)) Then If Parameters(IndexLoop) Is Nothing Then Value = "{Nothing}" Else Value = "{Object:" & TypeName(Parameters(IndexLoop)) & "}" End If Else Value = CStr(Parameters(IndexLoop)) End If If VarType(Parameters(IndexLoop)) = vbString Then Value = Chr$(34) & Value & Chr$(34) ElseIf VarType(Parameters(IndexLoop)) = vbError Then Value = Chr$(34) & Chr$(34) End If Data = Data & Value If IndexLoop <> UBound(Parameters) Then Data = Data & ", " End If Next Data = Data & ")" End If Data = Method & " " & Data 'add it lstItems.AddItem Data lstItems.ListIndex = lstItems.NewIndex 'add hscroll if required... Width = SendMessage(lstItems.hWnd, LB_GETHORIZONTALEXTENT, 0, 0) If TextWidth(Data) + 40 > Width Then SendMessage lstItems.hWnd, LB_SETHORIZONTALEXTENT, ByVal TextWidth(Data) + 40, ByVal 0& End If End Sub Sub Clear() lstItems.Clear End Sub Private Sub chkStandard_Click() RaiseEvent StandardColoursClicked(chkStandard) End Sub Private Sub cmdAbout_Click() RaiseEvent AboutClicked End Sub Private Sub cmdClear_Click() Count = 0 lstItems.Clear End Sub Private Sub cmdExit_Click() If pExitVisible Then RaiseEvent ExitClicked End If End Sub Private Sub UserControl_InitProperties() StandardColoursVisible = 0 ExitVisible = 0 AboutVisible = 0 UserControl_Resize End Sub Private Sub UserControl_ReadProperties(PropBag As PropertyBag) With PropBag StandardColoursVisible = .ReadProperty("StandardColoursVisible", 0) BackColor = .ReadProperty("BackColor", vbButtonFace) StandardColoursValue = .ReadProperty("StandardColoursValue", 0) AboutVisible = .ReadProperty("AboutVisible", 0) ExitVisible = .ReadProperty("ExitVisible", 0) End With UserControl_Resize End Sub Private Sub UserControl_Resize() On Error Resume Next lstItems.Move 0, lblHdr.Height + 2, ScaleWidth, ScaleHeight - (lblHdr.Height + 5 + cmdClear.Height) If pExitVisible = 0 Then cmdClear.Move ScaleWidth - cmdClear.Width, ScaleHeight - cmdClear.Height Else cmdExit.Move ScaleWidth - cmdExit.Width, ScaleHeight - cmdExit.Height cmdClear.Move cmdExit.Left - (cmdClear.Width + 3), cmdExit.Top End If cmdAbout.Move cmdClear.Left - (cmdClear.Width + 3), cmdClear.Top chkStandard.Top = cmdClear.Top + ((cmdClear.Height - chkStandard.Height) / 2) On Error GoTo 0 End Sub Private Sub UserControl_WriteProperties(PropBag As PropertyBag) With PropBag .WriteProperty "StandardColoursVisible", pStandardColoursVisible, 0 .WriteProperty "BackColor", BackColor, vbButtonFace .WriteProperty "StandardColoursValue", StandardColoursValue, 0 .WriteProperty "AboutVisible", pAboutVisible, 0 .WriteProperty "ExitVisible", pExitVisible, 0 End With End Sub