| PowerDavid 2006-05-23, 10:08 am |
| hi all
I need to translate this Visual Basic code to PowerBuilder:
'Read the contents of the active layer's Renderer property.
'Run one of the "Load..." procedures to populate the appropriate
'tab with the current renderer's properties.
Select Case True
Case lyr.Renderer Is Nothing
sstLayerProp.Tab = 0
Call LoadSingleSymbol
Case TypeOf lyr.Renderer Is mapobjects2.ValueMapRenderer
sstLayerProp.Tab = 1
Call LoadUniqueValues
Case TypeOf lyr.Renderer Is mapobjects2.ClassBreaksRenderer
sstLayerProp.Tab = 2
Call LoadClassBreaks
Case TypeOf lyr.Renderer Is mapobjects2.LabelRenderer
sstLayerProp.Tab = 3
Call LoadStandardLabels
Case TypeOf lyr.Renderer Is mapobjects2.LabelPlacer
sstLayerProp.Tab = 4
colorMask = lyr.Renderer.MaskColor
Call LoadNoOverlapLabels
Case TypeOf lyr.Renderer Is mapobjects2.ZRenderer
sstLayerProp.Tab = 5
Call LoadZRenderer
Case Else
sstLayerProp.Tab = 0
Call LoadSingleSymbol
End Select
'If the active layer does not support Z shapes, disable
'the "Elevation" rendering tab.
If (InStr(lyr.tag, "[SHAPEFILZ]") = 0) And (InStr(lyr.tag, "[SDEZ]") = 0) Then
sstLayerProp.TabEnabled(5) = False
End If
I'm using ESRI MapObjects OCX on my application to show maps of my city. In that maps I load points.
Now I have to change some properties of the map like colors, line style, labels, etc.
To do this i have to evaluate what type of map I'm working, so I need to translate this code to perform some procedures.
First, the line that says " Case lyr.Renderer Is Nothing ". I don't know how can use Nothing in PB.
In the line that says "Case TypeOf lyr.Renderer Is mapobjects2.ValueMapRenderer". I have to evaluate if the layer to change some properties is (in the propertie Renderer) the same Class defined for mapobjects2.ValueMapRenderer. Wow compare this if TypeOf in PB just returns the type of control, not the classtype or classname.
I know that properties in PB, but I can't realize to work like in VB.
If you have idea of how translate this to PB, please help me. |