CE Update 13: Porting from MDL V8i. Programmatically add menu

I'm currently porting 100+ applications for V8i written in MDL to native code (C++).

Most of these applications are launched by selecting the corresponding item in the pulldown menu (see attached screenshot; Italian version)

This menu is programmatically built at startup, after the login, using the APIs mdlDialog_menuBarGetCmdWinP and mdlDialog_menuBarInsMenu.

Any idea how to accomplish this in the CONNECT edtion (Update 13)?

Thanks,

Robert Kock

  • Any idea how to accomplish this in the CONNECT edtion (Update 13)?

    MicroStation CONNECT's customisation capability moves the task of user interface (UI) design from programmer to administrator.

    In V8 and its predecessors we were obliged to create menus and other UI widgets as part of an MDL app.  With CONNECT that's no longer necessary.

    You can use MicroStation's tools to create a DGNLib with your UI.  If the customisation tools aren't enough, you can write XML UI definitions.  Search for Ribbon Bar interface in MicroStationAPI help.

     
    Regards, Jon Summers
    LA Solutions

  • Hi Jon,

    Thanks a lot.

    The items in our pulldown menu are simple strings and each item launches a custom application. Which items are inserted/enabled depends on the permissions of the user that logged in (also the login procedure is a custom application).

    Can this all be accomplished by means of this Ribbon Bar Interface?

  • Which items are inserted/enabled depends on the permissions of the user that logged

    Yes: CONNECT also introduced Named Expressions as a user tool.  Use Expressions to test variables and enable UI widgets.  Search both this Forum and the MicroStation Forum for posts on that topic.

     
    Regards, Jon Summers
    LA Solutions

  • CONNECT also introduced Named Expressions as a user tool.  Use Expressions to test variables and enable UI widgets.

    This feature has existed in V8i also. I think the only difference is that in CONNECT Edition, synchronization system (ribbon can be informed about an event to re-evaluate a state of item) is available.

    Regards,

      Jan

  • Hi Robert,

    Any idea how to accomplish this in the CONNECT edtion (Update 13)?

    As Jon wrote already, there is no direct transition from V8i menu to CE GUI, because CONNECT Edition has no "menu".

    Because it requires to create the menu replacement from scratch, it's up to you (and the user) to analyze and decide, what approach is the best:

    • Ribbon is usually the first choice and when used in a right way, it's flexbile.
    • Backstage is used for less often used functionality and contains primarily function from former "File" menu.
    • Alternative menu (e.g. screen menu) is probably not good in this case, but should be evaluated also.
    You can use MicroStation's tools to create a DGNLib with your UI.

    Unlike Jon, I do not recommend this option for any professional development and application maintenance. Storing ribbon customization itself is fine, but the customization tool is buggy and also offers only limited set of features.

    If the customisation tools aren't enough, you can write XML UI definitions.

    XML file (compiled to rsc optionally) should be a standard way how to defined GUI (ribbon, backstage...) for applications.

    It makes available full ribbon feature set including visibility and enable expressions and, moreover, synchronization event system.

    Plus, because it's just XML, it allows to be stored together with application source code in Git (or any other CVS, as I assume no application development can be done today not using Git ;-). In contrast to XML, DGNLIB is a blackbox in fact.

    The items in our pulldown menu are simple strings and each item launches a custom application.

    I can imagine SIREN-IMP will be implemented as tab (available in selected workflows), existing menu will be split into groups accordingly to applications functionality and menu items can be e.g. buttons, drop down button etc.

    Which items are inserted/enabled depends on the permissions of the user that logged in (also the login procedure is a custom application).

    It sounds like chicken and egg issue: Menu allows to load application(s), but at the same time an application is responsible what menu items are visible ;-)

    The same effect can be achieved by Named Expressions, mentioned by Jon, used in visibility specifications of individual ribbon controls.

    For more information about ribbon xml definition and synchronization event system, see MicroStationAPI documentation, chapter Ribbon.

    With regards,

      Jan

  • I'm kinda lost.

    The menu needs to be built runtime as its contents depends not only on the user's permissions but also on what DGN is loaded.

    In our case, a DGN is a floor plan and when the user selects another one (which is done by activating a custom application that lets the user select one from the database), the whole menu is rebuilt since then plan has different functionalities or that specific user has different permissions for that specific plan.

    The functionalities are read dynamically from the database. By the way, the DGNs themselves are read from the database as well.

    Do you have any working example that I can use as a starting point?

    Thanks a lot,

    Robert

  • I forgot, currently the menu is 5 levels deep. A similar thing can be accomplished by means of the Ribbon?

  • User Interface Redesign

    The bottom line is that moving from a legacy user interface (UI) to MicroStation CONNECT's Ribbon requires work. It's more than just a port of MDL code to the MicroStationAPI: it requires re-engagement with your users to design a new UI. Then you have to work out how to dynamically modify that UI according to your rules. Rules that are currently embedded in MDL logic have to be moved to statements that use Named Expressions.

    I can imagine that a substantial amount of work is required, similar in magnitude to the work required to develop your original MDL menu system. I don't think anyone said that this would be easy.  

    Ribbon

    I'm kinda lost

    The ribbon has received opprobrium from many users (search for Ribbon in the MicroStation Forum).  Nor has it been welcomed by developers used, as you are, to more traditional UI widgets.

    We didn't ask for this: the Ribbon changes the UI model, whether we like it or not.  The Ribbon is there because of Bentley Systems' commitment to Windows and Microsoft standards.

    Named Expressions

    The menu UI needs to be built runtime

    An astute use of Named Expressions should help with that.

    currently the menu is 5 levels deep. A similar thing can be accomplished by means of the Ribbon?

    You'll need to figure out the Ribbon equivalent to nested menus.

     
    Regards, Jon Summers
    LA Solutions

  • Hi Robert,

    I'm kinda lost.

    No reason to be ;-) ... but it's true that V8i > CE is close to "GUI paradigm change", so the transition is complex. On the other hand, whatever was possible in V8i is also possible in CE, only in a different way: We have no menus, but it's still possible to manipulate with ribbon content ad-hoc dynamically at runtime (but I think there is no documentation for this).

    The menu needs to be built runtime as its contents depends not only on the user's permissions but also on what DGN is loaded.

    I can imagine that requirements to build the ribbon completely dynamically can exist, but I have not met such project yet.

    It's recommended to define static ribbon structure and to change it's visibility (or to dim controls) using named expressions and synchronization events. My experience is that a wide range of requirements can be solved even with this (not programmatic) way.

    It's also possible to use ribbon API directly, but it's not described, so self study and analysis is required without ensuring it's even possible. Also, at some situations, I guess Telerik WPF suite has to be installed. But so far I assume it's necessary only when you want to create own ribbon controls, not when you want to access existing ones.

    Do you have any working example that I can use as a starting point?

    I think you should start with documentation I already mentioned and to try:

    • What ribbon control(s) suits your requirements the best.
    • Whether menu structure can be decomposed to static options.

    With regards,

      Jan