home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Eagles Nest BBS 6
/
Eagles_Nest_Mac_Collection_Disc_6.TOAST
/
Windows
/
VisBasAPIex
/
VBAPIGUIDE.image
/
APICONS.FRM
< prev
next >
Wrap
Text File
|
1993-01-31
|
7KB
|
245 lines
VERSION 2.00
Begin Form ApiCons
Caption = "Retrieve API Constants"
Height = 4815
Icon = APICONS.FRX:0000
Left = 960
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 4125
ScaleWidth = 7425
Top = 1440
Width = 7545
Begin ListBox List2
Height = 1590
Left = 120
MultiSelect = 2 'Extended
TabIndex = 6
Top = 2280
Width = 6135
End
Begin ListBox List1
Height = 1395
Left = 120
MultiSelect = 2 'Extended
TabIndex = 5
Top = 660
Width = 6135
End
Begin CommonDialog CMDialog1
CancelError = -1 'True
DialogTitle = "Select API Constant File"
Filename = "Apiconst.Txt"
Filter = "Constant Files (*.txt)|*.txt"
Flags = 4096
Left = 6540
Top = 60
End
Begin ComboBox Combo1
Height = 300
Left = 120
TabIndex = 3
Top = 180
Width = 6150
End
Begin CommandButton CmdSearch
Caption = "Search"
Height = 495
Left = 6360
TabIndex = 4
Top = 780
Width = 855
End
Begin CommandButton CmdTransfer
Caption = "Transfer"
Height = 495
Left = 6360
TabIndex = 0
Top = 1440
Width = 855
End
Begin CommandButton CmdRemove
Caption = "Remove"
Height = 495
Left = 6360
TabIndex = 1
Top = 2400
Width = 855
End
Begin CommandButton CmdCopy
Caption = "Copy"
Height = 495
Left = 6360
TabIndex = 2
Top = 3180
Width = 855
End
Begin Menu MenuFile
Caption = "File"
Begin Menu MenuLoadText
Caption = "&Load Text"
End
End
Begin Menu MenuList
Caption = "List"
Begin Menu MenuSearch
Caption = "&Search"
Shortcut = ^S
End
Begin Menu MenuTransfer
Caption = "&Transfer"
Shortcut = ^T
End
Begin Menu MenuRemove
Caption = "&Remove"
Shortcut = ^R
End
Begin Menu MenuCopy
Caption = "&Copy"
Shortcut = ^C
End
End
End
' Copy the contents of list2 into the clipboard
'
Sub CmdCopy_Click ()
Dim totcount%, indexnum%
Dim OldMousePointer%
Dim strpos&
Dim usestring$
Dim liststring$
Dim tabposition%
totcount% = List2.ListCount
OldMousePointer% = Screen.MousePointer
Screen.MousePointer = 11
Do While indexnum% < totcount%
liststring$ = List2.List(indexnum%)
tabposition% = InStr(liststring$, Chr$(9))
Mid$(liststring$, tabposition%, 1) = "="
usestring$ = usestring$ + "Global Const" + liststring$ + Chr$(13) + Chr$(10)
indexnum% = indexnum% + 1
Loop
Clipboard.SetText usestring$
Screen.MousePointer = OldMousePointer%
End Sub
' Remove all selected entries in List2
'
Sub CmdRemove_Click ()
Dim totcount%, indexnum%
Dim OldMousePointer%
Dim strpos&
Dim usestring$
totcount% = List2.ListCount
OldMousePointer% = Screen.MousePointer
Screen.MousePointer = 11
Do While indexnum% < totcount%
If List2.Selected(indexnum%) Then
List2.RemoveItem indexnum%
indexnum% = indexnum% - 1
totcount% = totcount% - 1
End If
indexnum% = indexnum% + 1
Loop
Screen.MousePointer = OldMousePointer%
End Sub
Sub CmdSearch_Click ()
Dim srchstring$
Dim prompt$
prompt$ = "Enter the prefix of the string to search for"
srchstring$ = InputBox$(prompt$, "Search for string")
If (srchstring$ <> "") Then
srchstring$ = " " + srchstring$
strpos& = SendMessageByString&(List1.hWnd, LB_FINDSTRING, 0, srchstring$)
If strpos& >= 0 Then
di% = SendMessageByNum(List1.hWnd, LB_SETTOPINDEX, CInt(strpos&), 0)
End If
End If
End Sub
' Transfer all selected entries in List1 to List2
' Do not transfer duplicates
'
Sub CmdTransfer_Click ()
Dim totcount%, indexnum%
Dim OldMousePointer%
Dim strpos&
Dim usestring$
totcount% = List1.ListCount
OldMousePointer% = Screen.MousePointer
Screen.MousePointer = 11
For indexnum% = 0 To totcount% - 1
If List1.Selected(indexnum%) Then
' Get the selected strings
usestring$ = List1.List(indexnum%)
' Try to find the string in List2
strpos& = SendMessageByString&(List2.hWnd, LB_FINDSTRING, 0, usestring$)
' If it's not there, add it
If strpos& < 0 Then List2.AddItem usestring$
End If
Next indexnum%
List1.Selected(-1) = 0
Screen.MousePointer = OldMousePointer%
End Sub
' Scroll to the appropriate place
'
Sub Combo1_Click ()
Dim curentry%
If Combo1.ListIndex < 0 Then Exit Sub
curentry% = IndexList%(Combo1.ListIndex)
List1.TopIndex = curentry%
End Sub
' Set the tabstop location for both list boxes
'
Sub Form_Load ()
ReDim t%(2)
' Note that dialog units are 4* the average char width
t%(0) = tabposition% * 4
' We place a second tab stop just in case of very
' long variables
t%(0) = (tabposition% + 5) * 4
di% = SendMessage(List1.hWnd, LB_SETTABSTOPS, 2, t%(0))
di% = SendMessage(List2.hWnd, LB_SETTABSTOPS, 2, t%(0))
End Sub
Sub MenuCopy_Click ()
CmdCopy.Value = -1
End Sub
Sub MenuLoadText_Click ()
On Error Resume Next
CMDialog1.Action = 1
If Err = 0 Then
List1.Clear
LoadConstants (CMDialog1.Filename)
End If
End Sub
Sub MenuRemove_Click ()
CmdRemove.Value = -1
End Sub
Sub MenuSearch_Click ()
CmdSearch.Value = -1
End Sub
Sub MenuTransfer_Click ()
CmdTransfer.Value = -1
End Sub