MOI's interface

Next
 From:  Ambimind
4401.1 
Hi Michael,

I'm currently writing a small program and am again frustrated by Windows' limited set of UI gadgets/components(in function and display). It occurred to me, as I was working with MOI today, that:
1- It does not rely on the .net framework and thus file size is relatively small
2 - It does not suffer from said visual limits and yet is extremely responsive
3 - Looks the same across Xp,Vista, 7
5 - And because of this, it is a delight to work with and probably to program

In other words, it is quite an achievement.

I wondered if you would give some tips on how you managed this, particularly if you are using some standard framework I can purchase/download or if you've written it yourself, if you would considering selling it?

Thanks for any assistance,

Ambimind

EDITED: 26 Jul 2011 by AMBIMIND

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4401.2 In reply to 4401.1 
Hi Ambimind, thanks, I'm glad you like MoI's UI mechanism.

MoI v1 and v2's UI uses a custom library that is built on top of the mshtml.dll HTML display and parsing engine.

You can see the actual HTML files that make up the UI in the \ui sub-folder underneath MoI's main installation folder, for example \ui\CommandBar.htm is what defines the bottom toolbar, and \ui\SidePane.htm is what controls the side pane UI.

The primary benefit for using HTML for program UI is that it has a lot of stuff in it to control the layout of text - basically the HTML engine does the layout of the text and places controls and MoI has some code that plugs into the engine and draws the appearance of some custom controls. You'll see those custom controls as custom tags in the .htm files, like <moi:CommandButton> for example.

For MoI v3 I've actually switched how this is all structured so that it will now be based off of the WebKit html engine instead of mshtml - see this previous thread for some explanation on why that's happening:
http://moi3d.com/forum/index.php?webtag=MOI&msg=4391.3

Some of the other benefits of this kind of UI structure is that the UI is much more separated and independent from the core C++ code - it's more feasible for people who want to write scripts for example to write some HTML for their script's UI rather than being forced to only write C++ code, and there are a few other features that kind of come out from the whole system like the dynamic resolution-independent size (set any size you want for the UI by the "UI size" slider under Options > General), and also being able to have the language change dynamically - having a sophisticated text layout system helps a lot for translations in general since it is possible to have longer text get word wrapped and the UI expands if needed to make more space for such things.

But I'm sorry, the whole system is pretty involved and at this time I'm not able to make it available as a separate library from MoI, it would just take too much time for me to prepare it for general use for other programs and also just to support someone else making a full application using it would be too time prohibitive for me currently.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Ambimind
4401.3 In reply to 4401.2 
Thank you much for taking the time to explain in such detail.
This will be more then enough to start my investigation.

Regards,

Ambimind

Edit: For anyone else interested I found this great article which gives an explanation and source code for how this may be achieved:
http://ehsanakhgari.org/article/visual-c/html-dialogs
And here are the details of the dll:
http://www.geoffchappell.com/viewer.htm?doc=studies/windows/ie/mshtml/index.htm&tx=36

EDITED: 27 Jul 2011 by AMBIMIND

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All