Saturday, April 12, 2008

External Tools in Dolphin Idea Spaces

Based on a request in c.l.s.d "drag Squeak Shell To Dolphin's IdeaSpace" I decided to investigate an idea I got from an article at codeproject (Hosting .exe applications into a dialog). My goal was to get something similar in Dolphin - but packaged in a nice MVP friendly way.

Here is what I came up with:

ExternalProcessPresenter/ExternalProcessView


This combination allows you to display a external application within a Dolphin View/Presenter. It uses ExternalProcess (from Bob Jarvis Goodies) as it's model. This also means that you cannot wrap already running processes with it. The process has to be started from within Dolphin.

So you'll need the model first:

| externalProcess |
externalProcess := (ExternalProcess new)
commandLine: (SpecialFolderRelativeFileLocator windows
localFileSpecFor: 'system32\sol.exe');
yourself.

Now we show the presenter:

ExternalProcessPresenter showOn: externalProcess
DONE! This is what you should get:


Cool, isn't it?

ExternalToolShell

It even get's better. I added a Dolphin Smalltalk Integration to manage a set of external tools and run them within IdeaSpaces. Start the external Tools shell from the addition Tools folder and you'll get a shell with a List of known tools on the left. You are able to add and delete external tools and start them via double click. This allows you to e.g. run Squeak within Dolphin:


I hope this is useful for somebody.

WARNINGS/LIMITATIONS

  • This goodie is a Hack!!! - even for a Windows app. So you have been warned!!!
  • Single toplevel Window Applications only: If the application opens multiple top level windows only one will be shown in an IdeaSpace!
  • Force quit on View close: Currently the process' view is destroyed and the process terminated if the ExternalProcessView is closed. There is no onClose Handling
  • Redraw problems: Some controls (especially menus) have redraw problems. This is due to the fact that Windows never intended an application to have a MenuBar in a non-TopLevel Window
  • Focus Problem: When interacting with controls within the window the parent shell (IdeaSpace) looses the focus.

Download
Just download the newest version of my goodies and have fun!

1 comment:

Travis Kay said...

It is useful, thanks Udo! This looks like fun, my fravourite Smalltalks in one ;)