MindManager 7 "ToDo List" Add-in development: Notes to Self

Notes to Self: Object Model stuff I Might Use in my Add-in

  • Application.ActiveDocument: the currently-displayed Map
  • Application.Visible: enables/disables the MM UI
  • DocumentObject.Guid, DocumentObject.ResetDirty: this seems like a generic object type within the MM object model — might be useful for manipulating a whole collection of different objects at once
  • Document.Attributes: collection of document’s custom attributes
  • Document.CentralTopic
  • Document.Guid
  • Document.IsModified
  • Document.Properties
  • Document.AssignMapMarkers(): assigns a map markers template to the document
  • Document.GetAttributes()
  • Document.Range(): returns a new Range collection of all the specified objects (topics, boundaries, relationships) in the document
  • Topic.AllSubTopics: subtopics connected to the topic
  • Topic.Attributes
  • Topic.Document: the document in which the Topic is found
  • Topic.Guid
  • Topic.Icons, Topic.UserIcons
  • Topic.IsFirstSibling: TRUE if the topic is the first in a set of siblings
  • Topic.IsMainTopic: TRUE if the topic is a child of the Central topic
  • Topic.IsSubTopic: TRUE if the topic is a child of another topic
  • Topic.Level
  • Topic.NextSibling
  • Topic.ParentRelationship
  • Topic.ParentTopic
  • Topic.SubTopics, Topic.UnfilteredSubTopics
  • Topic.Synchronization: ????
  • Topic.Task
  • Topic.Text
  • Topic.TopicLabel
  • Topic.TopicPrefix: sets the prefix for the topic — something to do with “numbering”
  • Topic.Type
  • Topic.AddControlStripType()
  • Topic.AddSubTopic()
  • Topic.CreateHyperlinkToTopicByGuid(): Cool! This could be used to hyperlink topics in ToDoList back to their original Topics. Might be useful to sync properties, attributes automatically.
  • Topic.GetAttributes()
  • Topic.NewTopicFinder(): helpful for traversing sub-topics from the current topic.
  • Topic.ResetDirty(): resets dirty bit of this and all subsequent objects. [Could be used to determine if a Topic has been changed since last “sync”.]
  • Topics.Add()
  • Topics.AddWithGuid(): creates new Topic with a given Guid
  • CustomProperty.Value
  • CustomAttributes.GetAttributeValue(), CustomAttributes.SetAttributeValue()
  • Task.IsDone
  • Task.IsValid
  • Task.Priority
  • Task.Topic: the parent Topic for this object
  • TextLabels.AddTextLabel()
  • Icons.AddStockIcon(), Icons.AddCustomIcon()
  • Icon.Delete()
  • Utilities.Execute

Notes to Self: Questions to Research

  1. What’s the difference between a CustomProperty and a CustomAttribute?
    • Attributes are persistent
    • Nick Duffill has more info here
  2. Is a TextLabel the same thing as a Text Marker?
  3. What’s the difference between a CategoryMarker, a CustomIconMarker and a CustomIcon?
  4. What Events are available to which to respond (such as Topic.Moved)?
    • Nick Duffill alludes to “topic-delete” and “topic-add” here
  5. Is there a way to find the current position among siblings for a Topic? Could there be a Property that indicates the Topic’s position?
    • There is the Topics.Item property…
  6. Can you get a handle to a Topic when you know its Guid? Do you need to be attached to its Document, or can you search all open Documents (e.g. searching through the AllDocuments or Documents collections)?
  7. Is there some way (e.g. derive a class from the Topic class) that would allow me to define a Property whose Value was equal to its 1-index position among its siblings?
  8. Does the Dirty flag get toggled automatically as soon as any change is made to the object? Or is this a flag that must be explicitly set?
  9. Does the Dirty flag inherit up the tree — i.e. if any Object in a Document has the Dirty flag set, does that implicitly “set” the Dirty flag on the Document as well?
  10. Can you reset the Dirty flag on a Document, and would that reset the Dirty flag on every Object in the Document all at once?
  11. Could the InsertCustomProperties event be used to automatically propagate a Property to another attribute on the Topic object (e.g. taking the Index of a Topic next to its ToDoList siblings and convert that to a custom ToDoListPriority property, or to use the Priority icon’s value as a ToDoListPriority value)?
  12. Is the SetCustomPropertyValue event the one that’ll let me trigger when the user changes the Topic’s ToDoListPriority value (either automatically, by moving the Topic to a different position among its List siblings, or manually, by typing the value in or selecting it from a pre-populated list) to propagate that value back to the source Topic?
    • If so, could I reset the Dirty flag on the Topic in the ToDoList, but leave open the possibility that the ToDoList overall is still “Dirty” and prompt the user to save unsaved changes?

Notes to Self: MM-specific Objects to Manipulate

There’s all these new Object types defined in the MM object model:

  • BusinessTypeRegistry/Business Topics (see Nick Duffill’s expert explanation of these Object classes here)
  • External Topics
  • Map Parts
  • MapShortcutCollections
  • Baselines
  • DocumentBars
  • Filter
  • Control Strips

Notes to Self: Code Tidbits

“use the Document.Range() method to iterate over all Objects” (Create and Use Custom Attributes)

Add Topics

Iterate over Topics (includes sample code for using the TopicFinder, an iterator)

Work with the Object ID (includes reference to FindByGuid() method that finds DocumentObjects by GUID in any Range, such as Document.Range)

Get an Object’s Type (which refers to an enumeration of DocumentObject that includes mmDocumentObjectTypeTopic)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s