ShowTxtPosDesc: displays a message box with the all the (valid) properties of the specified text position description object (as returned by the gn3ted.Cursor object Desc property). Example: ShowTxtPosDesc Text.GetCursor(modeSame,cposCursor,False).Desc,"At cursor" displays the properties of the text at the current cursor position. Note: this function require specific constants. See Constants for TxtPosDesc functions.
Sub ShowTxtPosDesc(objDesc,strCaption)
Dim str
str = atptNames(objDesc.GetType-tptFirst)
If objDesc.GetIsExpansion Then
str = str & " expansion"
End If
If objDesc.GetIsJust Then
str = str & " just"
End If
If HasChar(objDesc) Then
str = str & vbCrLf & "Char: '" & chr(objDesc.GetChar) & "' (" & objDesc.GetChar & ")"
End If
If IsCmd(objDesc) Then
str = str & vbCrLf & "Command type: " & actNames(objDesc.GetCmdType-ctFirst)
End If
If HasTS(objDesc) Then
str = str & vbCrLf & "Font: " & objDesc.GetFontCode
If objDesc.GetItalic Then
str = str & " (italic)"
End If
If objDesc.GetBold Then
str = str & " (bold)"
End If
If objDesc.GetOutline Then
str = str & " outline"
End If
If objDesc.GetShadow Then
str = str & " shadow"
End If
If objDesc.GetSmall = smallOn Then
str = str & " small"
ElseIf objDesc.GetSmall = smallUpper Then
str = str & " upper"
ElseIf objDesc.GetSmall = smallLower Then
str = str & " lower"
End If
If objDesc.GetSlant <> 0 Then
str = str & vbCrLf & "Slant: " & objDesc.GetSlant
End If
str = str & vbCrLf & "Size: "
If objDesc.GetCharW = objDesc.GetCharH Then
str = str & objDesc.GetCharH & "m"
Else
str = str & objDesc.GetCharH & "m on " & objDesc.GetCharW & "m"
End If
str = str & vbCrLf & "SupColor: " & objDesc.GetSupColor & " " & objDesc.GetSupGray & "%"
End If
If HasMS(objDesc) Then
str = str & vbCrLf & "Color: " & objDesc.GetColor & " " & objDesc.GetGray & "%"
If objDesc.GetYOfs <> 0 Then
str = str & vbCrLf & "YOfs: " & objDesc.GetYOfs & "m"
End If
str = str & vbCrLf & "RemCode: " & objDesc.GetRemCode
str = str & vbCrLf & "Mode: " & objDesc.GetMode & " " & objDesc.GetModeData
If objDesc.GetNUnderlines > 0 Then
str = str & vbCrLf & "Underline(s): "
For i=0 To objDesc.GetNUnderlines-1
str = str & vbCrLf & " Y: " & objDesc.GetUY(i) & "m H: " & objDesc.GetUH(i) & " Color: " & objDesc.GetUColor(i) & " " & objDesc.GetUGray(i) & "% Flags: " & objDesc.GetUFlags(i)
Next
End If
End If
If IsCmd(objDesc) Then
If objDesc.GetJustElementType = jeleImg Then
str = str & vbCrLf & "Image"
ElseIf objDesc.GetJustElementType = jeleRule Then
str = str & vbCrLf & "Rule"
End If
End If
If objDesc.GetHasStyle Then
str = str & vbCrLf & "Style: '" & objDesc.GetStyle.Name & "'"
End If
MsgBox str,vbOkOnly,strCaption
End Sub
See also ShowTableDesc procedure.