Discussion:
Should MDI be avoided in new applications?
jabro
2005-08-13 19:19:23 UTC
Permalink
I'm going to begin a new wxWidgets application (targeted to Windows,
Mac OS X, GTK, and Motif) in which the user can open several documents
and copy/cut/paste between them. At first glance it looks like it would
fit nicely into the MDI concept, but I've been reading the docs (and
the newsgroups), and people tend to suggest avoiding MDI.

Moreover, at the wxMac supported classes, MDI is tagged as partially
implemented (but the MDI demo seems to work).

Should I avoid beginning a new MDI application, or can it still be a
wise decision in some scenarios?

thanks!
Aggro
2005-08-13 21:56:52 UTC
Permalink
Post by jabro
Should I avoid beginning a new MDI application, or can it still be a
wise decision in some scenarios?
IMHO Browsers would be useless without tabs (that is one reason I use
Firefox). Microsoft Paint sucks because you can only view one image at a
time. Some text editors are really nice to work with, because they allow
me to swap view between different files with one click and make
comparing and copy-pasting simple.

I think that MDI applications can be really good, if you just add a good
UI to them. It would suck to use Firefox if I would have to select
next/previous from Window-tool menu to select the correct window. But
because it has tabs to allow me to see and select the correct one fast
and easily, it makes it really usefull. Also, if the tabs would be just
empty buttons, that would also be a bad thing.

Main key is that user needs to be able to see and select the wanted
child frame easily with one click (of if there are very many of them,
with scrolling and then clicking). Extra information about that frame is
also good. (For example Firefox shows animation when page is still
loading. Text editors place an asterisk (*) after the filename in the
navigation panel when file has unsaved changes.

The bad reputation behind MDI applications is mostly because of bad UI
decisions. But this is just my opinion.
David Elliott
2005-08-13 23:05:36 UTC
Permalink
Post by jabro
I'm going to begin a new wxWidgets application (targeted to Windows,
Mac OS X, GTK, and Motif) in which the user can open several documents
and copy/cut/paste between them. At first glance it looks like it would
fit nicely into the MDI concept, but I've been reading the docs (and
the newsgroups), and people tend to suggest avoiding MDI.
The wxWidgets MDI classes do a standard MDI UI on Win32. This is
somewhat deprecated these days as the more modern Microsoft apps tend
to use a new top-level window for each document. However, it's still
a perfectly valid UI and some users seem to prefer it.
Post by jabro
Moreover, at the wxMac supported classes, MDI is tagged as partially
implemented (but the MDI demo seems to work).
I'd say where MDI really has an advantage is on wxMac. By simply
hiding your main MDI window (pushing it offscreen) or by turning it
into a tool window (making it into a floating toolbar) you can have a
very mac-like application that has a typical MDI interface on Windows.

The real downside though is that on Linux you are stuck with the
notebook tabs interface. Thus each document window has exactly the
same size. For some apps this can make sense. OTOH, if it makes
that much sense you might simply want the notebook tab interface on
all platforms.
Post by jabro
Should I avoid beginning a new MDI application, or can it still be a
wise decision in some scenarios?
Depends on what you're trying to do. A better solution may be to
just do one top-level window for each document and have a top-level
window that is hidden and/or closed when any one document window is
open but appears again when the last document window is closed (so
that Windows and Linux users still have a menubar and whatnot). On
Mac you could just leave that window hidden always. I believe the
normal (non MDI) doc/view classes can be used like this.

-Dave
Paul Koning
2005-08-14 16:49:59 UTC
Permalink
jabro> Moreover, at the wxMac supported classes, MDI is tagged as
jabro> partially implemented (but the MDI demo seems to work).

jabro> Should I avoid beginning a new MDI application, or can it
jabro> still be a wise decision in some scenarios?

It seems that on the Mac MDI is the only way to get an app that works
like a proper Mac app. You can't get the standard "menu bar without
any windows" without MDI.

So I have an app that's SDI on most platforms but MDI on the Mac, with
the parent frame invisible. Works nicely, and the amount of
conditional code is surprisingly small.

paul
David Elliott
2005-08-15 12:49:42 UTC
Permalink
Post by Paul Koning
jabro> Moreover, at the wxMac supported classes, MDI is tagged as
jabro> partially implemented (but the MDI demo seems to work).
jabro> Should I avoid beginning a new MDI application, or can it
jabro> still be a wise decision in some scenarios?
It seems that on the Mac MDI is the only way to get an app that works
like a proper Mac app. You can't get the standard "menu bar without
any windows" without MDI.
Not true. You can do exactly what MDI does and open a frame
offscreen that's used only for the menubar.

The reason it works fairly well with MDI though is because I already
had an MDI Win32 wxWidgets app (PhotoFlair) and needed it to work
well on Mac.

-Dave
Paul Koning
2005-08-15 13:19:58 UTC
Permalink
Post by Paul Koning
It seems that on the Mac MDI is the only way to get an app that
works like a proper Mac app. You can't get the standard "menu bar
without any windows" without MDI.
David> Not true. You can do exactly what MDI does and open a frame
David> offscreen that's used only for the menubar.

Sure, that's true. MDI does a bunch of other necessary legwork (such
as the Windows menu), so it's a good way to do this.

What I should have said is that you can't get the proper Mac behavior
with just toplevel windows; you have to do extra magic. MDI provides
much of the wrappers needed for that magic with less effort than the
alternative.

paul
jabro
2005-08-15 16:28:35 UTC
Permalink
Post by Paul Koning
So I have an app that's SDI on most platforms but MDI on the Mac, with
the parent frame invisible. Works nicely, and the amount of
conditional code is surprisingly small.
Can you point me to some clarifying example that shows how to perform
this SDI/MDI conditional compilation? (if you don't have such an
example, don't worry, I'll try to figure it out myself from the classes
documentation, but if there was an example, it would certainly help).

Thank you,

jabro
Paul Koning
2005-08-15 16:39:46 UTC
Permalink
Post by Paul Koning
So I have an app that's SDI on most platforms but MDI on the Mac,
with the parent frame invisible. Works nicely, and the amount of
conditional code is surprisingly small.
jabro> Can you point me to some clarifying example that shows how to
jabro> perform this SDI/MDI conditional compilation? (if you don't
jabro> have such an example, don't worry, I'll try to figure it out
jabro> myself from the classes documentation, but if there was an
jabro> example, it would certainly help).

cvs -d :pserver:***@akdesign.dyndns.org:/home/cvsroot co dtcyber/pterm_wx.cpp
will get you the source file where I did this. Look for the string
"MDI".

paul
jabro
2005-08-15 21:00:45 UTC
Permalink
Post by Paul Koning
Post by Paul Koning
So I have an app that's SDI on most platforms but MDI on the Mac,
with the parent frame invisible. Works nicely, and the amount of
conditional code is surprisingly small.
jabro> Can you point me to some clarifying example that shows how to
jabro> perform this SDI/MDI conditional compilation? (if you don't
jabro> have such an example, don't worry, I'll try to figure it out
jabro> myself from the classes documentation, but if there was an
jabro> example, it would certainly help).
will get you the source file where I did this. Look for the string
"MDI".
Thanks a lot, Paul!!! It was very helpful!

In this way, it's very easy to develop an application without having to
spend too much time deciding whether to go SDI or MDI... just go for
both! :-)

jabro

Loading...