Popup: simple UI framework for wftk or anything else

[ xml source ] [ discussion ]

The popup UI framework started out as a separate project concept, but wftk subsumed it, as it ultimately subsumes everything I think of nowadays. The initial project is a simple popup tool for ProZ.com, a translation job bidding database through which I find paying work from time to time. This tool will provide a lightweight interface to ProZ in order to pop up new job listings, provide a quick query interface for KudoZ questions (these are questions to fellow translators; it's a convenient way to get translations for sticky phrases), and also provide a quick query interface for Web-accessible dictionaries such as EuroDicAutom.

The framework itself is based on wxWindows and is a simple UI from which to hang queries and event listeners. Effectively it is a general IM client, except that instead of handling a single kind of unstructured message it is capable of handling structured messages corresponding to structured interactions with arbitrary systems. (Note that this means it'd make a fine IM client....)

It is unusual in the wftk in that it is written in C++. This allows it to interface with wxWindows, which is a C++ library. In addition, the window-UI style of programming is indeed a naturally object-oriented paradigm, so (sigh) I guess I'll go with the flow on this one. But most of the meat is in adaptors, and they remain ANSI C. So there.

The UI does three things, basically: it queries data sources using QUERY and CONNECT adaptors, it listens for and processes events and query replies using LISTEN and EVENT adaptors, and it stores and lists old messages using LIST adaptors in a folder paradigm. The reason this is still involved in the wftk is that all these adaptor classes will be immediately useful for the wftk itself and for its applications. I'm particularly looking forward to wrapping a very thin daemon wrapper around a LISTEN adaptor and the wftk library itself and getting a wftk workflow engine daemon as a result. This will be a Good Thing.

The popup UI doesn't use the wftk library directly at this point; it uses the wftk adaptor code to load adaptors directly and talks to them instead. This may change or it may not; for the current application I don't need the wftk library. There will later be query and event adaptors for talking to the workflow engine daemon listed above, and at that point it's going to be possible to do things like putting up screenshots -- people might think wftk is a real program or something!

At any rate, the five impinging adaptor classes will be where most of the meat of a given popup UI program will be. That's why this particular module here is the "popup UI framework." See? It all makes sense, doesn't it? Those adaptors again are as follows:

That leaves two pages worth of actual program for the framework:

This code and documentation are released under the terms of the GNU license. They are additionally copyright (c) 2001, Vivtek. All rights reserved except those explicitly granted under the terms of the GNU license. This presentation was prepared with LPML. Try literate programming. You'll like it.