Identify a specific icon in a macro?

  • 1
  • Question
  • Updated 4 years ago
OK, I am finding that the Icon class in the MM Object Model (within a macro) is a little less than helpful. Each of my topics (that I care about) are tagged with one or another of two main icons - a sun or a moon.

All I am trying to do is have the current topic look up at it's parent object, and see which of those two icons is present. None of the properties of the Icon class seem to be very directly helpful in determining that.

I suppose I could extract the map content and take a look at the tag for each icon and manually determine which unique signature it has, but man does that seem like a lot of work to accomplish something like this.

Any other way I am missing? I am currently using the m_Topic.Icons.Item(i).* property access...
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes

Posted 4 years ago

  • 1
Photo of Nigel Goult (Olympic & MIVAP)

Nigel Goult (Olympic & MIVAP)

  • 348 Posts
  • 134 Reply Likes
Hi Mike,

Depends on the type of icon. If it is a MindManager stock icon you could try:

If Topic.ParentTopic.AllIcons.HasStockIcon(mmStockIconArrowDown) then
'do your thang
End If

If it is a custom icon you will need the icon signature and try:

If Topic.ParentTopic.AllIcons.HasCustomIcon(pIconSignature) then
'do your thang
End If

HTH

Regards
Nigel
Olympic Limited
The MindManager Solutions Specialist
Check out our latest MindManager add-ins: Map Tracker - Topic Tracker - WordX
MAP for MindManager - Have you got your MAP? - Download Today!
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
Hi Nigel! You are just a question-answering machine :) Is there any way to get the particular signature I am looking for from within the code itself, or do I have to hack the map as I've suggested in order to get the constant I am looking for? I do like the method you used - much more compact than the For Each loop I was using. This is the first time I have programatically worked with Icons so I went with the good old standby route :)
Photo of Nigel Goult (Olympic & MIVAP)

Nigel Goult (Olympic & MIVAP)

  • 348 Posts
  • 134 Reply Likes
Mike.

You can use:

Dim IconSignature As String
Set IconSignature  = Utilities.GetCustomIconSignature(fileName as String)

I think... :-)

Regards

Nigel
Photo of Nick Duffill

Nick Duffill, Champion

  • 508 Posts
  • 169 Reply Likes
You can also find the signature of custom icons by locating the icon the Map Markers collection. Its signature is a property of the icon in the map marker set.

Although icons are visually convenient, if you are using mark-up to enable bulk processing of map data, then topic tags (text labels in the API) are easier because you can parse them directly on the topic without needing to resolve them elsewhere.
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes
OK, thanks for the ideas guys, I think I have it in the bag now :)