home *** CD-ROM | disk | FTP | other *** search
- Type EditCombo From HyperControl
- Dim EditBox As New ComboBox
- Dim BtnDelete As New Button
- Dim BtnOK As New Button
- Property Value Get getValue Set setValue As String
-
- ' METHODS for object: EditCombo
- Function AddItem(ByVal item As String) As Integer
- ' Exposing ComboBox's AddItem method through the hypercontrol
- AddItem = EditBox.AddItem(item)
- End Function
-
- Sub BtnDelete_Click()
- If EditBox.Text = Value Then
- EditBox.Text = ""
- Else
- EditBox.Text = Value
- End If
- BtnOK.Enabled = False
- End Sub
-
- Sub BtnOK_Click()
- ' Save this property
- Value = EditBox.Text
- SendEvent Click
- End Sub
-
- Sub Clear()
- ' Expose the ComboBox's Clear method through the hypercontrol
- EditBox.Clear
- End Sub
-
- Sub EditBox_GotFocus()
- BtnOK.Enabled = True
- End Sub
-
- Sub EditBox_KeyUp(keyCode As Integer, ByVal shift As Integer)
- ' If the return key is struck, enter the value
- If keyCode = VK_RETURN && BtnOK.Enabled Then BtnOK_Click
- End Sub
-
- Function getValue() As String
- ' Store the string in the hypercontrol's Caption property
- getValue = Caption
- End Function
-
- Sub Resize()
- BtnDelete.Move(0, 0, BtnDelete.Width, BtnDelete.Height)
- BtnOK.Move(BtnDelete.Width, 0, BtnDelete.Width, BtnDelete.Height)
- EditBox.Move((BtnDelete.Width * 2), 0, ScaleWidth - (2 * BtnDelete.Width), BtnDelete.Height)
- Height = BtnDelete.Height + (Height - ScaleHeight)
- End Sub
-
- Sub SelectEntry
- ' Need to select the contents of the EditBox
- EditBox.SelStart = 0
- EditBox.SelLength = Len(EditBox.Text)
- EditBox.SetFocus
- End Sub
-
- Sub SetFocus()
- EditBox.SetFocus
- End Sub
-
- Sub Setup()
- ' Clear out the value entry and disable the buttons
- Value = ""
- End Sub
-
- Sub setValue(entry As String)
- ' Store the string in the hypercontrol's Caption property
- Caption = entry
- EditBox.Text = entry
- BtnOK.Enabled = True
- End Sub
-
- End Type
-
- Type EditComboForm From SampleMasterForm
- Dim EditCombo1 As New EditCombo
- Dim LstPropertyEntry As New ListBox
- Dim Frame1 As New Frame
- Dim InstallButton1 As New InstallButton
- Dim LstPropertyNames As New ListBox
- Dim LstFont As New Font
-
- ' METHODS for object: EditComboForm
- Sub EditCombo1_Click()
- Dim index As Integer
- ' Need to update the selected LstPropertyEntry
- index = LstPropertyEntry.ListIndex
- LstPropertyEntry.RemoveItem(index)
- LstPropertyEntry.InsertItem(EditCombo1.Value, index)
- LstPropertyEntry.ListIndex = index
- End Sub
-
- Sub LstPropertyEntry_Click()
- ' Need to select the adjacent property
- LstPropertyNames.ListIndex = LstPropertyEntry.ListIndex
- UpdateEditCombo
- End Sub
-
- Sub LstPropertyEntry_DblClick()
- ' Need to select the adjacent property
- LstPropertyNames.ListIndex = LstPropertyEntry.ListIndex
- UpdateEditCombo
- EditCombo1.SelectEntry
- End Sub
-
- Sub LstPropertyNames_Click()
- ' Need to select the adjacent property
- LstPropertyEntry.ListIndex = LstPropertyNames.ListIndex
- UpdateEditCombo
- End Sub
-
- Sub ResetApplication_Click()
- ' Need to populate the ListBox
- LstPropertyNames.Clear
- LstPropertyEntry.Clear
-
- LstPropertyNames.AddItem "BackColor" : LstPropertyEntry.AddItem "1"
- LstPropertyNames.AddItem "BevelInner" : LstPropertyEntry.AddItem "0 - None"
- LstPropertyNames.AddItem "BevelOuter" : LstPropertyEntry.AddItem "0 - None"
- LstPropertyNames.AddItem "BevelWidth" : LstPropertyEntry.AddItem "2"
- LstPropertyNames.AddItem "BorderStyle" : LstPropertyEntry.AddItem "2 - Sizable"
- LstPropertyNames.AddItem "BorderWidth" : LstPropertyEntry.AddItem "0"
- LstPropertyNames.AddItem "Caption" : LstPropertyEntry.AddItem ""
- LstPropertyNames.AddItem "ClientHWnd" : LstPropertyEntry.AddItem "2294388"
- LstPropertyNames.AddItem "ControlBox" : LstPropertyEntry.AddItem "True"
-
- EditCombo1.Clear
- EditCombo1.SetFocus
- End Sub
-
- Sub UpdateEditCombo
- ' Need to clear the EditCombo Listbox
- EditCombo1.Clear
-
- ' Need to sent the current information to the EditCombo for editing
- ' Depending on which entry is to be edited, we may populate the
- ' combolist with entries
- Select Case LstPropertyEntry.ListIndex
- Case 0
- EditCombo1.Value = LstPropertyEntry.List(0)
- Case 1
- EditCombo1.Value = LstPropertyEntry.List(1)
- EditCombo1.AddItem "0 - None"
- EditCombo1.AddItem "1 - Line"
- EditCombo1.AddItem "2 - Inset"
- EditCombo1.AddItem "3 - Raised"
- Case 2
- EditCombo1.Value = LstPropertyEntry.List(2)
- EditCombo1.AddItem "0 - None"
- EditCombo1.AddItem "1 - Line"
- EditCombo1.AddItem "2 - Inset"
- EditCombo1.AddItem "3 - Raised"
- Case 3
- EditCombo1.Value = LstPropertyEntry.List(3)
- Case 4
- EditCombo1.Value = LstPropertyEntry.List(4)
- EditCombo1.AddItem "0 - None"
- EditCombo1.AddItem "1 - Fixed Single"
- EditCombo1.AddItem "2 - Sizable"
- EditCombo1.AddItem "3 - Fixed Double"
- Case 5
- EditCombo1.Value = LstPropertyEntry.List(5)
- Case 6
- EditCombo1.Value = LstPropertyEntry.List(6)
- Case 7
- EditCombo1.Value = LstPropertyEntry.List(7)
- Case 8
- EditCombo1.Value = LstPropertyEntry.List(8)
- EditCombo1.AddItem "True"
- EditCombo1.AddItem "False"
- End Select
-
- End Sub
-
- End Type
-
- Begin Code
- ' Reconstruction commands for object: EditCombo
- '
- With EditCombo
- .Move(4200, 1470, 4755, 780)
- .Value := ""
- With .EditBox
- .ZOrder := 3
- .Move(750, 0, 3885, 360)
- .Ctrl3d := False
- .Sorted := False
- End With 'EditCombo.EditBox
- With .BtnDelete
- .Caption := "X"
- .ZOrder := 2
- .Move(0, 0, 375, 375)
- End With 'EditCombo.BtnDelete
- With .BtnOK
- .Caption := "ok"
- .ZOrder := 1
- .Move(375, 0, 375, 375)
- End With 'EditCombo.BtnOK
- End With 'EditCombo
- ' Reconstruction commands for object: EditComboForm
- '
- With EditComboForm
- .Caption := "HyperControl Sample"
- .DragMode := "MiddleMouse"
- .Move(3525, 2385, 5655, 4260)
- .SampleDir := "C:\envelop\bootcamp\concepts\hyperctl\"
- .SampleName := "hyperctl"
- With .EditCombo1
- .Caption := "2294388"
- .ZOrder := 4
- .Move(300, 450, 3750, 375)
- .BorderStyle := "None"
- .MaxButton := False
- .ControlBox := False
- .Parent := EditComboForm
- .Value := "2294388"
- With .EditBox
- .Move(750, 0, 3000, 360)
- End With 'EditComboForm.EditCombo1.EditBox
- With .BtnDelete
- .Move(0, 0, 375, 375)
- End With 'EditComboForm.EditCombo1.BtnDelete
- With .BtnOK
- .Move(375, 0, 375, 375)
- End With 'EditComboForm.EditCombo1.BtnOK
- End With 'EditComboForm.EditCombo1
- With .LstPropertyEntry
- .BackColor := 12632256
- .Font := EditComboForm.LstFont
- .ZOrder := 3
- .Move(2385, 1050, 1245, 1920)
- .Ctrl3d := False
- .Sorted := False
- End With 'EditComboForm.LstPropertyEntry
- With .Frame1
- .ZOrder := 5
- .Move(150, 150, 4350, 3150)
- End With 'EditComboForm.Frame1
- With .InstallButton1
- .Caption := "InstallButton1"
- .ZOrder := 2
- .Move(4800, 300, 450, 450)
- .Outlined := True
- .Picture := EditComboForm.InstallButton1.installBitmap
- .installObject := EditCombo
- With .BmpOpen
- End With 'EditComboForm.InstallButton1.BmpOpen
- With .installBitmap
- .FileName := "hyperctl.ero"
- .ResId := 0
- End With 'EditComboForm.InstallButton1.installBitmap
- With .DefaultBitmap
- .FileName := "hyperctl.ero"
- .ResId := 1780
- End With 'EditComboForm.InstallButton1.DefaultBitmap
- End With 'EditComboForm.InstallButton1
- With .LstPropertyNames
- .Caption := "LstPropertyNames"
- .BackColor := 12632256
- .Font := EditComboForm.LstFont
- .ZOrder := 1
- .Move(1050, 1050, 1350, 1920)
- .Ctrl3d := False
- .Sorted := False
- End With 'EditComboForm.LstPropertyNames
- With .LstFont
- .FaceName := "Arial"
- .Size := 8.000000
- .Bold := False
- .Italic := False
- .Strikethru := False
- End With 'EditComboForm.LstFont
- With .helpfile
- .FileName := "C:\envelop\bootcamp\concepts\hyperctl\hyperctl.hlp"
- End With 'EditComboForm.helpfile
- End With 'EditComboForm
- End Code
-