G'day mate,
here is an example of how to use PopupMenus in a dialog and reading the values
too...
Cheers
Jacob K. Joergensen
Watertech a/s
www.watertech.dk
Sub TestDialog
Dim sComm, saPipeCatText(1) As String 'The values of PipeCategory text is
written to this array
Dim nRows As Integer
Dim sColCPipeCat, sCPipeCatTabName As String 'Column Name and table name from
pipe category table
sComm = "Select "+sColCPipeCat+" From "+sCPipeCatTabName
+" Into TempSelection Noselect Group By 1 Order By 1"
Run Command sComm
nRows = TableInfo(TempSelection, TAB_INFO_NROWS)
Redim saPipeCatText(nRows)
If nRows > 0 Then
Fetch first from TempSelection
For i = 1 to nRows
saPipeCatText(i) = TempSelection.Col1
If saPipeCatText(i) = "" Then
saPipeCatText(i) = " "
End If
Fetch Next From TempSelection
Next
End If
Dialog
Control StaticText Position 8, 91 Title "Pipe Category"
Control PopupMenu Position 80, 90 Title From Variable saPipeCatText Width
100
ID ID_PChkPipeCat Value 0 Into iPipeCatIndex
' Or select from a value list shown as a text with ;-separated strings:
' Control PopupMenu Position 80, 90 Title "Text1;Text2;Text3" Width 100
Control OKButton Position 90,350
ID ID_PChkApprovePipe Calling URPEdit_PipeTrigger
Control CancelButton Position 90,370
'...
End Sub TestDialog
'...
'...
'...
Sub URPEdit_PipeTrigger
Dim siTrigger As SmallInt
siTrigger = TriggerControl()
Do Case siTrigger
Case ID_PChkApprovePipe
iPipeCatIndex = ReadControlValue(ID_PChkPipeCat)
Print "Selected Pipe Category : "+saPipeCatText(iPipeCatIndex)
End Case
End Sub
________________________________
Fra: [EMAIL PROTECTED] på vegne af John Gosbell
Sendt: on 30-11-2005 03:45
Til: [email protected]
Emne: [MI-L] Setting Up Pick Lists for Attribute Editing within MI Pro
Howdy,
Can anyone provide me with some example Map Basic code illustrating how to
set up data entry via a predefined Picklist within MapInfo Pro?
Eg. when entering attributes, instead of having to type in the values,
the user is presented with a dropdown list of all the available options
(eg for Footpath Type have the options of "Blockpaved", "Asphalt",
"Concrete", "Gravel")
Cheers and Thanks
John Gosbell
GIS Administrator
City of Burnside
pH 088 366 4130
fax 088 366 4299
This Email is personal correspondence from the sender. It is not an
official document from the City of Burnside.
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l