RAPID: THE RAPID ADA PORTABLE INTERFACE DESIGNER Martin Carlisle Department of Computer Science US Air Force Academy
Objectives u Provide an intuitive GUI designer for Ada that is u Low cost u Readily extensible u Portable
Outline u RAPID development secrets u Demonstration u Questions
Compiler theory to the rescue u Bootstrapping u Created file format for RAPID GUIs u Created generators for widgets u GUI for RAPID was designed using RAPID u 40% of RAPID source was automatically generated u As new widgets were added, they could quickly be used in RAPID itself
Portion of GUI file WINDOW "." MENUBAR MENU "File" 0 ITEM "New" 0 "File_Menu.New_Choice" Ctrl+N ITEM "Open" 0 "File_Menu.Open_Choice" Ctrl+O ENDOF MENU ENDOF MENUBAR WIDGETS PICTUREBUTTON newButton "File_Menu.New_Choice" "new_gif" ENDOF WIDGETS ENDOF WINDOW
OO big win for widgets u GUI widgets naturally lend themselves to an inheritance hierarchy: Widget Button TextPicture
OO big win for widgets u Check button required only 101 new lines of code u 8 methods associated with a widget-- often much of work can be done by calling the parent method
Using OO to reduce code size procedure Write_Widget(Widget : Check_Button; File : File_Type) is begin -- Write_Widget Gui_Enum.Io.Put(File,Gui_Enum.Checkbutto n); Ada.Text_Io.Put(File," "); Write_Widget(Gui_Widget(Widget),File); Ada.Text_Io.Put_Line(File,Widget.Text.all); end Write_Widget;
Common Dialogs provided u File Open u File Save u Quit (are you sure?) u Yes/No u OK
Widgets (and their utilities) u Text Label u change text u Text Entry u Set text u Get text (as string, integer, float) u Clear u Text button u Picture button
More widgets u Check box u Select u Deselect u Is selected? u Radio button (creates an enumeration type) u Select u Which is selected?
Other utilities u Destroy window u Compare file times u Get value of Tcl variable (advanced user)
Demonstration u Overall u Sort demo
Conclusions u Project was successful, currently being used to design ground station software for USAFA Falconsat satellite u Compiler techniques (bootstrapping, intermediate language) support u faster development u easier “cross-compilation” to different GUI libraries
Future Work u Use JVM Swing components instead of Tcl/Tk u Additional widgets u Portable Ada IDE