Table of Contents

    1. Services

About News Mde's GUI Features Ideas Platforms Building Utility Programs Forum Trac Wiki Help


Content

Content is the central part of communication between user elements of the GUI and non-GUI code.

All content has a symbol name, e.g. "menus.main.quit". The '.'s are separators, by which the content is automatically made into a tree:

  • "menus" − a list of all the menus
    • "main" − the main ("File") menu; a list of all its items and sub-menus
      • "quit" − an event content with a callback causing the engine to shutdown

All content, when created, has a reference added to a hashmap with the symbol as the key, allowing the addContent function to get content based on a string. It is also added to a tree (the "all content" menu currently in mde uses the whole tree).

Content is "translatable": each content has name and description fields, which hold strings loaded from the localisation file, looked up by the content symbol. The name defaults to the symbol if no translation is found. Widgets displaying a content string (as a label) can display either the name or description, or the value (as text).

Content taking a value has its value automatically saved and loaded between runs. Maybe this won't always be desirable, but it works well for options.

Content can have callbacks, triggered on events such as a button press or an edit. This allows buttons to work, content-edit widgets to remain in-sync and option changes to take immediate effect.

Services

Context menus, when available, will display a list of services, based on the content clicked on. This will allow clipboard functionality and other things; e.g. spell checking for text, a calculator for numerical values.