Pen D-Flat: Making a CUA Interface Library Pencentric
From the Original Pages
Click a page to enlarge · Alt-click to open the full issue
Editor’s Note: Al Stevens is the C programming columnist for Dr. Dobb’s Journal and the author of numerous acclaimed books on C and C++ programming. Over the past year or so, Al has documented his development of D-Flat, a CUA (short for “Common User Access” — a user interface specification defined by IBM and adopted as a de facto standard by the computer industry) library for C programmers. The D-Flat project has been embraced by the PC programming community and one of the most popular projects ever undertaken by Dr. Dobb’s Journal. Provided free to programmers through DDJ’s public domain “careware” project (that is, money donated by programmers for D-Flat is given to charity), D-Flat is being used in commercial applications by small companies as well as companies like Texas Instruments. Upon completion of the project, Al tried it out as a pencentric application. What follows is his first report and comments on his speculations on how pen-based computing will evolve. He will be going into more details in future issues. Other plans for D-Flat include a rewrite (not a port) of the library in C++. This new library will be called D-Flat++.
Pen-based computers are here for a while, and we should be aware of what that means to software development. A pen-based development environment will resemble one for an embedded system where you develop on something other than the target hardware. No one would want to squint and scratch their way through a small clipboard-sized, handheld, compile, and debug session with Borland C++, for example. I guess you could do your programming while you ride the exercise bike, lounge at the beach, or take that nature walk, but you’d soon lose patience as you grappled with the pen and pad to change code, set breakpoints, and look at variables. Besides, not many of the little critters will have the megabytes of disk and RAM to install the new breed of gargantuan compilers. No, the pen-based platform is not ideal for software development. You still need all the tools that you need for traditional programming, but you also need something hooked to the AT that simulates the pen and pad.
Therefore, do not plan to launch a pen-based word processor product. No one will buy it.
This should give you a clue about what kind of applications are best served by pen-based software and what kinds are not. The notion that pen computers will proliferate in executive offices in the hands of keyboard-shy CEOs is silly. Today’s executives might be less than computer-literate, but that is changing. Before pen-based technology is good enough for serious word-processing and spreadsheets, it will be overtaken by two things — voice-based computing and a new generation of technology-savvy executives. Therefore, do not plan to launch a pen-based word processor product. No one will buy it.
Pen computing will wear a blue collar and will embrace vertical applications. It will realize its potential in walk-around applications where mobility and freedom from cabling are important and where there are some data to be entered that cannot be scanned. The UPS person in my hometown uses a pen tablet to record deliveries and recipient signatures. It’s an experimental program. In some cities, you can already get a traffic ticket written and printed by a pen-based computer. RoboCop. Combine a pen with a bar-code reader, and you have an excellent warehouse inventory input device. Scan the inventory number’s bar code and write the quantity-on-hand. Aluminum siding, screen enclosure, driveway paving, and roofing sales people could use small pen-based CAD applications to design and cost home improvements while sitting in the customer’s living room. Vertical applications every one. Opportunities for programmers.
Most pen-based systems have graphical operating environments at their foundation, and you need a GUI development environment. Microsoft Windows for Pen is one example. PenDOS, from Communications Intelligence Corporation (Redwood City, CA), is a pen-based operating environment that runs in text mode on top of MS-DOS. When used along with a cooperating digitizing tablet and pen, PenDOS provides a pen interface to text-mode DOS applications. Typical DOS applications need little or no modification to run with PenDOS. Most mouse and keyboard operations are handled by the environment as if you entered them with traditional devices. PenDOS emulates mouse actions by the movement and tapping of the pen on the screen’s surface. It emulates keyboard input by popping up a Writing Window into which you manually write text with the pen. The environment uses character recognition algorithms to translate your scribbles into keyboard characters. Your entries are displayed in a text entry window, and when you like what you’ve written on a line, you tap the Send button. PenDOS stuffs the characters into the application as if you had typed them. It works well, recognizing a variety of handwriting styles and requiring little practice to become comfortable with its use.
Even a pen-based application needs a user interface. I was not sure that the interfaces that work with the keyboard, screen, and mouse are meaningful on the pen/tablet platform, so I decided to use D-Flat (a CUA-compliant user interface library for C programs that I’ve developed in my “C Programming” column running in Dr. Dobb’s Journal) and PenDOS to experiment with a pen-based CUA interface.
In theory, a D-Flat application would run under PenDOS with little or no trouble. This combination would offer the developers of pen-based applications a CUA interface that uses pen taps and movements instead of mouse actions and handwritten pen text input instead of keyboard input.
I used the Wacom HD-648A Handwrite Digitizer to test PenDOS with D-Flat. This device has a VGA-compatible LCD screen and a serial pen input device. The drivers that come with PenDOS work with the Wacom. The pen emulates a serial mouse. This particular Wacom device is intended for developers who would test their programs with traditional PC hardware. Once debugged, the applications could be embedded into specialty pen-based DOS computers. The ideal testing configuration has the Wacom connected to the VGA port and the system console assigned to a monochrome monitor — the typical two-monitor testing platform. That allows you to use the keyboard and monochrome screen to debug while the Wacom VGA device displays the application screens.
With PenDOS and the Wacom digitizer installed, the display satisfactorily emulated the LCD VGA. I tried out some DOS commands through the Writing Window. It works, but users will probably not like entering DOS commands that way. You’ll need to boot into the embedded application. I ran D-Flat’s Memopad (a “mini” wordprocessor) example program unmodified under PenDOS. The pen properly selected menus, chose menu commands, pressed command buttons, and selected items from list boxes, check boxes, and radio buttons. I could move and resize windows easily with point and drag operations. Double-clicking is double tapping with the pen. If anything, the CUA mouse operations are easier and more intuitive with a pen pointed directly at a horizontal screen than they are with a mouse on the desk moving a cursor on a vertical screen.
All D-Flat needs to make it a complete pen-based user interface is an editbox control that uses handwriting input similar to the PenDOS Writing Window and the PenDOS “gesture” characters for text editing with a pen.
Transcribed from Pen-Based Computing, Volume 2, Number 3 — August 1992. Pages 8, 9.